Wasabi ExpressPlay SDK for Embedded Systems  1.10
Data Fields
TS2_CryptoInterface Struct Reference

Clients of the MPEG-2 TS SDK API must implement the following interface (TS2_CryptoInterface) to provide some cryptographic functionality that might be needed by the API. More...

#include <Ts2Protection.h>

Data Fields

void * instance
 
ATX_Result(* GetDrmKey )(void *instance, const char *content_id, const TS2_Secret **drm_key)
 Given a particular content ID, this function creates and return a TS2_Secret containing the key needed to decrypt the content referenced by the specified content ID. More...
 
ATX_Result(* TruncatedSha1 )(void *instance, const TS2_Secret *in_key, const TS2_Secret **out_key)
 Given a key as input, produce a new key as output by computing SHA1 digest and truncating to 16 bytes. More...
 
ATX_Result(* ExportSecret )(void *instance, const TS2_Secret *key, ATX_Byte *key_data, ATX_Size *key_data_size)
 Exports a key represented by a specified TS2_Secret object to a byte array. More...
 
ATX_Result(* GetKeyFormat )(void *instance, TS2_TrafficKeyFormat *key_format, const void **parameters)
 Gets the traffic key format. More...
 
ATX_Result(* EqualSecret )(void *instance, const TS2_Secret *key_a, const TS2_Secret *key_b, ATX_Boolean *equal)
 Compares two keys for equality. More...
 
void(* ReleaseSecret )(void *instance, const TS2_Secret *secret)
 Releases a TS2_Secret object earlier obtained through either GetDrmKey or UnwrapSecret. More...
 
ATX_Result(* UnwrapSecret )(void *instance, const TS2_Secret *key, const ATX_Byte *wrapped_key, ATX_Size wrapped_key_size, const TS2_Secret **unwrapped_key)
 Unwraps a (wrapped) key. More...
 
ATX_Result(* GetMacKey )(void *instance, const TS2_Secret *mac_key, const ATX_Byte *data, ATX_Size data_size, ATX_Byte mac_key_output[TS2_SHA1_DIGEST_SIZE])
 Uses the HMAC SHA-1 signature algorithm to calculate and return the bytes of a Hash-based Message Authentication Code (HMAC) signature for specified data. More...
 
ATX_Result(* CreateSecretAesCbcDecrypter )(void *instance, const ATX_Byte *key, ATX_Size key_size, const ATX_Byte *iv, TS2_SecretAesCbcDecrypter **decrypter)
 Creates a secret decrypter, whose Decrypt function can be used in the future to decrypt data that was encrypted with a specified AES key, using the AES algorithm in CBC mode with a specified initialization vector. More...
 

Detailed Description

Clients of the MPEG-2 TS SDK API must implement the following interface (TS2_CryptoInterface) to provide some cryptographic functionality that might be needed by the API.

Field Documentation

ATX_Result(* TS2_CryptoInterface::CreateSecretAesCbcDecrypter)(void *instance, const ATX_Byte *key, ATX_Size key_size, const ATX_Byte *iv, TS2_SecretAesCbcDecrypter **decrypter)

Creates a secret decrypter, whose Decrypt function can be used in the future to decrypt data that was encrypted with a specified AES key, using the AES algorithm in CBC mode with a specified initialization vector.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
keyThe key that will be needed to decrypt data.
key_sizeSize of the key parameter, in bytes.
ivThe initialization vector.
decrypterAddress of a pointer to a TS2_SecretAesCbcDecrypter, which this function will set to refer to the TS2_SecretAesCbcDecrypter it creates.
ATX_Result(* TS2_CryptoInterface::EqualSecret)(void *instance, const TS2_Secret *key_a, const TS2_Secret *key_b,ATX_Boolean *equal)

Compares two keys for equality.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
key_aOne of the keys to compare.
key_bThe other key to compare.
equalATX_TRUE if the keys are equal, ATX_FALSE otherwise.
ATX_Result(* TS2_CryptoInterface::ExportSecret)(void *instance, const TS2_Secret *key,ATX_Byte *key_data, ATX_Size *key_data_size)

Exports a key represented by a specified TS2_Secret object to a byte array.

