Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QTlsPrivate::X509CertificateOpenSSL Class Referencefinal

#include <qx509_openssl_p.h>

Inheritance diagram for QTlsPrivate::X509CertificateOpenSSL:
Collaboration diagram for QTlsPrivate::X509CertificateOpenSSL:

Public Member Functions

 X509CertificateOpenSSL ()
 ~X509CertificateOpenSSL ()
bool isEqual (const X509Certificate &rhs) const override
bool isSelfSigned () const override
QMultiMap< QSsl::AlternativeNameEntryType, QStringsubjectAlternativeNames () const override
TlsKeypublicKey () const override
QByteArray toPem () const override
QByteArray toDer () const override
QString toText () const override
Qt::HANDLE handle () const override
size_t hash (size_t seed) const noexcept override
Public Member Functions inherited from QTlsPrivate::X509CertificateBase
bool isNull () const override
QByteArray version () const override
QByteArray serialNumber () const override
QStringList issuerInfo (QSslCertificate::SubjectInfo info) const override
QStringList issuerInfo (const QByteArray &attribute) const override
QStringList subjectInfo (QSslCertificate::SubjectInfo info) const override
QStringList subjectInfo (const QByteArray &attribute) const override
QList< QByteArraysubjectInfoAttributes () const override
QList< QByteArrayissuerInfoAttributes () const override
QDateTime effectiveDate () const override
QDateTime expiryDate () const override
qsizetype numberOfExtensions () const override
QString oidForExtension (qsizetype index) const override
QString nameForExtension (qsizetype index) const override
QVariant valueForExtension (qsizetype index) const override
bool isExtensionCritical (qsizetype index) const override
bool isExtensionSupported (qsizetype index) const override
Public Member Functions inherited from QTlsPrivate::X509Certificate
virtual ~X509Certificate ()

Static Public Member Functions

static QSslCertificate certificateFromX509 (X509 *x)
static QList< QSslCertificatestackOfX509ToQSslCertificates (STACK_OF(X509) *x509)
static QSslErrorEntry errorEntryFromStoreContext (X509_STORE_CTX *ctx)
static QList< QSslErrorverify (const QList< QSslCertificate > &chain, const QString &hostName)
static QList< QSslErrorverify (const QList< QSslCertificate > &caCertificates, const QList< QSslCertificate > &certificateChain, const QString &hostName)
static QList< QSslCertificatecertificatesFromPem (const QByteArray &pem, int count)
static QList< QSslCertificatecertificatesFromDer (const QByteArray &der, int count)
static bool importPkcs12 (QIODevice *device, QSslKey *key, QSslCertificate *cert, QList< QSslCertificate > *caCertificates, const QByteArray &passPhrase)
static QSslError openSSLErrorToQSslError (int errorCode, const QSslCertificate &cert)
Static Public Member Functions inherited from QTlsPrivate::X509CertificateBase
static QByteArray subjectInfoToString (QSslCertificate::SubjectInfo info)
static bool matchLineFeed (const QByteArray &pem, int *offset)

Additional Inherited Members

Protected Member Functions inherited from QTlsPrivate::X509CertificateBase
bool validIndex (qsizetype index) const
Protected Attributes inherited from QTlsPrivate::X509CertificateBase
bool null = true
QByteArray versionString
QByteArray serialNumberString
QMultiMap< QByteArray, QStringissuerInfoEntries
QMultiMap< QByteArray, QStringsubjectInfoEntries
QDateTime notValidAfter
QDateTime notValidBefore
QList< X509CertificateExtensionextensions

Detailed Description

Definition at line 36 of file qx509_openssl_p.h.

Constructor & Destructor Documentation

◆ X509CertificateOpenSSL()

QTlsPrivate::X509CertificateOpenSSL::X509CertificateOpenSSL ( )
default

◆ ~X509CertificateOpenSSL()

QTlsPrivate::X509CertificateOpenSSL::~X509CertificateOpenSSL ( )

Definition at line 400 of file qx509_openssl.cpp.

References q_X509_free().

Here is the call graph for this function:

Member Function Documentation

◆ certificateFromX509()

QSslCertificate QTlsPrivate::X509CertificateOpenSSL::certificateFromX509 ( X509 * x)
static

Definition at line 540 of file qx509_openssl.cpp.

References q_X509_dup(), q_X509_get_serialNumber(), q_X509_getm_notAfter(), and q_X509_getm_notBefore().

Here is the call graph for this function:

◆ certificatesFromDer()

QList< QSslCertificate > QTlsPrivate::X509CertificateOpenSSL::certificatesFromDer ( const QByteArray & der,
int count )
static

Definition at line 755 of file qx509_openssl.cpp.

References q_d2i_X509(), and q_X509_free().

Here is the call graph for this function:

◆ certificatesFromPem()

QList< QSslCertificate > QTlsPrivate::X509CertificateOpenSSL::certificatesFromPem ( const QByteArray & pem,
int count )
static

Definition at line 721 of file qx509_openssl.cpp.

References q_X509_free().

Here is the call graph for this function:

◆ errorEntryFromStoreContext()

QSslErrorEntry QTlsPrivate::X509CertificateOpenSSL::errorEntryFromStoreContext ( X509_STORE_CTX * ctx)
static

Definition at line 593 of file qx509_openssl.cpp.

References q_X509_STORE_CTX_get_error(), and q_X509_STORE_CTX_get_error_depth().

Referenced by QTlsPrivate::TlsCryptographOpenSSL::emitErrorFromCallback(), QTlsPrivate::q_X509Callback(), dtlscallbacks::q_X509DtlsCallback(), and QTlsPrivate::qt_X509Callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle()

