QCoapPrivateKey#

The QCoapPrivateKey class provides an interface for managing CoAP security keys. More

Synopsis#

Functions#

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#

A QCoapPrivateKey packages a private key used in negotiating CoAP connections securely. It holds the information required for authentication using pre-shared keys and X.509 certificates.

class PySide6.QtCoap.QCoapPrivateKey#

PySide6.QtCoap.QCoapPrivateKey(key, algorithm[, format=QSsl.Pem[, passPhrase=QByteArray()]])

PySide6.QtCoap.QCoapPrivateKey(other)

PySide6.QtCoap.QCoapPrivateKey(handle)

Parameters:

Constructs an empty instance of QCoapPrivateKey .

Constructs a QCoapPrivateKey from the byte array key using the specified algorithm and encoding format.

If the key is encrypted then passPhrase is required to decrypt it.

Copies the contents of other into this key, making the two keys identical.

Constructs a QCoapPrivateKey from a native key handle.

PySide6.QtCoap.QCoapPrivateKey.algorithm()#
Return type:

KeyAlgorithm

Returns the key algorithm.

PySide6.QtCoap.QCoapPrivateKey.encodingFormat()#
Return type:

EncodingFormat

Returns the encoding format of the key.

PySide6.QtCoap.QCoapPrivateKey.handle()#
Return type:

Qt::HANDLE

Returns a pointer to the native key handle.

PySide6.QtCoap.QCoapPrivateKey.isNull()#
Return type:

bool

Returns true if the private key is null, returns false otherwise.

PySide6.QtCoap.QCoapPrivateKey.key()#
Return type:

PySide6.QtCore.QByteArray

Returns the encoded private key.

PySide6.QtCoap.QCoapPrivateKey.passPhrase()#
Return type:

PySide6.QtCore.QByteArray

Returns the passphrase for the key.

PySide6.QtCoap.QCoapPrivateKey.swap(other)#
Parameters:

otherPySide6.QtCoap.QCoapPrivateKey

Swaps this private key with other. This operation is very fast and never fails.