Sur cette page

QCoapPrivateKey Class

La classe QCoapPrivateKey fournit une interface pour gérer les clés de sécurité CoAP. Plus d'informations...

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

Une clé privée QCoapPrivateKey contient une clé privée utilisée pour négocier des connexions CoAP en toute sécurité. Elle contient les informations requises pour l'authentification à l'aide des clés pre-shared et des certificats X.509.

Fonction membre Documentation

QCoapPrivateKey::QCoapPrivateKey()

Construit une instance vide de QCoapPrivateKey.

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

Construit une clé QCoapPrivateKey à partir d'une clé native handle.

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

Construit un QCoapPrivateKey à partir du tableau d'octets key en utilisant le algorithm spécifié et l'encodage format.

Si la clé est cryptée, passPhrase est nécessaire pour la décrypter.

QCoapPrivateKey::QCoapPrivateKey(const QCoapPrivateKey &other)

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

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

Move-construit un QCoapPrivateKey, en le faisant pointer sur le même objet que other.

[noexcept] QCoapPrivateKey::~QCoapPrivateKey()

Libère les ressources détenues par QCoapPrivateKey.

QSsl::KeyAlgorithm QCoapPrivateKey::algorithm() const

Renvoie l'algorithme de la clé.

QSsl::EncodingFormat QCoapPrivateKey::encodingFormat() const

Renvoie le format d'encodage de la clé.

Qt::HANDLE QCoapPrivateKey::handle() const

Renvoie un pointeur sur la poignée de la clé native.

bool QCoapPrivateKey::isNull() const

Renvoie true si la clé privée est nulle, renvoie false dans le cas contraire.

QByteArray QCoapPrivateKey::key() const

Renvoie la clé privée encodée.

QByteArray QCoapPrivateKey::passPhrase() const

Renvoie la phrase d'authentification de la clé.

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

Échange cette clé privée avec other. Cette opération est très rapide et n'échoue jamais.

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

Copie le contenu de other dans cette clé, rendant 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.