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
QSslDiffieHellmanParameters Class Reference

The QSslDiffieHellmanParameters class provides an interface for Diffie-Hellman parameters for servers. More...

#include <qssldiffiehellmanparameters.h>

+ Collaboration diagram for QSslDiffieHellmanParameters:

Public Types

enum  Error { NoError , InvalidInputDataError , UnsafeParametersError }
 Describes a QSslDiffieHellmanParameters error. More...
 

Public Member Functions

 QSslDiffieHellmanParameters ()
 Constructs an empty QSslDiffieHellmanParameters instance.
 
 QSslDiffieHellmanParameters (const QSslDiffieHellmanParameters &other)
 Constructs an identical copy of other.
 
 QSslDiffieHellmanParameters (QSslDiffieHellmanParameters &&other) noexcept
 Move-constructs from other.
 
 ~QSslDiffieHellmanParameters ()
 Destroys the QSslDiffieHellmanParameters object.
 
QSslDiffieHellmanParametersoperator= (const QSslDiffieHellmanParameters &other)
 Copies the contents of other into this QSslDiffieHellmanParameters, making the two QSslDiffieHellmanParameters identical.
 
QSslDiffieHellmanParametersoperator= (QSslDiffieHellmanParameters &&other) noexcept
 Move-assigns other to this QSslDiffieHellmanParameters instance.
 
void swap (QSslDiffieHellmanParameters &other) noexcept
 Swaps this QSslDiffieHellmanParameters with other.
 
bool isEmpty () const noexcept
 Returns true if this is a an empty QSslDiffieHellmanParameters instance.
 
bool isValid () const noexcept
 Returns true if this is a valid QSslDiffieHellmanParameters; otherwise false.
 
Error error () const noexcept
 Returns the error that caused the QSslDiffieHellmanParameters object to be invalid.
 
QString errorString () const noexcept
 Returns a human-readable description of the error that caused the QSslDiffieHellmanParameters object to be invalid.
 

Static Public Member Functions

static QSslDiffieHellmanParameters defaultParameters ()
 Returns the default QSslDiffieHellmanParameters used by QSslSocket.
 
static QSslDiffieHellmanParameters fromEncoded (const QByteArray &encoded, QSsl::EncodingFormat format=QSsl::Pem)
 Constructs a QSslDiffieHellmanParameters object using the byte array encoded in either PEM or DER form as specified by encoding.
 
static QSslDiffieHellmanParameters fromEncoded (QIODevice *device, QSsl::EncodingFormat format=QSsl::Pem)
 Constructs a QSslDiffieHellmanParameters object by reading from device in either PEM or DER form as specified by encoding.
 

Friends

class QSslContext
 
bool operator== (const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
 
bool operator!= (const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
 
Q_NETWORK_EXPORT QDebug operator<< (QDebug debug, const QSslDiffieHellmanParameters &dhparam)
 
Q_NETWORK_EXPORT size_t qHash (const QSslDiffieHellmanParameters &dhparam, size_t seed) noexcept
 

Related Symbols

(Note that these are not member symbols.)

QDebug operator<< (QDebug debug, const QSslDiffieHellmanParameters &dhparam)
 
size_t qHash (const QSslDiffieHellmanParameters &dhparam, size_t seed) noexcept
 

Detailed Description

The QSslDiffieHellmanParameters class provides an interface for Diffie-Hellman parameters for servers.

Since
5.8

\reentrant

\inmodule QtNetwork

QSslDiffieHellmanParameters provides an interface for setting Diffie-Hellman parameters to servers based on QSslSocket.

See also
QSslSocket, QSslCipher, QSslConfiguration

Definition at line 30 of file qssldiffiehellmanparameters.h.

Member Enumeration Documentation

◆ Error

Describes a QSslDiffieHellmanParameters error.

\value NoError No error occurred.

\value InvalidInputDataError The given input data could not be used to construct a QSslDiffieHellmanParameters object.

\value UnsafeParametersError The Diffie-Hellman parameters are unsafe and should not be used.

Enumerator
NoError 
InvalidInputDataError 
UnsafeParametersError 

Definition at line 33 of file qssldiffiehellmanparameters.h.

Constructor & Destructor Documentation

◆ QSslDiffieHellmanParameters() [1/3]

QSslDiffieHellmanParameters::QSslDiffieHellmanParameters ( )

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()
QSslConfiguration

Definition at line 66 of file qssldiffiehellmanparameters.cpp.

References QBasicAtomicInteger< T >::ref(), and QSharedData::ref.

Referenced by fromEncoded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QSslDiffieHellmanParameters() [2/3]

QSslDiffieHellmanParameters::QSslDiffieHellmanParameters ( const QSslDiffieHellmanParameters & other)

Constructs an identical copy of other.

Definition at line 125 of file qssldiffiehellmanparameters.cpp.

References QBasicAtomicInteger< T >::ref(), and QSharedData::ref.

+ Here is the call graph for this function:

◆ QSslDiffieHellmanParameters() [3/3]

QSslDiffieHellmanParameters::QSslDiffieHellmanParameters ( QSslDiffieHellmanParameters && other)
inlinenoexcept

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.

Definition at line 43 of file qssldiffiehellmanparameters.h.

References other().

+ Here is the call graph for this function:

◆ ~QSslDiffieHellmanParameters()

QSslDiffieHellmanParameters::~QSslDiffieHellmanParameters ( )

Destroys the QSslDiffieHellmanParameters object.

Definition at line 144 of file qssldiffiehellmanparameters.cpp.

References QBasicAtomicInteger< T >::deref(), and QSharedData::ref.

+ Here is the call graph for this function:

Member Function Documentation

◆ defaultParameters()

QSslDiffieHellmanParameters QSslDiffieHellmanParameters::defaultParameters ( )
static

Returns the default QSslDiffieHellmanParameters used by QSslSocket.

This is currently the 2048-bit MODP group from RFC 3526.

Definition at line 49 of file qssldiffiehellmanparameters.cpp.

References QSslDiffieHellmanParametersPrivate::derData, QByteArray::fromBase64(), QByteArray(), and qssl_dhparams_default_base64.

Referenced by QSslConfiguration::isNull().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ error()

QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error ( ) const
noexcept

Returns the error that caused the QSslDiffieHellmanParameters object to be invalid.

Definition at line 225 of file qssldiffiehellmanparameters.cpp.

References QSslDiffieHellmanParametersPrivate::error.

◆ errorString()

QString QSslDiffieHellmanParameters::errorString ( ) const
noexcept

Returns a human-readable description of the error that caused the QSslDiffieHellmanParameters object to be invalid.

Definition at line 234 of file qssldiffiehellmanparameters.cpp.

References QSslDiffieHellmanParametersPrivate::error, InvalidInputDataError, NoError, QCoreApplication::translate(), and UnsafeParametersError.

+ Here is the call graph for this function:

◆ fromEncoded() [1/2]

QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded ( const QByteArray & encoded,
QSsl::EncodingFormat encoding = QSsl::Pem )
static

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()
QSslConfiguration

Definition at line 83 of file qssldiffiehellmanparameters.cpp.

References QSsl::Der, encoded, QSsl::Pem, and QSslSocketPrivate::tlsBackendInUse().

Referenced by fromEncoded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromEncoded() [2/2]

QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded ( QIODevice * device,
QSsl::EncodingFormat encoding = QSsl::Pem )
static

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()
QSslConfiguration

Definition at line 114 of file qssldiffiehellmanparameters.cpp.

References QSslDiffieHellmanParameters(), device, and fromEncoded().

+ Here is the call graph for this function:

◆ isEmpty()

bool QSslDiffieHellmanParameters::isEmpty ( ) const
noexcept

Returns 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.

Definition at line 185 of file qssldiffiehellmanparameters.cpp.

References QSslDiffieHellmanParametersPrivate::derData, QSslDiffieHellmanParametersPrivate::error, QByteArray::isNull(), and NoError.

+ Here is the call graph for this function:

◆ isValid()

bool QSslDiffieHellmanParameters::isValid ( ) const
noexcept

Returns 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()

Definition at line 201 of file qssldiffiehellmanparameters.cpp.

References QSslDiffieHellmanParametersPrivate::error, and NoError.

◆ operator=() [1/2]

QSslDiffieHellmanParameters & QSslDiffieHellmanParameters::operator= ( const QSslDiffieHellmanParameters & other)

Copies the contents of other into this QSslDiffieHellmanParameters, making the two QSslDiffieHellmanParameters identical.

Returns a reference to this QSslDiffieHellmanParameters.

Definition at line 156 of file qssldiffiehellmanparameters.cpp.

References copy(), other(), and swap().

+ Here is the call graph for this function:

◆ operator=() [2/2]

QSslDiffieHellmanParameters & QSslDiffieHellmanParameters::operator= ( QSslDiffieHellmanParameters && other)
inlinenoexcept

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.

Definition at line 47 of file qssldiffiehellmanparameters.h.

References other(), and swap().

+ Here is the call graph for this function:

◆ swap()

void QSslDiffieHellmanParameters::swap ( QSslDiffieHellmanParameters & other)
inlinenoexcept

Swaps this QSslDiffieHellmanParameters with other.

This function is very fast and never fails.

Definition at line 49 of file qssldiffiehellmanparameters.h.

References d, other(), and qt_ptr_swap().

Referenced by operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QSslDiffieHellmanParameters::operator!= ( const QSslDiffieHellmanParameters & lhs,
const QSslDiffieHellmanParameters & rhs )
friend
Since
5.8

Returns true if lhs is not equal to rhs; otherwise returns false.

Definition at line 66 of file qssldiffiehellmanparameters.h.

◆ operator<<() [1/2]

QDebug operator<< ( QDebug debug,
const QSslDiffieHellmanParameters & dhparam )
related
Since
5.8

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}

Definition at line 300 of file qssldiffiehellmanparameters.cpp.

◆ operator<< [2/2]

QDebug operator<< ( QDebug debug,
const QSslDiffieHellmanParameters & dhparam )
friend
Since
5.8

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}

Definition at line 300 of file qssldiffiehellmanparameters.cpp.

◆ operator==

bool QSslDiffieHellmanParameters::operator== ( const QSslDiffieHellmanParameters & lhs,
const QSslDiffieHellmanParameters & rhs )
friend
Since
5.8

Returns true if lhs is equal to rhs; otherwise returns false.

Definition at line 64 of file qssldiffiehellmanparameters.h.

◆ qHash() [1/2]

size_t qHash ( const QSslDiffieHellmanParameters & dhparam,
size_t seed )
related
Since
5.8

Returns an hash value for dhparam, using seed to seed the calculation.

Definition at line 316 of file qssldiffiehellmanparameters.cpp.

◆ qHash [2/2]

size_t qHash ( const QSslDiffieHellmanParameters & dhparam,
size_t seed = 0 )
friend
Since
5.8

Returns an hash value for dhparam, using seed to seed the calculation.

Definition at line 316 of file qssldiffiehellmanparameters.cpp.

◆ QSslContext

friend class QSslContext
friend

Definition at line 61 of file qssldiffiehellmanparameters.h.


The documentation for this class was generated from the following files: