PySide6.QtCoap.QCoapPrivateKey

class QCoapPrivateKey

QCoapPrivateKey 类提供了一个用于管理CoAP安全密钥的接口。更多

概要

方法

注意

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

详细描述

一个QCoapPrivateKey封装了用于安全协商CoAP连接的私钥。它包含了使用预共享密钥和X.509证书进行认证所需的信息。

__init__()

构造一个空的 QCoapPrivateKey 实例。

__init__(other)
Parameters:

其他QCoapPrivateKey

other的内容复制到此键中,使两个键完全相同。

__init__(handle)
Parameters:

handleQt::HANDLE

从本地密钥handle构造一个QCoapPrivateKey

__init__(key, algorithm[, format=QSsl.Pem[, passPhrase=QByteArray()]])
Parameters:

从字节数组 key 使用指定的 algorithm 和编码 format 构造一个 QCoapPrivateKey

如果密钥已加密,则需要passPhrase来解密它。

algorithm()
Return type:

KeyAlgorithm

返回密钥算法。

encodingFormat()
Return type:

EncodingFormat

返回键的编码格式。

handle()
Return type:

Qt::HANDLE

返回指向本地密钥句柄的指针。

isNull()
Return type:

布尔

如果私钥为空,则返回true,否则返回false

key()
Return type:

QByteArray

返回编码后的私钥。

passPhrase()
Return type:

QByteArray

返回密钥的密码。

swap(other)
Parameters:

其他QCoapPrivateKey

将此私钥与 other 交换。此操作非常快速且永远不会失败。