#include "exceptions.h"
#include "signer.h"
#include "cpl.h"
-#include "mxf_asset.h"
+#include "mxf.h"
#include "xml/kdm_smpte.h"
using std::list;
using std::setfill;
using std::cout;
using boost::shared_ptr;
-using namespace libdcp;
+using namespace dcp;
KDM::KDM (boost::filesystem::path kdm, boost::filesystem::path private_key)
: _xml_kdm (new xml::DCinemaSecurityMessage (kdm))
{
/* Read the private key */
- FILE* private_key_file = fopen (private_key.string().c_str(), "r");
+ FILE* private_key_file = fopen_boost (private_key, "r");
if (!private_key_file) {
- throw FileError ("could not find RSA private key file", private_key);
+ throw FileError ("could not find RSA private key file", private_key, errno);
}
RSA* rsa = PEM_read_RSAPrivateKey (private_key_file, 0, 0, 0);
fclose (private_key_file);
if (!rsa) {
- throw FileError ("could not read RSA private key file", private_key);
+ throw FileError ("could not read RSA private key file", private_key, errno);
}
/* Use it to decrypt the keys */
*/
apu.authorized_device_info.device_list.push_back ("2jmj7l5rSw0yVb/vlWAYkK/YBwk=");
- list<shared_ptr<const Asset> > assets = cpl->assets ();
- for (list<shared_ptr<const Asset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
+ list<shared_ptr<const Content> > assets = cpl->assets ();
+ for (list<shared_ptr<const Content> >::iterator i = assets.begin(); i != assets.end(); ++i) {
/* XXX: non-MXF assets? */
- shared_ptr<const MXFAsset> mxf = boost::dynamic_pointer_cast<const MXFAsset> (*i);
+ shared_ptr<const MXF> mxf = boost::dynamic_pointer_cast<const MXF> (*i);
if (mxf) {
apu.key_id_list.push_back (xml::TypedKeyId (mxf->key_type(), "urn:uuid:" + mxf->key_id()));
}
/* AuthenticatedPrivate */
- for (list<shared_ptr<const Asset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
+ for (list<shared_ptr<const Content> >::iterator i = assets.begin(); i != assets.end(); ++i) {
/* XXX: non-MXF assets? */
- shared_ptr<const MXFAsset> mxf = boost::dynamic_pointer_cast<const MXFAsset> (*i);
+ shared_ptr<const MXF> mxf = boost::dynamic_pointer_cast<const MXF> (*i);
if (mxf) {
KDMKey kkey (
signer, cpl->id (), mxf->key_type (), mxf->key_id (),
}
bool
-libdcp::operator== (libdcp::KDMKey const & a, libdcp::KDMKey const & b)
+dcp::operator== (dcp::KDMKey const & a, dcp::KDMKey const & b)
{
if (memcmp (a._signer_thumbprint, b._signer_thumbprint, 20) != 0) {
return false;