Wasabi ExpressPlay SDK for Embedded Systems
1.23.0
|
The media AES decrypter. More...
Typedefs | |
typedef struct WSB_MediaAesDecrypter | WSB_MediaAesDecrypter |
Functions | |
WSB_EXPORT WSB_Result | WSB_MediaAesDecrypter_Create (const WSB_MediaAesDecrypterConfig *config, WSB_MediaAesDecrypter **decrypter) |
Create the media AES decrypter. More... | |
WSB_EXPORT WSB_Result | WSB_MediaAesDecrypter_Decrypt (WSB_MediaAesDecrypter *decrypter, const WSB_MediaAesDecrypterParams *in_params, const WSB_Byte *in_data, WSB_UInt32 in_data_size, WSB_Byte **sec_buf, WSB_UInt32 *sec_buf_size) |
Decrypt input data into a secure buffer. More... | |
WSB_EXPORT WSB_Result | WSB_MediaAesDecrypter_Update (WSB_MediaAesDecrypter *decrypter, const WSB_MediaAesDecrypterUpdate *update) |
This function is only applicable for decrypter that is created with WSB_MADS_BBTS_CBC decryption_scheme. More... | |
WSB_EXPORT WSB_Result | WSB_MediaAesDecrypter_Destroy (WSB_MediaAesDecrypter *decrypter) |
Destroy the media AES decrypter object created earlier through WSB_MediaAesDecrypter_Create. More... | |
The media AES decrypter.
typedef struct WSB_MediaAesDecrypter WSB_MediaAesDecrypter |
WSB_EXPORT WSB_Result WSB_MediaAesDecrypter_Create | ( | const WSB_MediaAesDecrypterConfig * | config, |
WSB_MediaAesDecrypter ** | decrypter | ||
) |
Create the media AES decrypter.
If the decrypter is created with the decryption_scheme of WSB_MADS_BBTS_CBC, the application is responsible to detect content id changes where content id is described in section 2.2.4.2 of Marlin Broadband Transport Stream Specification (version 2.0.1). The application is expected to update the current decrypter object by calling WSB_MediaAesDecrypter_Update with the new content id and content key.
config | Pointer to the configuration parameters for the media AES decrypter. |
decrypter | Address of a WSB_MediaAesDecrypter pointer that is set to refer to the newly created WSB_MediaAesDecrypter object. |
WSB_EXPORT WSB_Result WSB_MediaAesDecrypter_Decrypt | ( | WSB_MediaAesDecrypter * | decrypter, |
const WSB_MediaAesDecrypterParams * | in_params, | ||
const WSB_Byte * | in_data, | ||
WSB_UInt32 | in_data_size, | ||
WSB_Byte ** | sec_buf, | ||
WSB_UInt32 * | sec_buf_size | ||
) |
Decrypt input data into a secure buffer.
Secure buffer is a memory buffer that cannot be accessed by the application CPU (REE - Rich Execution Environment).
There are a few invocation modes:
1) The caller allocates secure buffer. Pointer to the secure buffer is passed in as *sec_buf and the size of the secure buffer is passed in as *sec_buf_size.
2) The WSB_MediaAesDecrypter_Decrypt function allocates the secure buffer. The caller must pass in *sec_buf = NULL and *sec_buf_size = 0. The secure buffer and its size get assigned to *sec_buf and *sec_buffer_size respectively.
3) The caller queries the require size of the secure buffer for this operation. The caller must pass sec_buf = NULL and *sec_buf_size = 0
If the decrypter is created with the decryption_scheme of WSB_MADS_COMMON_ENC_CENC or WSB_MADS_COMMON_ENC_CBCS, the decrypter expects *in_data to contain one sample.
If the decrypter is created with the decryption_scheme of WSB_MADS_BBTS_CBC, the decrypter expects *in_data to contain one or multiple number of 188 bytes fixed size Transport Stream (TS) packets. Each TS packet must start with a sync byte. All the TS packets must corresponds to the same Key Stream Message (KSM).
decrypter | Pointer to the media AES decrypter object. |
in_params | Pointer to the structure contains corresponding decryption scheme parameters. |
in_data | Pointer to the encrypted input data. |
in_data_size | Size of the encrypted input data in bytes. |
sec_buf | Pointer to a secure buffer where the clear data is returned. Note that this buffer can be allocated either by the caller or by the WSB_MediaAesDecrypter_Decrypt function itself. |
sec_buf_size | The size of the secure buffer pointed to by *sec_buf. |
WSB_EXPORT WSB_Result WSB_MediaAesDecrypter_Destroy | ( | WSB_MediaAesDecrypter * | decrypter | ) |
Destroy the media AES decrypter object created earlier through WSB_MediaAesDecrypter_Create.
decrypter | Pointer to the object being destroyed. |
WSB_EXPORT WSB_Result WSB_MediaAesDecrypter_Update | ( | WSB_MediaAesDecrypter * | decrypter, |
const WSB_MediaAesDecrypterUpdate * | update | ||
) |
This function is only applicable for decrypter that is created with WSB_MADS_BBTS_CBC decryption_scheme.
Update the decrypter with content access information (e.g. content id, content key), and KSM. The method should be called: 1) before the first decryption or 2) when there is a change of content id or 3) when there is a change of KSM
Caller is responsible for decrypting all Transport Stream packets correspond to the current KSM, content id, content key before calling this method to update the decrypter with changes in KSM, content id, content key.
decrypter | Pointer to the media AES decrypter object. |
update | Pointer to the structure contains update information. |