Qt Cryptographic Architecture
Public Member Functions | List of all members
QCA::CertificateChain Class Reference

#include <QtCrypto>

Collaboration diagram for QCA::CertificateChain:
Collaboration graph
[legend]

Public Member Functions

 CertificateChain ()
 
 CertificateChain (const Certificate &primary)
 
CertificateChain complete (const QList< Certificate > &issuers=QList< Certificate >(), Validity *result=nullptr) const
 
const Certificateprimary () const
 
Validity validate (const CertificateCollection &trusted, const QList< CRL > &untrusted_crls=QList< CRL >(), UsageMode u=UsageAny, ValidateFlags vf=ValidateAll) const
 

Detailed Description

A chain of related Certificates.

CertificateChain is a list (a QList) of certificates that are related by the signature from one to another. If Certificate C signs Certificate B, and Certificate B signs Certificate A, then C, B and A form a chain.

The normal use of a CertificateChain is from a end-user Certificate (called the primary, equivalent to QList::first()) through some intermediate Certificates to some other Certificate (QList::last()), which might be a root Certificate Authority, but does not need to be.

You can build up the chain using normal QList operations, such as QList::append().

See also
QCA::CertificateCollection for an alternative way to represent a group of Certificates that do not necessarily have a chained relationship.
Examples
publickeyexample.cpp.

Constructor & Destructor Documentation

◆ CertificateChain() [1/2]

QCA::CertificateChain::CertificateChain ( )
inline

Create an empty certificate chain.

Referenced by complete().

◆ CertificateChain() [2/2]

QCA::CertificateChain::CertificateChain ( const Certificate primary)
inline

Create a certificate chain, starting at the specified certificate.

Parameters
primarythe end-user certificate that forms one end of the chain

References primary().

Member Function Documentation

◆ primary()

const Certificate & QCA::CertificateChain::primary ( ) const
inline

Return the primary (end-user) Certificate.

Examples
ssltest.cpp.

Referenced by CertificateChain().

◆ validate()

Validity QCA::CertificateChain::validate ( const CertificateCollection trusted,
const QList< CRL > &  untrusted_crls = QList<CRL>(),
UsageMode  u = UsageAny,
ValidateFlags  vf = ValidateAll 
) const
inline

Check the validity of a certificate chain.

Parameters
trusteda collection of trusted certificates
untrusted_crlsa list of additional CRLs, not necessarily trusted
uthe use required for the primary certificate
vfthe conditions to validate
Note
This function may block
See also
Certificate::validate()

References QCA::ErrorValidityUnknown.

◆ complete()

CertificateChain QCA::CertificateChain::complete ( const QList< Certificate > &  issuers = QList<Certificate>(),
Validity result = nullptr 
) const
inline

Complete a certificate chain for the primary certificate, using the rest of the certificates in the chain object, as well as those in issuers, as possible issuers in the chain.

If there are issuers missing, then the chain might be incomplete (at the worst case, if no issuers exist for the primary certificate, then the resulting chain will consist of just the primary certificate). Use the result argument to find out if there was a problem during completion. A result of ValidityGood means the chain was completed successfully.

The newly constructed CertificateChain is returned.

If the certificate chain is empty, then this will return an empty CertificateChain object.

Parameters
issuersa pool of issuers to draw from as necessary
resultthe result of the completion operation
Note
This function may block
See also
validate

References CertificateChain().


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