Simplify KDM API slightly.
authorCarl Hetherington <cth@carlh.net>
Tue, 24 Sep 2013 19:04:11 +0000 (20:04 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 24 Sep 2013 19:04:11 +0000 (20:04 +0100)
src/kdm.cc
src/kdm.h
test/encryption_test.cc

index b9e598b913604c2fe4476b25262abac30a0b1786..dde5db1cd1002e2ee48a790a8ac1fb8af55aedb7 100644 (file)
@@ -89,7 +89,7 @@ KDM::KDM (boost::filesystem::path kdm, boost::filesystem::path private_key)
 KDM::KDM (
        shared_ptr<const CPL> cpl, shared_ptr<const Signer> signer, shared_ptr<const Certificate> recipient_cert,
        boost::posix_time::ptime not_valid_before, boost::posix_time::ptime not_valid_after,
-       MXFMetadata mxf_metadata, XMLMetadata xml_metadata
+       string annotation_text, string issue_date
        )
        : xml_kdm (new xml::DCinemaSecurityMessage)
 {
@@ -99,8 +99,8 @@ KDM::KDM (
 
        apu.message_id = "urn:uuid:" + make_uuid ();
        apu.message_type = "http://www.smpte-ra.org/430-1/2006/KDM#kdm-key-type";
-       apu.annotation_text = mxf_metadata.product_name;
-       apu.issue_date = xml_metadata.issue_date;
+       apu.annotation_text = annotation_text;
+       apu.issue_date = issue_date;
        apu.signer.x509_issuer_name = signer->certificates().leaf()->issuer ();
        apu.signer.x509_serial_number = signer->certificates().leaf()->serial ();
        apu.recipient.x509_issuer_serial.x509_issuer_name = recipient_cert->issuer ();
index 90ed3b9cf4f74cdab180641ad4a98e754a1ca3cc..cee9db21b624f4f15ea6416d8bb7e37a823acad1 100644 (file)
--- a/src/kdm.h
+++ b/src/kdm.h
@@ -99,7 +99,7 @@ public:
        KDM (
                boost::shared_ptr<const CPL> cpl, boost::shared_ptr<const Signer>, boost::shared_ptr<const Certificate> recipient_cert,
                boost::posix_time::ptime not_valid_before, boost::posix_time::ptime not_valid_after,
-               MXFMetadata mxf_metadata, XMLMetadata xml_metadata
+               std::string annotation_text, std::string issue_date
                );
 
        std::list<KDMKey> keys () const {
index 961d281bee64bd2f18d95c95fab02e0dac2642f9..60177438fe1db3149d54d78de363874e7318deb6 100644 (file)
@@ -95,8 +95,8 @@ BOOST_AUTO_TEST_CASE (encryption)
                signer->certificates().leaf(),
                boost::posix_time::time_from_string ("2013-01-01 00:00:00"),
                boost::posix_time::time_from_string ("2013-01-08 00:00:00"),
-               mxf_metadata,
-               xml_metadata
+               "libdcp",
+               "2012-07-17T04:45:18+00:00"
                );
 
        kdm.as_xml ("build/test/bar.kdm.xml");