PySide6.QtNetwork.QSslCipher

class QSslCipher

The QSslCipher class represents an SSL cryptographic cipher.

Details

QSslCipher stores information about one cryptographic cipher. It is most commonly used with QSslSocket , either for configuring which ciphers the socket can use, or for displaying the socket’s ciphers to the user.

See also

QSslSocket QSslKey

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

__init__()

Constructs an empty QSslCipher object.

__init__(other)
Parameters:

otherQSslCipher

Constructs an identical copy of the other cipher.

__init__(name)
Parameters:

name – str

Constructs a QSslCipher object for the cipher determined by name. The constructor accepts only supported ciphers (i.e., the name must identify a cipher in the list of ciphers returned by QSslSocket::supportedCiphers()).

You can call isNull() after construction to check if name correctly identified a supported cipher.

__init__(name, protocol)
Parameters:

Constructs a QSslCipher object for the cipher determined by name and protocol. The constructor accepts only supported ciphers (i.e., the name and protocol must identify a cipher in the list of ciphers returned by QSslSocket::supportedCiphers()).

You can call isNull() after construction to check if name and protocol correctly identified a supported cipher.

authenticationMethod()
Return type:

str

Returns the cipher’s authentication method as a QString.

encryptionMethod()
Return type:

str

Returns the cipher’s encryption method as a QString.

isNull()
Return type:

bool

Returns true if this is a null cipher; otherwise returns false.

keyExchangeMethod()
Return type:

str

Returns the cipher’s key exchange method as a QString.

name()
Return type:

str

Returns the name of the cipher, or an empty QString if this is a null cipher.

See also

isNull()

__ne__(other)
Parameters:

otherQSslCipher

Return type:

bool

Returns true if this cipher is not the same as other; otherwise, false is returned.

__eq__(other)
Parameters:

otherQSslCipher

Return type:

bool

Returns true if this cipher is the same as other; otherwise, false is returned.

protocol()
Return type:

SslProtocol

Returns the cipher’s protocol type, or UnknownProtocol if QSslCipher is unable to determine the protocol ( protocolString() may contain more information).

See also

protocolString()

protocolString()
Return type:

str

Returns the cipher’s protocol as a QString.

See also

protocol()

supportedBits()
Return type:

int

Returns the number of bits supported by the cipher.

See also

usedBits()

swap(other)
Parameters:

otherQSslCipher

Swaps this cipher instance with other. This operation is very fast and never fails.

usedBits()
Return type:

int

Returns the number of bits used by the cipher.

See also

supportedBits()