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>
|
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...
|
|
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.
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
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
key | The key that will be needed to decrypt data. |
key_size | Size of the key parameter, in bytes. |
iv | The initialization vector. |
decrypter | Address of a pointer to a TS2_SecretAesCbcDecrypter, which this function will set to refer to the TS2_SecretAesCbcDecrypter it creates. |
Compares two keys for equality.
- Parameters
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
key_a | One of the keys to compare. |
key_b | The other key to compare. |
equal | ATX_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
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
key | The key to export. |
key_data | Pointer 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_size | Pointer 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
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
content_id | Content ID. |
drm_key | Address 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.
Gets the traffic key format.
- Parameters
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
key_format | Pointer to a TS2_TrafficKeyFormat, whose value is set by this function to the appropriate value. |
parameters | Pointer 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. |
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
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
mac_key | Secret key to be used in the HMAC calculation. |
data | The data whose HMAC signature should be calculated. |
data_size | Size of the data parameter, in bytes. |
mac_key_output | The HMAC signature. |
void* TS2_CryptoInterface::instance |
Releases a TS2_Secret object earlier obtained through either GetDrmKey or UnwrapSecret.
- Parameters
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
secret | Pointer to the TS2_Secret object to be released. |
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
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
in_key | Address of an existing TS2_Secret as the input key. |
out_key | Address 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
-
instance | Pointer to an instance of an object used to store anything the implementation may need. |
key | The key to be used to decrypt wrapped_key. |
wrapped_key | The wrapped key to be unwrapped. |
wrapped_key_size | The size of wrapped_key, in bytes. |
unwrapped_key | Address 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: