Add some KDM metadata accessors.
authorCarl Hetherington <cth@carlh.net>
Tue, 6 Oct 2015 11:38:47 +0000 (12:38 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 6 Oct 2015 11:38:47 +0000 (12:38 +0100)
src/decrypted_kdm.cc
src/decrypted_kdm.h
src/encrypted_kdm.cc
src/encrypted_kdm.h

index 949db72bdcc6e763767e7c24fea85d1af3d7ddae..f12752b6965ea29e7d4d095a8039e0ed4960734a 100644 (file)
@@ -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 (
index 45ad8fa6c2cfeab66e6ffabbd8184d800913c077..06e2f9e1f3634e8b197ed34461fe4c5bd667b336 100644 (file)
@@ -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;
index 5b596b80baac7864f9b10762e31508bacb35db81..d856c5e14412fd0abd6567a4148f41c6a5766546 100644 (file)
@@ -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;
+}
index 247d6678045098d7cac57e47f0328bda4c241657..6e08199fe559733214a6acf4196778265be68a50 100644 (file)
@@ -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;