我一直在尝试使用 SIM 工具包功能(例如 uicc.toolkit.ProactiveHandler )安装一个非常小的示例小程序。使用 Java Card SDK 中的 sampleapp.cap 工具编写小程序并生成文件 converter 后,我无法在用于开发的 Java Card 上安装 sampleapp.cap 文件。我正在使用 global platform pro,并且在尝试加载小程序时收到 6a88 SW 作为响应。

构建:
converter -classdir build -applet $APP_AID sampleapp.SampleToolkitApp sampleapp $PKG_AID 1.0(生成 build/sampleapp/javacard/sampleapp.cap )

安装(插入 java 读卡器):
gp -d -v --install build/sampleapp/javacard/sampleapp.cap
输出:

A>> T=1 (4+0000) 00A40400 00
A<< (0018+2) (45ms) 6F108408A000000003000000A5049F6501FF 9000
[DEBUG] GlobalPlatform - Auto-detected ISD AID: A000000003000000
[DEBUG] GlobalPlatform - Auto-detected block size: 255
A>> T=1 (4+0008) 80500000 08 6CB661C0B31315CB 00
A<< (0028+2) (117ms)     00003126960097F931740102007110F669CA335E5BAF5F8BF724DC1E 9000
[DEBUG] GlobalPlatform - Host challenge: 6CB661C0B31315CB
[DEBUG] GlobalPlatform - Card challenge: 007110F669CA335E
[DEBUG] GlobalPlatform - Card reports SCP02 with version 1 keys
[DEBUG] PlaintextKeys - session keys:
ENC: Ver:0 ID:0 Type:DES3 Len:16 Value:5246B7B44BB830257A6546CF9FF70413 KCV: 9E246B
MAC: Ver:0 ID:0 Type:DES3 Len:16 Value:250DC88427E2C97165280D315EB39640 KCV: 8FE051
KEK: Ver:0 ID:0 Type:DES3 Len:16 Value:AD1197EAA5AAB912CB91F82C7B7DC125 KCV: 55D1A7
[DEBUG] GlobalPlatform - Verified card cryptogram: 5BAF5F8BF724DC1E
[DEBUG] GlobalPlatform - Calculated host cryptogram: 608223EB1CE199AA
A>> T=1 (4+0016) 84820100 10 608223EB1CE199AA6AA94AAC2B12D3C2
A<< (0000+2) (42ms) 9000
CAP file (v2.1) generated on Wed Jun 29 14:12:28 EDT 2016
By Sun Microsystems Inc. converter 1.3 with JDK 1.7.0_80 (Oracle Corporation)
Package: sampleapp v1.0 with AID B115737612
Applet: SampleToolkitApp with AID B1157376121E
Import: A0000000620101 v1.2
Import: A0000000090003FFFFFFFF8910710002 v2.6
Total code size: 445 bytes (672 with debug)
SHA256 (code):     E4E65C31237BDA2CF893A4145309C1DA541290028EF7E8B3AEEC1279C58DF805
SHA1   (code): 97C8E9C2E364E4185D501552430FCF65A80A9CCF
A>> T=1 (4+0010) 84F28002 0A 4F00D59C73CC637DAD77 00
A<< (0000+2) (46ms) 6A86
A>> T=1 (4+0010) 84F28000 0A 4F0072678A1AE9D9D06E 00
A<< (0011+2) (50ms) 08A000000003000000079E 9000
A>> T=1 (4+0010) 84F24000 0A 4F0006A4F0528D4EFB48 00
A<< (0009+2) (54ms) 064DF87F7FB8BE0700 9000
A>> T=1 (4+0010) 84F22000 0A 4F0092C86D9389102AD4 00
A<< (0051+2) (68ms) 07A0000000035344010007A0000000035350010009534B544558544C4942010008A0000002270110000100054DF87F7FB80100 9000
A>> T=1 (4+0010) 84F21000 0A 4F001D7AC0FD69CBCB37 00
A<< (0000+2) (46ms) 6A81
[WARN] GlobalPlatform - GET STATUS failed for 80F21000024F0000 with 6a81
A>> T=1 (4+0026) 84E60200 1A 05B11573761208A0000000030000000000009BDAA789A47D5BB5
A<< (0001+2) (138ms) 00 9000
A>> T=1 (4+0255) 84E80000 FF C48201BD01000FDECAFFED010204000105B11573761202001F000F001F000A001E0042002700B40012001D000000E000050002000202010004001E02020107A0000000620101060210A0000000090003FFFFFFFF891071000203000A0106B1157376121E008006002700800300FF00040400000027FFFF001A002E42800301FF000702000000AE00B1800200810101080700B40005318F00013D181D1E8C000F2E1B8B00027A0140188C00037A02107C0004076D0504700303780110038000047A0421188B000560037A198B00062D7C000404415B8000041A032510806A08116E008D00071A042510206B227C0004076C081169868D00479BF5BDFAB2F540
A<< (0000+2) (1s213ms) 6A88
pro.javacard.gp.GPException: LOAD failed SW: 6A88
    at pro.javacard.gp.GPException.check(GPException.java:66)
    at pro.javacard.gp.GlobalPlatform.loadCapFile(GlobalPlatform.java:667)
    at pro.javacard.gp.GlobalPlatform.loadCapFile(GlobalPlatform.java:625)
    at pro.javacard.gp.GPTool.main(GPTool.java:518)
LOAD failed SW: 6A88

使用我作为 Java 卡购买的 SmartCafe Expert 3.2 72k。还使用 JavaCard SDK 2.2.1,这是该卡支持的版本,并且使用了 3GPP TS 43.019 v6.0.0 STK API 技术规范和 ETSI TS 102 241 13.0.0 UICC API for Java Card。

6A88 SW 指示“未找到引用数据”。这是我的卡特有的,因为它没有实现 STK 堆栈吗?

最佳答案

SmartCafe Expert 3.2 72k 是一个简单的常规 Java 卡,内部不包含 SIM 工具包 API。所以它不能安装那些使用 SIM 工具包 API 的小程序。

在加载过程中,卡上的 OPEN 试图在您的小程序和使用的库之间建立链接。由于在那里找不到 SIM 工具包库,它返回此错误。

关于javacard - 在 Java 卡上安装 SIM 工具包小程序失败并显示 SW 6A88,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38109132/

10-11 02:41