How do I read the PAN from an EMV SmartCard from Java

前端 未结 6 998
失恋的感觉
失恋的感觉 2020-12-13 22:15

I need to read account number from Maestro/Mastercard with smart card reader. I am using Java 1.6 and its javax.smartcardio package. I need to send APDU command which will a

6条回答
  •  星月不相逢
    2020-12-13 22:39

    You shouldn't need to wrap the APDU further. The API layer should take care of that.

    It looks like the 0x6D00 response just means that the application did not support the INS.

    Just troubleshooting now, but you did start out by selecting the MasterCard application, right?

    I.e. something like this:

    void selectApplication(CardChannel channel) throws CardException {
      byte[] masterCardRid = new byte[]{0xA0, 0x00, 0x00, 0x00, 0x04};
      CommandAPDU command = new CommandAPDU(0x00, 0xA4, 0x04, 0x00, masterCardRid);
      ResponseAPDU response = channel.transmit(command);
      return response.getData();
    }
    

提交回复
热议问题