En esta página

QSslDiffieHellmanParameters Class

La clase QSslDiffieHellmanParameters proporciona una interfaz para los parámetros Diffie-Hellman para servidores. Más...

Cabecera: #include <QSslDiffieHellmanParameters>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network

Nota: Todas las funciones de esta clase son reentrantes.

Tipos Públicos

enum Error { NoError, InvalidInputDataError, UnsafeParametersError }

Funciones Públicas

QSslDiffieHellmanParameters()
QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other)
QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other)
~QSslDiffieHellmanParameters()
QSslDiffieHellmanParameters::Error error() const
QString errorString() const
bool isEmpty() const
bool isValid() const
void swap(QSslDiffieHellmanParameters &other)
QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other)
QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other)

Miembros Públicos Estáticos

QSslDiffieHellmanParameters defaultParameters()
QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::Pem)
QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding = QSsl::Pem)
size_t qHash(const QSslDiffieHellmanParameters &key, size_t seed = 0)
bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)
QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam)
bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)

Descripción Detallada

QSslDiffieHellmanParameters proporciona una interfaz para establecer parámetros Diffie-Hellman a servidores basados en QSslSocket.

Véase también QSslSocket, QSslCipher, y QSslConfiguration.

Documentación del tipo de miembro

enum QSslDiffieHellmanParameters::Error

Describe un error QSslDiffieHellmanParameters.

ConstanteValorDescripción
QSslDiffieHellmanParameters::NoError0No se ha producido ningún error.
QSslDiffieHellmanParameters::InvalidInputDataError1Los datos de entrada proporcionados no se han podido utilizar para construir un objeto QSslDiffieHellmanParameters.
QSslDiffieHellmanParameters::UnsafeParametersError2Los parámetros Diffie-Hellman no son seguros y no deben utilizarse.

Documentación de las funciones miembro

QSslDiffieHellmanParameters::QSslDiffieHellmanParameters()

Construye una instancia vacía de QSslDiffieHellmanParameters.

Si se establece una instancia QSslDiffieHellmanParameters vacía en un objeto QSslConfiguration, se desactivará la negociación Diffie-Hellman.

Véase también isValid() y QSslConfiguration.

QSslDiffieHellmanParameters::QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other)

Construye una copia idéntica de other.

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

Mueve-construye desde other.

Nota: El objeto movido-desde other se coloca en un estado parcialmente formado, en el que las únicas operaciones válidas son la destrucción y la asignación de un nuevo valor.

[noexcept] QSslDiffieHellmanParameters::~QSslDiffieHellmanParameters()

Destruye el objeto QSslDiffieHellmanParameters.

[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::defaultParameters()

Devuelve el QSslDiffieHellmanParameters por defecto utilizado por QSslSocket.

Actualmente es el grupo MODP de 2048 bits del RFC 3526.

[noexcept] QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const

Devuelve el error que ha provocado que el objeto QSslDiffieHellmanParameters no sea válido.

[noexcept] QString QSslDiffieHellmanParameters::errorString() const

Devuelve una descripción legible por humanos del error que ha provocado que el objeto QSslDiffieHellmanParameters no sea válido.

[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::Pem)

Construye un objeto QSslDiffieHellmanParameters leyendo de device en forma PEM o DER según lo especificado por encoding.

Utilice el método isValid() en el objeto devuelto para comprobar si los parámetros Diffie-Hellman son válidos y se han cargado correctamente.

En particular, si device es nullptr o no está abierto a la lectura, se devolverá un objeto no válido.

Véase también isValid() y QSslConfiguration.

[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding = QSsl::Pem)

Construye un objeto QSslDiffieHellmanParameters utilizando la matriz de bytes encoded en forma PEM o DER según lo especificado por encoding.

Utilice el método isValid() en el objeto devuelto para comprobar si los parámetros Diffie-Hellman son válidos y se han cargado correctamente.

Véase también isValid() y QSslConfiguration.

[noexcept] bool QSslDiffieHellmanParameters::isEmpty() const

Devuelve true si se trata de una instancia vacía de QSslDiffieHellmanParameters.

Establecer una instancia QSslDiffieHellmanParameters vacía en un servidor basado en QSslSocket desactivará el intercambio de claves Diffie-Hellman.

[noexcept] bool QSslDiffieHellmanParameters::isValid() const

Devuelve true si se trata de un objeto QSslDiffieHellmanParameters válido; en caso contrario, false.

Este método debe utilizarse después de construir un objeto QSslDiffieHellmanParameters para determinar su validez.

Si un objeto QSslDiffieHellmanParameters no es válido, puede utilizar el método error() para determinar qué error impidió la construcción del objeto.

Véase también error().

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

Cambia este QSslDiffieHellmanParameters por other. Esta operación es muy rápida y nunca falla.

[noexcept] QSslDiffieHellmanParameters &QSslDiffieHellmanParameters::operator=(QSslDiffieHellmanParameters &&other)

Mover-asigna other a esta instancia QSslDiffieHellmanParameters.

Nota: El objeto movido-desde other se coloca en un estado parcialmente formado, en el que las únicas operaciones válidas son la destrucción y la asignación de un nuevo valor.

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

Copia el contenido de other en este QSslDiffieHellmanParameters, haciendo que los dos QSslDiffieHellmanParameters sean idénticos.

Devuelve una referencia a este QSslDiffieHellmanParameters.

No miembros relacionados

[noexcept] size_t qHash(const QSslDiffieHellmanParameters &key, size_t seed = 0)

Devuelve el valor hash para key, utilizando seed para sembrar el cálculo.

[noexcept] bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)

Devuelve true si lhs no es igual a rhs; en caso contrario devuelve false.

QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam)

Escribe el conjunto de parámetros Diffie-Hellman en dhparam en el objeto de depuración debug con fines de depuración.

Los parámetros Diffie-Hellman se representarán en forma DER codificada en Base64.

Véase también Técnicas de depuración.

[noexcept] bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)

Devuelve true si lhs es igual a rhs; en caso contrario devuelve false.

© 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.