我正在尝试使用 java smartcardIO 函数将数据写入 HID Omnikey 5122 设备中的非接触式卡。
我需要插入卡的数据是{00 01 02 03}
.
我试图通过 channel.transmit 函数发送的 APDU 命令在{FF D6 00 04 04 00 01 02 03}
哪里:
- FF 是 CLS
- D6 是 INS
- 00 是 P1
- 04是P2
- 04 是要更新的字节数
- 00 01 02 03 是我需要插入的数据。
我无法通过以下函数正确构建 APDU 命令。有人可以帮我弄这个吗。我正在使用 java smartcardio 库中可用的函数。
ResponseAPDU respApdu = channel.transmit(
new CommandAPDU(0xFF,0xD6,0x00,0x04,0x04,
new byte[] {(byte) 0x00,
(byte) 0x01,
(byte)0x02,
(byte)0x03}));
我收到语法错误,例如构造函数命令的参数无效。