Extended APDU Commands

2.2k Views Asked by At

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

2

There are 2 best solutions below

0
On

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

5
On

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.