不能select使用有效AID申请EMV卡

Can't select Application in EMV card using valid AID

我同时拥有 Visa Electron 和万事达借记卡,但是每当我尝试使用各自的 AID A0000000032010 和 A0000000041010 select 应用程序时,我都会收到 6A82 响应,这意味着找不到文件。

这是我的两个 select 离子的代码片段

//SELECTING VISA ELECRON CARD APPLICATION
byte[] ApduCMDVC = new byte[] {  (byte) 0x00, (byte) 0xA4, (byte) 0x04,
            (byte) 0x00, (byte) 0x0E,
            (byte) 0x41, (byte)0x30, (byte) 0x30, (byte) 0x30,
            (byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
            (byte) 0x33,(byte) 0x32,(byte) 0x30,(byte) 0x31,(byte) 0x30};

//SELECTING MASTER CARD APPLICATION
byte[] ApduCMDMC = new byte[] {  (byte) 0x00, (byte) 0xA4, (byte) 0x04,
            (byte) 0x00, (byte) 0x0E,
            (byte) 0x41, (byte)0x30, (byte) 0x30, (byte) 0x30,
            (byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
            (byte) 0x34,(byte) 0x31,(byte) 0x30,(byte) 0x31,(byte) 0x30};

我做错了什么吗?

我回顾了过去为此使用的一些 C++ 代码,我相信你的问题是你发送的 AID 是 ASCII,而不是二进制。这是我使用的 C++ 字节数组:

static  BYTE    selectAIDCmd[] = {0x00, 0xA4, 0x04, 0x00, 0x07, 0xA0, 0x00, 0x00, 0x00, 0x04, 0x10, 0x10 };

所以,你需要这个:

    byte[] ApduCMDMC = new byte[] {  (byte) 0x00, (byte) 0xA4, (byte) 0x04,
        (byte) 0x00, (byte) 0x07,
        (byte) 0xA0, (byte)0x00, (byte) 0x00, (byte) 0x00, (byte)0x03,(byte) 0x20,(byte) 0x10};