libdcp
Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
dcp::DecryptedKDM Class Reference

A decrypted KDM. More...

#include <decrypted_kdm.h>

Public Member Functions

 DecryptedKDM (EncryptedKDM const &kdm, std::string private_key)
 
 DecryptedKDM (LocalTime not_valid_before, LocalTime not_valid_after, std::string annotation_text, std::string content_title_text, std::string issue_date)
 
 DecryptedKDM (std::string cpl_id, std::map< std::shared_ptr< const ReelFileAsset >, Key > keys, LocalTime not_valid_before, LocalTime not_valid_after, std::string annotation_text, std::string content_title_text, std::string issue_date)
 
 DecryptedKDM (std::shared_ptr< const CPL > cpl, Key key, LocalTime not_valid_before, LocalTime not_valid_after, std::string annotation_text, std::string content_title_text, std::string issue_date)
 
EncryptedKDM encrypt (std::shared_ptr< const CertificateChain > signer, Certificate recipient, std::vector< std::string > trusted_devices, Formulation formulation, bool disable_forensic_marking_picture, boost::optional< int > disable_forensic_marking_audio) const
 
void add_key (boost::optional< std::string > type, std::string key_id, Key key, std::string cpl_id, Standard standard)
 
void add_key (DecryptedKDMKey key)
 
std::vector< DecryptedKDMKeykeys () const
 
boost::optional< std::string > annotation_text () const
 
std::string content_title_text () const
 
std::string issue_date () const
 

Static Private Member Functions

static void put_uuid (uint8_t **d, std::string id)
 
static std::string get_uuid (unsigned char **p)
 

Private Attributes

LocalTime _not_valid_before
 
LocalTime _not_valid_after
 
boost::optional< std::string > _annotation_text
 
std::string _content_title_text
 
std::string _issue_date
 
std::vector< DecryptedKDMKey_keys
 

Friends

class ::decrypted_kdm_test
 

Detailed Description

A decrypted KDM.

This is a KDM that has either been decrypted by a target private key, or one which has been created (by some other means) ready for encryption later.

A DecryptedKDM object can be created either from an EncryptedKDM and private key file, or from the details of the assets that the KDM should protect.

Definition at line 75 of file decrypted_kdm.h.

Constructor & Destructor Documentation

◆ DecryptedKDM() [1/4]

DecryptedKDM::DecryptedKDM ( EncryptedKDM const &  kdm,
std::string  private_key 
)
Parameters
kdmEncrypted KDM.
private_keyPrivate key as a PEM-format string.

Definition at line 143 of file decrypted_kdm.cc.

◆ DecryptedKDM() [2/4]

DecryptedKDM::DecryptedKDM ( LocalTime  not_valid_before,
LocalTime  not_valid_after,
std::string  annotation_text,
std::string  content_title_text,
std::string  issue_date 
)

Create an empty DecryptedKDM. After creation you must call add_key() to add each key that you want in the KDM.

Parameters
not_valid_beforeStart time for the KDM.
not_valid_afterEnd time for the KDM.

Definition at line 235 of file decrypted_kdm.cc.

◆ DecryptedKDM() [3/4]

DecryptedKDM::DecryptedKDM ( std::string  cpl_id,
std::map< std::shared_ptr< const ReelFileAsset >, Key keys,
LocalTime  not_valid_before,
LocalTime  not_valid_after,
std::string  annotation_text,
std::string  content_title_text,
std::string  issue_date 
)

Construct a DecryptedKDM containing a given set of keys.

Parameters
keysKeys to be included in the DecryptedKDM.

Definition at line 252 of file decrypted_kdm.cc.

◆ DecryptedKDM() [4/4]

DecryptedKDM::DecryptedKDM ( std::shared_ptr< const CPL cpl,
Key  key,
LocalTime  not_valid_before,
LocalTime  not_valid_after,
std::string  annotation_text,
std::string  content_title_text,
std::string  issue_date 
)

Create a DecryptedKDM by taking a CPL and setting up to encrypt each of its assets with the same symmetric key.

Parameters
cplCPL that the keys are for.
keyKey that was used to encrypt the assets.
not_valid_beforeStart time for the KDM.
not_valid_afterEnd time for the KDM.

Definition at line 273 of file decrypted_kdm.cc.

Member Function Documentation

◆ add_key()

void dcp::DecryptedKDM::add_key ( boost::optional< std::string >  type,
std::string  key_id,
Key  key,
std::string  cpl_id,
Standard  standard 
)
Parameters
type(MDIK, MDAK etc.)
key_idKey ID
keyThe actual symmetric key
cpl_idID of CPL that the key is for

◆ encrypt()

EncryptedKDM DecryptedKDM::encrypt ( std::shared_ptr< const CertificateChain signer,
Certificate  recipient,
std::vector< std::string >  trusted_devices,
Formulation  formulation,
bool  disable_forensic_marking_picture,
boost::optional< int >  disable_forensic_marking_audio 
) const

Encrypt this KDM's keys and sign the whole KDM.

Parameters
signerChain to sign with.
recipientCertificate of the projector/server which should receive this KDM's keys.
trusted_devicesThumbprints of extra trusted devices which should be written to the KDM (recipient will be written as a trusted device automatically and does not need to be included in this list).
formulationFormulation to use for the encrypted KDM.
disable_forensic_marking_picturetrue to disable forensic marking of picture.
disable_forensic_marking_audioif not set, don't disable forensic marking of audio. If set to 0, disable all forensic marking; if set above 0, disable forensic marking above that channel.
Returns
Encrypted KDM.

Definition at line 318 of file decrypted_kdm.cc.

◆ keys()

std::vector<DecryptedKDMKey> dcp::DecryptedKDM::keys ( ) const
inline
Returns
This KDM's (decrypted) keys, which could be used to decrypt assets.

Definition at line 158 of file decrypted_kdm.h.


The documentation for this class was generated from the following files: