class QCoapPrivateKey

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

Synopsis

Methods

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.

__init__()

Constructs an empty instance of QCoapPrivateKey .

__init__(other)
Parameters:

otherQCoapPrivateKey

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

__init__(handle)
Parameters:

handleQt::HANDLE

Constructs a QCoapPrivateKey from a native key handle.

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

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.

algorithm()
Return type:

KeyAlgorithm

Returns the key algorithm.

encodingFormat()
Return type:

EncodingFormat

Returns the encoding format of the key.

handle()
Return type:

Qt::HANDLE

Returns a pointer to the native key handle.

isNull()
Return type:

bool

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

key()
Return type:

QByteArray

Returns the encoded private key.

passPhrase()
Return type:

QByteArray

Returns the passphrase for the key.

swap(other)
Parameters:

otherQCoapPrivateKey

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