In questa pagina

QCoapPrivateKey Class

La classe QCoapPrivateKey fornisce un'interfaccia per la gestione delle chiavi di sicurezza CoAP. Per saperne di più...

Intestazione: #include <QCoapPrivateKey>
CMake: find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap)
qmake: QT += coap

Funzioni pubbliche

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)

Descrizione dettagliata

Un QCoapPrivateKey racchiude una chiave privata utilizzata per negoziare in modo sicuro le connessioni CoAP. Contiene le informazioni necessarie per l'autenticazione tramite chiavi " pre-shared " e certificati X.509.

Documentazione delle funzioni membro

QCoapPrivateKey::QCoapPrivateKey()

Crea un'istanza vuota di QCoapPrivateKey.

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

Crea un oggetto `QCoapPrivateKey` a partire da una chiave nativa handle.

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

Crea un oggetto `QCoapPrivateKey` a partire dall'array di byte ` key `, utilizzando l'algorithm e specificata e la codifica ` format`.

Se la chiave è crittografata, è necessario passPhrase per decrittografarla.

QCoapPrivateKey::QCoapPrivateKey(const QCoapPrivateKey &other)

Copia il contenuto di other in questa chiave, rendendo le due chiavi identiche.

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

Crea un oggetto `QCoapPrivateKey` tramite `move`, facendo sì che punti allo stesso oggetto a cui puntava ` other `.

[noexcept] QCoapPrivateKey::~QCoapPrivateKey()

Rilascia tutte le risorse gestite da QCoapPrivateKey.

QSsl::KeyAlgorithm QCoapPrivateKey::algorithm() const

Restituisce l'algoritmo della chiave.

QSsl::EncodingFormat QCoapPrivateKey::encodingFormat() const

Restituisce il formato di codifica della chiave.

Qt::HANDLE QCoapPrivateKey::handle() const

Restituisce un puntatore all'handle della chiave nativa.

bool QCoapPrivateKey::isNull() const

Restituisce ` true ` se la chiave privata è nulla, altrimenti restituisce ` false `.

QByteArray QCoapPrivateKey::key() const

Restituisce la chiave privata codificata.

QByteArray QCoapPrivateKey::passPhrase() const

Restituisce la passphrase della chiave.

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

Scambia questa chiave privata con other. Questa operazione è molto veloce e non fallisce mai.

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

Copia il contenuto di other in questa chiave, rendendo le due chiavi identiche.

Restituisce un riferimento a questa chiave 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.