1

I have an applet that works fine on contact card. Now i have a dual interface card (IDCore 3020) and i load my applet via contact interface to it. Also i have a contactless smartcard reader(acr122u) and i want to send APDU command via contactless interface and get response APDU. i sent SelectApplet APDU to card like this but i failed (SW = 6300):

00 A4 04 00 09 [A0,00,00,03,08,00,00,10,00] 00

I have three questions:

1- Can i use my applet in contactless mode like contact with same APDUs?

2- should i do anything to contactless reader recognize my card?

3- does current minidriver that work with contact card also works with contactless card?

Mohsen Gorgani
  • 420
  • 4
  • 18
  • 1
    `63 00` is a rather uncommon error code in response to a SELECT command, but it an error code that is frequently used by the ACR122U to indicate a generic error. Could it be that your reader did not (yet) detect the card? Is "Auto PICC polling" and "Auto ATS generation" for ISO 14443 Type A / Type B enabled on your reader (some versions of the ACR122U do not enable this by default)? – Michael Roland Jun 09 '16 at 16:00
  • 1
    Are you using `APDU.getProtocol()` during applet selection to filter access? Does your card implement Global Platform Amendment C (AFAIK IDCore 3020 does not, but I am not that sure...)? Does selecting any other application (e.g. ISD) work using contactless interface? – vlp Jun 09 '16 at 16:25
  • Thanks Micheal for reply. It's true and my reader did not detect the card yet. i can get reader firmware by followong apdu: FF 00 48 00 00 [] 00, but when i want to get picc parameter by following command: FF 00 50 00 00 [] 00, i failed and it returns 6300, also when i want to set these parameter by following command: FF 00 51 00 00 [] 00, it returns 6300 too. why is this happening? – Mohsen Gorgani Jun 11 '16 at 11:40
  • Thank you too vlp. not there is not a filter for contactless interface in select applet. I tested the reader by a transportation card that is a Mifare1K and sent follow command: FF 00 00 00 02 [D4,04] 00 to get current setting of contactless interface and reader returned D5 05 00 00 00 80 90 00 that means there is no tag in the field. i must mention that my mifare1K detected by my android phone using opensource app. – Mohsen Gorgani Jun 11 '16 at 11:54
  • That's odd (I assume that you are not actually sending both Lc = 0x00 and Le = 0x00, but actually meant that you don't send Lc (since it is zero) and only send Le as 0x00 (indicating up to 256 bytes of response data), right?). You could try to manually poll for tags then (polling command: FF 00 00 00 07 [D4 60 FF 01 10 20 23]). – Michael Roland Jun 24 '16 at 10:08
  • Thank you Micheal. After executing (polling command: FF 00 00 00 07 [D4 60 FF 01 10 20 23]), the response is:( D5 61 01 10 09 01 00 04 28 04 49 6B FF 5D 90 00). probably reader can detect my IDCore 3020 card successfully. Then when i send (FF 00 00 00 02 [D4,04] 00 ), the response is (D5 05 01 00 01 01 00 00 00 80 90 00) that is different by old response (D5 05 00 00 00 80 90 00). This means reader can detect the card succsessfull, but any other command return 6300. I think the reader doesn't connected to card yet. How i connect to card and send select applet to it? – Mohsen Gorgani Jun 28 '16 at 06:18
  • I use JSmartcardExplorer for connecting to card (or reader) ([link](https://sourceforge.net/projects/jsmartcard/)). when i press connect button it seems, JSmartcardExplorer connect to the reader not the card. How to connect to card and get ATS? – Mohsen Gorgani Jun 28 '16 at 06:50

1 Answers1

2

1- Can i use my applet in contactless mode like contact with same APDUs?

Yes, certainly, unless you explicitly disallow it in your code (using getProtocol.

2- should i do anything to contactless reader recognize my card?

No, if you have a PCSC & ISO/IEC 14443 compatible reader you should be able to communicate with it (and you have). I'm not sure what you mean with "recognize" here, but it certainly should be able to see it.

It could give a different ATS than the ATR given by the contact interface. The ATR/ATS is generated before the more general APDU interface can be used.

3- does current minidriver that work with contact card also works with contactless card?

That could be the case, but note the remark about the ATR/ATS above.

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
  • Thank you Maartan for your answer. But why my reader (ACR 122U) doesn't see my cards. I tested the reader with Mifare1K by following command: FF 00 00 00 02 [D4,04] 00 to get current setting of contactless interface and reader returned D5 05 00 00 00 80 90 00 that means there is no tag in the field. It seems the reader doesn't poll for detecting cards. – Mohsen Gorgani Jun 12 '16 at 05:00
  • Could it be a problem with the card itself? Does it actually have an antenna attached? Using MIFARE commands to check other cards is probably not a good idea; it could be implementation specific what you get back. Normally I would suggest another reader as well; maybe your mobile phone has an NFC reader you can use to check for tags? – Maarten Bodewes Jun 12 '16 at 08:25
  • I have another contactless card. My transportation card is a Mifare1K card. I tested it with my phone and it could successfully detect the card therefore the card (MIFARE1K) works correctly. previous commands had tested by MIFARE1K card. I think, there is a problem with ACR122U card reader. How can test whether the reader works correctly or not? I must mention that get firmware command work currectly but it can not detect any card. – Mohsen Gorgani Jun 12 '16 at 10:21