Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QTlsPrivate::TlsKeySchannel Class Referencefinal

#include <qtlskey_schannel_p.h>

+ Inheritance diagram for QTlsPrivate::TlsKeySchannel:
+ Collaboration diagram for QTlsPrivate::TlsKeySchannel:

Public Member Functions

QByteArray decrypt (Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv) const override
 
QByteArray encrypt (Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv) const override
 
- Public Member Functions inherited from QTlsPrivate::TlsKeyGeneric
void decodeDer (KeyType type, KeyAlgorithm algorithm, const QByteArray &der, const QByteArray &passPhrase, bool deepClear) override
 
void decodePem (KeyType type, KeyAlgorithm algorithm, const QByteArray &pem, const QByteArray &passPhrase, bool deepClear) override
 
QByteArray toPem (const QByteArray &passPhrase) const override
 
QByteArray derFromPem (const QByteArray &pem, QMap< QByteArray, QByteArray > *headers) const override
 
void fromHandle (Qt::HANDLE opaque, KeyType expectedType) override
 
void clear (bool deep) override
 
Qt::HANDLE handle () const override
 
int length () const override
 
bool isPkcs8 () const override
 
 TlsKeyBase (KeyType type=QSsl::PublicKey, KeyAlgorithm algorithm=QSsl::Opaque)
 
- Public Member Functions inherited from QTlsPrivate::TlsKeyBase
 TlsKeyBase (KeyType type=QSsl::PublicKey, KeyAlgorithm algorithm=QSsl::Opaque)
 
bool isNull () const override
 
KeyType type () const override
 
KeyAlgorithm algorithm () const override
 
QByteArray pemFromDer (const QByteArray &der, const QMap< QByteArray, QByteArray > &headers) const override
 
- Public Member Functions inherited from QTlsPrivate::TlsKey
virtual ~TlsKey ()
 
QByteArray pemHeader () const
 
QByteArray pemFooter () const
 

Additional Inherited Members

- Public Types inherited from QTlsPrivate::TlsKey
using KeyType = QSsl::KeyType
 
using KeyAlgorithm = QSsl::KeyAlgorithm
 
- Static Protected Member Functions inherited from QTlsPrivate::TlsKeyBase
static QByteArray pkcs8Header (bool encrypted)
 
static QByteArray pkcs8Footer (bool encrypted)
 
static bool isEncryptedPkcs8 (const QByteArray &der)
 
- Protected Attributes inherited from QTlsPrivate::TlsKeyBase
bool keyIsNull = true
 
KeyType keyType = QSsl::PublicKey
 
KeyAlgorithm keyAlgorithm = QSsl::Opaque
 

Detailed Description

Definition at line 30 of file qtlskey_schannel_p.h.

Member Function Documentation

◆ decrypt()

QByteArray QTlsPrivate::TlsKeySchannel::decrypt ( Cipher cipher,
const QByteArray & data,
const QByteArray & passPhrase,
const QByteArray & iv ) const
overridevirtual

This function allows to decrypt data (for example, a private key read from a file), using passPhrase, initialization vector iv. cipher is describing a block cipher and its mode (for example, AES256 + CBC). decrypt() is needed to implement QSslKey's constructor.

Note
A TLS backend may provide an empty implementation, but as a result QSslKey will not be able to work with private encrypted keys.
See also
QSslKey

Implements QTlsPrivate::TlsKey.

Definition at line 142 of file qtlskey_schannel.cpp.

References QTlsPrivate::doCrypt().

+ Here is the call graph for this function:

◆ encrypt()

QByteArray QTlsPrivate::TlsKeySchannel::encrypt ( Cipher cipher,
const QByteArray & data,
const QByteArray & passPhrase,
const QByteArray & iv ) const
overridevirtual

This function is needed to implement QSslKey::toPem() with encryption (for a private key). cipher names a block cipher to use to encrypt data, using passPhrase and initialization vector iv.

Note
An empty implementation is sufficient, but QSslKey::toPem() will fail for a private key and non-empty passphrase.
See also
QSslKey

Implements QTlsPrivate::TlsKey.

Definition at line 148 of file qtlskey_schannel.cpp.

References QTlsPrivate::doCrypt().

+ Here is the call graph for this function:

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