| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/network/ssl/qsslellipticcurve.cpp |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2014 Governikus GmbH & Co. KG. | - |
| 4 | ** Contact: https://www.qt.io/licensing/ | - |
| 5 | ** | - |
| 6 | ** This file is part of the QtNetwork module of the Qt Toolkit. | - |
| 7 | ** | - |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
| 9 | ** Commercial License Usage | - |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
| 11 | ** accordance with the commercial license agreement provided with the | - |
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - |
| 16 | ** | - |
| 17 | ** GNU Lesser General Public License Usage | - |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
| 19 | ** General Public License version 3 as published by the Free Software | - |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
| 21 | ** packaging of this file. Please review the following information to | - |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
| 24 | ** | - |
| 25 | ** GNU General Public License Usage | - |
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - |
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
| 31 | ** included in the packaging of this file. Please review the following | - |
| 32 | ** information to ensure the GNU General Public License requirements will | - |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
| 35 | ** | - |
| 36 | ** $QT_END_LICENSE$ | - |
| 37 | ** | - |
| 38 | ****************************************************************************/ | - |
| 39 | - | |
| 40 | #include "qsslellipticcurve.h" | - |
| 41 | - | |
| 42 | #ifndef QT_NO_DEBUG_STREAM | - |
| 43 | #include <QDebug> | - |
| 44 | #endif | - |
| 45 | - | |
| 46 | QT_BEGIN_NAMESPACE | - |
| 47 | - | |
| 48 | /*! | - |
| 49 | \class QSslEllipticCurve | - |
| 50 | \since 5.5 | - |
| 51 | - | |
| 52 | \brief Represents an elliptic curve for use by elliptic-curve cipher algorithms. | - |
| 53 | - | |
| 54 | \reentrant | - |
| 55 | \ingroup network | - |
| 56 | \ingroup ssl | - |
| 57 | \inmodule QtNetwork | - |
| 58 | - | |
| 59 | The class QSslEllipticCurve represents an elliptic curve for use by | - |
| 60 | elliptic-curve cipher algorithms. | - |
| 61 | - | |
| 62 | Elliptic curves can be constructed from a "short name" (SN) (fromShortName()), | - |
| 63 | and by a call to QSslConfiguration::supportedEllipticCurves(). | - |
| 64 | - | |
| 65 | QSslEllipticCurve instances can be compared for equality and can be used as keys | - |
| 66 | in QHash and QSet. They cannot be used as key in a QMap. | - |
| 67 | */ | - |
| 68 | - | |
| 69 | /*! | - |
| 70 | \fn QSslEllipticCurve::QSslEllipticCurve() | - |
| 71 | - | |
| 72 | Constructs an invalid elliptic curve. | - |
| 73 | - | |
| 74 | \sa isValid(), QSslConfiguration::supportedEllipticCurves() | - |
| 75 | */ | - |
| 76 | - | |
| 77 | /*! | - |
| 78 | \fn QSslEllipticCurve QSslEllipticCurve::fromShortName(const QString &name) | - |
| 79 | - | |
| 80 | Returns an QSslEllipticCurve instance representing the | - |
| 81 | named curve \a name. The \a name is the conventional short | - |
| 82 | name for the curve, as represented by RFC 4492 (for instance \c{secp521r1}), | - |
| 83 | or as NIST short names (for instance \c{P-256}). The actual set of | - |
| 84 | recognized names depends on the SSL implementation. | - |
| 85 | - | |
| 86 | If the given \a name is not supported, returns an invalid QSslEllipticCurve instance. | - |
| 87 | - | |
| 88 | \note The OpenSSL implementation of this function treats the name case-sensitively. | - |
| 89 | - | |
| 90 | \sa shortName() | - |
| 91 | */ | - |
| 92 | - | |
| 93 | /*! | - |
| 94 | \fn QSslEllipticCurve QSslEllipticCurve::fromLongName(const QString &name) | - |
| 95 | - | |
| 96 | Returns an QSslEllipticCurve instance representing the named curve \a name. | - |
| 97 | The \a name is a long name for the curve, whose exact spelling depends on the | - |
| 98 | SSL implementation. | - |
| 99 | - | |
| 100 | If the given \a name is not supported, returns an invalid QSslEllipticCurve instance. | - |
| 101 | - | |
| 102 | \note The OpenSSL implementation of this function treats the name case-sensitively. | - |
| 103 | - | |
| 104 | \sa longName() | - |
| 105 | */ | - |
| 106 | - | |
| 107 | /*! | - |
| 108 | \fn QString QSslEllipticCurve::shortName() const | - |
| 109 | - | |
| 110 | Returns the conventional short name for this curve. If this | - |
| 111 | curve is invalid, returns an empty string. | - |
| 112 | - | |
| 113 | \sa longName() | - |
| 114 | */ | - |
| 115 | - | |
| 116 | /*! | - |
| 117 | \fn QString QSslEllipticCurve::longName() const | - |
| 118 | - | |
| 119 | Returns the conventional long name for this curve. If this | - |
| 120 | curve is invalid, returns an empty string. | - |
| 121 | - | |
| 122 | \sa shortName() | - |
| 123 | */ | - |
| 124 | - | |
| 125 | /*! | - |
| 126 | \fn bool QSslEllipticCurve::isValid() const | - |
| 127 | - | |
| 128 | Returns true if this elliptic curve is a valid curve, false otherwise. | - |
| 129 | */ | - |
| 130 | - | |
| 131 | /*! | - |
| 132 | \fn bool QSslEllipticCurve::isTlsNamedCurve() const | - |
| 133 | - | |
| 134 | Returns true if this elliptic curve is one of the named curves that can be | - |
| 135 | used in the key exchange when using an elliptic curve cipher with TLS; | - |
| 136 | false otherwise. | - |
| 137 | */ | - |
| 138 | - | |
| 139 | /*! | - |
| 140 | \fn bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) | - |
| 141 | \since 5.5 | - |
| 142 | \relates QSslEllipticCurve | - |
| 143 | - | |
| 144 | Returns true if the curve \a lhs represents the same curve of \a rhs; | - |
| 145 | */ | - |
| 146 | - | |
| 147 | /*! | - |
| 148 | \fn bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) | - |
| 149 | \since 5.5 | - |
| 150 | \relates QSslEllipticCurve | - |
| 151 | - | |
| 152 | Returns true if the curve \a lhs represents a different curve than \a rhs; | - |
| 153 | false otherwise. | - |
| 154 | */ | - |
| 155 | - | |
| 156 | /*! | - |
| 157 | \fn uint qHash(QSslEllipticCurve curve, uint seed) | - |
| 158 | \since 5.5 | - |
| 159 | \relates QHash | - |
| 160 | - | |
| 161 | Returns an hash value for the curve \a curve, using \a seed to seed | - |
| 162 | the calculation. | - |
| 163 | */ | - |
| 164 | - | |
| 165 | #ifndef QT_NO_DEBUG_STREAM | - |
| 166 | /*! | - |
| 167 | \relates QSslEllipticCurve | - |
| 168 | \since 5.5 | - |
| 169 | - | |
| 170 | Writes the elliptic curve \a curve into the debug object \a debug for | - |
| 171 | debugging purposes. | - |
| 172 | - | |
| 173 | \sa {Debugging Techniques} | - |
| 174 | */ | - |
| 175 | QDebug operator<<(QDebug debug, QSslEllipticCurve curve) | - |
| 176 | { | - |
| 177 | QDebugStateSaver saver(debug); | - |
| 178 | debug.resetFormat().nospace(); | - |
| 179 | debug << "QSslEllipticCurve(" << curve.shortName() << ')'; | - |
| 180 | return debug; never executed: return debug; | 0 |
| 181 | } | - |
| 182 | #endif | - |
| 183 | - | |
| 184 | QT_END_NAMESPACE | - |
| Source code | Switch to Preprocessed file |