Shaka Packager SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Static Public Member Functions | List of all members
shaka::media::FixedKeySource Class Reference

A key source that uses fixed keys for encryption. More...

#include <fixed_key_source.h>

Inheritance diagram for shaka::media::FixedKeySource:
shaka::media::KeySource

Public Member Functions

KeySource implementation overrides.
Status FetchKeys (EmeInitDataType init_data_type, const std::vector< uint8_t > &init_data) override
 
Status GetKey (const std::string &stream_label, EncryptionKey *key) override
 
Status GetKey (const std::vector< uint8_t > &key_id, EncryptionKey *key) override
 
Status GetCryptoPeriodKey (uint32_t crypto_period_index, const std::string &stream_label, EncryptionKey *key) override
 

Static Public Member Functions

static std::unique_ptr
< FixedKeySource
Create (const std::vector< uint8_t > &key_id, const std::vector< uint8_t > &key, const std::vector< uint8_t > &pssh_boxes, const std::vector< uint8_t > &iv)
 

Detailed Description

A key source that uses fixed keys for encryption.

Definition at line 33 of file fixed_key_source.h.

Member Function Documentation

std::unique_ptr< FixedKeySource > shaka::media::FixedKeySource::Create ( const std::vector< uint8_t > &  key_id,
const std::vector< uint8_t > &  key,
const std::vector< uint8_t > &  pssh_boxes,
const std::vector< uint8_t > &  iv 
)
static

Creates a new FixedKeySource from the given data. Returns null if the strings are invalid.

Parameters
key_idis the key identifier. Must be 16 bytes.
keyis the encryption / decryption key. Must be 16 bytes.
pssh_boxesis the concatenated pssh boxes.
ivis the initialization vector. If not specified, a randomly generated IV with the default length will be used. Note: GetKey on the created key source will always return the same key for all track types.

Definition at line 78 of file fixed_key_source.cc.

Status shaka::media::FixedKeySource::FetchKeys ( EmeInitDataType  init_data_type,
const std::vector< uint8_t > &  init_data 
)
overridevirtual

Fetch keys based on the specified encrypted media init data.

Parameters
init_data_typespecifies the encrypted media init data type.
init_datacontains the init data.
Returns
OK on success, an error status otherwise.

Implements shaka::media::KeySource.

Definition at line 18 of file fixed_key_source.cc.

Status shaka::media::FixedKeySource::GetCryptoPeriodKey ( uint32_t  crypto_period_index,
const std::string &  stream_label,
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.
stream_labelis the label of stream 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 46 of file fixed_key_source.cc.

Status shaka::media::FixedKeySource::GetKey ( const std::string &  stream_label,
EncryptionKey key 
)
overridevirtual

Get encryption key of the specified stream label.

Parameters
stream_labelis the label of stream 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 24 of file fixed_key_source.cc.

Status shaka::media::FixedKeySource::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 32 of file fixed_key_source.cc.


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