DRM keys container.
More...
|
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...
|
|
DRM keys container.
Clears the WSB_KeyManager object, making it available to hold the keys for a different media file.
Creates an instance of a WSB_KeyManager object.
- Parameters
-
manager | Address of a WSB_KeyManager pointer that will be set to refer to the WSB_KeyManager object created. |
Creates an instance of a WSB_KeyManager object.
- Parameters
-
format_info | Information 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. |
manager | Address of a WSB_KeyManager pointer that will be set to refer to the WSB_KeyManager object created. |
Destroys the WSB_KeyManager object.
Gets the content key format info.
- Parameters
-
self | The WSB_KeyManager object. |
- Returns
- The WSB_ContentKeyFormatInfo structure.
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
-
self | The WSB_KeyManager object. |
key_name | The key name (see above). |
key_data | The 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_size | A 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.
Sets the key for the file.
Results are undefined if there is collision between track and file content ID.
- Parameters
-
self | The WSB_KeyManager object. |
file_content_id | The drm content identifier of the file. |
key_data | The key data. |
key_data_size | The key data size. |
- Returns
- WSB_ERROR_INVALID_PARAMETERS if any of the pointer parameters is NULL. WSB_SUCCESS otherwise.
Sets the key for a track.
Results are undefined if there is collision between track and file content ID.
- Parameters
-
self | The WSB_KeyManager object. |
track_id | The track identifier. |
track_content_id | The corresponding drm content identifier. |
key_data | The key data. |
key_data_size | The key data size. |
- Returns
- WSB_ERROR_INVALID_PARAMETERS if any of the pointer parameters is NULL. WSB_SUCCESS otherwise.