summaryrefslogtreecommitdiff
path: root/src/certificate_chain.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/certificate_chain.h')
-rw-r--r--src/certificate_chain.h35
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