summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-10-06 12:38:47 +0100
committerCarl Hetherington <cth@carlh.net>2015-10-06 12:38:47 +0100
commit4c2e6d70f15deb7e571af4a49c8643d3957f7b99 (patch)
treee6f3dc6fdf62bf31edd973469f9c062f7f569b02 /src
parentd97e1600057d796c4163cecf28f9f04a6ea6402b (diff)
Add some KDM metadata accessors.
Diffstat (limited to 'src')
-rw-r--r--src/decrypted_kdm.cc4
-rw-r--r--src/decrypted_kdm.h12
-rw-r--r--src/encrypted_kdm.cc18
-rw-r--r--src/encrypted_kdm.h4
4 files changed, 38 insertions, 0 deletions
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc
index 949db72b..f12752b6 100644
--- a/src/decrypted_kdm.cc
+++ b/src/decrypted_kdm.cc
@@ -181,6 +181,10 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key)
RSA_free (rsa);
BIO_free (bio);
+
+ _annotation_text = kdm.annotation_text ();
+ _content_title_text = kdm.content_title_text ();
+ _issue_date = kdm.issue_date ();
}
DecryptedKDM::DecryptedKDM (
diff --git a/src/decrypted_kdm.h b/src/decrypted_kdm.h
index 45ad8fa6..06e2f9e1 100644
--- a/src/decrypted_kdm.h
+++ b/src/decrypted_kdm.h
@@ -84,6 +84,18 @@ public:
return _keys;
}
+ std::string annotation_text () const {
+ return _annotation_text;
+ }
+
+ std::string content_title_text () const {
+ return _content_title_text;
+ }
+
+ std::string issue_date () const {
+ return _issue_date;
+ }
+
private:
LocalTime _not_valid_before;
LocalTime _not_valid_after;
diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc
index 5b596b80..d856c5e1 100644
--- a/src/encrypted_kdm.cc
+++ b/src/encrypted_kdm.cc
@@ -608,3 +608,21 @@ EncryptedKDM::keys () const
{
return _data->authenticated_private.encrypted_key;
}
+
+string
+EncryptedKDM::annotation_text () const
+{
+ return _data->authenticated_public.annotation_text;
+}
+
+string
+EncryptedKDM::content_title_text () const
+{
+ return _data->authenticated_public.required_extensions.kdm_required_extensions.content_title_text;
+}
+
+string
+EncryptedKDM::issue_date () const
+{
+ return _data->authenticated_public.issue_date;
+}
diff --git a/src/encrypted_kdm.h b/src/encrypted_kdm.h
index 247d6678..6e08199f 100644
--- a/src/encrypted_kdm.h
+++ b/src/encrypted_kdm.h
@@ -71,6 +71,10 @@ public:
*/
std::list<std::string> keys () const;
+ std::string annotation_text () const;
+ std::string content_title_text () const;
+ std::string issue_date () const;
+
private:
friend class DecryptedKDM;