If the output array passed to this function is not large enough to hold the exported data, this function sets *key_data_size to the number of bytes required, and returns ATX_ERROR_NOT_ENOUGH_SPACE. The caller can find out in advance the maximum size the output array should be by first calling this function with NULL for the key_data parameter. In that case, the function outputs, in *key_data_size, the maximum number of bytes required, and returns ATX_SUCCESS.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
keyThe key to export.
key_dataPointer to the caller-allocated output array, or NULL if the caller just wants the function to return, in *key_data_size, a number of bytes sufficient to hold the exported data. The output array, if supplied, must be large enough to hold the number of bytes specified by the key_data_size parameter.
key_data_sizePointer to the size of the output array, if the key_data parameter is not NULL; otherwise, pointer to a zero value. This parameter is in/out; the caller sets the value pointed to to the size of the output array, and upon return the value pointed to will be equal to the number of bytes written (or the number of bytes that would be written, if either the value passed was too small or key_data is NULL).
Returns
ATX_SUCCESS if the call succeeds, ATX_ERROR_NOT_ENOUGH_SPACE if *key_data_size is too small.
ATX_Result(* TS2_CryptoInterface::GetDrmKey)(void *instance, const char *content_id,const TS2_Secret **drm_key)

Given a particular content ID, this function creates and return a TS2_Secret containing the key needed to decrypt the content referenced by the specified content ID.

The returned TS2_Secret should be released through a call to ReleaseSecret once it is no longer needed.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
content_idContent ID.
drm_keyAddress of a TS2_Secret pointer that will be set to refer to the TS2_Secret object that is created.
Returns
ATX_ERROR_NO_SUCH_ITEM if no key is found for the given content ID.
ATX_Result(* TS2_CryptoInterface::GetKeyFormat)(void *instance, TS2_TrafficKeyFormat *key_format, const void **parameters)

Gets the traffic key format.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
key_formatPointer to a TS2_TrafficKeyFormat, whose value is set by this function to the appropriate value.
parametersPointer to an object created by this function containing the parameters the TS2_CryptoInterface implementation will use, if any, for the implementation of the ExportSecret function.
ATX_Result(* TS2_CryptoInterface::GetMacKey)(void *instance, const TS2_Secret *mac_key, const ATX_Byte *data, ATX_Size data_size,ATX_Byte mac_key_output[TS2_SHA1_DIGEST_SIZE])

Uses the HMAC SHA-1 signature algorithm to calculate and return the bytes of a Hash-based Message Authentication Code (HMAC) signature for specified data.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
mac_keySecret key to be used in the HMAC calculation.
dataThe data whose HMAC signature should be calculated.
data_sizeSize of the data parameter, in bytes.
mac_key_outputThe HMAC signature.
void* TS2_CryptoInterface::instance
void(* TS2_CryptoInterface::ReleaseSecret)(void *instance, const TS2_Secret *secret)

Releases a TS2_Secret object earlier obtained through either GetDrmKey or UnwrapSecret.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
secretPointer to the TS2_Secret object to be released.
ATX_Result(* TS2_CryptoInterface::TruncatedSha1)(void *instance, const TS2_Secret *in_key,const TS2_Secret **out_key)

Given a key as input, produce a new key as output by computing SHA1 digest and truncating to 16 bytes.

The returned TS2_Secret should be released through a call to ReleaseSecret once it is no longer needed.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
in_keyAddress of an existing TS2_Secret as the input key.
out_keyAddress of a TS2_Secret pointer that will be set to refer to the TS2_Secret object that is created.
ATX_Result(* TS2_CryptoInterface::UnwrapSecret)(void *instance, const TS2_Secret *key, const ATX_Byte *wrapped_key, ATX_Size wrapped_key_size,const TS2_Secret **unwrapped_key)

Unwraps a (wrapped) key.

The returned TS2_Secret containing the unwrapped key should be released through a call to ReleaseSecret once it is no longer needed.

Parameters
instancePointer to an instance of an object used to store anything the implementation may need.
keyThe key to be used to decrypt wrapped_key.
wrapped_keyThe wrapped key to be unwrapped.
wrapped_key_sizeThe size of wrapped_key, in bytes.
unwrapped_keyAddress of a pointer to a TS2_Secret, which this function will set to refer to a newly-created TS2_Secret containing the result of unwrapping wrapped_key.

The documentation for this struct was generated from the following file: