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::X509Certificate Class Referenceabstract

X509Certificate is an abstract class that allows a TLS backend to provide an implementation of the QSslCertificate class. More...

#include <qtlsbackend_p.h>

+ Inheritance diagram for QTlsPrivate::X509Certificate:
+ Collaboration diagram for QTlsPrivate::X509Certificate:

Public Member Functions

virtual ~X509Certificate ()
 
virtual bool isEqual (const X509Certificate &other) const =0
 
virtual bool isNull () const =0
 
virtual bool isSelfSigned () const =0
 
virtual QByteArray version () const =0
 
virtual QByteArray serialNumber () const =0
 
virtual QStringList issuerInfo (QSslCertificate::SubjectInfo subject) const =0
 
virtual QStringList issuerInfo (const QByteArray &attribute) const =0
 
virtual QStringList subjectInfo (QSslCertificate::SubjectInfo subject) const =0
 
virtual QStringList subjectInfo (const QByteArray &attribute) const =0
 
virtual QList< QByteArraysubjectInfoAttributes () const =0
 
virtual QList< QByteArrayissuerInfoAttributes () const =0
 
virtual QMultiMap< QSsl::AlternativeNameEntryType, QStringsubjectAlternativeNames () const =0
 
virtual QDateTime effectiveDate () const =0
 
virtual QDateTime expiryDate () const =0
 
virtual TlsKeypublicKey () const
 
virtual qsizetype numberOfExtensions () const =0
 
virtual QString oidForExtension (qsizetype i) const =0
 
virtual QString nameForExtension (qsizetype i) const =0
 
virtual QVariant valueForExtension (qsizetype i) const =0
 
virtual bool isExtensionCritical (qsizetype i) const =0
 
virtual bool isExtensionSupported (qsizetype i) const =0
 
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
 

Detailed Description

X509Certificate is an abstract class that allows a TLS backend to provide an implementation of the QSslCertificate class.

(Network-private)

This class provides an interface that must be reimplemented by a TLS plugin, that supports QSslCertificate. Most functions are pure virtual, and thus have to be overridden. For some of them, an empty overrider is acceptable, though a part of functionality in QSslCertificate will be missing.

See also
QTlsBackend::createCertificate(), QTlsBackend::X509PemReader(), QTlsBackend::X509DerReader()

Definition at line 97 of file qtlsbackend_p.h.

Constructor & Destructor Documentation

◆ ~X509Certificate()

QTlsPrivate::X509Certificate::~X509Certificate ( )
virtualdefault

Destroys this certificate.

Member Function Documentation

◆ effectiveDate()

QDateTime QTlsPrivate::X509Certificate::effectiveDate ( ) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateBase.

◆ expiryDate()

QDateTime QTlsPrivate::X509Certificate::expiryDate ( ) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateBase.

◆ handle()

Qt::HANDLE QTlsPrivate::X509Certificate::handle ( ) const
pure virtual

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

Implemented in QTlsPrivate::X509CertificateOpenSSL, QTlsPrivate::X509CertificateSchannel, and QTlsPrivate::X509CertificateGeneric.

◆ hash()

size_t QTlsPrivate::X509Certificate::hash ( size_t seed) const
pure virtualnoexcept

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

Implemented in QTlsPrivate::X509CertificateOpenSSL, and QTlsPrivate::X509CertificateGeneric.

◆ isEqual()

bool QTlsPrivate::X509Certificate::isEqual ( const X509Certificate & other) const
pure virtual

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

Implemented in QTlsPrivate::X509CertificateOpenSSL, and QTlsPrivate::X509CertificateGeneric.

◆ isExtensionCritical()

bool QTlsPrivate::X509Certificate::isExtensionCritical ( qsizetype i) const
pure virtual

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

See also
numberOfExtensions()

Implemented in QTlsPrivate::X509CertificateBase.

◆ isExtensionSupported()

bool QTlsPrivate::X509Certificate::isExtensionSupported ( qsizetype i) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateBase.

◆ isNull()

