Cleanup: fix more comments/guards (and add check script).
[libdcp.git] / src / certificate_chain.h
index df9f4ccfbf723fab1f1abf679abf0652e0d83c3a..61bf5d47c0b37eb363b5b9d0e3474c7b7da4ce75 100644 (file)
@@ -128,6 +128,12 @@ public:
        List root_to_leaf () const;
        List unordered () const;
 
+       /** Check if the certificates form a chain (i.e. root signs intermediate etc.)
+        *  and that the private key matches the leaf certificate.
+        *  @param if not nullptr, filled in with a reason for vailure (or untouched
+        *  if there is no error)
+        *  @return true if the chain is valid, false if not.
+        */
        bool valid (std::string* reason = nullptr) const;
 
        /** Check to see if the chain is valid (i.e. root signs the intermediate, intermediate
@@ -175,7 +181,7 @@ private:
        friend struct ::certificates_validation7;
        friend struct ::certificates_validation8;
 
-       bool chain_valid (List const & chain) const;
+       bool chain_valid(List const & chain, std::string* error = nullptr) const;
 
        /** Our certificates, not in any particular order */
        List _certificates;
@@ -184,6 +190,11 @@ private:
 };
 
 
+std::string public_key_digest(RSA* public_key);
+std::string public_key_digest(boost::filesystem::path private_key);
+std::string escape_digest(std::string digest);
+
+
 }