Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsslerror.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
5#ifndef QSSLERROR_H
6#define QSSLERROR_H
7
8#include <QtNetwork/qtnetworkglobal.h>
9#include <QtCore/qvariant.h>
10#include <QtNetwork/qsslcertificate.h>
11
12#include <memory>
13
15
16
17#ifndef QT_NO_SSL
18
20class Q_NETWORK_EXPORT QSslError
21{
23public:
64 Q_ENUM(SslError)
65
66 // RVCT compiler in debug build does not like about default values in const-
67 // So as an workaround we define all constructor overloads here explicitly
68 QSslError();
69 explicit QSslError(SslError error);
70 QSslError(SslError error, const QSslCertificate &certificate);
71
73
74 void swap(QSslError &other) noexcept
75 { d.swap(other.d); }
76
77 ~QSslError();
78 QSslError &operator=(QSslError &&other) noexcept { swap(other); return *this; }
79 QSslError &operator=(const QSslError &other);
80 bool operator==(const QSslError &other) const;
81 inline bool operator!=(const QSslError &other) const
82 { return !(*this == other); }
83
84 SslError error() const;
85 QString errorString() const;
86 QSslCertificate certificate() const;
87
88private:
89 // ### Qt 7: make QSslError implicitly shared
90 std::unique_ptr<QSslErrorPrivate> d;
91};
92Q_DECLARE_SHARED(QSslError)
93
94Q_NETWORK_EXPORT size_t qHash(const QSslError &key, size_t seed = 0) noexcept;
95
96#ifndef QT_NO_DEBUG_STREAM
97class QDebug;
98Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError &error);
99Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError::SslError &error);
100#endif
101#else
102class Q_NETWORK_EXPORT QSslError {}; // dummy class so that moc has a complete type
103#endif // QT_NO_SSL
104
106
107#ifndef QT_NO_SSL
108QT_DECL_METATYPE_EXTERN_TAGGED(QList<QSslError>, QList_QSslError, Q_NETWORK_EXPORT)
109#endif
110
111#endif
\inmodule QtCore
The QSslCertificate class provides a convenient API for an X509 certificate.
The QSslError class provides an SSL error.
Definition qsslerror.h:21
bool operator!=(const QSslError &other) const
Definition qsslerror.h:81
QSslError & operator=(QSslError &&other) noexcept
Definition qsslerror.h:78
void swap(QSslError &other) noexcept
Definition qsslerror.h:74
SslError
Describes all recognized errors that can occur during an SSL handshake.
Definition qsslerror.h:24
@ InvalidNotAfterField
Definition qsslerror.h:33
@ OcspResponseCannotBeTrusted
Definition qsslerror.h:58
@ OcspMalformedRequest
Definition qsslerror.h:52
@ OcspUnauthorized
Definition qsslerror.h:57
@ CertificateRejected
Definition qsslerror.h:43
@ SelfSignedCertificate
Definition qsslerror.h:34
@ UnableToVerifyFirstCertificate
Definition qsslerror.h:37
@ CertificateRevoked
Definition qsslerror.h:38
@ AuthorityIssuerSerialNumberMismatch
Definition qsslerror.h:45
@ OcspResponseExpired
Definition qsslerror.h:60
@ OcspResponseCertIdUnknown
Definition qsslerror.h:59
@ OcspSigRequred
Definition qsslerror.h:56
@ CertificateNotYetValid
Definition qsslerror.h:30
@ CertificateBlacklisted
Definition qsslerror.h:49
@ CertificateExpired
Definition qsslerror.h:31
@ UnableToDecodeIssuerPublicKey
Definition qsslerror.h:28
@ UnableToDecryptCertificateSignature
Definition qsslerror.h:27
@ UnableToGetLocalIssuerCertificate
Definition qsslerror.h:36
@ UnableToGetIssuerCertificate
Definition qsslerror.h:26
@ SubjectIssuerMismatch
Definition qsslerror.h:44
@ OcspMalformedResponse
Definition qsslerror.h:53
@ PathLengthExceeded
Definition qsslerror.h:40
@ CertificateStatusUnknown
Definition qsslerror.h:50
@ OcspTryLater
Definition qsslerror.h:55
@ SelfSignedCertificateInChain
Definition qsslerror.h:35
@ HostNameMismatch
Definition qsslerror.h:47
@ InvalidNotBeforeField
Definition qsslerror.h:32
@ OcspInternalError
Definition qsslerror.h:54
@ NoSslSupport
Definition qsslerror.h:48
@ CertificateUntrusted
Definition qsslerror.h:42
@ OcspStatusUnknown
Definition qsslerror.h:61
@ CertificateSignatureFailed
Definition qsslerror.h:29
@ InvalidPurpose
Definition qsslerror.h:41
@ InvalidCaCertificate
Definition qsslerror.h:39
@ OcspNoResponseFound
Definition qsslerror.h:51
@ NoPeerCertificate
Definition qsslerror.h:46
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT)
Definition qmetatype.h:1376
GLuint64 key
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError &error)
Q_NETWORK_EXPORT size_t qHash(const QSslError &key, size_t seed=0) noexcept
#define Q_ENUM(x)
#define Q_GADGET
QSharedPointer< T > other(t)
[5]
this swap(other)