X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fdecryption_test.cc;h=d9170daaf0c2253c9bfb8816d59d668546aff1c1;hb=fb14b55a26accff9495d155b9ede24ac8d00dab6;hp=8dfeffa658d36a3e498345cb01c3cb65454e1bb2;hpb=77b0ffe6c50796b8fb132f56394995e0df089713;p=libdcp.git diff --git a/test/decryption_test.cc b/test/decryption_test.cc index 8dfeffa6..d9170daa 100644 --- a/test/decryption_test.cc +++ b/test/decryption_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,10 +18,11 @@ */ #include -#include "kdm.h" #include "dcp.h" #include "mono_picture_frame.h" #include "cpl.h" +#include "decrypted_kdm.h" +#include "encrypted_kdm.h" #include "argb_frame.h" #include "mono_picture_mxf.h" #include "reel_picture_asset.h" @@ -58,11 +59,13 @@ BOOST_AUTO_TEST_CASE (decryption_test) encrypted.read (); BOOST_CHECK_EQUAL (encrypted.encrypted (), true); - dcp::KDM kdm ( - "test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml", - "test/data/private.key" + dcp::DecryptedKDM kdm ( + dcp::EncryptedKDM ( + dcp::file_to_string ("test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml") + ), + dcp::file_to_string ("test/data/private.key") ); - + encrypted.add (kdm); shared_ptr plaintext_frame = get_frame (plaintext); @@ -78,8 +81,8 @@ BOOST_AUTO_TEST_CASE (decryption_test) /** Load in a KDM that didn't work at first */ BOOST_AUTO_TEST_CASE (failing_kdm_test) { - dcp::KDM kdm ( - "test/data/target.pem.crt.de5d4eba-e683-41ca-bdda-aa4ad96af3f4.kdm.xml", - "test/data/private.key" + dcp::DecryptedKDM kdm ( + dcp::EncryptedKDM (dcp::file_to_string ("test/data/target.pem.crt.de5d4eba-e683-41ca-bdda-aa4ad96af3f4.kdm.xml")), + dcp::file_to_string ("test/data/private.key") ); }