X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fcertificate_chain.h;h=61bf5d47c0b37eb363b5b9d0e3474c7b7da4ce75;hb=0d31c86d6dfad9f437f5613d41cace9cc5928474;hp=df9f4ccfbf723fab1f1abf679abf0652e0d83c3a;hpb=0bf04f1817f97e70a918aa12369e04699ae10f46;p=libdcp.git diff --git a/src/certificate_chain.h b/src/certificate_chain.h index df9f4ccf..61bf5d47 100644 --- a/src/certificate_chain.h +++ b/src/certificate_chain.h @@ -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); + + }