Qt Cryptographic Architecture: QCA::CertificateChain Class Reference

Qt Cryptographic Architecture

Public Member Functions | List of all members
QCA::CertificateChain Class Reference
QCA user API

`#include <QtCrypto>`

Collaboration diagram for QCA::CertificateChain:
[legend]

## Public Member Functions
| CertificateChain ()
| CertificateChain (const Certificate &primary)
CertificateChain | complete (const QList< Certificate > &issuers=QList< Certificate >(), Validity *result=0) const
const Certificate & | primary () 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.

## ◆ CertificateChain() [2/2]

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

Create a certificate chain, starting at the specified certificate.

Parameters

  primary | the end-user certificate that forms one end of the chain

## Member Function Documentation

## ◆ primary()

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

Return the primary (end-user) Certificate.

Examples:
  ssltest.cpp.

References QCA::UsageAny.

## ◆ 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

  trusted | a collection of trusted certificates
  untrusted_crls | a list of additional CRLs, not necessarily trusted
  u | the use required for the primary certificate
  vf | the 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 = `0`
| ) |  | 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

  issuers | a pool of issuers to draw from as necessary
  result | the result of the completion operation

Note
  This function may block

See also
  validate

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

- qca_cert.h