Trying to read DESFire EV1 Card, requires Authentication.

Forum / MIFARE SDK / Trying to read DESFire EV1 Card, requires Authentication.

Tagged: ,

  • 9. March 2016 at 19:18
    Hey there,

    The issue was that I wasn't specifying the CommunicationType. Once I added that in, I was able to read the second file.

    Thanks for your help!
    Michael
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    17. March 2016 at 9:36
    Hello,
    I would like to use your example above but I'm lost.
    I want to read applications and files from a DESFire EV1 card.
    I'm using the Lite SDK (it's not clear what's in or not in the Advanced SDK for DESFire).
    I don't have methods like getApplicationIDs, readData, ...
    My code comes from the sample app and uses a NxpNfcLibLite libInstance, a Nxpnfcliblitecallback callback and onDESFireCardDetected method.
    I've read the posts here and still don't understand if I have to use both com.nxp.nfclib.* and com.nxp.nfcliblite.* in the same code.
    Thanks for your help.
    Best regards.
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    17. March 2016 at 10:56
    Hi César,

    You find a comparison between both SDK’s here:

    https://www.mifare.net/en/products/tools/mifare-sdk/

    Currently we have two different libraries, the Lite and the Advanced SDK. The Lite SDK has some limited capabilities, e.g.: no hardware keystore, no support of SAM etc.

    If you program with the Lite or with Advanced SDK you have class objects which almost very similar. Please have a look into the sources of the sample app. A more elaborated documentation of the classes can be found here:

    https://www.mifare.net/files/lite_javadoc/overview-summary.html

    I hope, it helps to make the first successful steps…

    The MIFARE Team
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    17. March 2016 at 11:06
    Thanks for your answer.
    My problem is that com.nxp.nfcliblite.cards.IDESFireEV1 and com.nxp.nfclib.desfire.DESFireEV1 are different.
    I can't find a usage of getApplicationIDs, readData, ... in the sample app.
    Extract:

    @Override
    public void onDESFireCardDetected(final IDESFireEV1 objDESFire) {

    if (mCardType == EnumCardType.EnumDESFireEV1 && mIsPerformingCardOperations) {
    //Already Some Operations are happening in the same card, discard the callback
    Log.d(TAG, "----- Already Some Operations are happening in the same card, discard the callback: " + mCardType.toString());
    return;
    }
    mIsPerformingCardOperations = true;
    mCardType = EnumCardType.EnumDESFireEV1;

    mDESFire = objDESFire;
    /* Insert your logic here by commenting the function call below. */
    try {
    mDESFire.getReader().close();
    mDESFire.getReader().connect();
    desfireCardLogic();
    } catch (Throwable t) {
    t.printStackTrace();
    showMessage("Unknown Error Tap Again!", 't');
    }

    mIsPerformingCardOperations = false;
    }

    In desfireCardLogic, I can get the card name or the uid, but I don't understand how to go deeper, get the application list and so on.

    DESFireEV1.CardDetails details = mDESFire.getCardDetails();
    showMessage("cardName : " + details.cardName, 'a');
    String uid = Utilities.dumpBytes(details.uid);
    showMessage("uid:" + uid, 'a');

    Thanks.
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    18. March 2016 at 10:43
    Cesar, I have the same problem.

    There is DESFireEV1 class and IDESFireEV1. I could operate with IDESFireEV1 for doing application using personalize function but it always create File ID "00" so it is so limited that cant work with that. Why there is DESFireEV1 and IDESFireEV1? Is there possibilities to do other File ID:s than "00" using IDESFireEV1 class?

    Br, Ville
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    22. March 2016 at 15:44
    Cesar, Did you find any solution for this?

    I am still struggling with this.

    @Override
    public void onDESFireCardDetected(final IDESFireEV1 objDESFire) {

    if(mCardType == EnumCardType.EnumDESFireEV1 && mIsPerformingCardOperations){
    //Already Some Operations are happening in the same card, discard the callback
    Log.d(TAG, "----- Already Some Operations are happening in the same card, discard the callback: " + mCardType.toString());
    return;
    }
    mIsPerformingCardOperations = true;
    mCardType = EnumCardType.EnumDESFireEV1;

    mDESFire =objDESFire;
    /* Insert your logic here by commenting the function call below. */
    try {
    mDESFire.getReader().close();
    mDESFire.getReader().connect();
    showMessage("DESFire EV1 Found", 't');

    }catch (Throwable t) {
    t.printStackTrace();
    showMessage("Unknown Error Tap Again!", 't');
    }
    mIsPerformingCardOperations = false;
    }

    The Code on top works but then all functions are very limited for mDESFire object.
    If I change declaration ->
    private IDESFireEV1 mDESFire; to private DESFireEV1 mDESFire; and "final IDESFireEV1 objDESFire" to "final DESFireEV1 objDESFire" then function on top cant be @Override and then it wont trigger when DESFire card found. So what is the solution that I cant use functions under DESFireEV1 (com.nxp.nfclib.desfire)? I am working with sample app and lib is "nxpnfclib".


    For IDESFireEV1 (com.nxp.nfcliblite.cards) there is only these functions:

    public interface IDESFireEV1 {
    String TAG = "DESFire_LITE";
    void writeNDEF(byte[] var1, NdefMessage var2) throws SmartCardException;
    NdefMessage readNDEF(byte[] var1);
    void updatePICCMasterKey(byte[] var1, byte[] var2) throws SmartCardException;
    void authenticate(byte[] var1, byte[] var2, byte[] var3) throws SmartCardException;
    void personalize(byte[] var1, byte[] var2, byte[] var3) throws SmartCardException;
    void updateApplicationMasterKey(byte[] var1, byte[] var2, byte[] var3, byte[] var4) throws SmartCardException;
    void write(byte[] var1) throws SmartCardException;
    byte[] read(int var1) throws SmartCardException;
    CardDetails getCardDetails() throws SmartCardException;
    void format(byte[] var1) throws SmartCardException;
    byte[] getUID() throws SmartCardException;
    IReader getReader();
    Type getType();
    + 1  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    22. March 2016 at 17:18
    Cesar,

    My solution was to use the Advanced SDK. After purchasing credits for this, I was able to get the application IDs and select the application on the card, then read the data off the application.

    Hope this helps,
    Michael
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    29. March 2016 at 18:15
    How does the purchase of the Advanced SDK work?
    You have to pay to get the SDK binaries? To use it? For each usage?
    Thanks.
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    29. March 2016 at 22:21
    You pay for a certain amount of credits, and from what I can see, the amount of credits you have is the amount of active users you can have at one time. For example, if you had 1000 credits, you could have 1000 different people using your app at once. (MiFare, please correct me if I'm wrong).
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    1. April 2016 at 11:48
    Hi Michael,

    Yes, this is correct. You can have one app (package name) or more. Every activated copy on a phone counts, regardless how this is distributed.

    The MIFARE Team

    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    13. April 2016 at 11:03
    Hello,

    I would like to buy the MIFARE Advanced SDK for Android but the website isn’t working.
    I’d like to create a MIFARE SDK developer account on your website https://inspire.nxp.com/mifare/register.html but can’t get the activation message.
    I’ve tried on several e-mail inboxes.
    The function to reset the password doesn’t work either.
    The NXP MIFARE e-mail support didn't give me an answer.
    Best regards.

    César
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    13. April 2016 at 11:32
    Hi César,

    I just tried to login at:

    https://inspire.nxp.com/mifare/index.html

    It works, but it feels a little bit slow. I will ask the server team if there is an issue.

    Regards,
    The MIFARE Team
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    13. April 2016 at 11:45
    Thanks but my problem is that my account is not activated and I can't get the activation/reset link.
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    14. April 2016 at 15:10
    Hi César,

    I got a message from the web server team that your activation was probably gone to your spam folder. The web server guys activated your account.

    Please let me know if the issue still exists.

    Regards,
    The MIFARE Team
    + 0  |  - 0

    Re: Trying to read DESFire EV1 Card, requires Authentication.

    14. April 2016 at 16:52
    Thanks for you help.
    I've checked my spam folder.

    The problem is that my password is now invalid and I still can't ask for a reset.
    And foremost I would like to subscribe to the advanced sdk with an other e-mail address (for mydev team, "equipesoft" on the same domain).
    + 0  |  - 0
Viewing 15 posts - 16 through 30 (of 46 total)

You must be logged in to reply to this topic.