DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions | List of all members
shaka::media::PlayReadyKeySource Class Reference

A key source that uses playready for encryption. More...

#include <playready_key_source.h>

Inheritance diagram for shaka::media::PlayReadyKeySource:
shaka::media::KeySource

Public Member Functions

 PlayReadyKeySource (const std::string &server_url)
 
 PlayReadyKeySource (const std::string &server_url, const std::string &client_cert_file, const std::string &client_cert_private_key_file, const std::string &client_cert_private_key_password)
 
virtual Status FetchKeysWithProgramIdentifier (const std::string &program_identifier)
 
void SetCaFile (const std::string &ca_file)
 Sets the Certificate Authority file for validating self-signed certificates.
 
KeySource implementation overrides.
Status FetchKeys (const std::vector< uint8_t > &pssh_box) override
 
Status FetchKeys (const std::vector< std::vector< uint8_t >> &key_ids) override
 
Status FetchKeys (uint32_t asset_id) override
 
Status GetKey (TrackType track_type, EncryptionKey *key) override
 
Status GetKey (const std::vector< uint8_t > &key_id, EncryptionKey *key) override
 
Status GetCryptoPeriodKey (uint32_t crypto_period_index, TrackType track_type, EncryptionKey *key) override
 

Static Public Member Functions

static std::unique_ptr
< PlayReadyKeySource
CreateFromKeyAndKeyId (const std::string &key_id_hex, const std::string &key_hex)
 
- Static Public Member Functions inherited from shaka::media::KeySource
static TrackType GetTrackTypeFromString (const std::string &track_type_string)
 Convert string representation of track type to enum representation.
 
static std::string TrackTypeToString (TrackType track_type)
 Convert TrackType to string.
 

Additional Inherited Members

- Public Types inherited from shaka::media::KeySource
enum  TrackType {
  TRACK_TYPE_UNKNOWN = 0, TRACK_TYPE_SD = 1, TRACK_TYPE_HD = 2, TRACK_TYPE_UHD1 = 3,
  TRACK_TYPE_UHD2 = 4, TRACK_TYPE_AUDIO = 5, TRACK_TYPE_UNSPECIFIED = 6, NUM_VALID_TRACK_TYPES = 6
}
 

Detailed Description

A key source that uses playready for encryption.

Definition at line 24 of file playready_key_source.h.

Constructor & Destructor Documentation

shaka::media::PlayReadyKeySource::PlayReadyKeySource ( const std::string &  server_url)

Creates a new PlayReadyKeySource from the given packaging information.

Parameters
server_urlPlayReady packaging server url.

Definition at line 160 of file playready_key_source.cc.

shaka::media::PlayReadyKeySource::PlayReadyKeySource ( const std::string &  server_url,
const std::string &  client_cert_file,
const std::string &  client_cert_private_key_file,
const std::string &  client_cert_private_key_password 
)

Creates a new PlayReadyKeySource from the given packaging information.

Parameters
server_urlPlayReady packaging server url.
client_cert_fileabsolute path to a client certificate.
client_cert_private_key_fileabsolute path to the private file for the client certificate.
client_cert_private_key_passwordpassword for the private key.

Definition at line 166 of file playready_key_source.cc.

Member Function Documentation

std::unique_ptr< PlayReadyKeySource > shaka::media::PlayReadyKeySource::CreateFromKeyAndKeyId ( const std::string &  key_id_hex,
const std::string &  key_hex 
)
static

Creates a new PlayReadyKeySource from the hex string information. Returns null if the strings are invalid.

Parameters
key_id_hexis the key id in hex string.
key_hexis the key in hex string. Note: GetKey on the created key source will always return the same key for all track types.

Definition at line 184 of file playready_key_source.cc.

Status shaka::media::PlayReadyKeySource::FetchKeys ( const std::vector< uint8_t > &  pssh_box)
overridevirtual

Fetch keys for CENC from the key server.

Parameters
pssh_boxThe entire PSSH box for the content to be decrypted
Returns
OK on success, an error status otherwise.

Implements shaka::media::KeySource.

Definition at line 313 of file playready_key_source.cc.

Status shaka::media::PlayReadyKeySource::FetchKeys ( const std::vector< std::vector< uint8_t >> &  key_ids)
overridevirtual

Fetch keys for CENC from the key server.

Parameters
key_idsthe key IDs for the keys to fetch from the server.
Returns
OK on success, an error status otherwise.

Implements shaka::media::KeySource.

Definition at line 318 of file playready_key_source.cc.

Status shaka::media::PlayReadyKeySource::FetchKeys ( uint32_t  asset_id)
overridevirtual

Fetch keys for WVM decryption from the key server.

Parameters
asset_idis the Widevine Classic asset ID for the content to be decrypted.
Returns
OK on success, an error status otherwise.

Implements shaka::media::KeySource.

Definition at line 324 of file playready_key_source.cc.

Status shaka::media::PlayReadyKeySource::GetCryptoPeriodKey ( uint32_t  crypto_period_index,
TrackType  track_type,
EncryptionKey key 
)
overridevirtual

Get encryption key of the specified track type at the specified index.

Parameters
crypto_period_indexis the sequence number of the key rotation period for which the key is being retrieved.
track_typeis the type of track for which retrieving the key.
keyis a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL.
Returns
OK on success, an error status otherwise.

Implements shaka::media::KeySource.

Definition at line 349 of file playready_key_source.cc.

Status shaka::media::PlayReadyKeySource::GetKey ( TrackType  track_type,
EncryptionKey key 
)
overridevirtual

Get encryption key of the specified track type.

Parameters
track_typeis the type of track for which retrieving the key.
keyis a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL.
Returns
OK on success, an error status otherwise.

Implements shaka::media::KeySource.

Definition at line 329 of file playready_key_source.cc.

Status shaka::media::PlayReadyKeySource::GetKey ( const std::vector< uint8_t > &  key_id,
EncryptionKey key 
)
overridevirtual

Get the encryption key specified by the CENC key ID.

Parameters
key_idis the unique identifier for the key being retreived.
keyis a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL.
Returns
OK on success, or an error status otherwise.

Implements shaka::media::KeySource.

Definition at line 339 of file playready_key_source.cc.


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