Add Certificate::subject_dn_qualifier().
[libdcp.git] / src / certificate.h
index 7a8c2a44f39f8a40ff1e149c7c4794de3efa2b01..bf11a965fc9783771a7cfef8035fd18cb459e131 100644 (file)
@@ -33,7 +33,7 @@
 
 
 /** @file  src/certificate.h
- *  @brief Certificate class.
+ *  @brief Certificate class
  */
 
 
@@ -41,6 +41,7 @@
 #define LIBDCP_CERTIFICATE_H
 
 
+#include "local_time.h"
 #undef X509_NAME
 #include <openssl/x509.h>
 #include <boost/filesystem.hpp>
@@ -64,10 +65,7 @@ namespace dcp {
 class Certificate
 {
 public:
-       Certificate ()
-               : _certificate (0)
-               , _public_key (0)
-       {}
+       Certificate() {}
 
        /** Load an X509 certificate from a string
         *  @param cert String to read from
@@ -101,13 +99,18 @@ public:
         *  and with + signs escaped to \+
         */
        std::string issuer () const;
+       std::string issuer_common_name() const;
+       std::string issuer_organization_name() const;
+       std::string issuer_organizational_unit_name() const;
 
        std::string subject () const;
        std::string subject_common_name () const;
        std::string subject_organization_name () const;
        std::string subject_organizational_unit_name () const;
-       struct tm not_before () const;
-       struct tm not_after () const;
+       std::string subject_dn_qualifier() const;
+
+       LocalTime not_before () const;
+       LocalTime not_after () const;
 
        X509* x509 () const {
                return _certificate;
@@ -115,6 +118,7 @@ public:
 
        /** @return RSA public key from this Certificate.  Caller must not free the returned value. */
        RSA* public_key () const;
+       std::string public_key_digest() const;
 
        /** @return thumbprint of the to-be-signed portion of this certificate */
        std::string thumbprint () const;
@@ -139,4 +143,5 @@ std::ostream& operator<< (std::ostream&s, Certificate const & c);
 
 }
 
+
 #endif