Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qssldiffiehellmanparameters.h
Go to the documentation of this file.
1// Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSSLDIFFIEHELLMANPARAMETERS_H
7#define QSSLDIFFIEHELLMANPARAMETERS_H
8
9#include <QtNetwork/qssl.h>
10#include <QtCore/qnamespace.h>
11#include <QtCore/qbytearray.h>
12#include <QtCore/qshareddata.h>
13
14QT_BEGIN_NAMESPACE
15
16#ifndef QT_NO_SSL
17
18class QIODevice;
19class QSslContext;
20class QSslDiffieHellmanParametersPrivate;
21
22class QSslDiffieHellmanParameters;
23// qHash is a friend, but we can't use default arguments for friends (ยง8.3.6.4)
24Q_NETWORK_EXPORT size_t qHash(const QSslDiffieHellmanParameters &dhparam, size_t seed = 0) noexcept;
25
26#ifndef QT_NO_DEBUG_STREAM
27class QDebug;
28Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparams);
29#endif
30
31class Q_NETWORK_EXPORT QSslDiffieHellmanParameters
32{
33public:
34 enum Error {
35 NoError,
36 InvalidInputDataError,
37 UnsafeParametersError
38 };
39
40 static QSslDiffieHellmanParameters defaultParameters();
41
42 QSslDiffieHellmanParameters();
43 QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other);
44 QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) noexcept : d(other.d) { other.d = nullptr; }
45 ~QSslDiffieHellmanParameters();
46
47 QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other);
48 QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other) noexcept { swap(other); return *this; }
49
50 void swap(QSslDiffieHellmanParameters &other) noexcept { qt_ptr_swap(d, other.d); }
51
52 static QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat format = QSsl::Pem);
53 static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
54
55 bool isEmpty() const noexcept;
56 bool isValid() const noexcept;
57 Error error() const noexcept;
58 QString errorString() const noexcept;
59
60private:
61 QSslDiffieHellmanParametersPrivate *d;
62 friend class QSslContext;
63
64 bool isEqual(const QSslDiffieHellmanParameters &other) const noexcept;
65 friend bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
66 { return lhs.isEqual(rhs); }
67 friend bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
68 { return !lhs.isEqual(rhs); }
69
70#ifndef QT_NO_DEBUG_STREAM
71 friend Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam);
72#endif
73 friend Q_NETWORK_EXPORT size_t qHash(const QSslDiffieHellmanParameters &dhparam, size_t seed) noexcept;
74};
75
77
78#endif // QT_NO_SSL
79
80QT_END_NAMESPACE
81
82#endif
This class represents Online Certificate Status Protocol response.
The QSslCertificate class provides a convenient API for an X509 certificate.
The QSslCipher class represents an SSL cryptographic cipher.
Definition qsslcipher.h:23
The QSslDiffieHellmanParameters class provides an interface for Diffie-Hellman parameters for servers...
Represents an elliptic curve for use by elliptic-curve cipher algorithms.
constexpr QSslEllipticCurve() noexcept
Constructs an invalid elliptic curve.
constexpr bool isValid() const noexcept
Returns true if this elliptic curve is a valid curve, false otherwise.
friend constexpr bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
Q_NETWORK_EXPORT bool isTlsNamedCurve() const noexcept
Returns true if this elliptic curve is one of the named curves that can be used in the key exchange w...
friend constexpr bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
The QSslKey class provides an interface for private and public keys.
Definition qsslkey.h:24
The QSslPreSharedKeyAuthenticator class provides authentication data for pre shared keys (PSK) cipher...
The QSslSocket class provides an SSL encrypted socket for both clients and servers.
Definition qsslsocket.h:30
Namespace containing onternal types that TLS backends implement.
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568
static QT_BEGIN_NAMESPACE QString msgUnsupportedMulticastAddress()
Definition qdtls.cpp:304
QOcspRevocationReason
QT_REQUIRE_CONFIG(thread)
constexpr size_t qHash(QSslEllipticCurve curve, size_t seed=0) noexcept
Q_DECLARE_TYPEINFO(QSslEllipticCurve, Q_PRIMITIVE_TYPE)