Sur cette page

QSslCipher Class

La classe QSslCipher représente un algorithme de chiffrement SSL. En savoir plus...

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

Remarque : toutes les fonctions de cette classe sont réentrantes.

Fonctions publiques

QSslCipher()
QSslCipher(const QString &name)
QSslCipher(const QString &name, QSsl::SslProtocol protocol)
QSslCipher(const QSslCipher &other)
~QSslCipher()
QString authenticationMethod() const
QString encryptionMethod() const
bool isNull() const
QString keyExchangeMethod() const
QString name() const
QSsl::SslProtocol protocol() const
QString protocolString() const
int supportedBits() const
void swap(QSslCipher &other)
int usedBits() const
bool operator!=(const QSslCipher &other) const
QSslCipher &operator=(const QSslCipher &other)
bool operator==(const QSslCipher &other) const

Description détaillée

QSslCipher stocke des informations concernant un algorithme de chiffrement. Elle est le plus souvent utilisée avec la fonction ` QSslSocket`, soit pour configurer les algorithmes de chiffrement que le socket peut utiliser, soit pour afficher les algorithmes de chiffrement du socket à l'utilisateur.

Voir également QSslSocket et QSslKey.

Documentation des fonctions membres

QSslCipher::QSslCipher()

Crée un objet QSslCipher vide.

[explicit] QSslCipher::QSslCipher(const QString &name)

Crée un objet QSslCipher pour le chiffrement déterminé par ` name`. Le constructeur n'accepte que les chiffrement pris en charge (c'est-à-dire que ` name ` doit identifier un chiffrement figurant dans la liste des chiffrement renvoyée par `QSslSocket::supportedCiphers()`).

Vous pouvez appeler isNull() après la construction pour vérifier si name a correctement identifié un algorithme pris en charge.

QSslCipher::QSslCipher(const QString &name, QSsl::SslProtocol protocol)

Crée un objet QSslCipher pour l'algorithme de chiffrement déterminé par name et protocol. Le constructeur n'accepte que les algorithmes pris en charge (c'est-à-dire que les paramètres name et protocol doivent identifier un algorithme figurant dans la liste des algorithmes renvoyée par QSslSocket::supportedCiphers()).

Vous pouvez appeler isNull() après la construction pour vérifier si name et protocol ont correctement identifié un algorithme pris en charge.

QSslCipher::QSslCipher(const QSslCipher &other)

Crée une copie identique du chiffrement « other ».

[noexcept] QSslCipher::~QSslCipher()

Supprime l'objet « QSslCipher ».

QString QSslCipher::authenticationMethod() const

Renvoie la méthode d'authentification du chiffrement sous la forme d'un objet de type ` QString`.

QString QSslCipher::encryptionMethod() const

Renvoie la méthode de chiffrement du algorithme sous la forme d'un objet de type ` QString`.

bool QSslCipher::isNull() const

Renvoie « true » s’il s’agit d’un chiffrement nul ; sinon, renvoie « false ».

QString QSslCipher::keyExchangeMethod() const

Renvoie la méthode d'échange de clés du chiffrement sous la forme d'un objet de type « QString ».

QString QSslCipher::name() const

Renvoie le nom du chiffrement, ou une QString vide s'il s'agit d'un chiffrement nul.

Voir aussi isNull().

QSsl::SslProtocol QSslCipher::protocol() const

Renvoie le type de protocole du chiffrement, ou « QSsl::UnknownProtocol » si la fonction ` QSslCipher ` ne parvient pas à déterminer le protocole (la fonction `protocolString()` peut contenir davantage d'informations).

Voir également protocolString().

QString QSslCipher::protocolString() const

Renvoie le protocole du chiffrement sous la forme d'un objet ` QString`.

Voir aussi protocol().

int QSslCipher::supportedBits() const

Renvoie le nombre de bits pris en charge par l'algorithme de chiffrement.

Voir aussi usedBits().

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

Remplace cette instance de chiffrement par other. Cette opération est très rapide et ne rencontre jamais d'échec.

int QSslCipher::usedBits() const

Renvoie le nombre de bits utilisés par l'algorithme de chiffrement.

Voir également supportedBits().

bool QSslCipher::operator!=(const QSslCipher &other) const

Renvoie « true » si ce chiffrement n'est pas le même que « other » ; sinon, la fonction renvoie « false ».

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

Copie le contenu de other dans ce chiffrement, rendant ainsi les deux chiffrement identiques.

bool QSslCipher::operator==(const QSslCipher &other) const

Renvoie « true » si ce chiffrement est identique à « other » ; sinon, la fonction renvoie « 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.