X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fcertificate_chain.h;h=63ef89015eee80e7cc6dd8822759d82865fc6e66;hb=3924dd859ad3de1d4a207d04e841f699bd27490a;hp=ca259c088e0e5d5b6c532a971f4d78acf9916ee8;hpb=4e2d5cca82d19246bd1ebf24bc9e2bf436232f83;p=libdcp.git diff --git a/src/certificate_chain.h b/src/certificate_chain.h index ca259c08..63ef8901 100644 --- a/src/certificate_chain.h +++ b/src/certificate_chain.h @@ -47,6 +47,15 @@ namespace xmlpp { class Node; } +struct certificates_validation1; +struct certificates_validation2; +struct certificates_validation3; +struct certificates_validation4; +struct certificates_validation5; +struct certificates_validation6; +struct certificates_validation7; +struct certificates_validation8; + namespace dcp { /** @class CertificateChain @@ -74,6 +83,8 @@ public: std::string leaf_common_name = "CS.smpte-430-2.LEAF.NOT_FOR_PRODUCTION" ); + explicit CertificateChain (std::string); + void add (Certificate c); void remove (Certificate c); void remove (int); @@ -85,12 +96,14 @@ public: List leaf_to_root () const; List root_to_leaf () const; + List unordered () const; - bool valid () const; - bool attempt_reorder (); + bool valid (std::string* reason = 0) const; + bool chain_valid () const; + bool private_key_valid () const; void sign (xmlpp::Element* parent, Standard standard) const; - void add_signature_value (xmlpp::Node* parent, std::string ns) const; + void add_signature_value (xmlpp::Element* parent, std::string ns, bool add_indentation) const; boost::optional key () const { return _key; @@ -103,8 +116,18 @@ public: std::string chain () const; private: - friend class ::certificates; - + friend struct ::certificates_validation1; + friend struct ::certificates_validation2; + friend struct ::certificates_validation3; + friend struct ::certificates_validation4; + friend struct ::certificates_validation5; + friend struct ::certificates_validation6; + friend struct ::certificates_validation7; + friend struct ::certificates_validation8; + + bool chain_valid (List const & chain) const; + + /** Our certificates, not in any particular order */ List _certificates; /** Leaf certificate's private key, if known */ boost::optional _key;