The QSslDiffieHellmanParameters class provides an interface for Diffie-Hellman parameters for servers. More...
| Header: | #include <QSslDiffieHellmanParameters> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Network)target_link_libraries(mytarget PRIVATE Qt6::Network) |
| qmake: | QT += network |
Note: All functions in this class are reentrant.
| enum | Error { NoError, InvalidInputDataError, UnsafeParametersError } |
| QSslDiffieHellmanParameters() | |
| QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other) | |
| QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) | |
| ~QSslDiffieHellmanParameters() | |
| QSslDiffieHellmanParameters::Error | error() const |
| QString | errorString() const |
| bool | isEmpty() const |
| bool | isValid() const |
| void | swap(QSslDiffieHellmanParameters &other) |
| QSslDiffieHellmanParameters & | operator=(QSslDiffieHellmanParameters &&other) |
| QSslDiffieHellmanParameters & | operator=(const QSslDiffieHellmanParameters &other) |
| QSslDiffieHellmanParameters | defaultParameters() |
| QSslDiffieHellmanParameters | fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::Pem) |
| QSslDiffieHellmanParameters | fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding = QSsl::Pem) |
| int | qHash(const QSslDiffieHellmanParameters &key, int seed = 0) |
| bool | operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) |
| QDebug | operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam) |
| bool | operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) |
QSslDiffieHellmanParameters provides an interface for setting Diffie-Hellman parameters to servers based on QSslSocket.
See also QSslSocket, QSslCipher, and QSslConfiguration.
Describes a QSslDiffieHellmanParameters error.
| Constant | Value | Description |
|---|---|---|
QSslDiffieHellmanParameters::NoError |
0 |
No error occurred. |
QSslDiffieHellmanParameters::InvalidInputDataError |
1 |
The given input data could not be used to construct a QSslDiffieHellmanParameters object. |
QSslDiffieHellmanParameters::UnsafeParametersError |
2 |
The Diffie-Hellman parameters are unsafe and should not be used. |
Constructs an empty QSslDiffieHellmanParameters instance.
If an empty QSslDiffieHellmanParameters instance is set on a QSslConfiguration object, Diffie-Hellman negotiation will be disabled.
See also isValid() and QSslConfiguration.
Constructs an identical copy of other.
[noexcept] QSslDiffieHellmanParameters::QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other)Move-constructs from other.
Note: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.
[noexcept] QSslDiffieHellmanParameters::~QSslDiffieHellmanParameters()Destroys the QSslDiffieHellmanParameters object.
[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::defaultParameters()Returns the default QSslDiffieHellmanParameters used by QSslSocket.
This is currently the 2048-bit MODP group from RFC 3526.
[noexcept] QSslDiffieHellmanParameters::Error
QSslDiffieHellmanParameters::error() constReturns the error that caused the QSslDiffieHellmanParameters object to be invalid.
[noexcept] QString QSslDiffieHellmanParameters::errorString() constReturns a human-readable description of the error that caused the QSslDiffieHellmanParameters object to be invalid.
[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::Pem)Constructs a QSslDiffieHellmanParameters object by reading from device in either PEM or DER form as specified by encoding.
Use the isValid() method on the returned object to check whether the Diffie-Hellman parameters were valid and loaded correctly.
In particular, if device is nullptr or not open for reading, an invalid object will be returned.
See also isValid() and QSslConfiguration.
[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding = QSsl::Pem)Constructs a QSslDiffieHellmanParameters object using the byte array encoded in either PEM or DER form as specified by encoding.
Use the isValid() method on the returned object to check whether the Diffie-Hellman parameters were valid and loaded correctly.
See also isValid() and QSslConfiguration.
[noexcept] bool QSslDiffieHellmanParameters::isEmpty() constReturns true if this is a an empty QSslDiffieHellmanParameters instance.
Setting an empty QSslDiffieHellmanParameters instance on a QSslSocket-based server will disable Diffie-Hellman key exchange.
[noexcept] bool QSslDiffieHellmanParameters::isValid() constReturns true if this is a valid QSslDiffieHellmanParameters; otherwise false.
This method should be used after constructing a QSslDiffieHellmanParameters object to determine its validity.
If a QSslDiffieHellmanParameters object is not valid, you can use the error() method to determine what error prevented the object from being constructed.
See also error().
[noexcept] void QSslDiffieHellmanParameters::swap(QSslDiffieHellmanParameters &other)Swaps this QSslDiffieHellmanParameters with other. This operation is very fast and never fails.
[noexcept] QSslDiffieHellmanParameters &QSslDiffieHellmanParameters::operator=(QSslDiffieHellmanParameters &&other)Move-assigns other to this QSslDiffieHellmanParameters instance.
Note: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.
Copies the contents of other into this QSslDiffieHellmanParameters, making the two QSslDiffieHellmanParameters identical.
Returns a reference to this QSslDiffieHellmanParameters.
[noexcept] int qHash(const QSslDiffieHellmanParameters &key, int seed = 0)Returns the hash value for key, using seed to seed the calculation.
[noexcept] bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)Returns true if lhs is not equal to rhs; otherwise returns false.
Writes the set of Diffie-Hellman parameters in dhparam into the debug object debug for debugging purposes.
The Diffie-Hellman parameters will be represented in Base64-encoded DER form.
See also Debugging Techniques.
[noexcept] bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)Returns true if lhs is equal to rhs; otherwise returns false.