Qt 4.8
Public Functions | Properties | Friends | List of all members
QSslCipher Class Reference

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

#include <qsslcipher.h>

Public Functions

QString authenticationMethod () const
 Returns the cipher's authentication method as a QString. More...
 
QString encryptionMethod () const
 Returns the cipher's encryption method as a QString. More...
 
bool isNull () const
 Returns true if this is a null cipher; otherwise returns false. More...
 
QString keyExchangeMethod () const
 Returns the cipher's key exchange method as a QString. More...
 
QString name () const
 Returns the name of the cipher, or an empty QString if this is a null cipher. More...
 
bool operator!= (const QSslCipher &other) const
 Returns true if this cipher is not the same as other; otherwise, false is returned. More...
 
QSslCipheroperator= (const QSslCipher &other)
 Copies the contents of other into this cipher, making the two ciphers identical. More...
 
bool operator== (const QSslCipher &other) const
 Returns true if this cipher is the same as other; otherwise, false is returned. More...
 
QSsl::SslProtocol protocol () const
 Returns the cipher's protocol type, or QSsl::UnknownProtocol if QSslCipher is unable to determine the protocol (protocolString() may contain more information). More...
 
QString protocolString () const
 Returns the cipher's protocol as a QString. More...
 
 QSslCipher ()
 Constructs an empty QSslCipher object. More...
 
 QSslCipher (const QString &name, QSsl::SslProtocol protocol)
 Constructs a QSslCipher object for the cipher determined by name and protocol. More...
 
 QSslCipher (const QSslCipher &other)
 Constructs an identical copy of the other cipher. More...
 
int supportedBits () const
 Returns the number of bits supported by the cipher. More...
 
int usedBits () const
 Returns the number of bits used by the cipher. More...
 
 ~QSslCipher ()
 Destroys the QSslCipher object. More...
 

Properties

QScopedPointer< QSslCipherPrivated
 

Friends

class QSslSocketBackendPrivate
 

Detailed Description

The QSslCipher class represents an SSL cryptographic cipher.

Since
4.3
Note
This class or function is reentrant.
Attention
Module: QtNetwork

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

Definition at line 59 of file qsslcipher.h.

Constructors and Destructors

◆ QSslCipher() [1/3]

QSslCipher::QSslCipher ( )

Constructs an empty QSslCipher object.

Definition at line 77 of file qsslcipher.cpp.

78  : d(new QSslCipherPrivate)
79 {
80 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

◆ QSslCipher() [2/3]

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

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.

Definition at line 92 of file qsslcipher.cpp.

93  : d(new QSslCipherPrivate)
94 {
95  foreach (const QSslCipher &cipher, QSslSocket::supportedCiphers()) {
96  if (cipher.name() == name && cipher.protocol() == protocol) {
97  *this = cipher;
98  return;
99  }
100  }
101 }
QSsl::SslProtocol protocol() const
Returns the cipher&#39;s protocol type, or QSsl::UnknownProtocol if QSslCipher is unable to determine the...
Definition: qsslcipher.cpp:228
The QSslCipher class represents an SSL cryptographic cipher.
Definition: qsslcipher.h:59
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82
static QList< QSslCipher > supportedCiphers()
Returns the list of cryptographic ciphers supported by this system.
QString name() const
Returns the name of the cipher, or an empty QString if this is a null cipher.
Definition: qsslcipher.cpp:162

◆ QSslCipher() [3/3]

QSslCipher::QSslCipher ( const QSslCipher other)

Constructs an identical copy of the other cipher.

Definition at line 106 of file qsslcipher.cpp.

107  : d(new QSslCipherPrivate)
108 {
109  *d.data() = *other.d.data();
110 }
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

◆ ~QSslCipher()

QSslCipher::~QSslCipher ( )

Destroys the QSslCipher object.

Definition at line 115 of file qsslcipher.cpp.

116 {
117 }

Functions

◆ authenticationMethod()

QString QSslCipher::authenticationMethod ( ) const

Returns the cipher's authentication method as a QString.

Definition at line 198 of file qsslcipher.cpp.

199 {
200  return d->authenticationMethod;
201 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82
QString authenticationMethod
Definition: qsslcipher_p.h:71

◆ encryptionMethod()

QString QSslCipher::encryptionMethod ( ) const

Returns the cipher's encryption method as a QString.

Definition at line 206 of file qsslcipher.cpp.

207 {
208  return d->encryptionMethod;
209 }
QString encryptionMethod
Definition: qsslcipher_p.h:72
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

◆ isNull()

bool QSslCipher::isNull ( ) const

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

Definition at line 151 of file qsslcipher.cpp.

Referenced by QSslSocketPrivate::resetDefaultCiphers(), and QSslSocket::setCiphers().

152 {
153  return d->isNull;
154 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

◆ keyExchangeMethod()

QString QSslCipher::keyExchangeMethod ( ) const

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

Definition at line 190 of file qsslcipher.cpp.

191 {
192  return d->keyExchangeMethod;
193 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82
QString keyExchangeMethod
Definition: qsslcipher_p.h:70

◆ name()

QString QSslCipher::name ( ) const

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

See also
isNull()

Definition at line 162 of file qsslcipher.cpp.

Referenced by QSslSocketBackendPrivate::initSslContext(), operator<<(), QSslCipher(), and QSslSocketPrivate::resetDefaultCiphers().

163 {
164  return d->name;
165 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

◆ operator!=()

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

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

Definition at line 68 of file qsslcipher.h.

68 { return !operator==(other); }
bool operator==(const QSslCipher &other) const
Returns true if this cipher is the same as other; otherwise, false is returned.
Definition: qsslcipher.cpp:133

◆ operator=()

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

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

Definition at line 123 of file qsslcipher.cpp.

124 {
125  *d.data() = *other.d.data();
126  return *this;
127 }
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

◆ operator==()

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

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

Definition at line 133 of file qsslcipher.cpp.

134 {
135  return d->name == other.d->name && d->protocol == other.d->protocol;
136 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82
QSsl::SslProtocol protocol
Definition: qsslcipher_p.h:75

◆ protocol()

QSsl::SslProtocol QSslCipher::protocol ( ) const

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

See also
protocolString()

Definition at line 228 of file qsslcipher.cpp.

Referenced by QSslCipher().

229 {
230  return d->protocol;
231 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82
QSsl::SslProtocol protocol
Definition: qsslcipher_p.h:75

◆ protocolString()

QString QSslCipher::protocolString ( ) const

Returns the cipher's protocol as a QString.

See also
protocol()

Definition at line 216 of file qsslcipher.cpp.

Referenced by operator<<().

217 {
218  return d->protocolString;
219 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82
QString protocolString
Definition: qsslcipher_p.h:74

◆ supportedBits()

int QSslCipher::supportedBits ( ) const

Returns the number of bits supported by the cipher.

See also
usedBits()

Definition at line 172 of file qsslcipher.cpp.

173 {
174  return d->supportedBits;
175 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

◆ usedBits()

int QSslCipher::usedBits ( ) const

Returns the number of bits used by the cipher.

See also
supportedBits()

Definition at line 182 of file qsslcipher.cpp.

Referenced by operator<<().

183 {
184  return d->bits;
185 }
QScopedPointer< QSslCipherPrivate > d
Definition: qsslcipher.h:82

Friends and Related Functions

◆ QSslSocketBackendPrivate

Definition at line 83 of file qsslcipher.h.

Properties

◆ d

QScopedPointer<QSslCipherPrivate> QSslCipher::d
private

The documentation for this class was generated from the following files: