More win32 build hacks.
[libdcp.git] / src / certificates.h
index 0b7127c869c4fcedfe6c41954e99c3a7dc23f3e6..9caea5a786cd8e8a15e1acde2c8c48922c27079d 100644 (file)
@@ -24,6 +24,7 @@
 #include <list>
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
+#undef X509_NAME
 #include <openssl/x509.h>
 
 class certificates;
@@ -37,6 +38,11 @@ namespace libdcp {
 class Certificate : public boost::noncopyable
 {
 public:
+       Certificate ()
+               : _certificate (0)
+       {}
+
+       Certificate (std::string const &);
        Certificate (X509 *);
        ~Certificate ();
 
@@ -47,9 +53,11 @@ public:
 
        std::string thumbprint () const;
 
-       static std::string name_for_xml (std::string const &);
-
 private:
+       static std::string name_for_xml (X509_NAME *);
+       static std::string asn_to_utf8 (ASN1_STRING *);
+       static std::string get_name_part (X509_NAME *, int);
+
        X509* _certificate;
 };
 
@@ -57,7 +65,8 @@ class CertificateChain
 {
 public:
        CertificateChain () {}
-       CertificateChain (std::string const &);
+
+       void add (boost::shared_ptr<Certificate>);
 
        boost::shared_ptr<Certificate> root () const;
        boost::shared_ptr<Certificate> leaf () const;