|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QSslCipher Class Reference
[QtNetwork module]

The QSslCipher class represents an SSL cryptographic cipher. More...

     #include <QSslCipher>

Note: All the functions in this class are reentrant.

This class was introduced in Qt 4.3.

- List of all members, including inherited members

### Public Types

- enum Protocol { SslV3, SslV2, TlsV1, Unknown }

### Public Functions

- QSslCipher ()
- QSslCipher ( const QString & name, Protocol protocol )
- QSslCipher ( const QSslCipher & other )
- ~QSslCipher ()
- QString authenticationMethod () const
- QString encryptionMethod () const
- bool isNull () const
- QString keyExchangeMethod () const
- QString name () const
- Protocol protocol () const
- QString protocolString () const
- int supportedBits () const
- int usedBits () const
- bool operator!= ( const QSslCipher & other ) const
- QSslCipher & operator= ( const QSslCipher & other )
- bool operator== ( const QSslCipher & other ) const

## Detailed Description

The QSslCipher class represents an SSL cryptographic cipher.

QSslCipher stores information about one cryptographic cipher. It is most commonly used together with QSslSocket to either configure what ciphers to use, or to display cipher information to the user.

See also QSslSocket and QSslKey.

## Member Type Documentation

### enum QSslCipher::Protocol

Describes the protocol of the cipher.

Constant | Value | Description
--- | --- | ---
`QSslCipher::SslV3` | `0` | SSLv3 - the default protocol.
`QSslCipher::SslV2` | `1` | SSLv2
`QSslCipher::TlsV1` | `2` | TLSv1
`QSslCipher::Unknown` | `3` | The cipher's protocol cannot be determined.

## Member Function Documentation

### QSslCipher::QSslCipher ()

Constructs an empty QSslCipher object.

### QSslCipher::QSslCipher ( const QString & name, Protocol protocol )

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

You can call isNull() later to check if name and protocol correctly identifies a supported cipher.

### QSslCipher::QSslCipher ( const QSslCipher & other )

Constructs an identical copy of other.

### QSslCipher::~QSslCipher ()

Destroys the QSslCipher object.

### QString QSslCipher::authenticationMethod () const

Returns the cipher's authentication method as a QString.

### QString QSslCipher::encryptionMethod () const

Returns the cipher's encryption method as a QString.

### bool QSslCipher::isNull () const

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

### QString QSslCipher::keyExchangeMethod () const

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

### QString QSslCipher::name () const

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

See also isNull().

### Protocol QSslCipher::protocol () const

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

See also protocolString().

### QString QSslCipher::protocolString () const

Returns the cipher's protocol as a QString.

See also protocol().

### int QSslCipher::supportedBits () const

Returns the number of bits supported by the cipher.

See also usedBits().

### int QSslCipher::usedBits () const

Returns the number of bits used by the cipher.

See also supportedBits().

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

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

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

Copies the contents of other into this cipher, making the two ciphers identical.

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

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