bool QTlsPrivate::X509Certificate::isNull ( ) const
pure virtual

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

See also
QSslCertificate::isNull()

Implemented in QTlsPrivate::X509CertificateBase.

◆ isSelfSigned()

bool QTlsPrivate::X509Certificate::isSelfSigned ( ) const
pure virtual

◆ issuerInfo() [1/2]

QStringList QTlsPrivate::X509Certificate::issuerInfo ( const QByteArray & attribute) const
pure virtual

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().

Implemented in QTlsPrivate::X509CertificateBase.

◆ issuerInfo() [2/2]

QStringList QTlsPrivate::X509Certificate::issuerInfo ( QSslCertificate::SubjectInfo subject) const
pure virtual

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().

Implemented in QTlsPrivate::X509CertificateBase.

◆ issuerInfoAttributes()

QList< QByteArray > QTlsPrivate::X509Certificate::issuerInfoAttributes ( ) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateBase.

◆ nameForExtension()

QString QTlsPrivate::X509Certificate::nameForExtension ( qsizetype i) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateBase.

◆ numberOfExtensions()

qsizetype QTlsPrivate::X509Certificate::numberOfExtensions ( ) const
pure virtual

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

Implemented in QTlsPrivate::X509CertificateBase.

◆ oidForExtension()

QString QTlsPrivate::X509Certificate::oidForExtension ( qsizetype i) const
pure virtual

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

See also
numberOfExtensions()

Implemented in QTlsPrivate::X509CertificateBase.

◆ publicKey()

TlsKey * QTlsPrivate::X509Certificate::publicKey ( ) const
virtual

Returns the certificate subject's public key.

Reimplemented in QTlsPrivate::X509CertificateOpenSSL, QTlsPrivate::X509CertificateSchannel, and QTlsPrivate::X509CertificateSecureTransport.

Definition at line 1695 of file qtlsbackend.cpp.

◆ serialNumber()

QByteArray QTlsPrivate::X509Certificate::serialNumber ( ) const
pure virtual

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

See also
QSslCertificate::serialNumber()

Implemented in QTlsPrivate::X509CertificateBase.

◆ subjectAlternativeNames()

QMultiMap< QSsl::AlternativeNameEntryType, QString > QTlsPrivate::X509Certificate::subjectAlternativeNames ( ) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateOpenSSL, and QTlsPrivate::X509CertificateGeneric.

◆ subjectInfo() [1/2]

QStringList QTlsPrivate::X509Certificate::subjectInfo ( const QByteArray & attribute) const
pure virtual

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().

Implemented in QTlsPrivate::X509CertificateBase.

◆ subjectInfo() [2/2]

QStringList QTlsPrivate::X509Certificate::subjectInfo ( QSslCertificate::SubjectInfo subject) const
pure virtual

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().

Implemented in QTlsPrivate::X509CertificateBase.

◆ subjectInfoAttributes()

QList< QByteArray > QTlsPrivate::X509Certificate::subjectInfoAttributes ( ) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateBase.

◆ toDer()

QByteArray QTlsPrivate::X509Certificate::toDer ( ) const
pure virtual

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

Implemented in QTlsPrivate::X509CertificateOpenSSL, and QTlsPrivate::X509CertificateGeneric.

◆ toPem()

QByteArray QTlsPrivate::X509Certificate::toPem ( ) const
pure virtual

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

Implemented in QTlsPrivate::X509CertificateOpenSSL, and QTlsPrivate::X509CertificateGeneric.

◆ toText()

QString QTlsPrivate::X509Certificate::toText ( ) const
pure virtual

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

Implemented in QTlsPrivate::X509CertificateOpenSSL, and QTlsPrivate::X509CertificateGeneric.

◆ valueForExtension()

QVariant QTlsPrivate::X509Certificate::valueForExtension ( qsizetype i) const
pure virtual

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()

Implemented in QTlsPrivate::X509CertificateBase.

◆ version()

QByteArray QTlsPrivate::X509Certificate::version ( ) const
pure virtual

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