微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法在 JavaCard 上加载小程序

如何解决无法在 JavaCard 上加载小程序

我正在尝试将我制作的小程序上传到真正的智能卡上。我尝试过像 JCWDE 和 CREF 这样的模拟器,它完美地工作。 但是对于我的智能卡,即使系统(我正在使用 GlobalPlatformPro 工具通过 gp -load 命令加载)识别卡,它也总是为我想做的每个操作显示错误,我不知道如何解决它。

这是 GlobalPlateform 的结果(带有 -d -v 选项):

C:\Java>gp -load javacard -d -v
GlobalPlatformPro 18.09.14-0-gb439b52
Running on Windows 10 10.0 amd64,Java 1.8.0_291 by Oracle Corporation
# Detected readers from JNA2PCSC
[ ] JAVACOS Virtual Contact Reader 0
[ ] JAVACOS Virtual Contactless Reader 1
[*] OMNIKEY AG Smart Card Reader USB 0
SCardConnect("OMNIKEY AG Smart Card Reader USB 0",T=*) -> T=0,3B7D9400005744290830869312C090111E1A
SCardBeginTransaction("OMNIKEY AG Smart Card Reader USB 0")
Reader: OMNIKEY AG Smart Card Reader USB 0
ATR: 3B7D9400005744290830869312C090111E1A
More information about your card:
    http://smartcard-atr.appspot.com/parse?ATR=3B7D9400005744290830869312C090111E1A

A>> T=0 (4+0000) 00A40400 00
A<< (0018+2) (16ms) 6F108408A000000003000000A5049F6501FF 9000
[DEBUG] GlobalPlatform - Auto-detected ISD: A000000003000000
Warning: no keys given,using default test key 404142434445464748494A4B4C4D4E4F
A>> T=0 (4+0008) 80500000 08 007D0897841EECAB 00
A<< (0000+2) (31ms) 6D00
INITIALIZE UPDATE Failed: 0x6D00 (Invalid INStruction)

这是 PyAptduTool 的结果:

Select CardManager begin...
Select CardManager successful.
Download Cap begin...
Download Cap successful.
Install Applet begin...
Install Applet successful.
Select Applet begin...
Select Applet successful.

我尝试使用 gpj,这是输出

Found card in terminal: OMNIKEY AG Smart Card Reader USB 0
ATR: 3B 7D 94 00 00 57 44 29 08 30 86 93 12 C0 90 11 24 1F
DEBUG: Command  APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00
DEBUG: Response APDU: 6A 82
Failed to select Security Domain GP211 A0 00 00 01 51 00 00,SW: 6A 82
DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 18 43 4D 00
DEBUG: Response APDU: 6A 82
Failed to select Security Domain GemaltoXpresspro A0 00 00 00 18 43 4D 00,SW: 6A 82
DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
DEBUG: Response APDU: 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 01 FF 90 00
Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
DEBUG: Command  APDU: 80 50 00 00 08 6A 40 39 0E 99 CC 40 D0
DEBUG: Response APDU: 6D 00
javax.smartcardio.CardException: Wrong initialize update,SW: 6D 00
        at net.sourceforge.gpj.cardservices.GlobalPlatformService.openSecureChannel(UnkNown Source)
        at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(UnkNown Source)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。