summaryrefslogtreecommitdiff
path: root/src/certificates.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-01-01 20:11:25 +0000
committerCarl Hetherington <cth@carlh.net>2013-01-01 20:11:25 +0000
commit3adf49eea65c2c015ae0b5bc7f066a599faf3933 (patch)
tree93e571aea5eec12772cf39058b51ddcabd8f3ee9 /src/certificates.h
parent4f902db0ad994910a34ca845225635ceefcac96e (diff)
Some work on encryption / signing.
Diffstat (limited to 'src/certificates.h')
-rw-r--r--src/certificates.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/certificates.h b/src/certificates.h
new file mode 100644
index 00000000..6baea84a
--- /dev/null
+++ b/src/certificates.h
@@ -0,0 +1,46 @@
+#ifndef LIBDCP_CERTIFICATES_H
+#define LIBDCP_CERTIFICATES_H
+
+#include <string>
+#include <list>
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+#include <openssl/x509.h>
+
+class certificates;
+
+namespace libdcp {
+
+class Certificate : public boost::noncopyable
+{
+public:
+ Certificate (X509 *);
+ ~Certificate ();
+
+ std::string issuer () const;
+ std::string serial () const;
+ std::string subject () const;
+
+ static std::string name_for_xml (std::string const &);
+
+private:
+ X509* _certificate;
+};
+
+class CertificateChain
+{
+public:
+ CertificateChain () {}
+ CertificateChain (std::string const &);
+
+ boost::shared_ptr<Certificate> root () const;
+ boost::shared_ptr<Certificate> leaf () const;
+
+private:
+ friend class ::certificates;
+ std::list<boost::shared_ptr<Certificate> > _certificates;
+};
+
+}
+
+#endif