【发布时间】:2014-03-12 10:20:37
【问题描述】:
我正在构建 android 应用程序,它连接到 nfc 安全元件并获取数据到 android 设备。为了构建安全元件,我使用了 java 卡 API。在 jcop 工具中发送 ATR 命令以重置 java 卡。这是发送命令.
/card -a a000000003000000 -c com.ibm.jc.CardManager
resetCard with timeout: 0 (ms)
--Waiting for card...
ATR=3B F8 18 00 FF 81 31 FE 45 4A 43 4F 50 76 32 34 ;.....1.EJCOPv24
31 43 1C
ATR: T=1, FI=1/DI=8 (31clk/etu), N=-1, IFSC=254, BWI=4/CWI=5, Hist="JCOPv241"
=> 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00
我正在为此使用 jcop 工具。安全元素部分已完成。但我的 android 应用程序需要在一秒钟内向安全元素发送更多请求。我使用创建标签并以这种方式发送数据。
byte[] GET_STRING = {
(byte) 0x80, // CLA Class
0x04, // INS Instruction
0x00, // P1 Parameter 1
0x00, // P2 Parameter 2
0x10 // LE maximal number of bytes expected in result
};
result = tag.transceive(GET_STRING);
int len = result.length;
if (!(result[len-2]==(byte)0x90&&result[len-1]==(byte) 0x00))
throw new RuntimeException("could not retrieve msisdn");
byte[] data = new byte[len-2];
System.arraycopy(result, 0, data, 0, len-2);
String str = new String(data).trim();
tag.close()
但我需要知道如何使用 android isoDep 连接发送 ATR 命令。如果获取数据后无法重置java卡。
谢谢 萨吉特
【问题讨论】:
-
您正在谈论向通过 NFC 接口连接的外部非接触式智能卡发送命令(而不是向安全元素直接连接到移动设备),对吧?
-
是的。只是我需要重置 NFC 连接。
标签: android security nfc reset javacard