Search code examples
javasmartcardapdu

Read write data in SLE4442 smart card with java commandAPDU?


I want to read and write data in SLE4442 smart card i have ACR38U-i1 smart card reader

For write I am use this commandAPDU

byte[] cmdApduPutCardUid = new byte[]{(byte)0xFF, (byte)0xD0,  (byte)0x40,(byte)0x00,  (byte)4,(byte)6,(byte)2,(byte)6,(byte)2};

And for read data

byte[] cmdApduGetCardUid = new byte[]{(byte)0xFF,(byte)0xB0,(byte)0x40,(byte)0x00,(byte)0xFF};

both are execute and send SW= 9000 but no one data receive in responseAPDU Like I write 6262 data but it not receive

I am also use Select command to before write and read command

The select command is

byte[] cmdApduSlcCardUid = new byte[]{(byte)0xFF,(byte)0xA4,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x06};

Have anyone Proper java code to read and write in SLE4442 smart card ?


Solution

  • APDU Commands related to work with Memory Cards could be different for different readers and implemented support. Here is an example for OmniKey reader.

    Take a look to your ACR reader specification and use specific Pseudo-APDU command to work with SLE 4442.

    For your question:

    4.6.1 SELECT_CARD_TYPE: "FF A4 00 00 01 06", where 0x06 in the data meant "Infineon SLE 4432 and SLE 4442".

    4.6.2 READ_MEMORY_CARD: "FF B0 00 [Bytes Address] [MEM_L]", where

    • [Bytes Address]: is the memory address location of memory card
    • [MEM_L]: Length of data to be read from the memory card

    4.6.5 WRITE_MEMORY_CARD: "FF D0 00 [Bytes Address] [MEM_L] [Data]"

    • [Data]: data to be written to the memory card

    You used P1 = 0x40 and this could be an issue.