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
qsslellipticcurve.h
Go to the documentation of this file.
1// Copyright (C) 2014 Governikus GmbH & Co. KG.
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#ifndef QSSLELLIPTICCURVE_H
6#define QSSLELLIPTICCURVE_H
7
8#include <QtNetwork/qtnetworkglobal.h>
9#include <QtCore/QString>
10#include <QtCore/QMetaType>
11#include <QtCore/qhashfunctions.h>
12
14
16// qHash is a friend, but we can't use default arguments for friends (ยง8.3.6.4)
17constexpr size_t qHash(QSslEllipticCurve curve, size_t seed = 0) noexcept;
18
20public:
21 constexpr QSslEllipticCurve() noexcept
22 : id(0)
23 {
24 }
25
26 Q_NETWORK_EXPORT static QSslEllipticCurve fromShortName(const QString &name);
27 Q_NETWORK_EXPORT static QSslEllipticCurve fromLongName(const QString &name);
28
29 [[nodiscard]] Q_NETWORK_EXPORT QString shortName() const;
31
32 constexpr bool isValid() const noexcept
33 {
34 return id != 0;
35 }
36
37 Q_NETWORK_EXPORT bool isTlsNamedCurve() const noexcept;
38
39private:
40 int id;
41
42 friend constexpr bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
43 { return lhs.id == rhs.id; }
44 friend constexpr bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
45 { return !(lhs == rhs); }
46 friend constexpr size_t qHash(QSslEllipticCurve curve, size_t seed) noexcept;
47
48 friend class QSslContext;
49 friend class QSslSocketPrivate;
50};
51
53
54constexpr inline size_t qHash(QSslEllipticCurve curve, size_t seed) noexcept
55{ return qHash(curve.id, seed); }
56
57#ifndef QT_NO_DEBUG_STREAM
58class QDebug;
59Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QSslEllipticCurve curve);
60#endif
61
62QT_END_NAMESPACE
63
64QT_DECL_METATYPE_EXTERN(QSslEllipticCurve, Q_NETWORK_EXPORT)
65
66#endif // QSSLELLIPTICCURVE_H
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
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)