Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Functions
WSB_KeyManager Class

DRM keys container. More...

Functions

WSB_EXPORT WSB_Result WSB_KeyManager_Create (WSB_KeyManager **manager)
 Creates an instance of a WSB_KeyManager object. More...
 
WSB_EXPORT WSB_Result WSB_KeyManager_CreateEx (WSB_ContentKeyFormatInfo format_info, WSB_KeyManager **manager)
 Creates an instance of a WSB_KeyManager object. More...
 
WSB_EXPORT WSB_ContentKeyFormatInfo WSB_KeyManager_GetContentKeyFormatInfo (WSB_KeyManager *self)
 Gets the content key format info. More...
 
WSB_EXPORT WSB_Result WSB_KeyManager_SetTrackKey (WSB_KeyManager *self, WSB_UInt32 track_id, const char *track_content_id, const WSB_Byte *key_data, WSB_Size key_data_size)
 Sets the key for a track. More...
 
WSB_EXPORT WSB_Result WSB_KeyManager_SetFileKey (WSB_KeyManager *self, const char *file_content_id, const WSB_Byte *key_data, WSB_Size key_data_size)
 Sets the key for the file. More...
 
WSB_EXPORT WSB_Result WSB_KeyManager_GetKeyByName (const WSB_KeyManager *self, const char *key_name, WSB_Byte *key_data, WSB_Size *key_data_size)
 Gets the key for a given key name. More...
 
WSB_EXPORT WSB_Result WSB_KeyManager_Clear (WSB_KeyManager *self)
 Clears the WSB_KeyManager object, making it available to hold the keys for a different media file. More...
 
WSB_EXPORT WSB_Result WSB_KeyManager_Destroy (WSB_KeyManager *self)
 Destroys the WSB_KeyManager object. More...
 

Detailed Description

DRM keys container.

Function Documentation

◆ WSB_KeyManager_Clear()

WSB_EXPORT WSB_Result WSB_KeyManager_Clear ( WSB_KeyManager self)

Clears the WSB_KeyManager object, making it available to hold the keys for a different media file.

◆ WSB_KeyManager_Create()

WSB_EXPORT WSB_Result WSB_KeyManager_Create ( WSB_KeyManager **  manager)

Creates an instance of a WSB_KeyManager object.

Parameters
managerAddress of a WSB_KeyManager pointer that will be set to refer to the WSB_KeyManager object created.

◆ WSB_KeyManager_CreateEx()

WSB_EXPORT WSB_Result WSB_KeyManager_CreateEx ( WSB_ContentKeyFormatInfo  format_info,
WSB_KeyManager **  manager 
)

Creates an instance of a WSB_KeyManager object.

Parameters
format_infoInformation on the format of the keys that will be stored in the manager. If the manager is created with WSB_KeyManager_Create, the format of the key is WSB_CONTENT_KEY_FORMAT_CLEARTEXT.
managerAddress of a WSB_KeyManager pointer that will be set to refer to the WSB_KeyManager object created.

◆ WSB_KeyManager_Destroy()

WSB_EXPORT WSB_Result WSB_KeyManager_Destroy ( WSB_KeyManager self)

Destroys the WSB_KeyManager object.

◆ WSB_KeyManager_GetContentKeyFormatInfo()

WSB_EXPORT WSB_ContentKeyFormatInfo WSB_KeyManager_GetContentKeyFormatInfo ( WSB_KeyManager self)

Gets the content key format info.

Parameters
selfThe WSB_KeyManager object.
Returns
The WSB_ContentKeyFormatInfo structure.

◆ WSB_KeyManager_GetKeyByName()

WSB_EXPORT WSB_Result WSB_KeyManager_GetKeyByName ( const WSB_KeyManager self,
const char *  key_name,
WSB_Byte key_data,
WSB_Size key_data_size 
)

Gets the key for a given key name.

The key name can be one of the following:

  • a DRM Content ID
  • "@track.{N}" if the content has a track-based protection scheme. {N} should be the track ID. Example: "@track.1"
  • "@file" if the content has a file-based protection scheme.

Key length can be queried by setting key_data to NULL. The function then returns key length in *key_data_size, and returns WSB_SUCCESS.

Parameters
selfThe WSB_KeyManager object.
key_nameThe key name (see above).
key_dataThe buffer, allocated by the client of the API, to which the key data should be written, or NULL if querying the key length (see above).
key_data_sizeA pointer to a WSB_Size variable indicating the available size in the key_data buffer. This parameter will be set to the actual key data size if the call is successful.
Returns
WSB_ERROR_INVALID_PARAMETERS if any of the pointer parameters is NULL (other than key_data when querying key length). WSB_ERROR_NO_SUCH_ITEM if no key is found for this key name. WSB_ERROR_NOT_ENOUGH_SPACE if there is not enough space in the key_data buffer to hold the actual key bytes. WSB_SUCCESS otherwise.

◆ WSB_KeyManager_SetFileKey()

WSB_EXPORT WSB_Result WSB_KeyManager_SetFileKey ( WSB_KeyManager self,
const char *  file_content_id,
const WSB_Byte key_data,
WSB_Size  key_data_size 
)

Sets the key for the file.

Results are undefined if there is collision between track and file content ID.

Parameters
selfThe WSB_KeyManager object.
file_content_idThe drm content identifier of the file.
key_dataThe key data.
key_data_sizeThe key data size.
Returns
WSB_ERROR_INVALID_PARAMETERS if any of the pointer parameters is NULL. WSB_SUCCESS otherwise.

◆ WSB_KeyManager_SetTrackKey()

WSB_EXPORT WSB_Result WSB_KeyManager_SetTrackKey ( WSB_KeyManager self,
WSB_UInt32  track_id,
const char *  track_content_id,
const WSB_Byte key_data,
WSB_Size  key_data_size 
)

Sets the key for a track.

Results are undefined if there is collision between track and file content ID.

Parameters
selfThe WSB_KeyManager object.
track_idThe track identifier.
track_content_idThe corresponding drm content identifier.
key_dataThe key data.
key_data_sizeThe key data size.
Returns
WSB_ERROR_INVALID_PARAMETERS if any of the pointer parameters is NULL. WSB_SUCCESS otherwise.