summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrun/tests2
-rwxr-xr-xrun/tools/dcpkdm12
-rw-r--r--src/decrypted_kdm.cc31
-rw-r--r--src/decrypted_kdm.h2
-rw-r--r--src/decrypted_kdm_key.cc6
-rw-r--r--src/decrypted_kdm_key.h14
-rw-r--r--src/encrypted_kdm.cc6
-rw-r--r--src/encrypted_kdm.h5
-rw-r--r--test/dcp_test.cc3
-rw-r--r--test/encryption_test.cc1
-rw-r--r--test/ref/DCP/dcp_test1/ASSETMAP.xml2
-rw-r--r--test/ref/DCP/dcp_test1/pkl_74e205d0-d145-42d2-8c49-7b55d058ca55.xml2
-rw-r--r--test/ref/DCP/dcp_test2/ASSETMAP.xml2
-rw-r--r--test/ref/DCP/dcp_test2/pkl_2afb4e45-f01c-4abc-a354-2ffc0c240a5e.xml2
-rw-r--r--test/ref/DCP/dcp_test5/ASSETMAP.xml2
-rw-r--r--test/ref/DCP/dcp_test5/pkl_34acc068-e059-4fb9-90ca-461c57d17dae.xml2
-rw-r--r--test/ref/DCP/encryption_test/ASSETMAP.xml2
-rw-r--r--test/ref/DCP/encryption_test/pkl_de125b93-db76-41d3-bccd-73deb5b2bb49.xml12
-rw-r--r--tools/dcpdecryptmxf.cc2
-rw-r--r--tools/dcpkdm.cc119
-rw-r--r--tools/wscript17
21 files changed, 201 insertions, 45 deletions
diff --git a/run/tests b/run/tests
index 2ea87bed..67b84a88 100755
--- a/run/tests
+++ b/run/tests
@@ -9,7 +9,7 @@ work=build/test
# Path to dcpinfo tool
dcpinfo=build/tools/dcpinfo
-export LD_LIBRARY_PATH=build/src:build/asdcplib/src:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=build/src:build/asdcplib/src:/home/c.hetherington/lib:$LD_LIBRARY_PATH
# Make sure we have the required tools
for c in xmlsec1 xmldiff; do
diff --git a/run/tools/dcpkdm b/run/tools/dcpkdm
new file mode 100755
index 00000000..0a08605b
--- /dev/null
+++ b/run/tools/dcpkdm
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export LD_LIBRARY_PATH=build/src:build/asdcplib/src:/home/c.hetherington/lib:$LD_LIBRARY_PATH
+if [ "$1" == "--debug" ]; then
+ shift
+ gdb --args build/tools/dcpkdm "$@"
+elif [ "$1" == "--valgrind" ]; then
+ shift
+ valgrind --tool="memcheck" --leak-check=full --show-reachable=yes build/tools/dcpkdm "$@"
+else
+ build/tools/dcpkdm "$@"
+fi
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc
index 8355e1c8..72070fe7 100644
--- a/src/decrypted_kdm.cc
+++ b/src/decrypted_kdm.cc
@@ -58,8 +58,12 @@ using std::hex;
using std::pair;
using std::map;
using boost::shared_ptr;
+using boost::optional;
using namespace dcp;
+/* Magic value specified by SMPTE S430-1-2006 */
+static uint8_t smpte_structure_id[] = { 0xf1, 0xdc, 0x12, 0x44, 0x60, 0x16, 0x9a, 0x0e, 0x85, 0xbc, 0x30, 0x06, 0x42, 0xf8, 0x66, 0xab };
+
static void
put (uint8_t ** d, string s)
{
@@ -166,13 +170,14 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key)
/* 93 is not-valid-after (a string) [25 bytes] */
p += 25;
/* 118 is the key [ASDCP::KeyLen bytes] */
- add_key ("", key_id, Key (p), cpl_id);
+ add_key (optional<string>(), key_id, Key (p), cpl_id, INTEROP);
break;
}
case 138:
{
/* SMPTE */
/* 0 is structure id (fixed sequence specified by standard) [16 bytes] */
+ DCP_ASSERT (memcmp (p, smpte_structure_id, 16) == 0);
p += 16;
/* 16 is is signer thumbprint [20 bytes] */
p += 20;
@@ -187,7 +192,7 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key)
/* 97 is not-valid-after (a string) [25 bytes] */
p += 25;
/* 112 is the key [ASDCP::KeyLen bytes] */
- add_key (key_type, key_id, Key (p), cpl_id);
+ add_key (key_type, key_id, Key (p), cpl_id, SMPTE);
break;
}
default:
@@ -237,7 +242,7 @@ DecryptedKDM::DecryptedKDM (
, _issue_date (issue_date)
{
for (map<shared_ptr<const ReelMXF>, Key>::const_iterator i = keys.begin(); i != keys.end(); ++i) {
- add_key (i->first->key_type(), i->first->key_id().get(), i->second, cpl_id);
+ add_key (i->first->key_type(), i->first->key_id().get(), i->second, cpl_id, SMPTE);
}
}
@@ -261,7 +266,7 @@ DecryptedKDM::DecryptedKDM (
BOOST_FOREACH(shared_ptr<const ReelAsset> i, cpl->reel_assets ()) {
shared_ptr<const ReelMXF> mxf = boost::dynamic_pointer_cast<const ReelMXF> (i);
if (mxf && mxf->key_id ()) {
- add_key (mxf->key_type(), mxf->key_id().get(), key, cpl->id ());
+ add_key (mxf->key_type(), mxf->key_id().get(), key, cpl->id(), SMPTE);
did_one = true;
}
}
@@ -277,9 +282,9 @@ DecryptedKDM::DecryptedKDM (
* @param cpl_id ID of CPL that the key is for.
*/
void
-DecryptedKDM::add_key (string type, string key_id, Key key, string cpl_id)
+DecryptedKDM::add_key (optional<string> type, string key_id, Key key, string cpl_id, Standard standard)
{
- _keys.push_back (DecryptedKDMKey (type, key_id, key, cpl_id));
+ _keys.push_back (DecryptedKDMKey (type, key_id, key, cpl_id, standard));
}
void
@@ -289,26 +294,28 @@ DecryptedKDM::add_key (DecryptedKDMKey key)
}
EncryptedKDM
-DecryptedKDM::encrypt (shared_ptr<const CertificateChain> signer, Certificate recipient, vector<Certificate> trusted_devices, Formulation formulation) const
+DecryptedKDM::encrypt (
+ shared_ptr<const CertificateChain> signer, Certificate recipient, vector<Certificate> trusted_devices, Formulation formulation
+ ) const
{
list<pair<string, string> > key_ids;
list<string> keys;
BOOST_FOREACH (DecryptedKDMKey const & i, _keys) {
- key_ids.push_back (make_pair (i.type(), i.id ()));
+ /* We're making SMPTE keys so we must have a type for each one */
+ DCP_ASSERT (i.type());
+ key_ids.push_back (make_pair (i.type().get(), i.id ()));
/* XXX: SMPTE only */
uint8_t block[138];
uint8_t* p = block;
- /* Magic value specified by SMPTE S430-1-2006 */
- uint8_t structure_id[] = { 0xf1, 0xdc, 0x12, 0x44, 0x60, 0x16, 0x9a, 0x0e, 0x85, 0xbc, 0x30, 0x06, 0x42, 0xf8, 0x66, 0xab };
- put (&p, structure_id, 16);
+ put (&p, smpte_structure_id, 16);
base64_decode (signer->leaf().thumbprint (), p, 20);
p += 20;
put_uuid (&p, i.cpl_id ());
- put (&p, i.type ());
+ put (&p, i.type().get());
put_uuid (&p, i.id ());
put (&p, _not_valid_before.as_string ());
put (&p, _not_valid_after.as_string ());
diff --git a/src/decrypted_kdm.h b/src/decrypted_kdm.h
index 752ced04..56529b5d 100644
--- a/src/decrypted_kdm.h
+++ b/src/decrypted_kdm.h
@@ -133,7 +133,7 @@ public:
Formulation formulation
) const;
- void add_key (std::string type, std::string key_id, Key key, std::string cpl_id);
+ void add_key (boost::optional<std::string> type, std::string key_id, Key key, std::string cpl_id, Standard standard);
void add_key (DecryptedKDMKey key);
/** @return This KDM's (decrypted) keys, which could be used to decrypt assets. */
diff --git a/src/decrypted_kdm_key.cc b/src/decrypted_kdm_key.cc
index 02042d4e..e5adc3c6 100644
--- a/src/decrypted_kdm_key.cc
+++ b/src/decrypted_kdm_key.cc
@@ -38,5 +38,9 @@ using namespace dcp;
bool
dcp::operator== (dcp::DecryptedKDMKey const & a, dcp::DecryptedKDMKey const & b)
{
- return a.type() == b.type() && a.id() == b.id() && a.key() == b.key() && a.cpl_id() == b.cpl_id();
+ return a.type() == b.type()
+ && a.id() == b.id()
+ && a.key() == b.key()
+ && a.cpl_id() == b.cpl_id()
+ && a.standard() == b.standard();
}
diff --git a/src/decrypted_kdm_key.h b/src/decrypted_kdm_key.h
index 95ffccb8..3fee9a68 100644
--- a/src/decrypted_kdm_key.h
+++ b/src/decrypted_kdm_key.h
@@ -39,6 +39,8 @@
#define LIBDCP_DECRYPTED_KDM_KEY_H
#include "key.h"
+#include "types.h"
+#include <boost/optional.hpp>
namespace dcp {
@@ -48,14 +50,15 @@ namespace dcp {
class DecryptedKDMKey
{
public:
- DecryptedKDMKey (std::string type, std::string id, Key key, std::string cpl_id)
+ DecryptedKDMKey (boost::optional<std::string> type, std::string id, Key key, std::string cpl_id, Standard standard)
: _type (type)
, _id (id)
, _key (key)
, _cpl_id (cpl_id)
+ , _standard (standard)
{}
- std::string type () const {
+ boost::optional<std::string> type () const {
return _type;
}
@@ -71,11 +74,16 @@ public:
return _cpl_id;
}
+ Standard standard () const {
+ return _standard;
+ }
+
private:
- std::string _type;
+ boost::optional<std::string> _type;
std::string _id;
Key _key;
std::string _cpl_id;
+ Standard _standard;
};
bool operator== (DecryptedKDMKey const &, DecryptedKDMKey const &);
diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc
index 80c5e2ef..8251007b 100644
--- a/src/encrypted_kdm.cc
+++ b/src/encrypted_kdm.cc
@@ -688,6 +688,12 @@ EncryptedKDM::not_valid_after () const
return _data->authenticated_public.required_extensions.kdm_required_extensions.not_valid_after;
}
+string
+EncryptedKDM::recipient_x509_subject_name () const
+{
+ return _data->authenticated_public.required_extensions.kdm_required_extensions.recipient.x509_subject_name;
+}
+
bool
dcp::operator== (EncryptedKDM const & a, EncryptedKDM const & b)
{
diff --git a/src/encrypted_kdm.h b/src/encrypted_kdm.h
index edbf5192..1605d911 100644
--- a/src/encrypted_kdm.h
+++ b/src/encrypted_kdm.h
@@ -90,8 +90,9 @@ public:
std::string content_title_text () const;
std::string issue_date () const;
std::string cpl_id () const;
- LocalTime not_valid_before() const;
- LocalTime not_valid_after() const;
+ LocalTime not_valid_before () const;
+ LocalTime not_valid_after () const;
+ std::string recipient_x509_subject_name () const;
private:
diff --git a/test/dcp_test.cc b/test/dcp_test.cc
index 0d7cea2d..ffc5fb2a 100644
--- a/test/dcp_test.cc
+++ b/test/dcp_test.cc
@@ -47,6 +47,7 @@ BOOST_AUTO_TEST_CASE (dcp_test1)
/* Some known metadata */
dcp::XMLMetadata xml_meta;
+ xml_meta.annotation_text = "Created by libdcp";
xml_meta.issuer = "OpenDCP 0.0.25";
xml_meta.creator = "OpenDCP 0.0.25";
xml_meta.issue_date = "2012-07-17T04:45:18+00:00";
@@ -115,6 +116,7 @@ BOOST_AUTO_TEST_CASE (dcp_test2)
/* Some known metadata */
dcp::XMLMetadata xml_meta;
+ xml_meta.annotation_text = "Created by libdcp";
xml_meta.issuer = "OpenDCP 0.0.25";
xml_meta.creator = "OpenDCP 0.0.25";
xml_meta.issue_date = "2012-07-17T04:45:18+00:00";
@@ -214,6 +216,7 @@ BOOST_AUTO_TEST_CASE (dcp_test5)
/* Some known metadata */
dcp::XMLMetadata xml_meta;
+ xml_meta.annotation_text = "Created by libdcp";
xml_meta.issuer = "OpenDCP 0.0.25";
xml_meta.creator = "OpenDCP 0.0.25";
xml_meta.issue_date = "2012-07-17T04:45:18+00:00";
diff --git a/test/encryption_test.cc b/test/encryption_test.cc
index a817d246..573074b2 100644
--- a/test/encryption_test.cc
+++ b/test/encryption_test.cc
@@ -58,6 +58,7 @@ BOOST_AUTO_TEST_CASE (encryption_test)
mxf_metadata.product_version = "0.0.25";
dcp::XMLMetadata xml_metadata;
+ xml_metadata.annotation_text = "Created by libdcp";
xml_metadata.issuer = "OpenDCP 0.0.25";
xml_metadata.creator = "OpenDCP 0.0.25";
xml_metadata.issue_date = "2012-07-17T04:45:18+00:00";
diff --git a/test/ref/DCP/dcp_test1/ASSETMAP.xml b/test/ref/DCP/dcp_test1/ASSETMAP.xml
index 3aa7bb8b..c431ca09 100644
--- a/test/ref/DCP/dcp_test1/ASSETMAP.xml
+++ b/test/ref/DCP/dcp_test1/ASSETMAP.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:48db27c3-4964-46a2-8b02-3e5570efb42d</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:74e205d0-d145-42d2-8c49-7b55d058ca55</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_74e205d0-d145-42d2-8c49-7b55d058ca55.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1039</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id><ChunkList><Chunk><Path>cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1374</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>26080</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:8b92bcee-62fc-4a33-a51a-816e9611ce85</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
+<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:48db27c3-4964-46a2-8b02-3e5570efb42d</Id><AnnotationText>Created by libdcp</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:74e205d0-d145-42d2-8c49-7b55d058ca55</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_74e205d0-d145-42d2-8c49-7b55d058ca55.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1029</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id><ChunkList><Chunk><Path>cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1374</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>26080</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:8b92bcee-62fc-4a33-a51a-816e9611ce85</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
diff --git a/test/ref/DCP/dcp_test1/pkl_74e205d0-d145-42d2-8c49-7b55d058ca55.xml b/test/ref/DCP/dcp_test1/pkl_74e205d0-d145-42d2-8c49-7b55d058ca55.xml
index c1e168f8..aa90b40a 100644
--- a/test/ref/DCP/dcp_test1/pkl_74e205d0-d145-42d2-8c49-7b55d058ca55.xml
+++ b/test/ref/DCP/dcp_test1/pkl_74e205d0-d145-42d2-8c49-7b55d058ca55.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:74e205d0-d145-42d2-8c49-7b55d058ca55</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id><AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText><Hash>1/64LdRLarzX5wgiEK/BjuXuSik=</Hash><Size>1374</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id><AnnotationText>46c3eb45-15e5-47d6-8684-d8641e4dc516</AnnotationText><Hash>fppx9bI5WaFQjRcwmeobYY29GNY=</Hash><Size>26080</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:8b92bcee-62fc-4a33-a51a-816e9611ce85</Id><AnnotationText>8b92bcee-62fc-4a33-a51a-816e9611ce85</AnnotationText><Hash>fnl4pJDAQk/xQ54W4R+l6S7PB7E=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList>
+<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:74e205d0-d145-42d2-8c49-7b55d058ca55</Id><AnnotationText>Created by libdcp</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id><AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText><Hash>1/64LdRLarzX5wgiEK/BjuXuSik=</Hash><Size>1374</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:46c3eb45-15e5-47d6-8684-d8641e4dc516</Id><AnnotationText>46c3eb45-15e5-47d6-8684-d8641e4dc516</AnnotationText><Hash>fppx9bI5WaFQjRcwmeobYY29GNY=</Hash><Size>26080</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:8b92bcee-62fc-4a33-a51a-816e9611ce85</Id><AnnotationText>8b92bcee-62fc-4a33-a51a-816e9611ce85</AnnotationText><Hash>fnl4pJDAQk/xQ54W4R+l6S7PB7E=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList>
diff --git a/test/ref/DCP/dcp_test2/ASSETMAP.xml b/test/ref/DCP/dcp_test2/ASSETMAP.xml
index d447a102..cf150d0e 100644
--- a/test/ref/DCP/dcp_test2/ASSETMAP.xml
+++ b/test/ref/DCP/dcp_test2/ASSETMAP.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:fc17a5e4-1127-4eb7-847f-a982d1ad0b34</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:2afb4e45-f01c-4abc-a354-2ffc0c240a5e</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_2afb4e45-f01c-4abc-a354-2ffc0c240a5e.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1039</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:cd49971e-bf4c-4594-8474-54ebef09a40c</Id><ChunkList><Chunk><Path>cpl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1498</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:07e9f5a0-83ab-4791-8c6b-7df5d11f76f9</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>35032</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:58d42406-691b-47e3-be74-e7a7b49c9514</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
+<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:fc17a5e4-1127-4eb7-847f-a982d1ad0b34</Id><AnnotationText>Created by libdcp</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:2afb4e45-f01c-4abc-a354-2ffc0c240a5e</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_2afb4e45-f01c-4abc-a354-2ffc0c240a5e.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1029</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:cd49971e-bf4c-4594-8474-54ebef09a40c</Id><ChunkList><Chunk><Path>cpl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1498</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:07e9f5a0-83ab-4791-8c6b-7df5d11f76f9</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>35032</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:58d42406-691b-47e3-be74-e7a7b49c9514</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
diff --git a/test/ref/DCP/dcp_test2/pkl_2afb4e45-f01c-4abc-a354-2ffc0c240a5e.xml b/test/ref/DCP/dcp_test2/pkl_2afb4e45-f01c-4abc-a354-2ffc0c240a5e.xml
index faa447c9..5df60c82 100644
--- a/test/ref/DCP/dcp_test2/pkl_2afb4e45-f01c-4abc-a354-2ffc0c240a5e.xml
+++ b/test/ref/DCP/dcp_test2/pkl_2afb4e45-f01c-4abc-a354-2ffc0c240a5e.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:2afb4e45-f01c-4abc-a354-2ffc0c240a5e</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:cd49971e-bf4c-4594-8474-54ebef09a40c</Id><AnnotationText>cd49971e-bf4c-4594-8474-54ebef09a40c</AnnotationText><Hash>9UToAEAcnkP2slky4m9+zpKr1Bw=</Hash><Size>1498</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:07e9f5a0-83ab-4791-8c6b-7df5d11f76f9</Id><AnnotationText>07e9f5a0-83ab-4791-8c6b-7df5d11f76f9</AnnotationText><Hash>M6O1IKSNbWdBQI6zm6AUFOUsrsg=</Hash><Size>35032</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:58d42406-691b-47e3-be74-e7a7b49c9514</Id><AnnotationText>58d42406-691b-47e3-be74-e7a7b49c9514</AnnotationText><Hash>hNT4mrE0QqE9NgUzqf+Eh3CYGWE=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList>
+<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:2afb4e45-f01c-4abc-a354-2ffc0c240a5e</Id><AnnotationText>Created by libdcp</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:cd49971e-bf4c-4594-8474-54ebef09a40c</Id><AnnotationText>cd49971e-bf4c-4594-8474-54ebef09a40c</AnnotationText><Hash>9UToAEAcnkP2slky4m9+zpKr1Bw=</Hash><Size>1498</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:07e9f5a0-83ab-4791-8c6b-7df5d11f76f9</Id><AnnotationText>07e9f5a0-83ab-4791-8c6b-7df5d11f76f9</AnnotationText><Hash>M6O1IKSNbWdBQI6zm6AUFOUsrsg=</Hash><Size>35032</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:58d42406-691b-47e3-be74-e7a7b49c9514</Id><AnnotationText>58d42406-691b-47e3-be74-e7a7b49c9514</AnnotationText><Hash>hNT4mrE0QqE9NgUzqf+Eh3CYGWE=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList>
diff --git a/test/ref/DCP/dcp_test5/ASSETMAP.xml b/test/ref/DCP/dcp_test5/ASSETMAP.xml
index 51eab2a5..5c0152ae 100644
--- a/test/ref/DCP/dcp_test5/ASSETMAP.xml
+++ b/test/ref/DCP/dcp_test5/ASSETMAP.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:7574c611-f8de-4d20-98c4-2eb7dc87080a</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:34acc068-e059-4fb9-90ca-461c57d17dae</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_34acc068-e059-4fb9-90ca-461c57d17dae.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1039</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:11c45f5d-d465-4c41-b008-5284cf38a037</Id><ChunkList><Chunk><Path>cpl_11c45f5d-d465-4c41-b008-5284cf38a037.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1817</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:7f8b3329-371b-4342-b849-a2ee840e8f45</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>26080</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:5ee06e49-440d-4aba-b83d-c783391e87bc</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
+<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:7574c611-f8de-4d20-98c4-2eb7dc87080a</Id><AnnotationText>Created by libdcp</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:34acc068-e059-4fb9-90ca-461c57d17dae</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_34acc068-e059-4fb9-90ca-461c57d17dae.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1029</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:11c45f5d-d465-4c41-b008-5284cf38a037</Id><ChunkList><Chunk><Path>cpl_11c45f5d-d465-4c41-b008-5284cf38a037.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1817</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:7f8b3329-371b-4342-b849-a2ee840e8f45</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>26080</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:5ee06e49-440d-4aba-b83d-c783391e87bc</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
diff --git a/test/ref/DCP/dcp_test5/pkl_34acc068-e059-4fb9-90ca-461c57d17dae.xml b/test/ref/DCP/dcp_test5/pkl_34acc068-e059-4fb9-90ca-461c57d17dae.xml
index efb9cb7f..917350f6 100644
--- a/test/ref/DCP/dcp_test5/pkl_34acc068-e059-4fb9-90ca-461c57d17dae.xml
+++ b/test/ref/DCP/dcp_test5/pkl_34acc068-e059-4fb9-90ca-461c57d17dae.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:34acc068-e059-4fb9-90ca-461c57d17dae</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:11c45f5d-d465-4c41-b008-5284cf38a037</Id><AnnotationText>11c45f5d-d465-4c41-b008-5284cf38a037</AnnotationText><Hash>6d2DG9wN0raCQX6c+w1PQEGR8p0=</Hash><Size>1817</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:7f8b3329-371b-4342-b849-a2ee840e8f45</Id><AnnotationText>7f8b3329-371b-4342-b849-a2ee840e8f45</AnnotationText><Hash>EhBPen6Vp+D3a2wcjeXA64+x4fs=</Hash><Size>26080</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:5ee06e49-440d-4aba-b83d-c783391e87bc</Id><AnnotationText>5ee06e49-440d-4aba-b83d-c783391e87bc</AnnotationText><Hash>T7S0u9QjNuhMsig5GMKweK9BBzM=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList>
+<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:34acc068-e059-4fb9-90ca-461c57d17dae</Id><AnnotationText>Created by libdcp</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:11c45f5d-d465-4c41-b008-5284cf38a037</Id><AnnotationText>11c45f5d-d465-4c41-b008-5284cf38a037</AnnotationText><Hash>6d2DG9wN0raCQX6c+w1PQEGR8p0=</Hash><Size>1817</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:7f8b3329-371b-4342-b849-a2ee840e8f45</Id><AnnotationText>7f8b3329-371b-4342-b849-a2ee840e8f45</AnnotationText><Hash>EhBPen6Vp+D3a2wcjeXA64+x4fs=</Hash><Size>26080</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:5ee06e49-440d-4aba-b83d-c783391e87bc</Id><AnnotationText>5ee06e49-440d-4aba-b83d-c783391e87bc</AnnotationText><Hash>T7S0u9QjNuhMsig5GMKweK9BBzM=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList>
diff --git a/test/ref/DCP/encryption_test/ASSETMAP.xml b/test/ref/DCP/encryption_test/ASSETMAP.xml
index 8dedb74d..7814c9a4 100644
--- a/test/ref/DCP/encryption_test/ASSETMAP.xml
+++ b/test/ref/DCP/encryption_test/ASSETMAP.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:9a5cc86d-e865-4317-ba80-a429f959cdd0</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:de125b93-db76-41d3-bccd-73deb5b2bb49</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_de125b93-db76-41d3-bccd-73deb5b2bb49.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>8163</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:975df3ad-1ace-4c08-aa20-c729ffa5a6b1</Id><ChunkList><Chunk><Path>cpl_975df3ad-1ace-4c08-aa20-c729ffa5a6b1.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>8618</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:e3146267-6089-4647-87d8-071cda0f9063</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>29896</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:b177f5a2-0d5b-4e7a-b5e3-34c04cfda6d4</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>165454</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
+<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:9a5cc86d-e865-4317-ba80-a429f959cdd0</Id><AnnotationText>Created by libdcp</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:de125b93-db76-41d3-bccd-73deb5b2bb49</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_de125b93-db76-41d3-bccd-73deb5b2bb49.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>8153</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:975df3ad-1ace-4c08-aa20-c729ffa5a6b1</Id><ChunkList><Chunk><Path>cpl_975df3ad-1ace-4c08-aa20-c729ffa5a6b1.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>8618</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:e3146267-6089-4647-87d8-071cda0f9063</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>29896</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:b177f5a2-0d5b-4e7a-b5e3-34c04cfda6d4</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>165454</Length></Chunk></ChunkList></Asset></AssetList></AssetMap>
diff --git a/test/ref/DCP/encryption_test/pkl_de125b93-db76-41d3-bccd-73deb5b2bb49.xml b/test/ref/DCP/encryption_test/pkl_de125b93-db76-41d3-bccd-73deb5b2bb49.xml
index 68f41cf0..57cd12c3 100644
--- a/test/ref/DCP/encryption_test/pkl_de125b93-db76-41d3-bccd-73deb5b2bb49.xml
+++ b/test/ref/DCP/encryption_test/pkl_de125b93-db76-41d3-bccd-73deb5b2bb49.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><Id>urn:uuid:de125b93-db76-41d3-bccd-73deb5b2bb49</Id><AnnotationText>Created by libdcp1.4.3devel</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:975df3ad-1ace-4c08-aa20-c729ffa5a6b1</Id><AnnotationText>975df3ad-1ace-4c08-aa20-c729ffa5a6b1</AnnotationText><Hash>2aBaofl0cfNVZJw3RcHsHJWn+8M=</Hash><Size>8618</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:e3146267-6089-4647-87d8-071cda0f9063</Id><AnnotationText>e3146267-6089-4647-87d8-071cda0f9063</AnnotationText><Hash>aUTqa7a8OuzPa3bLYwh9kFVi1T8=</Hash><Size>29896</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:b177f5a2-0d5b-4e7a-b5e3-34c04cfda6d4</Id><AnnotationText>b177f5a2-0d5b-4e7a-b5e3-34c04cfda6d4</AnnotationText><Hash>9zMCdZLeqvkJOE8Ixobv0GExLw0=</Hash><Size>165454</Size><Type>application/mxf</Type></Asset></AssetList><Signer><dsig:X509Data><dsig:X509IssuerSerial><dsig:X509IssuerName>dnQualifier=6eat8r33US71avuQEojmH\+bjk84=,CN=.smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION,OU=example.org,O=example.org</dsig:X509IssuerName><dsig:X509SerialNumber>7</dsig:X509SerialNumber></dsig:X509IssuerSerial><dsig:X509SubjectName>dnQualifier=QFVlym7fuql6bPOnY38aaO1ZPW4=,CN=CS.smpte-430-2.LEAF.NOT_FOR_PRODUCTION,OU=example.org,O=example.org</dsig:X509SubjectName></dsig:X509Data></Signer><dsig:Signature><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>fblo3zclDjy/nuzsRVF8x9hEGiw=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>lFYFoPdjnJH1yIMuWgdx+1QNkcN8NRaVjSrWIKPkRF19qDramVJQslUlaLCtWSpg
-VQcUUsXbm+ecC5Eh+4Ye5ri03c6MWrxl6xIP8/awj8arUbB9qOIuN0GIZE/fRYEj
-5y0NT3okJdYEDnWnmgQAqmjDs5pLwHITeasYjNkH+3Jan+J4HDoyLaOf5V/c5+RV
-LCRXAW3dPhF/gSygkgy8Bl4AKYmCijg6r6m00SuzLn5NhhAMxvcASqanekvfL0+4
-vlMP994J358ac+2LL3860KSW1ZnotfvrkMswGRvgoEw7QiLS3w38hRO2E0SxRK0h
-tfPeFO3LtPcoo45GszqfFw==</dsig:SignatureValue><dsig:KeyInfo><dsig:X509Data><dsig:X509IssuerSerial><dsig:X509IssuerName>dnQualifier=6eat8r33US71avuQEojmH\+bjk84=,CN=.smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION,OU=example.org,O=example.org</dsig:X509IssuerName><dsig:X509SerialNumber>7</dsig:X509SerialNumber></dsig:X509IssuerSerial><dsig:X509Certificate>MIIEezCCA2OgAwIBAgIBBzANBgkqhkiG9w0BAQsFADCBijEUMBIGA1UEChMLZXhh
+<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><Id>urn:uuid:de125b93-db76-41d3-bccd-73deb5b2bb49</Id><AnnotationText>Created by libdcp</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:975df3ad-1ace-4c08-aa20-c729ffa5a6b1</Id><AnnotationText>975df3ad-1ace-4c08-aa20-c729ffa5a6b1</AnnotationText><Hash>2aBaofl0cfNVZJw3RcHsHJWn+8M=</Hash><Size>8618</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:e3146267-6089-4647-87d8-071cda0f9063</Id><AnnotationText>e3146267-6089-4647-87d8-071cda0f9063</AnnotationText><Hash>aUTqa7a8OuzPa3bLYwh9kFVi1T8=</Hash><Size>29896</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:b177f5a2-0d5b-4e7a-b5e3-34c04cfda6d4</Id><AnnotationText>b177f5a2-0d5b-4e7a-b5e3-34c04cfda6d4</AnnotationText><Hash>9zMCdZLeqvkJOE8Ixobv0GExLw0=</Hash><Size>165454</Size><Type>application/mxf</Type></Asset></AssetList><Signer><dsig:X509Data><dsig:X509IssuerSerial><dsig:X509IssuerName>dnQualifier=6eat8r33US71avuQEojmH\+bjk84=,CN=.smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION,OU=example.org,O=example.org</dsig:X509IssuerName><dsig:X509SerialNumber>7</dsig:X509SerialNumber></dsig:X509IssuerSerial><dsig:X509SubjectName>dnQualifier=QFVlym7fuql6bPOnY38aaO1ZPW4=,CN=CS.smpte-430-2.LEAF.NOT_FOR_PRODUCTION,OU=example.org,O=example.org</dsig:X509SubjectName></dsig:X509Data></Signer><dsig:Signature><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><dsig:Reference URI=""><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>tzUACzSZAox5Bl2hA0/X7F2gv8I=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>gCjlb4yuSk+8Jr9MRT7AuxBt0FSi5spviKZ2RF057HWEZTNAQ7sAOr3bPRyn1W1F
+ySCYm0+VM/K5QitCHUfMNE6GlL1BxypKwreqKw0edRwqP0jNG8V8mmhzfBUKs5DD
+Sl8buBgRKAosMAfZ6R4ZbiDiTVJa76vx0wmIhvY/7JQjlek6RWFNR5QmGFZJzloy
+LlzpHej4sluFLKJkTwAPOH6rlLXYyKkDk4zBeYsmKkNVQzih0OG2OFR4pBwDM3w9
+S8Ugp9JmJd5Xipd8SsnnKO/Uzcb/1iy2BkoM8iHr2L3mutwv9RnxZuLsMDIFKiP7
+FWlve0in0pZcS2TDIdRxEQ==</dsig:SignatureValue><dsig:KeyInfo><dsig:X509Data><dsig:X509IssuerSerial><dsig:X509IssuerName>dnQualifier=6eat8r33US71avuQEojmH\+bjk84=,CN=.smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION,OU=example.org,O=example.org</dsig:X509IssuerName><dsig:X509SerialNumber>7</dsig:X509SerialNumber></dsig:X509IssuerSerial><dsig:X509Certificate>MIIEezCCA2OgAwIBAgIBBzANBgkqhkiG9w0BAQsFADCBijEUMBIGA1UEChMLZXhh
bXBsZS5vcmcxFDASBgNVBAsTC2V4YW1wbGUub3JnMTUwMwYDVQQDFCwuc21wdGUt
NDMwLTIuSU5URVJNRURJQVRFLk5PVF9GT1JfUFJPRFVDVElPTjElMCMGA1UELhMc
NmVhdDhyMzNVUzcxYXZ1UUVvam1IK2Jqazg0PTAeFw0xNTA2MDUxMzIwMDhaFw0y
diff --git a/tools/dcpdecryptmxf.cc b/tools/dcpdecryptmxf.cc
index e640620a..c387442f 100644
--- a/tools/dcpdecryptmxf.cc
+++ b/tools/dcpdecryptmxf.cc
@@ -56,7 +56,7 @@ static void
help (string n)
{
cerr << "Syntax: " << n << " [OPTION] <MXF>]\n"
- << " -v, --version show DCP-o-matic version\n"
+ << " -v, --version show libdcp version\n"
<< " -h, --help show this help\n"
<< " -o, --output output filename\n"
<< " -k, --kdm KDM file\n"
diff --git a/tools/dcpkdm.cc b/tools/dcpkdm.cc
new file mode 100644
index 00000000..1e35803f
--- /dev/null
+++ b/tools/dcpkdm.cc
@@ -0,0 +1,119 @@
+/*
+ Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+
+ This file is part of libdcp.
+
+ libdcp is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ libdcp is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with libdcp. If not, see <http://www.gnu.org/licenses/>.
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of portions of this program with the
+ OpenSSL library under certain conditions as described in each
+ individual source file, and distribute linked combinations
+ including the two.
+
+ You must obey the GNU General Public License in all respects
+ for all of the code used other than OpenSSL. If you modify
+ file(s) with this exception, you may extend this exception to your
+ version of the file(s), but you are not obligated to do so. If you
+ do not wish to do so, delete this exception statement from your
+ version. If you delete this exception statement from all source
+ files in the program, then also delete it here.
+*/
+
+#include "encrypted_kdm.h"
+#include "decrypted_kdm.h"
+#include "util.h"
+#include "exceptions.h"
+#include <boost/foreach.hpp>
+#include <getopt.h>
+
+using std::string;
+using std::cout;
+using std::cerr;
+using boost::optional;
+
+static void
+help (string n)
+{
+ cerr << "Syntax: " << n << " [OPTION] <KDM>]\n"
+ << " -h, --help show this help\n"
+ << " -p, --private-key private key file\n";
+}
+
+int
+main (int argc, char* argv[])
+{
+ optional<boost::filesystem::path> private_key_file;
+
+ int option_index = 0;
+ while (true) {
+ struct option long_options[] = {
+ { "help", no_argument, 0, 'h' },
+ { "private-key", required_argument, 0, 'p'},
+ { 0, 0, 0, 0 }
+ };
+
+ int c = getopt_long (argc, argv, "hp:", long_options, &option_index);
+
+ if (c == -1) {
+ break;
+ }
+
+ switch (c) {
+ case 'h':
+ help (argv[0]);
+ exit (EXIT_SUCCESS);
+ case 'p':
+ private_key_file = optarg;
+ break;
+ }
+ }
+
+ if (optind >= argc) {
+ help (argv[0]);
+ exit (EXIT_FAILURE);
+ }
+
+ boost::filesystem::path kdm_file = argv[optind];
+
+ dcp::EncryptedKDM enc_kdm (dcp::file_to_string (kdm_file));
+
+ if (enc_kdm.annotation_text()) {
+ cout << "Annotation: " << enc_kdm.annotation_text().get() << "\n";
+ }
+ cout << "Content title: " << enc_kdm.content_title_text() << "\n";
+ cout << "CPL id: " << enc_kdm.cpl_id() << "\n";
+ cout << "Recipient: " << enc_kdm.recipient_x509_subject_name() << "\n";
+
+ if (private_key_file) {
+ try {
+ dcp::DecryptedKDM dec_kdm (enc_kdm, dcp::file_to_string (private_key_file.get()));
+ cout << "\nKeys";
+ BOOST_FOREACH (dcp::DecryptedKDMKey i, dec_kdm.keys ()) {
+ cout << "\n";
+ cout << "\tID: " << i.id() << "\n";
+ cout << "\tStandard: " << (i.standard() == dcp::SMPTE ? "SMPTE" : "Interop") << "\n";
+ if (i.type()) {
+ cout << "\tType: " << i.type().get() << "\n";
+ }
+ cout << "\tKey: " << i.key().hex() << "\n";
+ }
+ } catch (dcp::KDMDecryptionError& e) {
+ cerr << e.what() << "\n";
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ return 0;
+}
diff --git a/tools/wscript b/tools/wscript
index b3bb3a1f..ecdd74d4 100644
--- a/tools/wscript
+++ b/tools/wscript
@@ -44,14 +44,9 @@ def build(bld):
obj.source = 'dcpinfo.cc common.cc'
obj.target = 'dcpinfo'
- obj = bld(features='cxx cxxprogram')
- obj.use = ['libdcp%s' % bld.env.API_VERSION]
- obj.uselib = 'OPENJPEG CXML OPENMP ASDCPLIB_CTH BOOST_FILESYSTEM LIBXML++ XMLSEC1 OPENSSL'
- obj.source = 'dcpdumpsub.cc'
- obj.target = 'dcpdumpsub'
-
- obj = bld(features='cxx cxxprogram')
- obj.use = ['libdcp%s' % bld.env.API_VERSION]
- obj.uselib = 'OPENJPEG CXML OPENMP ASDCPLIB_CTH BOOST_FILESYSTEM LIBXML++ XMLSEC1 OPENSSL'
- obj.source = 'dcpdecryptmxf.cc'
- obj.target = 'dcpdecryptmxf'
+ for f in ['dumpsub', 'decryptmxf', 'kdm']:
+ obj = bld(features='cxx cxxprogram')
+ obj.use = ['libdcp%s' % bld.env.API_VERSION]
+ obj.uselib = 'OPENJPEG CXML OPENMP ASDCPLIB_CTH BOOST_FILESYSTEM LIBXML++ XMLSEC1 OPENSSL'
+ obj.source = 'dcp%s.cc' % f
+ obj.target = 'dcp%s' % f