A couple of hacks to KDMs for testing by Dolby.
[libdcp.git] / src / encrypted_kdm.cc
1 /*
2     Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #include "encrypted_kdm.h"
21 #include "util.h"
22 #include "certificate_chain.h"
23 #include <libcxml/cxml.h>
24 #include <libxml++/document.h>
25 #include <libxml++/nodes/element.h>
26 #include <libxml/parser.h>
27 #include <boost/date_time/posix_time/posix_time.hpp>
28 #include <boost/foreach.hpp>
29
30 using std::list;
31 using std::vector;
32 using std::string;
33 using std::map;
34 using std::pair;
35 using boost::shared_ptr;
36 using namespace dcp;
37
38 namespace dcp {
39
40 /** Namespace for classes used to hold our data; they are internal to this .cc file */
41 namespace data {
42
43 class Signer
44 {
45 public:
46         Signer () {}
47
48         Signer (shared_ptr<const cxml::Node> node)
49                 : x509_issuer_name (node->string_child ("X509IssuerName"))
50                 , x509_serial_number (node->string_child ("X509SerialNumber"))
51         {
52
53         }
54
55         void as_xml (xmlpp::Element* node) const
56         {
57                 node->add_child("X509IssuerName", "ds")->add_child_text (x509_issuer_name);
58                 node->add_child("X509SerialNumber", "ds")->add_child_text (x509_serial_number);
59         }
60
61         string x509_issuer_name;
62         string x509_serial_number;
63 };
64
65 class X509Data
66 {
67 public:
68         X509Data () {}
69
70         X509Data (boost::shared_ptr<const cxml::Node> node)
71                 : x509_issuer_serial (Signer (node->node_child ("X509IssuerSerial")))
72                 , x509_certificate (node->string_child ("X509Certificate"))
73         {
74                 node->done ();
75         }
76
77         void as_xml (xmlpp::Element* node) const
78         {
79                 x509_issuer_serial.as_xml (node->add_child ("X509IssuerSerial", "ds"));
80                 node->add_child("X509Certificate", "ds")->add_child_text (x509_certificate);
81         }
82
83         Signer x509_issuer_serial;
84         std::string x509_certificate;
85 };
86
87 class Reference
88 {
89 public:
90         Reference () {}
91
92         Reference (string u)
93                 : uri (u)
94         {}
95
96         Reference (shared_ptr<const cxml::Node> node)
97                 : uri (node->string_attribute ("URI"))
98                 , digest_value (node->string_child ("DigestValue"))
99         {
100
101         }
102
103         void as_xml (xmlpp::Element* node) const
104         {
105                 node->set_attribute ("URI", uri);
106                 node->add_child("DigestMethod", "ds")->set_attribute ("Algorithm", "http://www.w3.org/2001/04/xmlenc#sha256");
107                 node->add_child("DigestValue", "ds")->add_child_text (digest_value);
108         }
109
110         string uri;
111         string digest_value;
112 };
113
114 class SignedInfo
115 {
116 public:
117         SignedInfo ()
118                 : authenticated_public ("#ID_AuthenticatedPublic")
119                 , authenticated_private ("#ID_AuthenticatedPrivate")
120         {}
121
122         SignedInfo (shared_ptr<const cxml::Node> node)
123         {
124                 list<shared_ptr<cxml::Node> > references = node->node_children ("Reference");
125                 for (list<shared_ptr<cxml::Node> >::const_iterator i = references.begin(); i != references.end(); ++i) {
126                         if ((*i)->string_attribute ("URI") == "#ID_AuthenticatedPublic") {
127                                 authenticated_public = Reference (*i);
128                         } else if ((*i)->string_attribute ("URI") == "#ID_AuthenticatedPrivate") {
129                                 authenticated_private = Reference (*i);
130                         }
131
132                         /* XXX: do something if we don't recognise the node */
133                 }
134         }
135
136         void as_xml (xmlpp::Element* node) const
137         {
138                 node->add_child ("CanonicalizationMethod", "ds")->set_attribute (
139                         "Algorithm", "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"
140                         );
141
142                 node->add_child ("SignatureMethod", "ds")->set_attribute (
143                         "Algorithm", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
144                         );
145
146                 authenticated_public.as_xml (node->add_child ("Reference", "ds"));
147                 authenticated_private.as_xml (node->add_child ("Reference", "ds"));
148         }
149
150 private:
151         Reference authenticated_public;
152         Reference authenticated_private;
153 };
154
155 class Signature
156 {
157 public:
158         Signature () {}
159
160         Signature (shared_ptr<const cxml::Node> node)
161                 : signed_info (node->node_child ("SignedInfo"))
162                 , signature_value (node->string_child ("SignatureValue"))
163         {
164                 list<shared_ptr<cxml::Node> > x509_data_nodes = node->node_child("KeyInfo")->node_children ("X509Data");
165                 for (list<shared_ptr<cxml::Node> >::const_iterator i = x509_data_nodes.begin(); i != x509_data_nodes.end(); ++i) {
166                         x509_data.push_back (X509Data (*i));
167                 }
168         }
169
170         void as_xml (xmlpp::Node* node) const
171         {
172                 signed_info.as_xml (node->add_child ("SignedInfo", "ds"));
173                 node->add_child("SignatureValue", "ds")->add_child_text (signature_value);
174
175                 xmlpp::Element* key_info_node = node->add_child ("KeyInfo", "ds");
176                 for (std::list<X509Data>::const_iterator i = x509_data.begin(); i != x509_data.end(); ++i) {
177                         i->as_xml (key_info_node->add_child ("X509Data", "ds"));
178                 }
179         }
180
181         SignedInfo signed_info;
182         string signature_value;
183         list<X509Data> x509_data;
184 };
185
186 class AuthenticatedPrivate
187 {
188 public:
189         AuthenticatedPrivate () {}
190
191         AuthenticatedPrivate (shared_ptr<const cxml::Node> node)
192         {
193                 list<shared_ptr<cxml::Node> > encrypted_key_nodes = node->node_children ("EncryptedKey");
194                 for (list<shared_ptr<cxml::Node> >::const_iterator i = encrypted_key_nodes.begin(); i != encrypted_key_nodes.end(); ++i) {
195                         encrypted_key.push_back ((*i)->node_child("CipherData")->string_child ("CipherValue"));
196                 }
197         }
198
199         void as_xml (xmlpp::Element* node, map<string, xmlpp::Attribute *>& references) const
200         {
201                 references["ID_AuthenticatedPrivate"] = node->set_attribute ("Id", "ID_AuthenticatedPrivate");
202
203                 for (list<string>::const_iterator i = encrypted_key.begin(); i != encrypted_key.end(); ++i) {
204                         xmlpp::Element* encrypted_key = node->add_child ("EncryptedKey", "enc");
205                         /* XXX: hack for testing with Dolby */
206                         encrypted_key->set_namespace_declaration ("http://www.w3.org/2001/04/xmlenc#", "enc");
207                         xmlpp::Element* encryption_method = encrypted_key->add_child ("EncryptionMethod", "enc");
208                         encryption_method->set_attribute ("Algorithm", "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p");
209                         xmlpp::Element* digest_method = encryption_method->add_child ("DigestMethod", "ds");
210                         /* XXX: hack for testing with Dolby */
211                         digest_method->set_namespace_declaration ("http://www.w3.org/2000/09/xmldsig#", "ds");
212                         digest_method->set_attribute ("Algorithm", "http://www.w3.org/2000/09/xmldsig#sha1");
213                         xmlpp::Element* cipher_data = encrypted_key->add_child ("CipherData", "enc");
214                         cipher_data->add_child("CipherValue", "enc")->add_child_text (*i);
215                 }
216         }
217
218         list<string> encrypted_key;
219 };
220
221 class TypedKeyId
222 {
223 public:
224         TypedKeyId () {}
225
226         TypedKeyId (shared_ptr<const cxml::Node> node)
227                 : key_type (node->string_child ("KeyType"))
228                 , key_id (remove_urn_uuid (node->string_child ("KeyId")))
229         {
230
231         }
232
233         TypedKeyId (string type, string id)
234                 : key_type (type)
235                 , key_id (id)
236         {}
237
238         void as_xml (xmlpp::Element* node) const
239         {
240                 xmlpp::Element* type = node->add_child("KeyType");
241                 type->add_child_text (key_type);
242                 node->add_child("KeyId")->add_child_text ("urn:uuid:" + key_id);
243                 /* XXX: this feels like a bit of a hack */
244                 if (key_type == "MDEK") {
245                         type->set_attribute ("scope", "http://www.dolby.com/cp850/2012/KDM#kdm-key-type");
246                 }
247         }
248
249         string key_type;
250         string key_id;
251 };
252
253 class KeyIdList
254 {
255 public:
256         KeyIdList () {}
257
258         KeyIdList (shared_ptr<const cxml::Node> node)
259         {
260                 list<shared_ptr<cxml::Node> > typed_key_id_nodes = node->node_children ("TypedKeyId");
261                 for (list<shared_ptr<cxml::Node> >::const_iterator i = typed_key_id_nodes.begin(); i != typed_key_id_nodes.end(); ++i) {
262                         typed_key_id.push_back (TypedKeyId (*i));
263                 }
264         }
265
266         void as_xml (xmlpp::Element* node) const
267         {
268                 for (list<TypedKeyId>::const_iterator i = typed_key_id.begin(); i != typed_key_id.end(); ++i) {
269                         i->as_xml (node->add_child("TypedKeyId"));
270                 }
271         }
272
273         list<TypedKeyId> typed_key_id;
274 };
275
276 class AuthorizedDeviceInfo
277 {
278 public:
279         AuthorizedDeviceInfo () {}
280
281         AuthorizedDeviceInfo (shared_ptr<const cxml::Node> node)
282                 : device_list_identifier (remove_urn_uuid (node->string_child ("DeviceListIdentifier")))
283                 , device_list_description (node->optional_string_child ("DeviceListDescription"))
284         {
285                 BOOST_FOREACH (cxml::ConstNodePtr i, node->node_child("DeviceList")->node_children("CertificateThumbprint")) {
286                         certificate_thumbprints.push_back (i->content ());
287                 }
288         }
289
290         void as_xml (xmlpp::Element* node) const
291         {
292                 node->add_child ("DeviceListIdentifier")->add_child_text ("urn:uuid:" + device_list_identifier);
293                 if (device_list_description) {
294                         node->add_child ("DeviceListDescription")->add_child_text (device_list_description.get());
295                 }
296                 xmlpp::Element* device_list = node->add_child ("DeviceList");
297                 BOOST_FOREACH (string i, certificate_thumbprints) {
298                         device_list->add_child("CertificateThumbprint")->add_child_text (i);
299                 }
300         }
301
302         /** DeviceListIdentifier without the urn:uuid: prefix */
303         string device_list_identifier;
304         boost::optional<string> device_list_description;
305         std::list<string> certificate_thumbprints;
306 };
307
308 class X509IssuerSerial
309 {
310 public:
311         X509IssuerSerial () {}
312
313         X509IssuerSerial (shared_ptr<const cxml::Node> node)
314                 : x509_issuer_name (node->string_child ("X509IssuerName"))
315                 , x509_serial_number (node->string_child ("X509SerialNumber"))
316         {
317
318         }
319
320         void as_xml (xmlpp::Element* node) const
321         {
322                 node->add_child("X509IssuerName", "ds")->add_child_text (x509_issuer_name);
323                 node->add_child("X509SerialNumber", "ds")->add_child_text (x509_serial_number);
324         }
325
326         string x509_issuer_name;
327         string x509_serial_number;
328 };
329
330 class Recipient
331 {
332 public:
333         Recipient () {}
334
335         Recipient (shared_ptr<const cxml::Node> node)
336                 : x509_issuer_serial (node->node_child ("X509IssuerSerial"))
337                 , x509_subject_name (node->string_child ("X509SubjectName"))
338         {
339
340         }
341
342         void as_xml (xmlpp::Element* node) const
343         {
344                 x509_issuer_serial.as_xml (node->add_child ("X509IssuerSerial"));
345                 node->add_child("X509SubjectName")->add_child_text (x509_subject_name);
346         }
347
348         X509IssuerSerial x509_issuer_serial;
349         string x509_subject_name;
350 };
351
352 class KDMRequiredExtensions
353 {
354 public:
355         KDMRequiredExtensions () {}
356
357         KDMRequiredExtensions (shared_ptr<const cxml::Node> node)
358                 : recipient (node->node_child ("Recipient"))
359                 , composition_playlist_id (remove_urn_uuid (node->string_child ("CompositionPlaylistId")))
360                 , content_title_text (node->string_child ("ContentTitleText"))
361                 , not_valid_before (node->string_child ("ContentKeysNotValidBefore"))
362                 , not_valid_after (node->string_child ("ContentKeysNotValidAfter"))
363                 , authorized_device_info (node->node_child ("AuthorizedDeviceInfo"))
364                 , key_id_list (node->node_child ("KeyIdList"))
365         {
366
367         }
368
369         void as_xml (xmlpp::Element* node) const
370         {
371                 node->set_attribute ("xmlns", "http://www.smpte-ra.org/schemas/430-1/2006/KDM");
372
373                 recipient.as_xml (node->add_child ("Recipient"));
374                 node->add_child("CompositionPlaylistId")->add_child_text ("urn:uuid:" + composition_playlist_id);
375                 node->add_child("ContentTitleText")->add_child_text (content_title_text);
376                 if (content_authenticator) {
377                         node->add_child("ContentAuthenticator")->add_child_text (content_authenticator.get ());
378                 }
379                 node->add_child("ContentKeysNotValidBefore")->add_child_text (not_valid_before.as_string ());
380                 node->add_child("ContentKeysNotValidAfter")->add_child_text (not_valid_after.as_string ());
381                 authorized_device_info.as_xml (node->add_child ("AuthorizedDeviceInfo"));
382                 key_id_list.as_xml (node->add_child ("KeyIdList"));
383
384                 xmlpp::Element* forensic_mark_flag_list = node->add_child ("ForensicMarkFlagList");
385                 forensic_mark_flag_list->add_child("ForensicMarkFlag")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-picture-disable");
386                 forensic_mark_flag_list->add_child("ForensicMarkFlag")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable");
387         }
388
389         Recipient recipient;
390         string composition_playlist_id;
391         boost::optional<string> content_authenticator;
392         string content_title_text;
393         LocalTime not_valid_before;
394         LocalTime not_valid_after;
395         AuthorizedDeviceInfo authorized_device_info;
396         KeyIdList key_id_list;
397 };
398
399 class RequiredExtensions
400 {
401 public:
402         RequiredExtensions () {}
403
404         RequiredExtensions (shared_ptr<const cxml::Node> node)
405                 : kdm_required_extensions (node->node_child ("KDMRequiredExtensions"))
406         {
407
408         }
409
410         void as_xml (xmlpp::Element* node) const
411         {
412                 kdm_required_extensions.as_xml (node->add_child ("KDMRequiredExtensions"));
413         }
414
415         KDMRequiredExtensions kdm_required_extensions;
416 };
417
418 class AuthenticatedPublic
419 {
420 public:
421         AuthenticatedPublic ()
422                 : message_id (make_uuid ())
423                   /* XXX: hack for Dolby to see if there must be a not-empty annotation text */
424                 , annotation_text ("none")
425                 , issue_date (LocalTime().as_string ())
426         {}
427
428         AuthenticatedPublic (shared_ptr<const cxml::Node> node)
429                 : message_id (remove_urn_uuid (node->string_child ("MessageId")))
430                 , annotation_text (node->string_child ("AnnotationText"))
431                 , issue_date (node->string_child ("IssueDate"))
432                 , signer (node->node_child ("Signer"))
433                 , required_extensions (node->node_child ("RequiredExtensions"))
434         {
435
436         }
437
438         void as_xml (xmlpp::Element* node, map<string, xmlpp::Attribute *>& references) const
439         {
440                 references["ID_AuthenticatedPublic"] = node->set_attribute ("Id", "ID_AuthenticatedPublic");
441
442                 node->add_child("MessageId")->add_child_text ("urn:uuid:" + message_id);
443                 node->add_child("MessageType")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#kdm-key-type");
444                 node->add_child("AnnotationText")->add_child_text (annotation_text);
445                 node->add_child("IssueDate")->add_child_text (issue_date);
446
447                 signer.as_xml (node->add_child ("Signer"));
448                 required_extensions.as_xml (node->add_child ("RequiredExtensions"));
449
450                 node->add_child ("NonCriticalExtensions");
451         }
452
453         string message_id;
454         string annotation_text;
455         string issue_date;
456         Signer signer;
457         RequiredExtensions required_extensions;
458 };
459
460 /** Class to describe our data.  We use a class hierarchy as it's a bit nicer
461  *  for XML data than a flat description.
462  */
463 class EncryptedKDMData
464 {
465 public:
466         EncryptedKDMData ()
467         {
468
469         }
470
471         EncryptedKDMData (shared_ptr<const cxml::Node> node)
472                 : authenticated_public (node->node_child ("AuthenticatedPublic"))
473                 , authenticated_private (node->node_child ("AuthenticatedPrivate"))
474                 , signature (node->node_child ("Signature"))
475         {
476
477         }
478
479         shared_ptr<xmlpp::Document> as_xml () const
480         {
481                 shared_ptr<xmlpp::Document> document (new xmlpp::Document ());
482                 xmlpp::Element* root = document->create_root_node ("DCinemaSecurityMessage", "http://www.smpte-ra.org/schemas/430-3/2006/ETM");
483                 root->set_namespace_declaration ("http://www.w3.org/2000/09/xmldsig#", "ds");
484                 root->set_namespace_declaration ("http://www.w3.org/2001/04/xmlenc#", "enc");
485                 map<string, xmlpp::Attribute *> references;
486                 authenticated_public.as_xml (root->add_child ("AuthenticatedPublic"), references);
487                 authenticated_private.as_xml (root->add_child ("AuthenticatedPrivate"), references);
488                 signature.as_xml (root->add_child ("Signature", "ds"));
489
490                 for (map<string, xmlpp::Attribute*>::const_iterator i = references.begin(); i != references.end(); ++i) {
491                         xmlAddID (0, document->cobj(), (const xmlChar *) i->first.c_str(), i->second->cobj ());
492                 }
493
494                 return document;
495         }
496
497         AuthenticatedPublic authenticated_public;
498         AuthenticatedPrivate authenticated_private;
499         Signature signature;
500 };
501
502 }
503 }
504
505 EncryptedKDM::EncryptedKDM (string s)
506 {
507         shared_ptr<cxml::Document> doc (new cxml::Document ("DCinemaSecurityMessage"));
508         doc->read_string (s);
509         _data = new data::EncryptedKDMData (doc);
510 }
511
512 EncryptedKDM::EncryptedKDM (
513         shared_ptr<const CertificateChain> signer,
514         Certificate recipient,
515         vector<Certificate> trusted_devices,
516         string device_list_description,
517         string cpl_id,
518         string content_title_text,
519         LocalTime not_valid_before,
520         LocalTime not_valid_after,
521         Formulation formulation,
522         list<pair<string, string> > key_ids,
523         list<string> keys
524         )
525         : _data (new data::EncryptedKDMData)
526 {
527         /* Fill our XML-ish description in with the juicy bits that the caller has given */
528
529         data::AuthenticatedPublic& aup = _data->authenticated_public;
530         aup.signer.x509_issuer_name = signer->leaf().issuer ();
531         aup.signer.x509_serial_number = signer->leaf().serial ();
532
533         data::KDMRequiredExtensions& kre = _data->authenticated_public.required_extensions.kdm_required_extensions;
534         kre.recipient.x509_issuer_serial.x509_issuer_name = recipient.issuer ();
535         kre.recipient.x509_issuer_serial.x509_serial_number = recipient.serial ();
536         kre.recipient.x509_subject_name = recipient.subject ();
537         kre.authorized_device_info.device_list_description = device_list_description;
538         kre.composition_playlist_id = cpl_id;
539         if (formulation == DCI_ANY || formulation == DCI_SPECIFIC) {
540                 kre.content_authenticator = signer->leaf().thumbprint ();
541         }
542         kre.content_title_text = content_title_text;
543         kre.not_valid_before = not_valid_before;
544         kre.not_valid_after = not_valid_after;
545         kre.authorized_device_info.device_list_identifier = make_uuid ();
546         string n = recipient.subject_common_name ();
547         if (n.find (".") != string::npos) {
548                 n = n.substr (n.find (".") + 1);
549         }
550         kre.authorized_device_info.device_list_description = n;
551
552         if (formulation == MODIFIED_TRANSITIONAL_1 || formulation == DCI_ANY) {
553                 /* Use the "assume trust" thumbprint */
554                 kre.authorized_device_info.certificate_thumbprints.push_back ("2jmj7l5rSw0yVb/vlWAYkK/YBwk=");
555         } else if (formulation == DCI_SPECIFIC) {
556                 /* As I read the standard we should use the recipient
557                    /and/ other trusted device thumbprints here.  MJD
558                    reports that this doesn't work with his setup;
559                    a working KDM does not include the recipient's
560                    thumbprint (recipient.thumbprint()).
561                 */
562                 BOOST_FOREACH (Certificate const & i, trusted_devices) {
563                         kre.authorized_device_info.certificate_thumbprints.push_back (i.thumbprint ());
564                 }
565         }
566
567         for (list<pair<string, string> >::const_iterator i = key_ids.begin(); i != key_ids.end(); ++i) {
568                 kre.key_id_list.typed_key_id.push_back (data::TypedKeyId (i->first, i->second));
569         }
570
571         _data->authenticated_private.encrypted_key = keys;
572
573         /* Read the XML so far and sign it */
574         shared_ptr<xmlpp::Document> doc = _data->as_xml ();
575         xmlpp::Node::NodeList children = doc->get_root_node()->get_children ();
576         for (xmlpp::Node::NodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
577                 if ((*i)->get_name() == "Signature") {
578                         signer->add_signature_value (*i, "ds");
579                 }
580         }
581
582         /* Read the bits that add_signature_value did back into our variables */
583         shared_ptr<cxml::Node> signed_doc (new cxml::Node (doc->get_root_node ()));
584         _data->signature = data::Signature (signed_doc->node_child ("Signature"));
585 }
586
587 EncryptedKDM::EncryptedKDM (EncryptedKDM const & other)
588         : _data (new data::EncryptedKDMData (*other._data))
589 {
590
591 }
592
593 EncryptedKDM &
594 EncryptedKDM::operator= (EncryptedKDM const & other)
595 {
596         if (this == &other) {
597                 return *this;
598         }
599
600         delete _data;
601         _data = new data::EncryptedKDMData (*other._data);
602         return *this;
603 }
604
605 EncryptedKDM::~EncryptedKDM ()
606 {
607         delete _data;
608 }
609
610 void
611 EncryptedKDM::as_xml (boost::filesystem::path path) const
612 {
613         FILE* f = fopen_boost (path, "w");
614         string const x = as_xml ();
615         fwrite (x.c_str(), 1, x.length(), f);
616         fclose (f);
617 }
618
619 string
620 EncryptedKDM::as_xml () const
621 {
622         return _data->as_xml()->write_to_string ("UTF-8");
623 }
624
625 list<string>
626 EncryptedKDM::keys () const
627 {
628         return _data->authenticated_private.encrypted_key;
629 }
630
631 string
632 EncryptedKDM::annotation_text () const
633 {
634         return _data->authenticated_public.annotation_text;
635 }
636
637 string
638 EncryptedKDM::content_title_text () const
639 {
640         return _data->authenticated_public.required_extensions.kdm_required_extensions.content_title_text;
641 }
642
643 string
644 EncryptedKDM::cpl_id () const
645 {
646         return _data->authenticated_public.required_extensions.kdm_required_extensions.composition_playlist_id;
647 }
648
649 string
650 EncryptedKDM::issue_date () const
651 {
652         return _data->authenticated_public.issue_date;
653 }
654
655 bool
656 dcp::operator== (EncryptedKDM const & a, EncryptedKDM const & b)
657 {
658         /* Not exactly efficient... */
659         return a.as_xml() == b.as_xml();
660 }