Forum › MIFARE SDK › Desfire AppID › Re: Desfire AppID
Hi,
Below are the steps to create application and writing and reading from it for factory default card.
public void onDESFIRECardDetected(final DESFire objDesfire) {
NxpLogUtils.i(TAG, "Desfire Card Detected!!");
desfire = objDesfire;
/* Insert your logic here by commenting the function call below. */
// New Card Master Key.
byte[] cardKey = new byte[] { 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
// New Application Key.
byte[] appKey = new byte[] { 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
// Application ID.
byte[] appID = new byte[] { 0x12, 0x12, 0x12 };
// Data to write.
byte[] data = new byte[] { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11 };
try {
objDesfire.connect();
objDesfire.setTimeOut(2000);
// Only Use First personalize API, for subsequent use with the same card replace
// personalize with authenticate API.
objDesfire.personalize(cardKey, appID, appKey);
objDesfire.write(data);
byte[] Readdata = objDesfire.read(5);
objDesfire.close();
} catch (Exception t) {
showMessage("Unknown Error Tap Again!", 't');
}
}
Note: please refer sample application code for further information.
Regards,
MIFARE SDK Team
Below are the steps to create application and writing and reading from it for factory default card.
public void onDESFIRECardDetected(final DESFire objDesfire) {
NxpLogUtils.i(TAG, "Desfire Card Detected!!");
desfire = objDesfire;
/* Insert your logic here by commenting the function call below. */
// New Card Master Key.
byte[] cardKey = new byte[] { 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
// New Application Key.
byte[] appKey = new byte[] { 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
// Application ID.
byte[] appID = new byte[] { 0x12, 0x12, 0x12 };
// Data to write.
byte[] data = new byte[] { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11 };
try {
objDesfire.connect();
objDesfire.setTimeOut(2000);
// Only Use First personalize API, for subsequent use with the same card replace
// personalize with authenticate API.
objDesfire.personalize(cardKey, appID, appKey);
objDesfire.write(data);
byte[] Readdata = objDesfire.read(5);
objDesfire.close();
} catch (Exception t) {
showMessage("Unknown Error Tap Again!", 't');
}
}
Note: please refer sample application code for further information.
Regards,
MIFARE SDK Team
+ 0
|
- 0