1// Copyright (C) 2021 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 QSSL_H
6#define QSSL_H
7
8#if 0
9#pragma qt_class(QSsl)
10#endif
11
12#include <QtNetwork/qtnetworkglobal.h>
13#include <QtCore/QFlags>
14
15QT_BEGIN_NAMESPACE
16
17
18namespace QSsl {
19 enum KeyType {
20 PrivateKey,
21 PublicKey
22 };
23
24 enum EncodingFormat {
25 Pem,
26 Der
27 };
28
29 enum KeyAlgorithm {
30 Opaque,
31 Rsa,
32 Dsa,
33 Ec,
34 Dh,
35 };
36
37 enum AlternativeNameEntryType {
38 EmailEntry,
39 DnsEntry,
40 IpAddressEntry
41 };
42
43 enum SslProtocol {
44 TlsV1_0 QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
45 TlsV1_1 QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
46 TlsV1_2,
47 AnyProtocol,
48 SecureProtocols,
49
50 TlsV1_0OrLater QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
51 TlsV1_1OrLater QT_DEPRECATED_VERSION_X_6_3("Use TlsV1_2OrLater instead."),
52 TlsV1_2OrLater,
53
54 DtlsV1_0 QT_DEPRECATED_VERSION_X_6_3("Use DtlsV1_2OrLater instead."),
55 DtlsV1_0OrLater QT_DEPRECATED_VERSION_X_6_3("Use DtlsV1_2OrLater instead."),
56 DtlsV1_2,
57 DtlsV1_2OrLater,
58
59 TlsV1_3,
60 TlsV1_3OrLater,
61
62 UnknownProtocol = -1
63 };
64
65 enum SslOption {
66 SslOptionDisableEmptyFragments = 0x01,
67 SslOptionDisableSessionTickets = 0x02,
68 SslOptionDisableCompression = 0x04,
69 SslOptionDisableServerNameIndication = 0x08,
70 SslOptionDisableLegacyRenegotiation = 0x10,
71 SslOptionDisableSessionSharing = 0x20,
72 SslOptionDisableSessionPersistence = 0x40,
73 SslOptionDisableServerCipherPreference = 0x80
74 };
75 Q_DECLARE_FLAGS(SslOptions, SslOption)
76
77 enum class AlertLevel {
78 Warning,
79 Fatal,
80 Unknown
81 };
82
83 enum class AlertType {
84 CloseNotify,
85 UnexpectedMessage = 10,
86 BadRecordMac = 20,
87 RecordOverflow = 22,
88 DecompressionFailure = 30, // reserved
89 HandshakeFailure = 40,
90 NoCertificate = 41, // reserved
91 BadCertificate = 42,
92 UnsupportedCertificate = 43,
93 CertificateRevoked = 44,
94 CertificateExpired = 45,
95 CertificateUnknown = 46,
96 IllegalParameter = 47,
97 UnknownCa = 48,
98 AccessDenied = 49,
99 DecodeError = 50,
100 DecryptError = 51,
101 ExportRestriction = 60, // reserved
102 ProtocolVersion = 70,
103 InsufficientSecurity = 71,
104 InternalError = 80,
105 InappropriateFallback = 86,
106 UserCancelled = 90,
107 NoRenegotiation = 100,
108 MissingExtension = 109,
109 UnsupportedExtension = 110,
110 CertificateUnobtainable = 111, // reserved
111 UnrecognizedName = 112,
112 BadCertificateStatusResponse = 113,
113 BadCertificateHashValue = 114, // reserved
114 UnknownPskIdentity = 115,
115 CertificateRequired = 116,
116 NoApplicationProtocol = 120,
117 UnknownAlertMessage = 255
118 };
119
120 enum class ImplementedClass
121 {
122 Key,
123 Certificate,
124 Socket,
125 DiffieHellman,
126 EllipticCurve,
127 Dtls,
128 DtlsCookie
129 };
130
131 enum class SupportedFeature
132 {
133 CertificateVerification,
134 ClientSideAlpn,
135 ServerSideAlpn,
136 Ocsp,
137 Psk,
138 SessionTicket,
139 Alerts
140 };
141}
142
143Q_DECLARE_OPERATORS_FOR_FLAGS(QSsl::SslOptions)
144
145QT_END_NAMESPACE
146
147#endif // QSSL_H
148

source code of qtbase/src/network/ssl/qssl.h