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