summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cpl.cc9
-rw-r--r--src/cpl.h7
-rw-r--r--src/util.cc27
3 files changed, 11 insertions, 32 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index c59fc853..fd7b734e 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -18,6 +18,7 @@
*/
#include <fstream>
+#include <libxml/parser.h>
#include "cpl.h"
#include "parse/cpl.h"
#include "util.h"
@@ -317,7 +318,9 @@ CPL::make_kdm (
string const & signer_key,
shared_ptr<const Certificate> recipient_cert,
boost::posix_time::ptime from,
- boost::posix_time::ptime until
+ boost::posix_time::ptime until,
+ MXFMetadata const & mxf_metadata,
+ XMLMetadata const & xml_metadata
) const
{
assert (recipient_cert);
@@ -335,8 +338,8 @@ CPL::make_kdm (
authenticated_public->add_child("MessageId")->add_child_text ("urn:uuid:" + make_uuid());
authenticated_public->add_child("MessageType")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#kdm-key-type");
- authenticated_public->add_child("AnnotationText")->add_child_text (MXFMetadata::instance()->product_name);
- authenticated_public->add_child("IssueDate")->add_child_text (MXFMetadata::instance()->issue_date);
+ authenticated_public->add_child("AnnotationText")->add_child_text (mxf_metadata.product_name);
+ authenticated_public->add_child("IssueDate")->add_child_text (xml_metadata.issue_date);
{
xmlpp::Element* signer = authenticated_public->add_child("Signer");
diff --git a/src/cpl.h b/src/cpl.h
index f9814337..3f483504 100644
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -34,7 +34,8 @@ namespace parse {
class Asset;
class Reel;
class XMLMetadata;
- class Encryption;
+class MXFMetadata;
+class Encryption;
/** @brief A CPL within a DCP */
class CPL
@@ -86,7 +87,9 @@ public:
std::string const &,
boost::shared_ptr<const Certificate>,
boost::posix_time::ptime from,
- boost::posix_time::ptime until
+ boost::posix_time::ptime until,
+ MXFMetadata const &,
+ XMLMetadata const &
) const;
private:
diff --git a/src/util.cc b/src/util.cc
index 0c63c305..e4c8122c 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -307,20 +307,6 @@ libdcp::init ()
if (xmlSecInit() < 0) {
throw MiscError ("could not initialise xmlsec");
}
-
-#ifdef XMLSEC_CRYPTO_DYNAMIC_LOADING
- if (xmlSecCryptoDLLoadLibrary (BAD_CAST XMLSEC_CRYPTO) < 0) {
- throw MiscError ("unable to load default xmlsec-crypto library");
- }
-#endif
-
- if (xmlSecCryptoAppInit (0) < 0) {
- throw MiscError ("could not initialise crypto library");
- }
-
- if (xmlSecCryptoInit() < 0) {
- throw MiscError ("could not initialise xmlsec-crypto");
- }
}
void
@@ -348,19 +334,6 @@ libdcp::add_signature_value (xmlpp::Element* parent, CertificateChain const & ce
if (!keys_manager) {
throw MiscError ("could not create keys manager");
}
- if (xmlSecCryptoAppDefaultKeysMngrInit (keys_manager) < 0) {
- throw MiscError ("could not initialise keys manager");
- }
-
- xmlSecKeyPtr const key = xmlSecCryptoAppKeyLoad (signer_key.c_str(), xmlSecKeyDataFormatPem, 0, 0, 0);
- if (key == 0) {
- throw MiscError ("could not load signer key");
- }
-
- if (xmlSecCryptoAppDefaultKeysMngrAdoptKey (keys_manager, key) < 0) {
- xmlSecKeyDestroy (key);
- throw MiscError ("could not use signer key");
- }
xmlSecDSigCtx signature_context;