Forum › MIFARE SDK › Trying to read DESFire EV1 Card, requires Authentication. › Reply To: Trying to read DESFire EV1 Card, requires Authentication.
Hello,
Thanks to your answer I'm using the application master key (and not the PICC master key).
The initialization of the keystore doesn't throw any exception now:
But I had to switch the type to KEYSTORE_KEY_TYPE_2K3DES. I don't understand why: my Mifare application was documented as "AES 128 bits method".
My next step is to call authenticate on my objDESFireEV1.
I've tried DESFireEV1.AuthType.AES in the first parameter. No success.
Best regards.
Thanks to your answer I'm using the application master key (and not the PICC master key).
The initialization of the keystore doesn't throw any exception now:
libInstance = NxpNfcLib.getInstance();
libInstance.registerActivity(this, packageKey);
KeyStoreFactory.KeyStoreType kst = libInstance.getKeyStoreType();
try {
IKeyStore iks= libInstance.getKeyStore();
ks = KeyStoreFactory.getInstance().getSoftwareKeyStore();
ks.setKey(0, (byte) 0,
IKeyConstants.KeyType.KEYSTORE_KEY_TYPE_2K3DES, KEY_AES128);
} catch (SmartCardException e) {
showMessage(e.getMessage(), 'l');
showMessage("SmartCardException in init Keystore ... check LogCat",
't');
e.printStackTrace();
}
libInstance.loadKeyStore(ks);
But I had to switch the type to KEYSTORE_KEY_TYPE_2K3DES. I don't understand why: my Mifare application was documented as "AES 128 bits method".
My next step is to call authenticate on my objDESFireEV1.
I've tried DESFireEV1.AuthType.AES in the first parameter. No success.
Best regards.
+ 0
|
- 0