PySide6.QtCoap.QCoapPrivateKey¶
- class QCoapPrivateKey¶
QCoapPrivateKey类提供了一个用于管理CoAP安全密钥的接口。更多…概要¶
方法¶
def
__init__()def
algorithm()def
encodingFormat()def
handle()def
isNull()def
key()def
passPhrase()def
swap()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
一个
QCoapPrivateKey封装了用于安全协商CoAP连接的私钥。它包含了使用预共享密钥和X.509证书进行认证所需的信息。- __init__()¶
构造一个空的
QCoapPrivateKey实例。- __init__(other)
- Parameters:
其他 –
QCoapPrivateKey
将
other的内容复制到此键中,使两个键完全相同。- __init__(handle)
- Parameters:
handle –
Qt::HANDLE
从本地密钥
handle构造一个QCoapPrivateKey。- __init__(key, algorithm[, format=QSsl.Pem[, passPhrase=QByteArray()]])
- Parameters:
key –
QByteArray算法 –
KeyAlgorithmformat –
EncodingFormatpassPhrase –
QByteArray
从字节数组
key使用指定的algorithm和编码format构造一个QCoapPrivateKey。如果密钥已加密,则需要
passPhrase来解密它。- algorithm()¶
- Return type:
返回密钥算法。
- encodingFormat()¶
- Return type:
返回键的编码格式。
- handle()¶
- Return type:
Qt::HANDLE
返回指向本地密钥句柄的指针。
- isNull()¶
- Return type:
布尔
如果私钥为空,则返回
true,否则返回false。- key()¶
- Return type:
返回编码后的私钥。
- passPhrase()¶
- Return type:
返回密钥的密码。
- swap(other)¶
- Parameters:
其他 –
QCoapPrivateKey
将此私钥与
other交换。此操作非常快速且永远不会失败。