En esta página

QCoapPrivateKey Class

La clase QCoapPrivateKey ofrece una interfaz para gestionar las claves de seguridad CoAP. Más información...

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

Funciones públicas

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)

Descripción detallada

Un QCoapPrivateKey contiene una clave privada utilizada para negociar conexiones CoAP de forma segura. Almacena la información necesaria para la autenticación mediante claves « pre-shared » y certificados X.509.

Documentación de las funciones de los miembros

QCoapPrivateKey::QCoapPrivateKey()

Crea una instancia vacía de QCoapPrivateKey.

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

Crea un objeto `QCoapPrivateKey` a partir de una clave nativa ` handle`.

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

Crea un objeto `QCoapPrivateKey` a partir de la matriz de bytes ` key `, utilizando la longitud especificada ` algorithm ` y la codificación ` format`.

Si la clave está cifrada, se necesita passPhrase para descifrarla.

QCoapPrivateKey::QCoapPrivateKey(const QCoapPrivateKey &other)

Copia el contenido de « other » en esta clave, de modo que ambas claves queden idénticas.

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

Move crea un objeto `QCoapPrivateKey`, haciendo que apunte al mismo objeto al que apuntaba ` other `.

[noexcept] QCoapPrivateKey::~QCoapPrivateKey()

Libera los recursos retenidos por ` QCoapPrivateKey`.

QSsl::KeyAlgorithm QCoapPrivateKey::algorithm() const

Devuelve el algoritmo de clave.

QSsl::EncodingFormat QCoapPrivateKey::encodingFormat() const

Devuelve el formato de codificación de la clave.

Qt::HANDLE QCoapPrivateKey::handle() const

Devuelve un puntero al identificador de clave nativo.

bool QCoapPrivateKey::isNull() const

Devuelve « true » si la clave privada es nula; en caso contrario, devuelve « false ».

QByteArray QCoapPrivateKey::key() const

Devuelve la clave privada codificada.

QByteArray QCoapPrivateKey::passPhrase() const

Devuelve la frase de contraseña de la clave.

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

Intercambia esta clave privada con other. Esta operación es muy rápida y nunca falla.

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

Copia el contenido de other en esta clave, de modo que ambas claves quedan idénticas.

Devuelve una referencia a esta « 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.