40 #ifndef LIBDCP_CERTIFICATE_CHAIN_H
41 #define LIBDCP_CERTIFICATE_CHAIN_H
46 #include <boost/filesystem.hpp>
47 #include <boost/optional.hpp>
55 struct certificates_validation1;
56 struct certificates_validation2;
57 struct certificates_validation3;
58 struct certificates_validation4;
59 struct certificates_validation5;
60 struct certificates_validation6;
61 struct certificates_validation7;
62 struct certificates_validation8;
88 boost::filesystem::path openssl,
90 std::string organisation =
"example.org",
91 std::string organisational_unit =
"example.org",
92 std::string root_common_name =
".smpte-430-2.ROOT.NOT_FOR_PRODUCTION",
93 std::string intermediate_common_name =
".smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION",
94 std::string leaf_common_name =
"CS.smpte-430-2.LEAF.NOT_FOR_PRODUCTION"
123 typedef std::vector<Certificate> List;
129 List unordered ()
const;
137 bool valid (std::string* reason =
nullptr)
const;
155 void sign (xmlpp::Element* parent, Standard standard)
const;
162 void add_signature_value (xmlpp::Element* parent, std::string ns,
bool add_indentation)
const;
164 boost::optional<std::string> key ()
const {
168 void set_key (std::string k) {
172 std::string chain ()
const;
175 friend struct ::certificates_validation1;
176 friend struct ::certificates_validation2;
177 friend struct ::certificates_validation3;
178 friend struct ::certificates_validation4;
179 friend struct ::certificates_validation5;
180 friend struct ::certificates_validation6;
181 friend struct ::certificates_validation7;
182 friend struct ::certificates_validation8;
184 bool chain_valid(List
const & chain, std::string* error =
nullptr)
const;
189 boost::optional<std::string>
_key;
193 std::string public_key_digest(RSA* public_key);
194 std::string public_key_digest(boost::filesystem::path private_key);
195 std::string escape_digest(std::string digest);
A chain of any number of certificates, from root to leaf.
List leaf_to_root() const
List root_to_leaf() const
boost::optional< std::string > _key
bool private_key_valid() const
bool valid(std::string *reason=nullptr) const
void add_signature_value(xmlpp::Element *parent, std::string ns, bool add_indentation) const
void sign(xmlpp::Element *parent, Standard standard) const
void remove(Certificate c)
A wrapper for an X509 certificate.
Namespace for everything in libdcp.