1
votes

I want to re-develop new desktop application to read information from EMV smart card and I have logs from previous (working) application.

Assume, there is an app with AID = 44 44 44 44 44 44 44 44 (DDDDDDDD) in the EMV smart card.

I am sending APDU command: 00 A4 04 00 08 44 44 44 44 44 44 44 44 00 and getting timeout exception (timeout = 60s).

I tried to send APDU command: 00 A4 04 00 08 44 44 44 44 44 44 44 44 and got response code = 61 37.

I tried to select file 1PAY.SYS.DDF01, immediately got response = 6a82 (it is right).

2

2 Answers

5
votes

Error code 61XX means you will receive your data after calling Get Response command with Le=XX:

Example:

--> 00 A4 04 00 08 44 44 44 44 44 44 44 44
<-- 61 37
--> 00 C0 00 00 37
<-- some data of length 0x37 and status code 90 00.

Related question: About Get Response command in javacard

Docs by Oracle:

There may be several APDU connections open at the same time using different logical channels with the same card. However, since APDU protocol is synchronous, there can be no interleaving of command and their response APDUs across logical channels. Between the receipt of the command APDU and the sending of the response APDU to that command, only one logical channel is active. For T=0 protocol, for case 4 and case 2 command APDUs the card may respond with '61 XX' or '6C XX'. These special cases MUST be handled by the implementation in the following manner:

'61 XX': The implementation MUST send GET RESPONSE to the card to get the response data before any other command is sent. '6C XX': The implementation MUST resend the command after setting Le equal to XX received from the card before any other command is sent.

In both the cases discussed above, the implementation MUST make sure that between sending the command APDU, receiving status word '61 XX' or '6C XX', and sending GET RESPONSE or resending the command APDU with Le set to XX respectively, there MUST not be any other APDU exchange on any logical channel with the card. In case the status word '61 XX' is received multiple times successively from the card, the implementation must accumulate all the response data received from the card before returning it to the J2ME application. J2ME applications MUST remain oblivious of the exchanges mentioned above and should only get the response received as a result of the above operations.

1
votes

I changed library from RXTXserial to JSSC and it solved my problem. Now I get responses without GET RESPONSE request. Thank you guys.