APDU for get UID from mifare desfire? -


i new apdus. read datasheet desfire. according have:

cla  = 0x90      ins  = desfire cmd code                                             p1   = 0x00         p2   = 0x00 lc   = length of wrapped data     data = desfire command parameter(s)  le   = 0x00 

i want desfire uid, can't create command apdu this. can lead me right direction? created apdu not sure if it's correct:

byte[8] cmd_apdu_getuid_part1= {0x90 , 0x93 , 0x20 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00}; 

and don't understand concept of parameters lc , don't find ins uid. 0x93 ox20 part 1 of uid , 0x95 0x20 part 2 of uid?

the commands 9x 20 part of lower iso 14443-3 protocol , used during anticollision , activation of card. apdus, on other hand, exchanged on higher protocol layer , after activation of card. hence, can't use these command codes in apdus.

how uid desfire (ev1) card depends on type of id want get:

  • get uid used during anti-collision phase: depends on reader (and possibly device platform) use. instance, pc/sc compliant contactless smartcard readers typically allow read anti-collision identifier of selected card using pc/sc specific apdu

    ff ca 00 00 xx 

    (where xx either 00 or expected length of uid, desfire typically 04 or 07).

  • (desfire ev1 only) get uid of card if card's random-uid feature not activated: need use getversion command (see desfire ev1 datasheet). need set ins command code find in datasheet (cmd), lc , data not present:

    90 cmd 00 00 00 

    the answer like

    <several response data bytes> 91 status 
  • (desfire ev1 only) get uid of card if card's random-uid feature activated: far more complex. first need authenticate card. can use getcarduid command (see desfire ev1 datasheet) retrieve actual card uid. again, command like

    90 cmd 00 00 00 

    the answer like

    <uid (encrypted)> 91 status 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -