-1

Hello All,

I am working on the Contact card(CT) reader, in which I need send more 256 bytes of data. I have read alot on online for the solutions, As they mentioned the T=0 and T=1 protocols and all and even I also readed about the extended APDU command which supports & capable of sending larger bytes to the card.

After reading all the details I have searched alot for the command set for the extended APDU commands, but I could not get it.

As, I have one SAM card sim sized contact card, one credit card type contact card and one Mifare DesFire Ev2 4k contactless card(CL) card in which I need to write larger data bytes using the extended APDU commands.

After searching alot I could not found any ISO-7816 Extended APDU commands so that I can write such large data byte in the cards.

So, Can you please share me the Extended APDU commands sets through which I can perform my operation for write and read on the card with large data bytes.

Looking forward for the Extended APDU command sets ....

All the support are highly appreciated.

Thanks in advance.

Warm Regards Sachin

SACHIN RAJPUT
  • 11
  • 1
  • 4

2 Answers2

0

Actually there are no special commands, you just send the properly formatted LC and LE fields. If the command requires both, their extended state has to match.

Some caveats:

  • Ensure, the respective card supports extended length. While EF.info or card capabilities in the ATR may indicate something, existence of this indication can't be taken for granted, and the actual limit has to be found out additionally.

  • For cards, where the APDUs are translated into something else by the driver of the reader (Memory cards) and of course for those, where a quite limited block size applies (MIFARE classic, DesFire EV1), extended APDU may not be an option.

guidot
  • 5,095
  • 2
  • 25
  • 37
  • Hi, 1. Yes I read that there no such special commands are available. We need to extend our LC parameter from 1 byte(C0) to 3 bytes(C3C2C1) where one byte is to be zero indicating the 2 bytes size of extended command. 2. Yes, card need to be checked for the supported extended length. Can let me know that how we can derive conclusion from the ATR that card supports the extended length or not. 3. Actually I am using the Mifare DesFire Ev2 4k contact less card which support the ISO 7816 CT card command for RD/WR. And I need the 300 bytes of data to card in single APDU command. – SACHIN RAJPUT Jun 10 '20 at 06:03
  • And the Mifare DesFire card has the memory of the 4k and I am trying the 300 bytes of data to in the single APUD command exchange, So I came to know about the extended APDU commands sets. Here I am sharing my link through I got the idea about the Extended APDU : https://askra.de/software/jcdocs/app-notes-2.2.2/extapdu.html https://docs.oracle.com/en/java/javacard/3.1/guide/extended-apdu-format.html#GUID-0F452782-9402-43E9-B39C-337772C200DF It will really great of your if you can share me such commands for the above. – SACHIN RAJPUT Jun 10 '20 at 06:05
  • @SACHINRAJPUT: The fact, that the card has 4 kByte does not mean you can read arbitrary sizes; this is why I referred to block structure. Card capabilities are described in ISO 7816-4(2013), section 12.1.1.9, EF.ATR/INFO in section 12.2.2. – guidot Jun 10 '20 at 07:03
  • I know we cannot read arbirtary size if it has 4k bytes of memory. – SACHIN RAJPUT Jun 17 '20 at 06:24
  • I know we cannot write arbitrary size if it has 4k bytes of memory. The thing is that as I gone through the online searches for the write larger data 256 bytes then we can use extended APDU commands wright ? And as Mifare DesFire Ev2 4k card is support extended length command So I am trying to use it. to send all the data direct in single APDU command.(Mifare Desfire Ev2 4k also support ISO 7816 protocols). And I will go through the suggested section above and it great if can share some detail regarding the write larger data to card in least or short APDU command execution. – SACHIN RAJPUT Jun 17 '20 at 06:31
0

As guidot answered, you just have to encode Lc and Le fields if you're trying to send more than 8-bit range (1..255). Please refer the encoding rules in this page for more info: Extended APDU encoding

Note: Both Lc and Le have to be formatted if you're going for an extended format.

Regards, Badhri