diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-07-12 20:54:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-07-12 20:54:06 +0100 |
| commit | 43d2c7aef17adceb04f84109b432a830f00d1bd1 (patch) | |
| tree | 66f27488ad79f0f900cf3a636b7c8ec0d763cbbb /src/certificate_chain.h | |
| parent | a09bbf5f06a9ed2f5011999c0a6eef78b9e1ca56 (diff) | |
Move CertificateChain into the right header.
Diffstat (limited to 'src/certificate_chain.h')
| -rw-r--r-- | src/certificate_chain.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/certificate_chain.h b/src/certificate_chain.h index dcb9c141..8ebf854c 100644 --- a/src/certificate_chain.h +++ b/src/certificate_chain.h @@ -21,10 +21,43 @@ * @brief Functions to make signer chains. */ +#ifndef LIBDCP_CERTIFICATE_CHAIN_H +#define LIBDCP_CERTIFICATE_CHAIN_H + +#include "certificates.h" #include <boost/filesystem.hpp> namespace dcp { +/** @class CertificateChain + * @brief A chain of any number of certificates, from root to leaf. + */ +class CertificateChain +{ +public: + CertificateChain () {} + + void add (Certificate c); + void remove (Certificate c); + void remove (int); + + Certificate root () const; + Certificate leaf () const; + + typedef std::list<Certificate> List; + + List leaf_to_root () const; + List root_to_leaf () const; + + bool valid () const; + bool attempt_reorder (); + +private: + friend class ::certificates; + + List _certificates; +}; + /** Create a chain of certificates for signing things. * @param openssl Name of openssl binary (if it is on the path) or full path. * @return Directory (which should be deleted by the caller) containing: @@ -43,3 +76,5 @@ boost::filesystem::path make_certificate_chain ( ); } + +#endif |
