Javacard J2A040 不支持来自 javacardos 的 glabalplatform?

Javacard J2A040 not support glabalplatform from javacardos?

因为这是我第一次将 globalplatform 与 javacardos (JCIDE) 一起使用,所以我注意到在我输入的代码中无法下载小程序:

private void processGetCardStatus(APDU apdu) { 
        byte[] buffer = apdu.getBuffer();           
        short le = apdu.setOutgoing();
        
        if ( le < (byte)1 )
           ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
        
        apdu.setOutgoingLength( (byte)1);
        buffer[0] = (byte)GPSystem.getCardState();
        
        apdu.sendBytes((short)0, (short)1);
    }

使用 PyApduTool 下载 cap 文件时出现错误:

Download Cap error: Download cap file failed. Send: 80 E8 00 00 F0 C4 82 04 29 01 00 1B DE CA FF ED 02 02 04 00 01 05 01 02 03 04 05 0B 6D 6F 6E 70 61 63 6B 61 67 65 32 02 00 21 00 1B 00 21 00 0A 00 1E 00 7E 00 14 02 AE 00 0A 00 60 00 00 01 19 09 6E 00 00 00 00 00 00 03 01 00 04 00 1E 03 03 01 07 A0 00 00 00 62 01 01 07 01 06 A0 00 00 01 51 00 00 01 07 A0 00 00 00 62 00 01 03 00 0A 01 06 01 02 03 04 05 00 00 64 06 00 14 00 00 00 80 03 03 00 02 04 04 00 00 00 7D FF FF 00 70 00 85 07 02 AE 00 05 43 18 8C 00 18 18 10 40 04 8D 00 05 87 00 18 8F 00 03 3D 06 10 08 8C 00 04 87 01 19 1E 25 29 04 1E 16 04 41 04 41 31 19 1E 25 29 05 1E 16 05 41 04 41 31 19 1E 25 29 06 19 1E 04 41 AD 00 03 16 06 8D 00 06 3B 18 8F 00 03 3D 06 10 08 8C 00 04 87 01 AD 01 19 1E 04 41 16 06 8B 00 07 18 8B 00, Recv: 6A 80.

但是当我注释上面代码中的行时,我可以下载 CAP 文件:

//buffer[0] = (byte)GPSystem.getCardState();

我使用 GlobalPlatform API 1.7,我的卡是 J2A040,基于 JCOP 2.4.1,JC 2.2.2,GP 2.1.1.,T=1,SCP02

在代码之上我有

import org.globalplatform.GPSystem;

问题出在哪里,是不是API版本的问题?

感谢您的回复。

问题,已解决。这是因为在 JCIDE Javacardos 上,我需要添加 jar 容器,通过 select 包,单击右键,属性,Libray 选项,然后单击按钮添加 Jar 容器,然后 select Global Platform 2.1.1