summaryrefslogtreecommitdiff
path: root/src/decrypted_kdm.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-10-08 00:10:01 +0100
committerCarl Hetherington <cth@carlh.net>2015-10-08 00:10:01 +0100
commit6a9f36928b7404250fc71694e88a73d5b4125695 (patch)
tree0ba85c77e2661f07399fd7f810d52198f6d228e0 /src/decrypted_kdm.h
parent4debca21936fd004fdcabe8d6178694f8cbf5f4d (diff)
Allow DecryptedKDM to be built up from individual keys.
Diffstat (limited to 'src/decrypted_kdm.h')
-rw-r--r--src/decrypted_kdm.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/decrypted_kdm.h b/src/decrypted_kdm.h
index 06e2f9e1..2cb934bb 100644
--- a/src/decrypted_kdm.h
+++ b/src/decrypted_kdm.h
@@ -55,7 +55,23 @@ public:
*/
DecryptedKDM (EncryptedKDM const & kdm, std::string private_key);
- /** Construct a DecryptedKDM.
+ /** Create an empty DecryptedKDM. After creation you must call
+ * add_key() to add each key that you want in the KDM.
+ *
+ * @param not_valid_before Start time for the KDM.
+ * @param not_valid_after End time for the KDM.
+ */
+ DecryptedKDM (
+ LocalTime not_valid_before,
+ LocalTime not_valid_after,
+ std::string annotation_text,
+ std::string content_title_text,
+ std::string issue_date
+ );
+
+ /** Create a DecryptedKDM by taking a CPL and setting up to encrypt each of its
+ * assets with the same symmetric key.
+ *
* @param cpl CPL that the keys are for.
* @param key Key that was used to encrypt the assets.
* @param not_valid_before Start time for the KDM.
@@ -79,6 +95,9 @@ public:
*/
EncryptedKDM encrypt (boost::shared_ptr<const CertificateChain> signer, Certificate recipient, Formulation formulation) const;
+ void add_key (std::string type, std::string key_id, Key key, std::string cpl_id);
+ void add_key (DecryptedKDMKey key);
+
/** @return This KDM's (decrypted) keys, which could be used to decrypt assets. */
std::list<DecryptedKDMKey> keys () const {
return _keys;