More licence fixups.
[libdcp.git] / src / encrypted_kdm.h
index 0d459d5a300aeb6d949717a237c5c4aa755de5ff..85cd348cfe5e59bacbae50634c71f925d1d5a2b9 100644 (file)
@@ -1,20 +1,20 @@
 /*
-    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
+    This file is part of libdcp.
+
+    libdcp is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
+    libdcp is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
+    along with libdcp.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 /** @file  src/encrypted_kdm.h
@@ -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 {
@@ -39,7 +40,7 @@ namespace data {
        class EncryptedKDMData;
 }
 
-class Signer;  
+class CertificateChain;
 class Certificate;
 
 /** @class EncryptedKDM
@@ -52,11 +53,7 @@ class Certificate;
 class EncryptedKDM
 {
 public:
-       /** Read a KDM from an XML file.
-        *  @param file XML file to read.
-        */
-       EncryptedKDM (boost::filesystem::path file);
-
+       EncryptedKDM (std::string);
        EncryptedKDM (EncryptedKDM const & kdm);
        EncryptedKDM & operator= (EncryptedKDM const &);
        ~EncryptedKDM ();
@@ -74,28 +71,37 @@ public:
         *  keys (also key id, CPL id etc.)
         */
        std::list<std::string> keys () const;
-       
+
+       boost::optional<std::string> annotation_text () const;
+       std::string content_title_text () const;
+       std::string issue_date () const;
+       std::string cpl_id () const;
+
 private:
 
        friend class DecryptedKDM;
 
        /** Construct an EncryptedKDM from a set of details */
        EncryptedKDM (
-               boost::shared_ptr<const Signer> signer,
-               boost::shared_ptr<const Certificate> recipient,
+               boost::shared_ptr<const CertificateChain> signer,
+               Certificate recipient,
+               std::vector<Certificate> trusted_devices,
                std::string device_list_description,
                std::string cpl_id,
                std::string cpl_content_title_text,
+               boost::optional<std::string> annotation_text,
                LocalTime not_valid_before,
                LocalTime not_valid_after,
                Formulation formulation,
                std::list<std::pair<std::string, std::string> > key_ids,
                std::list<std::string> keys
                );
-       
+
        data::EncryptedKDMData* _data;
 };
 
+extern bool operator== (EncryptedKDM const & a, EncryptedKDM const & b);
+
 }
 
 #endif