I would like to exchange data with an external smart card, but I don't know how the APDU commands should be written.
Can anybody give me some explanations or sample?
Thanks
I would like to exchange data with an external smart card, but I don't know how the APDU commands should be written.
Can anybody give me some explanations or sample?
Thanks
Sending APDU commands to smartcard requires CAD (Card acceptance device).
Assuming u have the setup to communicte with smart card
CLA INS P1 P2 LC DATA LE
Eg: 8050000005010203040500
for APDU commands refer this link
http://www.ttfn.net/techno/smartcards/iso7816_4.html
thanks and regards
sunil
Hello esunilkumare,
I'm trying to build and APDU for authenticatiion without any luck. Actually all my commands are rejected by the card/reader. By the way, if I have to write an NDEFMessage which length is variable depending on what the user inputs, it might take more sectors to write on the Mifare card right? If so, then should I authenticate each of those sectors???
Thank you!!!
Hello esunilkumare,
I don't know, I guess I want to authenticate a Mifare portion. I mean, all I need is to write an NDEFMessage to a Mifare card, and I've read I have to authenticate to sectors in order to perform and R/W operation, but I have no clue. I'm really newbie in this...
I know my question might seem stupid, but thanks a lot anyway!
If you are using NDEFMessage, NDEFRecord and connection.write() methods and classes, you dont need to do the auentication process explicitly. it will be taken care by the API(ie, it will take the known keysets for authentication).
esunilkumare, I wasn't clear on my post. I'm doing this writing with an Omnikey reader. The MIDlet part is not the problem. The thing is, I don't really know much about these "keys" things, how to write them, where to write them etc.
What I need is to write my NDEFMessage (I have already deciphered it, and know how to convert it to the Hexa values) to the Mifare card and make it readable by the Nokia, which I've read uses the keys D3F7D3F7D3F7. How and where do I write those keys with the Omnikey 5321?!!
Thanks a lot esunilkumare
hi juancarlosr,
to write to a mifare tag, first we should know the memory archetecture. please have a look at the datasheet :
http://www.nxp.com/acrobat_download/...S50_rev5_3.pdf
in page 7 under topic 6.6 Memory organization.
for setting keys, each sector contains a trailer which holds these keys. this also contains access bits which controls the access (read/write etc) of keys and datablocks.
this is in page 12 under topic 6.7.1 Access conditions
hope this helps
thanks and regards
sunil
hi,
i'm trying to increment / decrement a block memory of a MIFARE 1k but this block still in a plain read / write block not a value block can you tell me please what is the APDU to use to change this block in a value block so i can use the APDU for incrementing.
thanks
Hallo Rym,
If you are trying to do this from a MIDlet on the phone, you cannot use (pseudo-)APDUs to access the MIFARE card. Instead you use Nokia's MIFARE API (com.nokia.nfc.nxp.mfstd). To format a data block into a value block, you would do something like the following:
- open a MFStandardConnection to the card
- retrieve the MFBlock
- read the block with the MFBlock.read() method
- parse the current value (you read the whole data block, not the value so far)
- store the value back with the MFBlock.writeValue() method
br,
Michael