PySide6.QtNetwork.QSslDiffieHellmanParameters¶
- class QSslDiffieHellmanParameters¶
- The - QSslDiffieHellmanParametersclass provides an interface for Diffie-Hellman parameters for servers. More…- Synopsis¶- Methods¶- def - __init__()
- def - error()
- def - errorString()
- def - isEmpty()
- def - isValid()
- def - __ne__()
- def - __eq__()
- def - swap()
 - Static functions¶
- def - fromEncoded()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- QSslDiffieHellmanParametersprovides an interface for setting Diffie-Hellman parameters to servers based on- QSslSocket.- See also - class Error¶
- Describes a - QSslDiffieHellmanParameterserror.- Constant - Description - QSslDiffieHellmanParameters.NoError - No error occurred. - QSslDiffieHellmanParameters.InvalidInputDataError - The given input data could not be used to construct a - QSslDiffieHellmanParametersobject.- QSslDiffieHellmanParameters.UnsafeParametersError - The Diffie-Hellman parameters are unsafe and should not be used. 
 - __init__()¶
 - Constructs an empty - QSslDiffieHellmanParametersinstance.- If an empty - QSslDiffieHellmanParametersinstance is set on a- QSslConfigurationobject, Diffie-Hellman negotiation will be disabled.- See also - __init__(other)
- Parameters:
- other – - QSslDiffieHellmanParameters
 
 - Constructs an identical copy of - other.- static defaultParameters()¶
- Return type:
 
 - Returns the default - QSslDiffieHellmanParametersused by- QSslSocket.- This is currently the 2048-bit MODP group from RFC 3526. - Returns the error that caused the - QSslDiffieHellmanParametersobject to be invalid.- errorString()¶
- Return type:
- str 
 
 - Returns a human-readable description of the error that caused the - QSslDiffieHellmanParametersobject to be invalid.- static fromEncoded(device[, format=QSsl.Pem])¶
- Parameters:
- device – - QIODevice
- format – - EncodingFormat
 
- Return type:
 
 - Constructs a - QSslDiffieHellmanParametersobject by reading from- devicein 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 - deviceis- Noneor not open for reading, an invalid object will be returned.- See also - static fromEncoded(encoded[, format=QSsl.Pem])
- Parameters:
- encoded – - QByteArray
- format – - EncodingFormat
 
- Return type:
 
 - Constructs a - QSslDiffieHellmanParametersobject using the byte array- encodedin 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 - isEmpty()¶
- Return type:
- bool 
 
 - Returns - trueif this is a an empty- QSslDiffieHellmanParametersinstance.- Setting an empty - QSslDiffieHellmanParametersinstance on a- QSslSocket-based server will disable Diffie-Hellman key exchange.- isValid()¶
- Return type:
- bool 
 
 - Returns - trueif this is a valid- QSslDiffieHellmanParameters; otherwise false.- This method should be used after constructing a - QSslDiffieHellmanParametersobject to determine its validity.- If a - QSslDiffieHellmanParametersobject is not valid, you can use the- error()method to determine what error prevented the object from being constructed.- See also - __ne__(rhs)¶
- Parameters:
- Return type:
- bool 
 
 - Returns - trueif- lhsis not equal to- rhs; otherwise returns- false.- __eq__(rhs)¶
- Parameters:
- Return type:
- bool 
 
 - Returns - trueif- lhsis equal to- rhs; otherwise returns- false.- swap(other)¶
- Parameters:
- other – - QSslDiffieHellmanParameters
 
 - Swaps this - QSslDiffieHellmanParameterswith- other. This operation is very fast and never fails.