Strange Invalid CLA Team (6E 00) on Java SmartCard IO

I write an application for smart cards and after successfully selecting an application with its AID, when it is sent to send processing processing parameters

I get 6E 00 as a response - Invalid CLA command. This is part of the code that sends a command and receives a response:

ResponseAPDU rapdu = sendCommand(new byte[]{(byte)0x80, (byte)0xA8, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0x83, (byte)0x00, (byte)0x00}); private ResponseAPDU sendCommand(byte[] apdu) throws CardException{ CommandAPDU capdu = new CommandAPDU(apdu); ResponseAPDU rpd = channel.transmit(capdu); return rpd; } 

I use the same command to read the map using the Jaccal library, and it works fine, but it's just that jaccal is not suitable for my application due to the use of an external dll file. I do not know why this gives me such an answer.

+6
source share
2 answers

Several blog / forum posts discuss this issue:

In my case, VISA cards look “forgiving,” but MasterCards are not (6E 00). Please note that, contrary to advice, upgrading to Java 7 did not fix this for me. You are probably looking at the sun.security.smartcardio.t0GetResponse solution and processing responses.

I did the following to make it work:

 System.setProperty("sun.security.smartcardio.t0GetResponse", "false"); 

Process responses with GET RESPONSE (see EMV 4.3, book 1, section 9.3.1.3). This link is also useful:

+6
source

Basically this error due to the command you are passing does not match. Just check (0x80) that the first field is correct or incorrect. In the OS card of the card, it checks the fist field with the expected value, if it does not match it, sends a CLA Not Found Exception means error code 6E 00. You will need to provide more detailed information about what you are doing - which card, version, GP compliance A list of existing cards that you are using. What language do you work in (e.g. net or java) so that I can help you.

-1
source

Source: https://habr.com/ru/post/903405/


All Articles