QCA::CertificateChain

QCA::CertificateChain Class Reference

#include <QtCrypto>

Inheritance diagram for QCA::CertificateChain:

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
 
- Public Member Functions inherited from QList< Certificate >
 QList (const QList< T > &other)
 
 QList (std::initializer_list< T > args)
 
 QList (InputIterator first, InputIterator last)
 
 QList (QList< T > &&other)
 
void append (const T &value)
 
void append (const QList< T > &value)
 
const T & at (int i) const const
 
T & back ()
 
const T & back () const const
 
QList::iterator begin ()
 
QList::const_iterator begin () const const
 
QList::const_iterator cbegin () const const
 
QList::const_iterator cend () const const
 
void clear ()
 
QList::const_iterator constBegin () const const
 
QList::const_iterator constEnd () const const
 
const T & constFirst () const const
 
const T & constLast () const const
 
bool contains (const T &value) const const
 
int count (const T &value) const const
 
int count () const const
 
QList::const_reverse_iterator crbegin () const const
 
QList::const_reverse_iterator crend () const const
 
bool empty () const const
 
QList::iterator end ()
 
QList::const_iterator end () const const
 
bool endsWith (const T &value) const const
 
QList::iterator erase (QList::iterator pos)
 
QList::iterator erase (QList::iterator begin, QList::iterator end)
 
const T & first () const const
 
T & first ()
 
T & front ()
 
const T & front () const const
 
int indexOf (const T &value, int from) const const
 
void insert (int i, const T &value)
 
QList::iterator insert (QList::iterator before, const T &value)
 
bool isEmpty () const const
 
T & last ()
 
const T & last () const const
 
int lastIndexOf (const T &value, int from) const const
 
int length () const const
 
QList< T > mid (int pos, int length) const const
 
void move (int from, int to)
 
bool operator!= (const QList< T > &other) const const
 
QList< T > operator+ (const QList< T > &other) const const
 
QList< T > & operator+= (const QList< T > &other)
 
QList< T > & operator+= (const T &value)
 
bool operator< (const QList< T > &lhs, const QList< T > &rhs)
 
QDataStreamoperator<< (QDataStream &out, const QList< T > &list)
 
QList< T > & operator<< (const QList< T > &other)
 
QList< T > & operator<< (const T &value)
 
bool operator<= (const QList< T > &lhs, const QList< T > &rhs)
 
QList< T > & operator= (QList< T > &&other)
 
QList< T > & operator= (const QList< T > &other)
 
bool operator== (const QList< T > &other) const const
 
bool operator> (const QList< T > &lhs, const QList< T > &rhs)
 
bool operator>= (const QList< T > &lhs, const QList< T > &rhs)
 
QDataStreamoperator>> (QDataStream &in, QList< T > &list)
 
const T & operator[] (int i) const const
 
T & operator[] (int i)
 
void pop_back ()
 
void pop_front ()
 
void prepend (const T &value)
 
void push_back (const T &value)
 
void push_front (const T &value)
 
uint qHash (const QList< T > &key, uint seed)
 
QList::reverse_iterator rbegin ()
 
QList::const_reverse_iterator rbegin () const const
 
int removeAll (const T &value)
 
void removeAt (int i)
 
void removeFirst ()
 
void removeLast ()
 
bool removeOne (const T &value)
 
QList::const_reverse_iterator rend () const const
 
QList::reverse_iterator rend ()
 
void replace (int i, const T &value)
 
void reserve (int alloc)
 
int size () const const
 
bool startsWith (const T &value) const const
 
void swap (int i, int j)
 
void swap (QList< T > &other)
 
void swapItemsAt (int i, int j)
 
takeAt (int i)
 
takeFirst ()
 
takeLast ()
 
QSet< T > toSet () const const
 
std::list< T > toStdList () const const
 
QVector< T > toVector () const const
 
value (int i) const const
 
value (int i, const T &defaultValue) const const
 

Additional Inherited Members

- Static Public Member Functions inherited from QList< Certificate >
QList< T > fromSet (const QSet< T > &set)
 
QList< T > fromStdList (const std::list< T > &list)
 
QList< T > fromVector (const QVector< T > &vector)
 
- Public Attributes inherited from QList< Certificate >
typedef const_pointer
 
typedef const_reference
 
typedef const_reverse_iterator
 
typedef ConstIterator
 
typedef difference_type
 
typedef Iterator
 
typedef pointer
 
typedef reference
 
typedef reverse_iterator
 
typedef size_type
 
typedef value_type
 

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.

Definition at line 1225 of file qca_cert.h.

Constructor & Destructor Documentation

QCA::CertificateChain::CertificateChain ( )
inline

Create an empty certificate chain.

Definition at line 1231 of file qca_cert.h.

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

Definition at line 1241 of file qca_cert.h.

Member Function Documentation

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

Definition at line 1309 of file qca_cert.h.

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

Return the primary (end-user) Certificate.

Examples:
ssltest.cpp.

Definition at line 1249 of file qca_cert.h.

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

Definition at line 1299 of file qca_cert.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Sep 17 2020 23:03:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.