17 #ifndef _TS2_PROTECTION_H_ 18 #define _TS2_PROTECTION_H_ 31 #define TS2_PROTECTION_KEY_LENGTH 16 76 ATX_Result (*GetDrmKey)(
void* instance,
77 const char* content_id,
79 ATX_Size* drm_key_len);
96 ATX_Result (*Decrypt)(
void* instance,
97 const ATX_Byte* enc_data,
100 void (*Destroy)(
void* instance);
106 #define TS2_SecretAesCbcDecrypter_Decrypt(self,a,b,c) \ 107 self->Decrypt(self->instance,a,b,c) 109 #define TS2_SecretAesCbcDecrypter_Destroy(self) \ 137 ATX_Result (*GetDrmKey)(
void* instance,
138 const char* content_id,
155 ATX_Result (*TruncatedSha1)(
void* instance,
191 ATX_Result (*ExportSecret)(
void* instance,
195 ATX_Size* key_data_size);
209 ATX_Result (*GetKeyFormat)(
void* instance,
211 const void** parameters);
223 ATX_Result (*EqualSecret)(
void* instance,
237 void (*ReleaseSecret)(
void* instance,
255 ATX_Result (*UnwrapSecret)(
void* instance,
257 const ATX_Byte* wrapped_key,
258 ATX_Size wrapped_key_size,
274 ATX_Result (*GetMacKey)(
void* instance,
276 const ATX_Byte* data,
296 ATX_Result (*CreateSecretAesCbcDecrypter)(
void* instance,
307 #define TS2_Crypto_GetDrmKey(self,a,b) \ 308 self.GetDrmKey(self.instance,a,b) 310 #define TS2_Crypto_TruncatedSha1(self,in_key,out_key) \ 311 self.TruncatedSha1(self.instance,in_key,out_key) 313 #define TS2_Crypto_ExportSecret(self,a,b,c) \ 314 self.ExportSecret(self.instance,a,b,c) 316 #define TS2_Crypto_GetKeyFormat(self,a,b) \ 317 self.GetKeyFormat(self.instance,a,b) 319 #define TS2_Crypto_EqualSecret(self,a,b,c) \ 320 self.EqualSecret(self.instance,a,b,c) 322 #define TS2_Crypto_ReleaseSecret(self,a) \ 323 self.ReleaseSecret(self.instance,a) 325 #define TS2_Crypto_UnwrapSecret(self,a,b,c,d) \ 326 self.UnwrapSecret(self.instance,a,b,c,d) 328 #define TS2_Crypto_GetMacKey(self,a,b,c,d) \ 329 self.GetMacKey(self.instance,a,b,c,d) 331 #define TS2_Crypto_CreateSecretAesCbcDecrypter(self,a,b,c,d) \ 332 self.CreateSecretAesCbcDecrypter(self.instance,a,b,c,d) 353 const ATX_Byte* drm_key,
354 const ATX_Byte* cid_extension,
355 ATX_Boolean is_service,
356 ATX_UInt32 crypto_period,
357 const ATX_Byte* traffic_seed,
359 ATX_UInt32 segment_start_index,
360 const ATX_Byte* common_iv,
361 ATX_Boolean single_key_layer,
363 const ATX_Byte* access_criteria,
364 ATX_Size access_criteria_size,
369 const ATX_Byte* drm_key,
370 const ATX_Byte* cid_extension,
371 ATX_Boolean is_service,
372 const ATX_Byte* access_criteria,
373 ATX_Size access_criteria_size);
440 void (*OnKsmInfoChange)(
void *instance,
442 ATX_UInt32 change_mask );
469 const char* cid_base,
494 const char* content_id,
495 const ATX_Byte* key);
499 const char* content_id);
514 ATX_Byte* traffic_key);
const ATX_Byte * next_key
Definition: Ts2Protection.h:426
void * instance
Definition: Ts2Protection.h:439
ATX_Result TS2_PacketDecrypter_Create(TS2_TrafficProtectionSystem protection, ATX_UInt32 kdf_type, const char *cid_base, TS2_DrmKeyResolver key_resolver, TS2_CryptoInterface *crypto, TS2_PacketDecrypter **decrypter)
void TS2_PacketDecrypter_Destroy(TS2_PacketDecrypter *self)
Definition: Ts2Protection.h:392
struct TS2_PacketDecrypter TS2_PacketDecrypter
Definition: Ts2Protection.h:37
ATX_Size current_key_size
Definition: Ts2Protection.h:423
Definition: Ts2Protection.h:339
ATX_UInt8 permissions_category
Definition: Ts2Protection.h:434
void TS2_PacketEncrypter_IncrementSegmentIndex(TS2_PacketEncrypter *self)
ATX_Result TS2_PacketEncrypter_ResetDrm(TS2_PacketEncrypter *self, const ATX_Byte *drm_key, const ATX_Byte *cid_extension, ATX_Boolean is_service, const ATX_Byte *access_criteria, ATX_Size access_criteria_size)
void TS2_ProtectionKeyMap_Destroy(TS2_ProtectionKeyMap *self)
const ATX_Byte * TS2_ProtectionKeyMap_GetKey(const TS2_ProtectionKeyMap *self, const char *content_id)
TS2_TrafficKeyParity
Definition: Ts2Protection.h:391
Definition: Ts2Protection.h:410
void * instance
Definition: Ts2Protection.h:95
TS2_TrafficProtectionSystem protection
Definition: Ts2Protection.h:435
const void * format_params
Definition: Ts2Protection.h:420
Definition: Ts2Protection.h:438
ATX_UInt8 key_lifetime
Definition: Ts2Protection.h:433
ATX_Size next_iv_size
Definition: Ts2Protection.h:429
const ATX_Byte * next_iv
Definition: Ts2Protection.h:428
ATX_Result TS2_GenerateInitializationVector(const ATX_Byte *seed, ATX_Size seed_size, ATX_UInt32 index, ATX_Byte *iv)
ATX_Size access_criteria_count
Definition: Ts2Protection.h:431
Definition: Ts2Protection.h:336
const ATX_Byte * current_key
Definition: Ts2Protection.h:422
For DVB-CSA protection, key consumer needs to depad the traffic keys from 128-bits to 64-bits...
Definition: Ts2Protection.h:416
struct TS2_KsmDecrypter TS2_KsmDecrypter
Definition: Ts2Protection.h:445
TS2_DrmKeyResolver TS2_ProtectionKeyMap_GetResolver(TS2_ProtectionKeyMap *self)
ATX_Result TS2_KsmDecrypter_UpdateKSM(TS2_KsmDecrypter *self, const TS2_KSM *ksm)
ATX_Byte * value
Definition: Ts2Protection.h:399
Definition: Ts2Iec62455.h:111
Definition: Ts2Protection.h:406
ATX_Byte * access_criteria
Definition: Ts2Protection.h:430
void * instance
Definition: Ts2Protection.h:119
ATX_Size next_key_size
Definition: Ts2Protection.h:427
Definition: Ts2Protection.h:408
Definition: Ts2Protection.h:409
void TS2_KsmDecrypter_Destroy(TS2_KsmDecrypter *self)
ATX_Byte length
Definition: Ts2Protection.h:398
ATX_Result TS2_PacketEncrypter_Create(TS2_TrafficProtectionSystem protection, const ATX_Byte *drm_key, const ATX_Byte *cid_extension, ATX_Boolean is_service, ATX_UInt32 crypto_period, const ATX_Byte *traffic_seed, ATX_Size seed_size, ATX_UInt32 segment_start_index, const ATX_Byte *common_iv, ATX_Boolean single_key_layer, TS2_KSMT *ksmt, const ATX_Byte *access_criteria, ATX_Size access_criteria_size, TS2_PacketEncrypter **encrypter)
ATX_Result TS2_GenerateTrafficKey(const ATX_Byte *seed, ATX_Size seed_size, ATX_UInt32 index, ATX_Byte *traffic_key)
Definition: Ts2Protection.h:46
ATX_Result TS2_KsmDecrypter_Create(const char *cid_base, TS2_CryptoInterface crypto, TS2_KsmDecrypterListener listener, TS2_TrafficProtectionSystem protection, ATX_UInt32 kdf_type, TS2_KsmDecrypter **decrypter)
Clients of the MPEG-2 TS SDK API must implement the following interface (TS2_CryptoInterface) to prov...
Definition: Ts2Protection.h:118
Definition: Ts2Protection.h:335
Definition: Ts2Packet.h:91
TS2_KsmInfoFlag
Definition: Ts2Protection.h:402
ATX_Result TS2_PacketDecrypter_UpdateKSM(TS2_PacketDecrypter *self, const TS2_KSM *ksm)
Definition: Ts2Protection.h:404
struct TS2_Secret TS2_Secret
An opaque data structure defined by an implementation of the TS2_CryptoInterface. ...
Definition: Ts2Protection.h:44
Definition: Ts2Protection.h:393
Definition: Ts2Protection.h:407
TS2_TrafficKeyFormat format
Definition: Ts2Protection.h:419
ATX_UInt64 timestamp
Definition: Ts2Protection.h:432
Definition: Ts2Protection.h:87
const ATX_Byte * current_iv
Definition: Ts2Protection.h:424
ATX_Byte tag
Definition: Ts2Protection.h:397
ATX_UInt32 present_mask
Definition: Ts2Protection.h:417
ATX_Result TS2_PacketEncrypter_UpdateKSMT(TS2_PacketEncrypter *self)
Definition: Ts2Protection.h:396
TS2_TrafficProtectionSystem
Definition: Ts2Protection.h:334
Definition: Ts2Protection.h:337
TS2_TrafficKeyParity current_key_parity
Definition: Ts2Protection.h:421
#define TS2_SHA1_DIGEST_SIZE
Definition: Ts2Crypto.h:31
Decrypter structure for the decrypter created by the TS2_CryptoInterface CreateSecretAesCbcDecrypter ...
Definition: Ts2Protection.h:94
TS2_TrafficKeyFormat
Traffic key format identifiers.
Definition: Ts2Protection.h:85
ATX_Result TS2_PacketDecrypter_Decrypt(TS2_PacketDecrypter *self, TS2_Packet *packet)
Definition: Ts2Iec62455.h:85
ATX_Result TS2_PacketEncrypter_Encrypt(TS2_PacketEncrypter *self, TS2_Packet *packet)
struct TS2_PacketEncrypter TS2_PacketEncrypter
Definition: Ts2Protection.h:36
void TS2_PacketEncrypter_Destroy(TS2_PacketEncrypter *self)
Definition: Ts2Protection.h:338
ATX_Result TS2_ProtectionKeyMap_SetKey(TS2_ProtectionKeyMap *self, const char *content_id, const ATX_Byte *key)
key length is TS2_PROTECTION_KEY_LENGTH
ATX_Result TS2_ProtectionKeyMap_Create(TS2_ProtectionKeyMap **key_map)
ATX_Size current_iv_size
Definition: Ts2Protection.h:425
void * instance
Definition: Ts2Protection.h:47
struct TS2_ProtectionKeyMap TS2_ProtectionKeyMap
Definition: Ts2Protection.h:38
Definition: Ts2Protection.h:403
Definition: Ts2Protection.h:86
Definition: Ts2Protection.h:405