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::X509CertificateBase Class Reference

#include <qx509_base_p.h>

+ Inheritance diagram for QTlsPrivate::X509CertificateBase:
+ Collaboration diagram for QTlsPrivate::X509CertificateBase:

Classes

struct  X509CertificateExtension
 

Public Member Functions

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 ()
 
virtual bool isEqual (const X509Certificate &other) const =0
 
virtual bool isSelfSigned () const =0
 
virtual QMultiMap< QSsl::AlternativeNameEntryType, QStringsubjectAlternativeNames () const =0
 
virtual TlsKeypublicKey () const
 
virtual QByteArray toPem () const =0
 
virtual QByteArray toDer () const =0
 
virtual QString toText () const =0
 
virtual Qt::HANDLE handle () const =0
 
virtual size_t hash (size_t seed) const noexcept=0
 

Static Public Member Functions

static QByteArray subjectInfoToString (QSslCertificate::SubjectInfo info)
 
static bool matchLineFeed (const QByteArray &pem, int *offset)
 

Protected Member Functions

bool validIndex (qsizetype index) const
 

Protected Attributes

bool null = true
 
QByteArray versionString
 
QByteArray serialNumberString
 
QMultiMap< QByteArray, QStringissuerInfoEntries
 
QMultiMap< QByteArray, QStringsubjectInfoEntries
 
QDateTime notValidAfter
 
QDateTime notValidBefore
 
QList< X509CertificateExtensionextensions
 

Detailed Description

Definition at line 33 of file qx509_base_p.h.

Member Function Documentation

◆ effectiveDate()

QDateTime QTlsPrivate::X509CertificateBase::effectiveDate ( ) const
overridevirtual

This function is expected to return the date-time that the certificate becomes valid, or an empty QDateTime if this is a null certificate.

See also
expiryDate()

Implements QTlsPrivate::X509Certificate.

Definition at line 95 of file qx509_base.cpp.

References notValidBefore.

◆ expiryDate()

QDateTime QTlsPrivate::X509CertificateBase::expiryDate ( ) const
overridevirtual

This function is expected to return the date-time that the certificate expires, or an empty QDateTime if this is a null certificate.

See also
effectiveDate()

Implements QTlsPrivate::X509Certificate.

Definition at line 100 of file qx509_base.cpp.

References notValidAfter.

◆ isExtensionCritical()

bool QTlsPrivate::X509CertificateBase::isExtensionCritical ( qsizetype i) const
overridevirtual

This function is expected to return the criticality of the extension with index i.

See also
numberOfExtensions()

Implements QTlsPrivate::X509Certificate.

Definition at line 128 of file qx509_base.cpp.

References extensions, Q_ASSERT, and validIndex().

+ Here is the call graph for this function:

◆ isExtensionSupported()

bool QTlsPrivate::X509CertificateBase::isExtensionSupported ( qsizetype i) const
overridevirtual

This function is expected to return true if this extension is supported. In this case, supported simply means that the structure of the QVariant returned by the valueForExtension() accessor will remain unchanged between versions.

See also
numberOfExtensions()

Implements QTlsPrivate::X509Certificate.

Definition at line 134 of file qx509_base.cpp.

References extensions, Q_ASSERT, and validIndex().

+ Here is the call graph for this function:

◆ isNull()

bool QTlsPrivate::X509CertificateBase::isNull ( ) const
overridevirtual

Returns true if this certificate was default-constructed and not initialized yet. This function is called by QSslCertificate::isNull().

See also
QSslCertificate::isNull()

Implements QTlsPrivate::X509Certificate.

Definition at line 50 of file qx509_base.cpp.

References null.

◆ issuerInfo() [1/2]

QStringList QTlsPrivate::X509CertificateBase::issuerInfo ( const QByteArray & attribute) const
overridevirtual

This function is expected to return the issuer information for attribute from the certificate, or an empty list if there is no information for attribute in the certificate. There can be more than one entry for an attribute.

See also
QSslCertificate::issuerInfo().

Implements QTlsPrivate::X509Certificate.

Definition at line 70 of file qx509_base.cpp.

References issuerInfoEntries, and QMultiMap< Key, T >::values().

+ Here is the call graph for this function:

◆ issuerInfo() [2/2]

QStringList QTlsPrivate::X509CertificateBase::issuerInfo ( QSslCertificate::SubjectInfo subject) const
overridevirtual

This function is expected to return the issuer information for the subject from the certificate, or an empty list if there is no information for subject in the certificate. There can be more than one entry of each type.

See also
QSslCertificate::issuerInfo().

Implements QTlsPrivate::X509Certificate.

Definition at line 65 of file qx509_base.cpp.

References info, issuerInfo(), and subjectInfoToString().

Referenced by issuerInfo().

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

◆ issuerInfoAttributes()

QList< QByteArray > QTlsPrivate::X509CertificateBase::issuerInfoAttributes ( ) const
overridevirtual

This function is expected to return a list of the attributes that have values in the issuer information of this certificate. The information associated with a given attribute can be accessed using the issuerInfo() method. Note that this list may include the OIDs for any elements that are not known by the TLS backend.

Note
This function implements QSslCertificate::issuerInfoAttributes().
See also
issuerInfo()

Implements QTlsPrivate::X509Certificate.

Definition at line 90 of file qx509_base.cpp.

References issuerInfoEntries, and QMultiMap< Key, T >::uniqueKeys().

+ Here is the call graph for this function:

◆ matchLineFeed()

bool QTlsPrivate::X509CertificateBase::matchLineFeed ( const QByteArray & pem,
int * offset )
static

Definition at line 28 of file qx509_base.cpp.

References ch, and Q_ASSERT.

Referenced by QTlsPrivate::X509CertificateOpenSSL::certificatesFromPem(), and QTlsPrivate::X509CertificateGeneric::certificatesFromPem().

+ Here is the caller graph for this function:

◆ nameForExtension()

QString QTlsPrivate::X509CertificateBase::nameForExtension ( qsizetype i) const
overridevirtual

This function is expected to return the name for the extension with index i. If no name is known for the extension then the OID will be returned.

See also
numberOfExtensions(), oidForExtension()

Implements QTlsPrivate::X509Certificate.

Definition at line 116 of file qx509_base.cpp.

References extensions, Q_ASSERT, and validIndex().

+ Here is the call graph for this function:

◆ numberOfExtensions()

qsizetype QTlsPrivate::X509CertificateBase::numberOfExtensions ( ) const
overridevirtual

This function is expected to return the number of X509 extensions of this certificate.

Implements QTlsPrivate::X509Certificate.

Definition at line 105 of file qx509_base.cpp.

References extensions.

◆ oidForExtension()

QString QTlsPrivate::X509CertificateBase::oidForExtension ( qsizetype i) const
overridevirtual

This function is expected to return the ASN.1 OID for the extension with index i.

See also
numberOfExtensions()

Implements QTlsPrivate::X509Certificate.

Definition at line 110 of file qx509_base.cpp.

References extensions, Q_ASSERT, and validIndex().

+ Here is the call graph for this function:

◆ serialNumber()

QByteArray QTlsPrivate::X509CertificateBase::serialNumber ( ) const
overridevirtual

This function is expected to return the certificate's serial number string in hexadecimal format.

See also
QSslCertificate::serialNumber()

Implements QTlsPrivate::X509Certificate.

Definition at line 60 of file qx509_base.cpp.

References serialNumberString.

Referenced by QTlsPrivate::X509CertificateOpenSSL::certificateFromX509().

+ Here is the caller graph for this function:

◆ subjectInfo() [1/2]

QStringList QTlsPrivate::X509CertificateBase::subjectInfo ( const QByteArray & attribute) const
overridevirtual

This function is expected to return the subject information for attribute, or an empty list if there is no information for attribute in the certificate. There can be more than one entry for an attribute.

See also
QSslCertificate::subjectInfo().

Implements QTlsPrivate::X509Certificate.

Definition at line 80 of file qx509_base.cpp.

References subjectInfoEntries, and QMultiMap< Key, T >::values().

+ Here is the call graph for this function:

◆ subjectInfo() [2/2]

QStringList QTlsPrivate::X509CertificateBase::subjectInfo ( QSslCertificate::SubjectInfo subject) const
overridevirtual

This function is expected to return the information for the subject, or an empty list if there is no information for subject in the certificate. There can be more than one entry of each type.

See also
QSslCertificate::subjectInfo().

Implements QTlsPrivate::X509Certificate.

Definition at line 75 of file qx509_base.cpp.

References info, subjectInfo(), and subjectInfoToString().

Referenced by subjectInfo().

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

◆ subjectInfoAttributes()

QList< QByteArray > QTlsPrivate::X509CertificateBase::subjectInfoAttributes ( ) const
overridevirtual

This function is expected to return a list of the attributes that have values in the subject information of this certificate. The information associated with a given attribute can be accessed using the subjectInfo() method. Note that this list may include the OIDs for any elements that are not known by the TLS backend.

Note
This function is needed for QSslCertificate:subjectInfoAttributes().
See also
subjectInfo()

Implements QTlsPrivate::X509Certificate.

Definition at line 85 of file qx509_base.cpp.

References subjectInfoEntries, and QMultiMap< Key, T >::uniqueKeys().

+ Here is the call graph for this function:

◆ subjectInfoToString()

QByteArray QTlsPrivate::X509CertificateBase::subjectInfoToString ( QSslCertificate::SubjectInfo info)
static

Definition at line 10 of file qx509_base.cpp.

References QSslCertificate::CommonName, QSslCertificate::CountryName, QSslCertificate::DistinguishedNameQualifier, QSslCertificate::EmailAddress, info, QSslCertificate::LocalityName, QSslCertificate::Organization, QSslCertificate::OrganizationalUnitName, QByteArray(), QSslCertificate::SerialNumber, QSslCertificate::StateOrProvinceName, and str.

Referenced by issuerInfo(), and subjectInfo().

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

◆ validIndex()

bool QTlsPrivate::X509CertificateBase::validIndex ( qsizetype index) const
inlineprotected

Definition at line 59 of file qx509_base_p.h.

References extensions.

Referenced by isExtensionCritical(), isExtensionSupported(), nameForExtension(), oidForExtension(), and valueForExtension().

+ Here is the caller graph for this function:

◆ valueForExtension()

QVariant QTlsPrivate::X509CertificateBase::valueForExtension ( qsizetype i) const
overridevirtual

This function is expected to return the value of the extension with index i. The structure of the value returned depends on the extension type

See also
numberOfExtensions()

Implements QTlsPrivate::X509Certificate.

Definition at line 122 of file qx509_base.cpp.

References extensions, Q_ASSERT, and validIndex().

+ Here is the call graph for this function:

◆ version()

QByteArray QTlsPrivate::X509CertificateBase::version ( ) const
overridevirtual

Implements QSslCertificate::version().

See also
QSslCertificate::version()

Implements QTlsPrivate::X509Certificate.

Definition at line 55 of file qx509_base.cpp.

References versionString.

Member Data Documentation

◆ extensions

◆ issuerInfoEntries

QMultiMap<QByteArray, QString> QTlsPrivate::X509CertificateBase::issuerInfoEntries
protected

◆ notValidAfter

QDateTime QTlsPrivate::X509CertificateBase::notValidAfter
protected

Definition at line 70 of file qx509_base_p.h.

Referenced by expiryDate(), and QTlsPrivate::X509CertificateGeneric::parse().

◆ notValidBefore

QDateTime QTlsPrivate::X509CertificateBase::notValidBefore
protected

Definition at line 71 of file qx509_base_p.h.

Referenced by effectiveDate(), and QTlsPrivate::X509CertificateGeneric::parse().

◆ null

bool QTlsPrivate::X509CertificateBase::null = true
protected

◆ serialNumberString

QByteArray QTlsPrivate::X509CertificateBase::serialNumberString
protected

Definition at line 66 of file qx509_base_p.h.

Referenced by QTlsPrivate::X509CertificateGeneric::parse(), and serialNumber().

◆ subjectInfoEntries

QMultiMap<QByteArray, QString> QTlsPrivate::X509CertificateBase::subjectInfoEntries
protected

◆ versionString

QByteArray QTlsPrivate::X509CertificateBase::versionString
protected

Definition at line 65 of file qx509_base_p.h.

Referenced by QTlsPrivate::X509CertificateGeneric::parse(), and version().


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