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
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
4#ifndef QSSLELLIPTICCURVE_H
5#define QSSLELLIPTICCURVE_H
6
7#include <QtNetwork/qtnetworkglobal.h>
8#include <QtCore/QString>
9#include <QtCore/QMetaType>
10#include <QtCore/qhashfunctions.h>
11
13
15// qHash is a friend, but we can't use default arguments for friends (ยง8.3.6.4)
16constexpr size_t qHash(QSslEllipticCurve curve, size_t seed = 0) noexcept;
17
19public:
20 constexpr QSslEllipticCurve() noexcept
21 : id(0)
22 {
23 }
24
25 Q_NETWORK_EXPORT static QSslEllipticCurve fromShortName(const QString &name);
26 Q_NETWORK_EXPORT static QSslEllipticCurve fromLongName(const QString &name);
27
28 [[nodiscard]] Q_NETWORK_EXPORT QString shortName() const;
29 [[nodiscard]] Q_NETWORK_EXPORT QString longName() const;
30
31 constexpr bool isValid() const noexcept
32 {
33 return id != 0;
34 }
35
36 Q_NETWORK_EXPORT bool isTlsNamedCurve() const noexcept;
37
39 int id;
40
41 friend constexpr bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
42 { return lhs.id == rhs.id; }
43 friend constexpr bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
44 { return !(lhs == rhs); }
45 friend constexpr size_t qHash(QSslEllipticCurve curve, size_t seed) noexcept;
46
47 friend class QSslContext;
48 friend class QSslSocketPrivate;
49};
50
52
53constexpr inline size_t qHash(QSslEllipticCurve curve, size_t seed) noexcept
54{ return qHash(curve.id, seed); }
55
56#ifndef QT_NO_DEBUG_STREAM
57class QDebug;
59#endif
60
62
64
65#endif // QSSLELLIPTICCURVE_H
\inmodule QtCore
Represents an elliptic curve for use by elliptic-curve cipher algorithms.
friend constexpr bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
Q_NETWORK_EXPORT QString shortName() const
Returns the conventional short name for this curve.
constexpr QSslEllipticCurve() noexcept
Constructs an invalid elliptic curve.
static Q_NETWORK_EXPORT QSslEllipticCurve fromShortName(const QString &name)
Returns an QSslEllipticCurve instance representing the named curve name.
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...
static Q_NETWORK_EXPORT QSslEllipticCurve fromLongName(const QString &name)
Returns an QSslEllipticCurve instance representing the named curve name.
constexpr bool isValid() const noexcept
Returns true if this elliptic curve is a valid curve, false otherwise.
Q_NETWORK_EXPORT QString longName() const
Returns the conventional long name for this curve.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
GLuint name
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QSslEllipticCurve curve)
constexpr size_t qHash(QSslEllipticCurve curve, size_t seed=0) noexcept
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180