Package javacardx.apdu

Extension package that enables support for ISO7816 specification defined optional APDU related mechanisms. The platform must support this optional package only if the features enabled are included in the implementation.

The javacardx.apdu package contains the ExtendedLength interface class. The ExtendedLength interface provides a tagging interface to allow an applet to declare that it requires support for the ISO7816-4 defined extended length APDU messages via the javacard.framework.APDU class.

Interface Summary Interface 	Description
ExtendedLength 	
The ExtendedLength interface serves as a tagging interface to indicate that the applet supports extended length APDU.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
NfcA.transceive() 方法用于向 NFC-A 标签发送 APDU(Application Protocol Data Unit)命令并返回响应。APDU 命令遵循 ISO 7816 标准,它通常由两个或者三个部分组成: 1. CLA(Class):命令类别,用于指定命令的种类。 2. INS(Instruction):命令操作码,用于指定具体的操作。 3. P1-P2(Parameter):命令参数,用于指定命令的具体参数。 4. Lc(Length):数据长度,用于指定要发送的数据的长度。 5. Data:要发送的数据。 6. Le(Expected Length):期望的响应数据长度,用于指定要接收的数据的长度。 下面是一个示例的 APDU 命令: ``` byte[] command = new byte[]{0x00, (byte) 0xA4, 0x04, 0x00, 0x07, (byte) 0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01}; ``` 这个命令的 CLA 是 0x00,INS 是 0xA4,P1 是 0x04,P2 是 0x00,Lc 是 0x07,Data 是 0xD2 0x76 0x00 0x00 0x85 0x01 0x01,Le 是 0x00。 当我们调用 NfcA.transceive(command) 方法发送命令时,它会返回一个 byte[] 类型的响应。响应数据也遵循 ISO 7816 标准,通常由两个部分组成: 1. 响应状态码(Response Status Code):用于指示响应的状态。 2. 响应数据(Response Data):指令执行后返回的数据。 下面是一个示例的响应数据: ``` byte[] response = new byte[]{(byte) 0x90, 0x00}; ``` 这个响应数据的状态码是 0x90 0x00,表示操作成功。 需要注意的是,APDU 命令和响应数据的具体格式可能因标签类型、应用程序、命令类型等因素而异。在使用 NfcA.transceive() 方法时,需要根据具体情况构造合适的 APDU 命令,并解析响应数据。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值