泰信论坛

 找回密码
 立即注册
查看: 19972|回复: 3
打印 上一主题 下一主题

Develop smart card CA application on the base of NGB standard interface

[复制链接]

5

主题

28

帖子

131

积分

版主

Rank: 7Rank: 7Rank: 7

积分
131
跳转到指定楼层
楼主
发表于 2014-1-9 18:21:37 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
ps:应国外网友的要求,对前面技术开发的帖子逐步做了翻译,希望对广大的海外朋友有所帮助。

The development of smart card CA application on the base of NGB standard interface is the research of smart card CA, as for the traditional CA used smart card,on the condition of current STB technology platform,if it is possible that we can develop the current STB client terminal software into a commonly multi-platform APK according to the NGB Java interface specification of NGB, and thus the traditionally closed smart card CA system can be compatibility to DCAS. the development measures of smart card CA application is some kind of the same as DCAS application, you can read the last post of The development of DCAS application on the base of NGB standard interface. Now we just tell the differences of them.
The key difference between them is the smart card communication, including the reset, initiation of smart card, CA information acquisition, the ECM and EMM data decryption and STB & SC Binding, etc. DTVOS extends the interface of smart devices according to the NGB standard interface, and through the device interface combining the communication protocol of different CA, such as wether applying protocol T0, T1 or T14, the order’s form, the packaging measure, the smart card’s response time after receiving the order,the response form, etc,and thus it can accomplish the smart card communication function of traditional CA base in CA application.
In addition, there is another difference between the development of traditional smart card CA application and DCAS and that is the set of CW. Because the DCAS uses hierarchy key system, we set the encrypted CW when setting CW, and at the same time we set various encrypted hierarchy key. But as for the current smart card CA is short of the system, there is a difference when setting CW. According to the CW interface given by the specification which is: loadCW,
The interface Prototype is:
public void loadCW(int VendorID, CWKey cwKey, Key[] levelKeys, int schemeId) throws CADriverException
The way can be used to inform the terminal software platform to insert control word to the descrambler, and insert the needed key to the terminal security chip.
And for @param cwKey control word, if the control word is plaintext, the LevelKeys parameter being ignored. And if the cwKey is null, that means the CA application doesn’t provide the valid control word.
@param levelKeys is the multilevel key imbedding in the terminal security chip. The key group’s index is equal to the absolute position of terminal security chip, in the group the special element value is null, which indicates that the key shouldn’t be insert into the specified position in the terminal security chip.
   @param schemeId the schemeId is used to the specified terminal security chip’s encryption algorithm (such as AES, TDES)
   @ChipController interface giving the scheme list. If the controller only support one form then the scheme value should be ignored.
If we take no account of advanced security environment, after the smart card decoding the cw, the setting cw is set when the control word is plaintext, referring to the conception of CWKey.
public class CWKey extends Key
{
public static final int PARITY_EVEN = 0;
public static final int PARITY_ODD = 1;

/*
*@param value key value
*@param true-value indicates the key is encrypted and false value means the key is unencrypted.
*@param odd-even value, indicating the parity of the control word.
*/
public CWKey(byte[] value, boolean encrypted, int parity)

/**
*return to the control word’s parity
*@return control word’s parity
*/
public int getParity()

}

Let’s assume the odd-even CW group respectively are: evencw, oddcw, the corresponding cwkey are ECW[0] and ECW[1], so
ECW[0]=new CWKey (evencw, false, 0);
ECW[1]=new CWKey (oddcw, false, 1);
try {
           descramblerContext.loadCW(0x1234, ECW [0], null,  ChipController.SCHEME_3DES);
             } catch (CADriverException ex) {
}

try {
           descramblerContext.loadCW(0x1234, ECW [1], null,  ChipController.SCHEME_3DES);
             } catch (CADriverException ex) {
}

After we finished the two programs according to the case of DCAS application development, it is relatively easy to develop a commonly used smart card CA application.
Each CA is a individual application, namely a APK file, which has its own interface. CA application uses Android application’s basic module namely service to manage its own life cycle. It monitors the Android. Intent. Action. BOOT_COMPLETED broadcast and start its service after broadcast, and then accomplishing the functions like startXlet when starting service:finishing its own initiation (including smart card’s initiation), accomplishing the sign to CASModuleManager when the descramble works. The sign process is as follows:
The working process of the CA application:
As shown below, when the STB finding the current program is scrambled, the platform will call the startDescrambling of CASModuleManager, to pass the systemid and sign as CASEventListener to monior the returning of descrambling result. When calling the startDescrambling interface of CA application, it will start to receive ECM, EMM data. After licensed and the cw descrambled, we can call loadCW interface to set control word to descramble the programs. Please sign in www.interactiveweb.org, to learn the detailed courses and cases. If you want to learn the davic interface quickly, please visit www.code4tv.com, where there is the sealed mhp whole interface.

jimmy 该用户已被删除
沙发
发表于 2014-2-6 22:44:25 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

0

主题

1

帖子

9

积分

新手上路

Rank: 1

积分
9
板凳
发表于 2014-12-7 12:45:19 | 只看该作者
非常不错的技术帖子

0

主题

2

帖子

407

积分

中级会员

Rank: 3Rank: 3

积分
407
地板
发表于 2015-1-27 12:46:30 | 只看该作者
us encrypted hierarchy key. But as for the current smart card CA is short of the system, there is a difference when setting CW. According to the CW interface given by the specification which is: loadCW,
The interface Prototype is:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



Archiver|手机版|泰信

GMT+8, 2024-12-23 00:16 , Processed in 0.190437 second(s), 21 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表