×

Discussion Board

Results 1 to 11 of 11

Thread: APDU command

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    3

    APDU command

    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

  2. #2
    Registered User
    Join Date
    Apr 2006
    Posts
    3

    Re: APDU command

    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

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    182

    Re: APDU command

    for APDU commands refer this link

    http://www.ttfn.net/techno/smartcards/iso7816_4.html

    thanks and regards
    sunil

  4. #4
    Registered User
    Join Date
    Sep 2007
    Posts
    40

    Re: APDU command

    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!!!

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    182

    Re: APDU command

    Quote Originally Posted by juancarlosr View Post
    Hello esunilkumare,

    I'm trying to build and APDU for authenticatiion without any luck. Actually all my commands are rejected by the card/reader.
    are you trying to authenticate yourself during a SE operation or you are using mifare portion ?

  6. #6
    Registered User
    Join Date
    Sep 2007
    Posts
    40

    Re: APDU command

    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!

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    182

    Re: APDU command

    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).

  8. #8
    Registered User
    Join Date
    Sep 2007
    Posts
    40

    Re: APDU command

    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

  9. #9
    Registered User
    Join Date
    Oct 2006
    Posts
    182

    Re: APDU command

    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

  10. #10
    Registered User
    Join Date
    Jun 2010
    Posts
    1

    Re: APDU command

    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

  11. #11
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: APDU command

    Hallo Rym,

    Quote Originally Posted by Rym View Post
    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.
    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:
    1. open a MFStandardConnection to the card
    2. retrieve the MFBlock
    3. read the block with the MFBlock.read() method
    4. parse the current value (you read the whole data block, not the value so far)
    5. store the value back with the MFBlock.writeValue() method


    br,
    Michael

Similar Threads

  1. How can i solve this error?
    By symbian-newbie in forum Symbian
    Replies: 6
    Last Post: 2006-05-23, 05:33
  2. Can I send apdu command to sim card in NOKIA 3250?
    By menye in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-04-24, 07:59
  3. Can I send apdu command to sim card in NOKIA 3250?
    By arlaichin in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2006-02-09, 13:03
  4. Getting started with Carbide.vs -- running the app
    By ET3D in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2005-11-23, 17:45
  5. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •