46 #include "compose.hpp"
47 #include <asdcp/AS_DCP.h>
48 #include <asdcp/KM_prng.h>
49 #include <asdcp/KM_util.h>
50 #include <libxml++/nodes/element.h>
51 #include <boost/filesystem.hpp>
59 using std::shared_ptr;
60 using std::dynamic_pointer_cast;
65 : _context_id (make_uuid ())
73 MXF::MXF (Standard standard)
74 : _context_id (make_uuid ())
75 , _standard (standard)
82 MXF::fill_writer_info (ASDCP::WriterInfo* writer_info,
string id)
const
84 writer_info->ProductVersion = _metadata.product_version;
85 writer_info->CompanyName = _metadata.company_name;
86 writer_info->ProductName = _metadata.product_name;
88 DCP_ASSERT (_standard);
89 if (_standard == Standard::INTEROP) {
90 writer_info->LabelSetType = ASDCP::LS_MXF_INTEROP;
92 writer_info->LabelSetType = ASDCP::LS_MXF_SMPTE;
95 Kumu::hex2bin (
id.c_str(), writer_info->AssetUUID, Kumu::UUID_Length, &c);
96 DCP_ASSERT (c == Kumu::UUID_Length);
98 writer_info->UsesHMAC =
true;
101 Kumu::hex2bin (_context_id.c_str(), writer_info->ContextID, Kumu::UUID_Length, &c);
102 writer_info->EncryptedEssence =
true;
105 Kumu::hex2bin (
_key_id.get().c_str(), writer_info->CryptographicKeyID, Kumu::UUID_Length, &c);
106 DCP_ASSERT (c == Kumu::UUID_Length);
128 if (info.EncryptedEssence) {
129 Kumu::bin2UUIDhex (info.CryptographicKeyID, ASDCP::UUIDlen, buffer, sizeof (buffer));
133 switch (info.LabelSetType) {
134 case ASDCP::LS_MXF_INTEROP:
135 _standard = Standard::INTEROP;
137 case ASDCP::LS_MXF_SMPTE:
138 _standard = Standard::SMPTE;
141 throw ReadError (
"Unrecognised label set type in MXF");
144 _metadata.read (info);
146 Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer));
A key for decrypting/encrypting assets.
virtual void set_key(Key)
boost::optional< Key > _key
std::string read_writer_info(ASDCP::WriterInfo const &)
boost::optional< std::string > _key_id
boost::optional< Key > key() const
Any error that occurs when reading data from a DCP.
Exceptions thrown by libdcp.
Namespace for everything in libdcp.
Methods for conversion to/from string.
Utility methods and classes.