Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Typedefs | Functions
WSB_MediaAesDecrypter Class

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...
 

Detailed Description

The media AES decrypter.

Typedef Documentation

◆ WSB_MediaAesDecrypter

Function Documentation

◆ WSB_MediaAesDecrypter_Create()

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.

Parameters
configPointer to the configuration parameters for the media AES decrypter.
decrypterAddress of a WSB_MediaAesDecrypter pointer that is set to refer to the newly created WSB_MediaAesDecrypter object.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaAesDecrypter_Decrypt()

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).

Parameters
decrypterPointer to the media AES decrypter object.
in_paramsPointer to the structure contains corresponding decryption scheme parameters.
in_dataPointer to the encrypted input data.
in_data_sizeSize of the encrypted input data in bytes.
sec_bufPointer 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_sizeThe size of the secure buffer pointed to by *sec_buf.
Returns
WSB_SUCCESS on success, WSB_ERROR_NOT_ENOUGH_SPACE if the caller allocated secure buffer is not large enough to accomodate the decrypted output, other negative error codes on other failures.

◆ WSB_MediaAesDecrypter_Destroy()

WSB_EXPORT WSB_Result WSB_MediaAesDecrypter_Destroy ( WSB_MediaAesDecrypter decrypter)

Destroy the media AES decrypter object created earlier through WSB_MediaAesDecrypter_Create.

Parameters
decrypterPointer to the object being destroyed.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaAesDecrypter_Update()

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.

Parameters
decrypterPointer to the media AES decrypter object.
updatePointer to the structure contains update information.
Returns
WSB_SUCCESS on success, or a negative error code if it fails.