PySide6.QtCoap.QCoapSecurityConfiguration

class QCoapSecurityConfiguration

QCoapSecurityConfiguration 类在认证过程中保存配置选项。更多

概要

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

它包含诸如客户端身份、预共享密钥、证书信息等信息。

__init__()

构造一个新的QCoapSecurityConfiguration

__init__(other)
Parameters:

其他QCoapSecurityConfiguration

复制other的配置和状态。

caCertificates()
Return type:

QSslCertificate的列表

返回此连接的证书颁发机构证书数据库。

另请参阅

setCaCertificates()

defaultCipherString()
Return type:

字符串

返回默认的加密字符串。

localCertificateChain()
Return type:

QSslCertificate的列表

返回在握手期间要呈现给对等方的证书链。

preSharedKey()
Return type:

QByteArray

返回预共享密钥。

另请参阅

setPreSharedKey()

preSharedKeyIdentity()
Return type:

QByteArray

返回PSK客户端身份。

privateKey()
Return type:

QCoapPrivateKey

返回分配给连接的私钥。

setCaCertificates(certificates)
Parameters:

certificates – QSslCertificate 的列表

certificates设置为连接的证书颁发机构数据库。

另请参阅

caCertificates()

setDefaultCipherString(cipherString)
Parameters:

cipherString – str

设置SSL加密字符串为cipherString

安全后端(例如 OpenSSL)默认可能不包含RFC 7252所需的加密算法。此方法指定后端应使用的加密算法。例如,要启用 RFC 所需的 CCM 加密算法,可以将“AESCCM”作为cipherString传递。

有关加密字符串的更多信息,请参阅OpenSSL文档

另请参阅

defaultCipherString()

setLocalCertificateChain(localChain)
Parameters:

localChain – QSslCertificate 的列表

localChain设置为在握手期间向对等方呈现的证书链。

setPreSharedKey(preSharedKey)
Parameters:

preSharedKeyQByteArray

将预共享密钥设置为 preSharedKey

另请参阅

preSharedKey()

setPreSharedKeyIdentity(preSharedKeyIdentity)
Parameters:

preSharedKeyIdentityQByteArray

将PSK客户端身份(将通知给服务器)设置为identity

另请参阅

preSharedKeyIdentity()

setPrivateKey(key)
Parameters:

keyQCoapPrivateKey

将连接的私钥设置为 key

swap(other)
Parameters:

其他QCoapSecurityConfiguration

将此安全配置与 other 交换。此操作非常快速且永远不会失败。