*/
#include <libcxml/cxml.h>
-#include <dcp/certificates.h>
+#include <dcp/certificate.h>
#include <boost/enable_shared_from_this.hpp>
class Cinema;
#include "cross.h"
#include "raw_convert.h"
#include <dcp/colour_matrix.h>
-#include <dcp/signer.h>
#include <dcp/certificate_chain.h>
#include <libcxml/cxml.h>
#include <glib.h>
{
if (!boost::filesystem::exists (file ())) {
/* Make a new set of signing certificates and key */
- _signer.reset (new dcp::Signer (openssl_path ()));
+ _signer.reset (new dcp::CertificateChain (openssl_path ()));
/* And decryption keys */
make_decryption_keys ();
return;
cxml::NodePtr signer = f.optional_node_child ("Signer");
dcp::CertificateChain signer_chain;
if (signer) {
+ shared_ptr<dcp::CertificateChain> c (new dcp::CertificateChain ());
/* Read the signing certificates and private key in from the config file */
list<cxml::NodePtr> certificates = signer->node_children ("Certificate");
for (list<cxml::NodePtr>::const_iterator i = certificates.begin(); i != certificates.end(); ++i) {
- signer_chain.add (dcp::Certificate ((*i)->content ()));
+ c->add (dcp::Certificate ((*i)->content ()));
}
-
- _signer.reset (new dcp::Signer (signer_chain, signer->string_child ("PrivateKey")));
+ c->set_key (signer->string_child ("PrivateKey"));
+ _signer = c;
} else {
/* Make a new set of signing certificates and key */
- _signer.reset (new dcp::Signer (openssl_path ()));
+ _signer.reset (new dcp::CertificateChain (openssl_path ()));
}
if (f.optional_string_child ("DecryptionCertificate")) {
void
Config::make_decryption_keys ()
{
- boost::filesystem::path p = dcp::make_certificate_chain (openssl_path ());
- _decryption_certificate = dcp::Certificate (dcp::file_to_string (p / "leaf.signed.pem"));
- _decryption_private_key = dcp::file_to_string (p / "leaf.key");
- boost::filesystem::remove_all (p);
+ dcp::CertificateChain c (openssl_path ());
+ _decryption_certificate = c.leaf ();
+ _decryption_private_key = c.key().get ();
}
/** @return Filename to write configuration to */
#endif
xmlpp::Element* signer = root->add_child ("Signer");
- dcp::CertificateChain::List certs = _signer->certificates().root_to_leaf ();
+ dcp::CertificateChain::List certs = _signer->root_to_leaf ();
for (dcp::CertificateChain::List::const_iterator i = certs.begin(); i != certs.end(); ++i) {
signer->add_child("Certificate")->add_child_text (i->certificate (true));
}
- signer->add_child("PrivateKey")->add_child_text (_signer->key ());
+ signer->add_child("PrivateKey")->add_child_text (_signer->key().get ());
root->add_child("DecryptionCertificate")->add_child_text (_decryption_certificate.certificate (true));
root->add_child("DecryptionPrivateKey")->add_child_text (_decryption_private_key);
#include "isdcf_metadata.h"
#include "video_content.h"
#include <dcp/metadata.h>
-#include <dcp/certificates.h>
-#include <dcp/signer.h>
+#include <dcp/certificate.h>
+#include <dcp/certificate_chain.h>
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
#include <boost/filesystem.hpp>
return _kdm_email;
}
- boost::shared_ptr<const dcp::Signer> signer () const {
+ boost::shared_ptr<const dcp::CertificateChain> signer () const {
return _signer;
}
void reset_kdm_email ();
- void set_signer (boost::shared_ptr<const dcp::Signer> s) {
+ void set_signer (boost::shared_ptr<const dcp::CertificateChain> s) {
maybe_set (_signer, s);
}
std::string _kdm_cc;
std::string _kdm_bcc;
std::string _kdm_email;
- boost::shared_ptr<const dcp::Signer> _signer;
+ boost::shared_ptr<const dcp::CertificateChain> _signer;
dcp::Certificate _decryption_certificate;
std::string _decryption_private_key;
/** true to check for updates on startup */
#include "md5_digester.h"
#include <libcxml/cxml.h>
#include <dcp/cpl.h>
-#include <dcp/signer.h>
+#include <dcp/certificate_chain.h>
#include <dcp/util.h>
#include <dcp/local_time.h>
#include <dcp/decrypted_kdm.h>
using boost::optional;
using boost::is_any_of;
using dcp::Size;
-using dcp::Signer;
+using dcp::CertificateChain;
#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, Log::TYPE_GENERAL);
) const
{
shared_ptr<const dcp::CPL> cpl (new dcp::CPL (cpl_file));
- shared_ptr<const dcp::Signer> signer = Config::instance()->signer();
+ shared_ptr<const dcp::CertificateChain> signer = Config::instance()->signer();
if (!signer->valid ()) {
throw InvalidSignerError ();
}
#include "audio_processor.h"
#include "safe_stringstream.h"
#include <dcp/util.h>
-#include <dcp/signer.h>
#include <dcp/picture_asset.h>
#include <dcp/sound_asset.h>
#include <dcp/subtitle_asset.h>
#include <dcp/reel_subtitle_asset.h>
#include <dcp/dcp.h>
#include <dcp/cpl.h>
-#include <dcp/signer.h>
+#include <dcp/certificate_chain.h>
#include <dcp/interop_subtitle_asset.h>
#include <dcp/smpte_subtitle_asset.h>
#include <boost/foreach.hpp>
meta.creator = String::compose ("DCP-o-matic %1 %2", dcpomatic_version, dcpomatic_git_commit);
meta.set_issue_date_now ();
- shared_ptr<const dcp::Signer> signer;
+ shared_ptr<const dcp::CertificateChain> signer;
if (_film->is_signed ()) {
signer = Config::instance()->signer ();
/* We did check earlier, but check again here to be on the safe side */
*/
#include <getopt.h>
-#include <dcp/certificates.h>
+#include <dcp/certificate.h>
#include "lib/film.h"
#include "lib/cinema.h"
#include "lib/kdm.h"
#include "lib/cross.h"
#include "lib/exceptions.h"
#include <dcp/exceptions.h>
-#include <dcp/signer.h>
+#include <dcp/certificate_chain.h>
#include <wx/stdpaths.h>
#include <wx/preferences.h>
#include <wx/filepicker.h>
void config_changed ()
{
- _signer.reset (new dcp::Signer (*Config::instance()->signer().get ()));
+ _signer.reset (new dcp::CertificateChain (*Config::instance()->signer().get ()));
update_certificate_list ();
update_signer_private_key ();
if (d->ShowModal() == wxID_OK) {
try {
dcp::Certificate c (dcp::file_to_string (wx_to_std (d->GetPath ())));
- _signer->certificates().add (c);
+ _signer->add (c);
Config::instance()->set_signer (_signer);
update_certificate_list ();
} catch (dcp::MiscError& e) {
}
_certificates->DeleteItem (i);
- _signer->certificates().remove (i);
+ _signer->remove (i);
Config::instance()->set_signer (_signer);
update_sensitivity ();
void update_certificate_list ()
{
_certificates->DeleteAllItems ();
- dcp::CertificateChain::List certs = _signer->certificates().root_to_leaf ();
+ dcp::CertificateChain::List certs = _signer->root_to_leaf ();
size_t n = 0;
for (dcp::CertificateChain::List::const_iterator i = certs.begin(); i != certs.end(); ++i) {
wxListItem item;
void remake_certificates ()
{
- dcp::CertificateChain chain = Config::instance()->signer()->certificates ();
+ shared_ptr<const dcp::CertificateChain> chain = Config::instance()->signer();
string intermediate_common_name;
- if (chain.root_to_leaf().size() >= 3) {
- dcp::CertificateChain::List all = chain.root_to_leaf ();
+ if (chain->root_to_leaf().size() >= 3) {
+ dcp::CertificateChain::List all = chain->root_to_leaf ();
dcp::CertificateChain::List::iterator i = all.begin ();
++i;
intermediate_common_name = i->subject_common_name ();
MakeSignerChainDialog* d = new MakeSignerChainDialog (
_panel,
- chain.root().subject_organization_name (),
- chain.root().subject_organizational_unit_name (),
- chain.root().subject_common_name (),
+ chain->root().subject_organization_name (),
+ chain->root().subject_organizational_unit_name (),
+ chain->root().subject_common_name (),
intermediate_common_name,
- chain.leaf().subject_common_name ()
+ chain->leaf().subject_common_name ()
);
if (d->ShowModal () == wxID_OK) {
_signer.reset (
- new dcp::Signer (
+ new dcp::CertificateChain (
openssl_path (),
d->organisation (),
d->organisational_unit (),
void update_signer_private_key ()
{
- checked_set (_signer_private_key, dcp::private_key_fingerprint (_signer->key ()));
+ checked_set (_signer_private_key, dcp::private_key_fingerprint (_signer->key().get ()));
}
void load_signer_private_key ()
wxStaticText* _decryption_private_key;
wxButton* _load_decryption_private_key;
wxButton* _export_decryption_certificate;
- shared_ptr<dcp::Signer> _signer;
+ shared_ptr<dcp::CertificateChain> _signer;
};
class TMSPage : public StandardPage
#include <wx/wx.h>
#include <boost/shared_ptr.hpp>
-#include <dcp/certificates.h>
+#include <dcp/certificate.h>
#include "table_dialog.h"
class Progress;