Qt::HANDLE QTlsPrivate::X509CertificateOpenSSL::handle ( ) const
overridevirtual

This function is expected to return a pointer to the native certificate handle, if there is one, else nullptr.

Implements QTlsPrivate::X509Certificate.

Definition at line 522 of file qx509_openssl.cpp.

◆ hash()

size_t QTlsPrivate::X509CertificateOpenSSL::hash ( size_t seed) const
overridevirtualnoexcept

This function is expected to return the hash value for this certificate, using seed to seed the calculation.

Implements QTlsPrivate::X509Certificate.

Definition at line 527 of file qx509_openssl.cpp.

References q_EVP_sha1(), and q_X509_digest().

Here is the call graph for this function:

◆ importPkcs12()

bool QTlsPrivate::X509CertificateOpenSSL::importPkcs12 ( QIODevice * device,
QSslKey * key,
QSslCertificate * cert,
QList< QSslCertificate > * caCertificates,
const QByteArray & passPhrase )
static

Definition at line 775 of file qx509_openssl.cpp.

References q_BIO_free(), q_d2i_PKCS12_bio(), q_ERR_error_string(), q_ERR_get_error(), q_EVP_PKEY_free(), q_OPENSSL_sk_pop_free(), q_PKCS12_free(), and q_X509_free().

Here is the call graph for this function:

◆ isEqual()

bool QTlsPrivate::X509CertificateOpenSSL::isEqual ( const X509Certificate & other) const
overridevirtual

This function is expected to return true if this certificate is the same as the other, false otherwise. Used by QSslCertificate's comparison operators.

Implements QTlsPrivate::X509Certificate.

Definition at line 406 of file qx509_openssl.cpp.

References QTlsBackendOpenSSL::logAndClearErrorQueue().

Here is the call graph for this function:

◆ isSelfSigned()

bool QTlsPrivate::X509CertificateOpenSSL::isSelfSigned ( ) const
overridevirtual

This function is needed to implement QSslCertificate::isSelfSigned()

See also
QSslCertificate::isSelfSigned()

Implements QTlsPrivate::X509Certificate.

Definition at line 420 of file qx509_openssl.cpp.

References q_X509_check_issued().

Here is the call graph for this function:

◆ openSSLErrorToQSslError()

QSslError QTlsPrivate::X509CertificateOpenSSL::openSSLErrorToQSslError ( int errorCode,
const QSslCertificate & cert )
static

Definition at line 838 of file qx509_openssl.cpp.

◆ publicKey()

TlsKey * QTlsPrivate::X509CertificateOpenSSL::publicKey ( ) const
overridevirtual

Returns the certificate subject's public key.

Reimplemented from QTlsPrivate::X509Certificate.

Definition at line 490 of file qx509_openssl.cpp.

References QTlsPrivate::TlsKeyOpenSSL::publicKeyFromX509().

Here is the call graph for this function:

◆ stackOfX509ToQSslCertificates()

QList< QSslCertificate > QTlsPrivate::X509CertificateOpenSSL::stackOfX509ToQSslCertificates ( STACK_OF(X509) * x509)
static

Definition at line 579 of file qx509_openssl.cpp.

◆ subjectAlternativeNames()

QMultiMap< QSsl::AlternativeNameEntryType, QString > QTlsPrivate::X509CertificateOpenSSL::subjectAlternativeNames ( ) const
overridevirtual

This function is expected to return the list of alternative subject names for this certificate. The alternative names typically contain host names, optionally with wildcards, that are valid for this certificate.

See also
subjectInfo()

Implements QTlsPrivate::X509Certificate.

Definition at line 429 of file qx509_openssl.cpp.

References q_ASN1_STRING_get0_data(), q_ASN1_STRING_length(), q_GENERAL_NAME_free(), q_OPENSSL_sk_pop_free(), and q_X509_get_ext_d2i().

Here is the call graph for this function:

◆ toDer()

QByteArray QTlsPrivate::X509CertificateOpenSSL::toDer ( ) const
overridevirtual

This function is expected to return this certificate converted to a DER (binary) encoded representation.

Implements QTlsPrivate::X509Certificate.

Definition at line 506 of file qx509_openssl.cpp.

◆ toPem()

QByteArray QTlsPrivate::X509CertificateOpenSSL::toPem ( ) const
overridevirtual

This function is expected to return this certificate converted to a PEM (Base64) encoded representation.

Implements QTlsPrivate::X509Certificate.

Definition at line 498 of file qx509_openssl.cpp.

◆ toText()

QString QTlsPrivate::X509CertificateOpenSSL::toText ( ) const
overridevirtual

This function is expected to return this certificate converted to a human-readable text representation.

Implements QTlsPrivate::X509Certificate.

Definition at line 514 of file qx509_openssl.cpp.

◆ verify() [1/2]

QList< QSslError > QTlsPrivate::X509CertificateOpenSSL::verify ( const QList< QSslCertificate > & caCertificates,
const QList< QSslCertificate > & certificateChain,
const QString & hostName )
static

Definition at line 616 of file qx509_openssl.cpp.

References q_OPENSSL_sk_free(), q_OPENSSL_sk_new_null(), q_X509_STORE_CTX_init(), q_X509_STORE_CTX_new(), q_X509_STORE_free(), q_X509_STORE_new(), q_X509_STORE_set_verify_cb(), q_X509_verify_cert(), and QTlsPrivate::qt_X509Callback().

Here is the call graph for this function:

◆ verify() [2/2]

QList< QSslError > QTlsPrivate::X509CertificateOpenSSL::verify ( const QList< QSslCertificate > & chain,
const QString & hostName )
static

Definition at line 600 of file qx509_openssl.cpp.


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