/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
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
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);
Certificate root () const;
Certificate leaf () const;
- typedef std::list<Certificate> List;
+ typedef std::vector<Certificate> List;
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<std::string> key () const {
return _key;
_key = k;
}
-private:
- friend class ::certificates;
+ std::string chain () const;
+private:
+ 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<std::string> _key;