Search code examples
javacardapduuidpcscdesfire

JavaCard with DESFire emulation get Uid´s


I´ve got a JavaCard (SmartMX) with emulated DESFire EV2 and want to get both Uid´s from DESFire and JavaCard.

Therefor I´ve found the following APDU command:

0xFF, 0xCA, 0x00, 0x00, 0x00

But only get the DESFire Uid. May someone tell how to retreive the JavaCard Uid?

I´m using PCSC Lib together with C# .net5.

The documentation is saying, that the first protokoll which is called will be proceed. Therefor I´ve tried to read JavaCard free memory with APDU:

0x00, 0xB0, 0x00, 0x00, 0x02

But after again calling GetUid I´ve received again the DESFire CSN/Uid. May someone also tell which format a JavaCard´s Uid has?


Solution

  • But only get the DESFire Uid. May someone tell how to retreive the JavaCard Uid?

    NXP SmartMX has ISO 14443 type A communication. UID value appears during initialization phase of the contactless protocol (see ANTICOLLISION and SELECT commands in ISO 14443-3). It's before branching between protocols (Mifare and JavaCard protocols). Protocol type A initialization is common for both Mifare and JavaCard. There is no special value for Mifare and special value for JavaCard. Therefore, chip can have only one UID value for all protocols.

    May someone also tell which format a JavaCard´s Uid has?

    As far as I know UID in JCOP cards is configurable until the card is fused. There are several acceptable formats of UID. See your chip datasheet for exact information. Sometimes UID can be random.