diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/decrypted_kdm.cc | 2 | ||||
| -rw-r--r-- | src/decrypted_kdm.h | 7 | ||||
| -rw-r--r-- | src/encrypted_kdm.cc | 13 | ||||
| -rw-r--r-- | src/encrypted_kdm.h | 5 |
4 files changed, 16 insertions, 11 deletions
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc index 99cbca10..6aba26de 100644 --- a/src/decrypted_kdm.cc +++ b/src/decrypted_kdm.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> 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 diff --git a/src/decrypted_kdm.h b/src/decrypted_kdm.h index f7d21dbe..21df45a1 100644 --- a/src/decrypted_kdm.h +++ b/src/decrypted_kdm.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> 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 @@ -30,6 +30,7 @@ #include "types.h" #include "certificate.h" #include <boost/filesystem.hpp> +#include <boost/optional.hpp> namespace dcp { @@ -110,7 +111,7 @@ public: return _keys; } - std::string annotation_text () const { + boost::optional<std::string> annotation_text () const { return _annotation_text; } @@ -125,7 +126,7 @@ public: private: LocalTime _not_valid_before; LocalTime _not_valid_after; - std::string _annotation_text; + boost::optional<std::string> _annotation_text; std::string _content_title_text; std::string _issue_date; std::list<DecryptedKDMKey> _keys; diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc index 132e8df3..8ed0c315 100644 --- a/src/encrypted_kdm.cc +++ b/src/encrypted_kdm.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> 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 @@ -33,6 +33,7 @@ using std::string; using std::map; using std::pair; using boost::shared_ptr; +using boost::optional; using namespace dcp; namespace dcp { @@ -427,7 +428,7 @@ public: AuthenticatedPublic (shared_ptr<const cxml::Node> node) : message_id (remove_urn_uuid (node->string_child ("MessageId"))) - , annotation_text (node->string_child ("AnnotationText")) + , annotation_text (node->optional_string_child ("AnnotationText")) , issue_date (node->string_child ("IssueDate")) , signer (node->node_child ("Signer")) , required_extensions (node->node_child ("RequiredExtensions")) @@ -441,7 +442,9 @@ public: node->add_child("MessageId")->add_child_text ("urn:uuid:" + message_id); node->add_child("MessageType")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#kdm-key-type"); - node->add_child("AnnotationText")->add_child_text (annotation_text); + if (annotation_text) { + node->add_child("AnnotationText")->add_child_text (annotation_text.get ()); + } node->add_child("IssueDate")->add_child_text (issue_date); signer.as_xml (node->add_child ("Signer")); @@ -451,7 +454,7 @@ public: } string message_id; - string annotation_text; + optional<string> annotation_text; string issue_date; Signer signer; RequiredExtensions required_extensions; @@ -628,7 +631,7 @@ EncryptedKDM::keys () const return _data->authenticated_private.encrypted_key; } -string +optional<string> EncryptedKDM::annotation_text () const { return _data->authenticated_public.annotation_text; diff --git a/src/encrypted_kdm.h b/src/encrypted_kdm.h index c899dcbe..a36e7aaf 100644 --- a/src/encrypted_kdm.h +++ b/src/encrypted_kdm.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> 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 @@ -27,6 +27,7 @@ #include "local_time.h" #include "types.h" #include <boost/filesystem.hpp> +#include <boost/optional.hpp> #include <boost/date_time/local_time/local_time.hpp> namespace cxml { @@ -71,7 +72,7 @@ public: */ std::list<std::string> keys () const; - std::string annotation_text () const; + boost::optional<std::string> annotation_text () const; std::string content_title_text () const; std::string issue_date () const; std::string cpl_id () const; |
