【发布时间】:2019-09-22 06:40:56
【问题描述】:
我开始学习java卡,我正在阅读一个钱包的示例代码,里面有一个OwnerPin。
这里是代码的一部分,与 pin 及其验证相关:
OwnerPIN pin;
private myApplet(byte[] bArray, short bOffset, byte bLength) {
// It is good programming practice to allocate
// all the memory that an applet needs during
// its lifetime inside the constructor
pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
byte iLen = bArray[bOffset]; // aid length
bOffset = (short) (bOffset + iLen + 1);
byte cLen = bArray[bOffset]; // info length
bOffset = (short) (bOffset + cLen + 1);
byte aLen = bArray[bOffset]; // applet data length
// The installation parameters contain the PIN
// initialization value
pin.update(bArray, (short) (bOffset + 1), aLen);
register();
}
我在理解这段代码时遇到了一些麻烦。我知道这是根据安装脚本设置pin的部分:
0x80 0xB8 0x00 0x00 0xd 0xb 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x00 0x00 0x00 0x7F;
我无法理解安装小程序后 pin 的值是多少。
【问题讨论】:
-
如果
0x0B是AID的长度,那么0x00之前的0x7F是PIN长度,表示PIN为空。 -
这是否有机会与 jcardsim 一起用于测试? Jcardsim 使用 CLA-INS 组合
0x80 0xB8创建小程序。