Integrity Error on Change Key Desfire EV3 on Android

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Integrity Error on Change Key Desfire EV3 on Android

371 Views
saikumar_CH
Junior Contributor I

Environment Details:

Card:
- MIFARE DESFire EV3

SDK:
- NXP TapLinx

Android:
- Android Studio + Kotlin

Transport:
- IsoDep

Library Interface:
- IDESFireEV1

Goal:
1. Create DESFire EV3 application
2. Change application master key (key 0)
3. Authenticate with new key

Working:
- PICC authentication
- formatPICC()
- createApplication()
- selectApplication()

Failing:
- authenticate() on newly created AES application
OR
- changeKey() with SW2=30Working:
- PICC authentication
- formatPICC()
- createApplication()
- selectApplication()

Failing:
- changeKey() with SW2=30

 Logcat:
Integrity Error SW2 = 30
 com.nxp.nfclib.desfire.DESFireUtil.invalidResponse(:260)
com.nxp.nfclib.desfire.DESFireResponse.invalidResponse(:174)
 com.nxp.nfclib.desfire.DESFireEV2.changeKeyCommandTransfer(:1034)
com.nxp.nfclib.desfire.DESFireEV1.changeKeyHelper(:1215)
com.nxp.nfclib.desfire.DESFireEV2.changeKey(:851)



private fun createApplication() {
        val s = EV1ApplicationKeySettings.Builder()
            .setAppMasterKeyChangeable(true)
            .setAppKeySettingsChangeable(true)
            .setAuthenticationRequiredForFileManagement(true)
            .setAuthenticationRequiredForDirectoryConfigurationData(true)
            .setMaxNumberOfApplicationKeys(3)
            .setKeyTypeOfApplicationKeys(KeyType.TWO_KEY_THREEDES)
            .build()
        desfire.createApplication(AID, s)
        detail("  createApplication: AID=${AID.toHex()}, type=$KEY_TYPE, numKeys=3")
    }



desfire.changeKey(keyNo, KeyType.TWO_KEY_THREEDES, oldKey, newKey, 0x00)

 

0 Kudos
Reply
1 Reply

316 Views
KaiLi
NXP TechSupport
NXP TechSupport

Hello @saikumar_CH 

Recommends you to refer Sample_Application_Android\src\main\java\com\nxp\sampletaplinx\WriteActivity, there has desfireEV3CardLogic could be helpful to you.

0 Kudos
Reply