You should have received a copy of the GNU General Public License
along with libdcp. If not, see <http://www.gnu.org/licenses/>.
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of portions of this program with the
+ OpenSSL library under certain conditions as described in each
+ individual source file, and distribute linked combinations
+ including the two.
+
+ You must obey the GNU General Public License in all respects
+ for all of the code used other than OpenSSL. If you modify
+ file(s) with this exception, you may extend this exception to your
+ version of the file(s), but you are not obligated to do so. If you
+ do not wish to do so, delete this exception statement from your
+ version. If you delete this exception statement from all source
+ files in the program, then also delete it here.
*/
#include "encrypted_kdm.h"
public:
Signer () {}
- Signer (shared_ptr<const cxml::Node> node)
+ explicit Signer (shared_ptr<const cxml::Node> node)
: x509_issuer_name (node->string_child ("X509IssuerName"))
, x509_serial_number (node->string_child ("X509SerialNumber"))
{
public:
X509Data () {}
- X509Data (boost::shared_ptr<const cxml::Node> node)
+ explicit X509Data (boost::shared_ptr<const cxml::Node> node)
: x509_issuer_serial (Signer (node->node_child ("X509IssuerSerial")))
, x509_certificate (node->string_child ("X509Certificate"))
{
public:
Reference () {}
- Reference (string u)
+ explicit Reference (string u)
: uri (u)
{}
- Reference (shared_ptr<const cxml::Node> node)
+ explicit Reference (shared_ptr<const cxml::Node> node)
: uri (node->string_attribute ("URI"))
, digest_value (node->string_child ("DigestValue"))
{
, authenticated_private ("#ID_AuthenticatedPrivate")
{}
- SignedInfo (shared_ptr<const cxml::Node> node)
+ explicit SignedInfo (shared_ptr<const cxml::Node> node)
{
list<shared_ptr<cxml::Node> > references = node->node_children ("Reference");
for (list<shared_ptr<cxml::Node> >::const_iterator i = references.begin(); i != references.end(); ++i) {
public:
Signature () {}
- Signature (shared_ptr<const cxml::Node> node)
+ explicit Signature (shared_ptr<const cxml::Node> node)
: signed_info (node->node_child ("SignedInfo"))
, signature_value (node->string_child ("SignatureValue"))
{
public:
AuthenticatedPrivate () {}
- AuthenticatedPrivate (shared_ptr<const cxml::Node> node)
+ explicit AuthenticatedPrivate (shared_ptr<const cxml::Node> node)
{
list<shared_ptr<cxml::Node> > encrypted_key_nodes = node->node_children ("EncryptedKey");
for (list<shared_ptr<cxml::Node> >::const_iterator i = encrypted_key_nodes.begin(); i != encrypted_key_nodes.end(); ++i) {
public:
TypedKeyId () {}
- TypedKeyId (shared_ptr<const cxml::Node> node)
+ explicit TypedKeyId (shared_ptr<const cxml::Node> node)
: key_type (node->string_child ("KeyType"))
, key_id (remove_urn_uuid (node->string_child ("KeyId")))
{
public:
KeyIdList () {}
- KeyIdList (shared_ptr<const cxml::Node> node)
+ explicit KeyIdList (shared_ptr<const cxml::Node> node)
{
list<shared_ptr<cxml::Node> > typed_key_id_nodes = node->node_children ("TypedKeyId");
for (list<shared_ptr<cxml::Node> >::const_iterator i = typed_key_id_nodes.begin(); i != typed_key_id_nodes.end(); ++i) {
public:
AuthorizedDeviceInfo () {}
- AuthorizedDeviceInfo (shared_ptr<const cxml::Node> node)
+ explicit AuthorizedDeviceInfo (shared_ptr<const cxml::Node> node)
: device_list_identifier (remove_urn_uuid (node->string_child ("DeviceListIdentifier")))
, device_list_description (node->optional_string_child ("DeviceListDescription"))
{
public:
X509IssuerSerial () {}
- X509IssuerSerial (shared_ptr<const cxml::Node> node)
+ explicit X509IssuerSerial (shared_ptr<const cxml::Node> node)
: x509_issuer_name (node->string_child ("X509IssuerName"))
, x509_serial_number (node->string_child ("X509SerialNumber"))
{
public:
Recipient () {}
- Recipient (shared_ptr<const cxml::Node> node)
+ explicit Recipient (shared_ptr<const cxml::Node> node)
: x509_issuer_serial (node->node_child ("X509IssuerSerial"))
, x509_subject_name (node->string_child ("X509SubjectName"))
{
public:
KDMRequiredExtensions () {}
- KDMRequiredExtensions (shared_ptr<const cxml::Node> node)
+ explicit KDMRequiredExtensions (shared_ptr<const cxml::Node> node)
: recipient (node->node_child ("Recipient"))
, composition_playlist_id (remove_urn_uuid (node->string_child ("CompositionPlaylistId")))
, content_title_text (node->string_child ("ContentTitleText"))
public:
RequiredExtensions () {}
- RequiredExtensions (shared_ptr<const cxml::Node> node)
+ explicit RequiredExtensions (shared_ptr<const cxml::Node> node)
: kdm_required_extensions (node->node_child ("KDMRequiredExtensions"))
{
, issue_date (LocalTime().as_string ())
{}
- AuthenticatedPublic (shared_ptr<const cxml::Node> node)
+ explicit AuthenticatedPublic (shared_ptr<const cxml::Node> node)
: message_id (remove_urn_uuid (node->string_child ("MessageId")))
, annotation_text (node->optional_string_child ("AnnotationText"))
, issue_date (node->string_child ("IssueDate"))
}
- EncryptedKDMData (shared_ptr<const cxml::Node> node)
+ explicit EncryptedKDMData (shared_ptr<const cxml::Node> node)
: authenticated_public (node->node_child ("AuthenticatedPublic"))
, authenticated_private (node->node_child ("AuthenticatedPrivate"))
, signature (node->node_child ("Signature"))
reports that this doesn't work with his setup;
a working KDM does not include the recipient's
thumbprint (recipient.thumbprint()).
+ Waimea uses only the trusted devices here, too.
*/
BOOST_FOREACH (Certificate const & i, trusted_devices) {
kre.authorized_device_info.certificate_thumbprints.push_back (i.thumbprint ());
return _data->authenticated_public.issue_date;
}
+LocalTime
+EncryptedKDM::not_valid_before () const
+{
+ return _data->authenticated_public.required_extensions.kdm_required_extensions.not_valid_before;
+}
+
+LocalTime
+EncryptedKDM::not_valid_after () const
+{
+ return _data->authenticated_public.required_extensions.kdm_required_extensions.not_valid_after;
+}
+
bool
dcp::operator== (EncryptedKDM const & a, EncryptedKDM const & b)
{