/* 93 is not-valid-after (a string) [25 bytes] */
p += 25;
/* 118 is the key [ASDCP::KeyLen bytes] */
- add_key (optional<string>(), key_id, Key (p), cpl_id);
+ add_key (optional<string>(), key_id, Key (p), cpl_id, INTEROP);
break;
}
case 138:
/* 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:
, _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);
}
}
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;
}
}
* @param cpl_id ID of CPL that the key is for.
*/
void
-DecryptedKDM::add_key (optional<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
}
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;
#define LIBDCP_DECRYPTED_KDM_KEY_H
#include "key.h"
+#include "types.h"
#include <boost/optional.hpp>
namespace dcp {
class DecryptedKDMKey
{
public:
- DecryptedKDMKey (boost::optional<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, std::string signer_thumbprint)
: _type (type)
, _id (id)
, _key (key)
, _cpl_id (cpl_id)
+ , _standard (standard)
+ , _signer_thumbprint (signer_thumbprint)
{}
boost::optional<std::string> type () const {
return _cpl_id;
}
+ Standard standard () const {
+ return _standard;
+ }
+
+ std::string signer_thumbprint () const {
+ return _signer_thumbprint;
+ }
+
private:
boost::optional<std::string> _type;
std::string _id;
Key _key;
std::string _cpl_id;
+ Standard _standard;
+ std::string _signer_thumbprint;
};
bool operator== (DecryptedKDMKey const &, DecryptedKDMKey const &);
cout << "\nKeys";
BOOST_FOREACH (dcp::DecryptedKDMKey i, dec_kdm.keys ()) {
cout << "\n";
- cout << "\tID: " << i.id() << "\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 << "\tType: " << i.type().get() << "\n";
}
- cout << "\tKey: " << i.key().hex() << "\n";
+ cout << "\tKey: " << i.key().hex() << "\n";
}
} catch (dcp::KDMDecryptionError& e) {
cerr << e.what() << "\n";