summaryrefslogtreecommitdiff
path: root/src/mxf_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-07 00:39:15 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-07 00:39:15 +0100
commit932b942a51bef4e2dd2de9f83aa5b68ad07f60f9 (patch)
tree40f81e0b4b2e04f46bab243e9c94ff24b8bcb2ef /src/mxf_asset.cc
parent4313456938d34d93239194e914b82e7a5ae14c1c (diff)
Working decryption via KDM.
Diffstat (limited to 'src/mxf_asset.cc')
-rw-r--r--src/mxf_asset.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc
index 3cb13250..1c45dcbc 100644
--- a/src/mxf_asset.cc
+++ b/src/mxf_asset.cc
@@ -33,6 +33,7 @@
#include "util.h"
#include "metadata.h"
#include "exceptions.h"
+#include "kdm.h"
using std::string;
using std::list;
@@ -46,6 +47,7 @@ MXFAsset::MXFAsset (string directory, string file_name)
, _progress (0)
, _encrypted (false)
, _encryption_context (0)
+ , _decryption_context (0)
{
}
@@ -55,6 +57,7 @@ MXFAsset::MXFAsset (string directory, string file_name, boost::signals2::signal<
, _progress (progress)
, _encrypted (encrypted)
, _encryption_context (0)
+ , _decryption_context (0)
{
if (_encrypted) {
_key_id = make_uuid ();
@@ -150,3 +153,12 @@ MXFAsset::write_to_cpl (xmlpp::Node* node) const
a->add_child("KeyId")->add_child_text ("urn:uuid:" + _key_id);
}
}
+
+void
+MXFAsset::set_kdm_cipher (KDMCipher cipher)
+{
+ _decryption_context = new ASDCP::AESDecContext;
+ if (ASDCP_FAILURE (_decryption_context->InitKey (cipher.key_raw ()))) {
+ throw MiscError ("could not set up decryption context");
+ }
+}