RDK Documentation (Open Sourced RDK Components)
AampClearKeyHelper Class Reference

Class handles the clear key license operations. More...

#include <AampClearKeyHelper.h>

Inheritance diagram for AampClearKeyHelper:
Inheritance graph
Collaboration diagram for AampClearKeyHelper:
Collaboration graph

Public Member Functions

const std::string & ocdmSystemId () const
 Returns the OCDM system ID of the helper. More...
 
void createInitData (std::vector< uint8_t > &initData) const
 
bool parsePssh (const uint8_t *initData, uint32_t initDataLen)
 Parse the optional PSSH data. More...
 
bool isClearDecrypt () const
 Determine if the DRM system needs to be in the clear or encrypted. More...
 
void getKey (std::vector< uint8_t > &keyID) const
 Get the key ID. More...
 
virtual int getDrmCodecType () const
 Returns the DRM codec type for the helper, used in trace. More...
 
void generateLicenseRequest (const AampChallengeInfo &challengeInfo, AampLicenseRequest &licenseRequest) const
 Generate the request details for the DRM license. More...
 
void transformLicenseResponse (std::shared_ptr< DrmData > licenseResponse) const
 Transform the license response from the server into the necessary format for OCDM. More...
 
virtual const std::string & friendlyName () const override
 Gets the friendly display name of the DRM. More...
 
 AampClearKeyHelper (const struct DrmInfo &drmInfo, AampLogManager *logObj)
 
- Public Member Functions inherited from AampDrmHelper
 AampDrmHelper (const struct DrmInfo drmInfo, AampLogManager *logObj)
 
 AampDrmHelper (const AampDrmHelper &)=delete
 
AampDrmHelperoperator= (const AampDrmHelper &)=delete
 
virtual bool isHdcp22Required () const
 Determine whether HDCP 2.2 protection is required to be active. More...
 
virtual const std::string & getDrmMetaData () const
 Returns the content specific DRM metadata. More...
 
virtual void setDrmMetaData (const std::string &metaData)
 Sets the content specific DRM metadata. More...
 
virtual void setDefaultKeyID (const std::string &cencData)
 Sets the defualt keyID. More...
 
virtual uint32_t licenseGenerateTimeout () const
 Get the amount of time in milliseconds to wait before aborting the wait for the license_challenge message to be received Default is TWO Seconds - 2000. More...
 
virtual uint32_t keyProcessTimeout () const
 Get the amount of time in milliseconds to wait before aborting the wait for the key_updated message to be received Default is TWO Seconds - 2000. More...
 
virtual void getKeys (std::map< int, std::vector< uint8_t >> &keyIDs) const
 Get the key IDs. More...
 
virtual const std::string & getUuid () const
 Get the UUID. More...
 
virtual bool isExternalLicense () const
 Determines if the DRM itself fetches the license or if AAMP should use its own internal HTTP client to fetch the license Returning 'true' removes AAMP calling generateLicenseRequest() on the CDM Default is to return false. More...
 
virtual AAMPMemorySystemgetMemorySystem ()
 Get the memory system used to transform data for transmission. More...
 
virtual bool compare (std::shared_ptr< AampDrmHelper > other)
 Compare against another helper instance. More...
 
virtual void cancelDrmSession ()
 Cancels a DRM session.
 
virtual bool canCancelDrmSession ()
 Checks if the helper can cancel a session, or if the caller should do it. More...
 
void setOutputProtectionFlag (bool bValue)
 Set Output protection flag for the drmHelper. More...
 

Private Attributes

const std::string CLEARKEY_KEY_ID
 
const std::string FRIENDLY_NAME
 
const int CODEC_TYPE
 
const size_t CLEARKEY_DASH_KEY_ID_OFFSET
 
const size_t CLEARKEY_DASH_KEY_ID_LEN
 
const int KEY_ID_OFFSET
 
const int KEY_PAYLOAD_OFFSET
 
const int BASE_16
 
std::string mPsshStr
 
std::vector< uint8_t > mInitData
 
std::vector< uint8_t > mKeyID
 

Static Private Attributes

static const std::string CLEARKEY_OCDM_ID = "org.w3.clearkey"
 

Additional Inherited Members

- Data Fields inherited from AampDrmHelper
const uint32_t TIMEOUT_SECONDS
 
const std::string EMPTY_DRM_METADATA
 
const std::string EMPTY_STRING
 
AampLogManagermLogObj
 
- Protected Attributes inherited from AampDrmHelper
const DrmInfo mDrmInfo
 
bool bOutputProtectionEnabled
 

yes

Class handles the clear key license operations.

Definition at line 35 of file AampClearKeyHelper.h.

Member Function Documentation

◆ ocdmSystemId()

const std::string & AampClearKeyHelper::ocdmSystemId ( ) const
virtual

Returns the OCDM system ID of the helper.

Returns
the OCDM system ID

Implements AampDrmHelper.

Definition at line 36 of file AampClearKeyHelper.cpp.

◆ createInitData()

void AampClearKeyHelper::createInitData ( std::vector< uint8_t > &  initData) const
virtual
Parameters
initDatathe Init Data to send to the CDM

Implements AampDrmHelper.

Definition at line 41 of file AampClearKeyHelper.cpp.

◆ parsePssh()

bool AampClearKeyHelper::parsePssh ( const uint8_t *  initData,
uint32_t  initDataLen 
)
virtual

Parse the optional PSSH data.

Parameters
initDataThe init data from the PSSH
initDataLenthe length of initData
Returns

Implements AampDrmHelper.

Definition at line 61 of file AampClearKeyHelper.cpp.

◆ isClearDecrypt()

bool AampClearKeyHelper::isClearDecrypt ( ) const
inlinevirtual

Determine if the DRM system needs to be in the clear or encrypted.

Returns
true if the data is clear, false if it should remain in the TEE

Implements AampDrmHelper.

Definition at line 44 of file AampClearKeyHelper.h.

◆ getKey()

void AampClearKeyHelper::getKey ( std::vector< uint8_t > &  keyID) const
virtual

Get the key ID.

Parameters
keyIDThe key ID as a vector of binary data

Implements AampDrmHelper.

Definition at line 70 of file AampClearKeyHelper.cpp.

◆ getDrmCodecType()

virtual int AampClearKeyHelper::getDrmCodecType ( ) const
inlinevirtual

Returns the DRM codec type for the helper, used in trace.

Returns
the DRM codec type

Reimplemented from AampDrmHelper.

Definition at line 48 of file AampClearKeyHelper.h.

◆ generateLicenseRequest()

void AampClearKeyHelper::generateLicenseRequest ( const AampChallengeInfo challengeInfo,
AampLicenseRequest licenseRequest 
) const
virtual

Generate the request details for the DRM license.

Parameters
challengeInfochallenge information from the DRM system necessary to construct the license request
licenseRequestlicense request data to populate

Implements AampDrmHelper.

Definition at line 85 of file AampClearKeyHelper.cpp.

◆ transformLicenseResponse()

void AampClearKeyHelper::transformLicenseResponse ( std::shared_ptr< DrmData licenseResponse) const
virtual

Transform the license response from the server into the necessary format for OCDM.

Parameters
licenseResponselicense response from the server to transform

Reimplemented from AampDrmHelper.

Definition at line 109 of file AampClearKeyHelper.cpp.

◆ friendlyName()

virtual const std::string& AampClearKeyHelper::friendlyName ( ) const
inlineoverridevirtual

Gets the friendly display name of the DRM.

Returns
friendly name

Reimplemented from AampDrmHelper.

Definition at line 54 of file AampClearKeyHelper.h.


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