Sur cette page

QCoapPrivateKey Class

La classe QCoapPrivateKey offre une interface permettant de gérer les clés de sécurité CoAP. En savoir plus...

En-tête : #include <QCoapPrivateKey>
CMake : find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap)
qmake : QT += coap

Fonctions publiques

QCoapPrivateKey()
QCoapPrivateKey(const Qt::HANDLE &handle)
QCoapPrivateKey(const QByteArray &key, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format = QSsl::Pem, const QByteArray &passPhrase = QByteArray())
QCoapPrivateKey(const QCoapPrivateKey &other)
QCoapPrivateKey(QCoapPrivateKey &&other)
~QCoapPrivateKey()
QSsl::KeyAlgorithm algorithm() const
QSsl::EncodingFormat encodingFormat() const
Qt::HANDLE handle() const
bool isNull() const
QByteArray key() const
QByteArray passPhrase() const
void swap(QCoapPrivateKey &other)
QCoapPrivateKey &operator=(const QCoapPrivateKey &other)

Description détaillée

Un objet QCoapPrivateKey regroupe une clé privée utilisée pour négocier des connexions CoAP de manière sécurisée. Il contient les informations nécessaires à l'authentification à l'aide de clés « pre-shared » et de certificats X.509.

Documentation des fonctions membres

QCoapPrivateKey::QCoapPrivateKey()

Crée une instance vide de QCoapPrivateKey.

QCoapPrivateKey::QCoapPrivateKey(const Qt::HANDLE &handle)

Crée un objet `QCoapPrivateKey` à partir d'une clé native handle.

QCoapPrivateKey::QCoapPrivateKey(const QByteArray &key, QSsl::KeyAlgorithm algorithm, QSsl::EncodingFormat format = QSsl::Pem, const QByteArray &passPhrase = QByteArray())

Crée un objet `QCoapPrivateKey` à partir du tableau d'octets ` key ` en utilisant l'algorithm ` spécifié et l'encodage ` format`.

Si la clé est chiffrée, le paramètre passPhrase est nécessaire pour la déchiffrer.

QCoapPrivateKey::QCoapPrivateKey(const QCoapPrivateKey &other)

Copie le contenu de la clé « other » dans cette clé, rendant ainsi les deux clés identiques.

[noexcept] QCoapPrivateKey::QCoapPrivateKey(QCoapPrivateKey &&other)

La fonction « move » construit un objet `QCoapPrivateKey` de manière à ce qu'il pointe vers le même objet que celui vers lequel pointait ` other `.

[noexcept] QCoapPrivateKey::~QCoapPrivateKey()

Libère toutes les ressources occupées par QCoapPrivateKey.

QSsl::KeyAlgorithm QCoapPrivateKey::algorithm() const

Renvoie l'algorithme de clé.

QSsl::EncodingFormat QCoapPrivateKey::encodingFormat() const

Renvoie le format d'encodage de la clé.

Qt::HANDLE QCoapPrivateKey::handle() const

Renvoie un pointeur vers le descripteur natif de la clé.

bool QCoapPrivateKey::isNull() const

Renvoie « true » si la clé privée est nulle ; sinon, renvoie « false ».

QByteArray QCoapPrivateKey::key() const

Renvoie la clé privée encodée.

QByteArray QCoapPrivateKey::passPhrase() const

Renvoie la phrase secrète associée à la clé.

[noexcept] void QCoapPrivateKey::swap(QCoapPrivateKey &other)

Permet d'échanger cette clé privée contre celle de other. Cette opération est très rapide et ne rencontre jamais d'échec.

QCoapPrivateKey &QCoapPrivateKey::operator=(const QCoapPrivateKey &other)

Copie le contenu de « other » dans cette clé, rendant ainsi les deux clés identiques.

Renvoie une référence à cette clé « QCoapPrivateKey ».

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.