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.cpp
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#include "qsslellipticcurve.h"
5#include "qtlsbackend_p.h"
6#include "qsslsocket_p.h"
7
8#ifndef QT_NO_DEBUG_STREAM
9#include <QDebug>
10#endif
11
13
15
16
61{
63 if (name.isEmpty())
64 return result;
65
66 if (const auto *tlsBackend = QSslSocketPrivate::tlsBackendInUse())
67 result.id = tlsBackend->curveIdFromShortName(name);
68
69 return result;
70}
71
84{
86 if (name.isEmpty())
87 return result;
88
89 if (const auto *tlsBackend = QSslSocketPrivate::tlsBackendInUse())
90 result.id = tlsBackend->curveIdFromLongName(name);
91
92 return result;
93}
94
102{
104
105 if (const auto *tlsBackend = QSslSocketPrivate::tlsBackendInUse())
106 name = tlsBackend->shortNameForId(id);
107
108 return name;
109}
110
118{
120
121 if (const auto *tlsBackend = QSslSocketPrivate::tlsBackendInUse())
122 name = tlsBackend->longNameForId(id);
123
124 return name;
125}
126
139{
140 if (const auto *tlsBackend = QSslSocketPrivate::tlsBackendInUse())
141 return tlsBackend->isTlsNamedCurve(id);
142
143 return false;
144}
145
146
171#ifndef QT_NO_DEBUG_STREAM
182{
183 QDebugStateSaver saver(debug);
184 debug.resetFormat().nospace();
185 debug << "QSslEllipticCurve(" << curve.shortName() << ')';
186 return debug;
187}
188#endif
189
\inmodule QtCore
\inmodule QtCore
Represents an elliptic curve for use by elliptic-curve cipher algorithms.
Q_NETWORK_EXPORT QString shortName() const
Returns the conventional short name for this curve.
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.
QDebug operator<<(QDebug debug, QSslEllipticCurve curve)
Q_NETWORK_EXPORT QString longName() const
Returns the conventional long name for this curve.
static QTlsBackend * tlsBackendInUse()
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
#define QT_IMPL_METATYPE_EXTERN(TYPE)
Definition qmetatype.h:1390
GLuint name
GLuint64EXT * result
[6]