QSslDiffieHellmanParametersclass provides an interface for Diffie-Hellman parameters for servers. 更多 …
New in version 5.8.
def
defaultParameters
()
def
fromEncoded
(device[, format=QSsl.Pem])
def
fromEncoded
(encoded[, format=QSsl.Pem])
QSslDiffieHellmanParametersprovides an interface for setting Diffie-Hellman parameters to servers based onQSslSocket.
QSslDiffieHellmanParameters
¶
QSslDiffieHellmanParameters(other)
- param other
构造空
QSslDiffieHellmanParameters
实例。
If an empty
QSslDiffieHellmanParameters
instance is set on a
QSslConfiguration
object, Diffie-Hellman negotiation will be disabled.
PySide2.QtNetwork.QSslDiffieHellmanParameters.
Error
¶
Describes a
QSslDiffieHellmanParameters
错误。
|
常量 |
描述 |
|---|---|
|
QSslDiffieHellmanParameters.NoError |
没有发生错误。 |
|
QSslDiffieHellmanParameters.InvalidInputDataError |
The given input data could not be used to construct a
|
|
QSslDiffieHellmanParameters.UnsafeParametersError |
The Diffie-Hellman parameters are unsafe and should not be used. |
PySide2.QtNetwork.QSslDiffieHellmanParameters.
defaultParameters
(
)
¶
Returns the default
QSslDiffieHellmanParameters
used by
QSslSocket
.
This is currently the 1024-bit MODP group from RFC 2459, also known as the Second Oakley Group.
PySide2.QtNetwork.QSslDiffieHellmanParameters.
error
(
)
¶
Returns the error that caused the
QSslDiffieHellmanParameters
object to be invalid.
PySide2.QtNetwork.QSslDiffieHellmanParameters.
errorString
(
)
¶
unicode
Returns a human-readable description of the error that caused the
QSslDiffieHellmanParameters
object to be invalid.
PySide2.QtNetwork.QSslDiffieHellmanParameters.
fromEncoded
(
device
[
,
format=QSsl.Pem
]
)
¶
device
–
QIODevice
format
–
EncodingFormat
构造
QSslDiffieHellmanParameters
object by reading from
device
in either PEM or DER form as specified by
encoding
.
使用
isValid()
method on the returned object to check whether the Diffie-Hellman parameters were valid and loaded correctly.
In particular, if
device
is
None
or not open for reading, an invalid object will be returned.
PySide2.QtNetwork.QSslDiffieHellmanParameters.
fromEncoded
(
encoded
[
,
format=QSsl.Pem
]
)
¶
encoded
–
QByteArray
format
–
EncodingFormat
PySide2.QtNetwork.QSslDiffieHellmanParameters.
isEmpty
(
)
¶
bool
返回
true
if this is a an empty
QSslDiffieHellmanParameters
实例。
Setting an empty
QSslDiffieHellmanParameters
instance on a
QSslSocket
-based server will disable Diffie-Hellman key exchange.
PySide2.QtNetwork.QSslDiffieHellmanParameters.
isValid
(
)
¶
bool
返回
true
if this is a valid
QSslDiffieHellmanParameters
; otherwise false.
This method should be used after constructing a
QSslDiffieHellmanParameters
object to determine its validity.
若
QSslDiffieHellmanParameters
object is not valid, you can use the
error()
method to determine what error prevented the object from being constructed.
另请参阅
PySide2.QtNetwork.QSslDiffieHellmanParameters.
__ne__
(
rhs
)
¶
bool
PySide2.QtNetwork.QSslDiffieHellmanParameters.
__eq__
(
rhs
)
¶
bool
PySide2.QtNetwork.QSslDiffieHellmanParameters.
swap
(
other
)
¶
other
–
QSslDiffieHellmanParameters
交换此
QSslDiffieHellmanParameters
with
other
。此函数非常快,且从不失败。