Wasabi ExpressPlay SDK for Embedded Systems
1.10
Main Page
Modules
Data Structures
Files
File List
Globals
Client
Source
Interface
Extended
WsbEcmDecrypter.h
Go to the documentation of this file.
1
/*****************************************************************
2
|
3
| Wasabi - ECM Decrypter Module
4
|
5
| $Id$
6
| Original author: Edin Hodzic (dino@concisoft.com)
7
|
8
| This software is provided to you pursuant to your agreement
9
| with Intertrust Technologies Corporation ("Intertrust").
10
| This software may be used only in accordance with the terms
11
| of the agreement.
12
|
13
| Copyright (c) 2010-2014 by Intertrust. All rights reserved.
14
|
15
****************************************************************/
21
#ifndef _WSB_ECM_DECRYPTER_H_
22
#define _WSB_ECM_DECRYPTER_H_
23
24
/*----------------------------------------------------------------------
25
| includes
26
+---------------------------------------------------------------------*/
27
#include "
WsbTypes.h
"
28
#include "
WsbMediaFile.h
"
29
#include "
WsbKeyManager.h
"
30
31
/*----------------------------------------------------------------------
32
| prototypes
33
+---------------------------------------------------------------------*/
89
/*----------------------------------------------------------------------
90
| types
91
+---------------------------------------------------------------------*/
92
99
typedef
struct
WSB_EcmDecrypter
WSB_EcmDecrypter
;
100
104
typedef
enum
{
105
WSB_MP2TS_KEY_EVEN
,
/* <- even MPEG-2 TS key */
106
WSB_MP2TS_KEY_ODD
/* <- odd MPEG-2 TS key */
107
}
WSB_Mpeg2TsTrafficKey_Parity
;
108
112
typedef
enum
{
113
WSB_NO_TRAFFIC_PROTECTION
,
114
WSB_UNSUPPORTED_TRAFFIC_PROTECTION
,
115
WSB_MPEG2TS_CRYPT_AES_CBC_PROTECTION
,
116
WSB_MPEG2TS_CRYPT_AES_CBC_BBTS20_PROTECTION
,
117
WSB_MPEG2TS_CRYPT_DVB_CSA_PROTECTION
118
}
WSB_Mpeg2TsTrafficKey_ProtectionSystem
;
119
120
124
typedef
enum
{
128
WSB_MP2TS_KEY_FORMAT_CLEAR
,
129
133
WSB_MP2TS_KEY_FORMAT_SKB
134
}
WSB_Mpeg2TsTrafficKey_Format
;
135
139
typedef
enum
{
140
WSB_KIF_CURRENT_KEY
= (1<<0),
141
WSB_KIF_CURRENT_IV
= (1<<1),
142
WSB_KIF_NEXT_KEY
= (1<<2),
143
WSB_KIF_NEXT_IV
= (1<<3),
144
WSB_KIF_ACCESS_CRIT
= (1<<4),
145
WSB_KIF_TIMESTAMP
= (1<<5),
146
WSB_KIF_KEY_LIFETIME
= (1<<6),
147
WSB_KIF_PERMCATEGORY
= (1<<7)
148
}
WSB_KsmInfoFlag
;
149
153
typedef
struct
{
159
WSB_UInt32
present_mask
;
160
161
WSB_Mpeg2TsTrafficKey_Format
format
;
162
const
void
*
format_params
;
163
164
WSB_Mpeg2TsTrafficKey_Parity
current_key_parity
;
165
166
const
WSB_Byte
*
current_key
;
167
WSB_Size
current_key_size
;
168
const
WSB_Byte
*
current_iv
;
169
WSB_Size
current_iv_size
;
170
171
const
WSB_Byte
*
next_key
;
172
WSB_Size
next_key_size
;
173
const
WSB_Byte
*
next_iv
;
174
WSB_Size
next_iv_size
;
175
176
WSB_Byte
*
access_criteria
;
177
WSB_Size
access_criteria_count
;
178
WSB_UInt64
timestamp
;
179
WSB_UInt8
key_lifetime
;
180
WSB_UInt8
permissions_category
;
181
WSB_Mpeg2TsTrafficKey_ProtectionSystem
protection
;
182
}
WSB_KsmInfo
;
183
187
typedef
struct
{
188
190
void
*
instance
;
191
210
WSB_Result
(*OnNewMediaFile)(
void
* instance,
211
WSB_MediaFile
* media_file,
212
WSB_KeyManager
* key_manager);
213
230
void (*OnKsmInfoChange)(
void
* instance,
231
const
WSB_KsmInfo
* key_info,
232
WSB_UInt32
change_mask);
233
234
}
WSB_EcmDecrypter_Listener
;
235
236
/*----------------------------------------------------------------------
237
| functions
238
+---------------------------------------------------------------------*/
239
#if defined(__cplusplus)
240
extern
"C"
{
241
#endif
242
258
WSB_EXPORT
WSB_Result
259
WSB_EcmDecrypter_Create
(
const
WSB_EcmDecrypter_Listener
listener,
260
WSB_Mpeg2TsTrafficKey_Format
key_format,
261
const
void
* key_format_params,
262
/* returns */
WSB_EcmDecrypter
** ecm_decrypter);
263
272
WSB_EXPORT
WSB_Result
273
WSB_EcmDecrypter_Destroy
(
WSB_EcmDecrypter
* ecm_decrypter);
274
286
WSB_EXPORT
WSB_Result
287
WSB_EcmDecrypter_UpdatePmt
(
WSB_EcmDecrypter
* ecm_decrypter,
288
const
WSB_Byte
* pmt_table,
289
WSB_Size
pmt_len,
290
/* returns */
291
WSB_UInt16
* ecm_pid);
292
304
WSB_EXPORT
WSB_Result
305
WSB_EcmDecrypter_UpdateCat
(
WSB_EcmDecrypter
* ecm_decrypter,
306
const
WSB_Byte
* cat_table,
307
WSB_Size
cat_len,
308
/* returns */
309
WSB_UInt16
* mrt_pid);
310
322
WSB_EXPORT
WSB_Result
323
WSB_EcmDecrypter_UpdateEcm
(
WSB_EcmDecrypter
* ecm_decrypter,
324
const
WSB_Byte
* ecm_table,
325
WSB_Size
ecm_len);
326
338
WSB_EXPORT
WSB_Result
339
WSB_EcmDecrypter_UpdateMrt
(
WSB_EcmDecrypter
* ecm_decrypter,
340
const
WSB_Byte
* mr_table,
341
WSB_Size
mrt_len);
342
345
#ifdef __cplusplus
346
}
347
#endif
348
349
#endif
/* _WSB_ECM_DECRYPTER_H_ */