5.10.1. MIFARE DESFire EV2 : Prepare Secure Element¶
5.10.1.1. Prerequisites¶
Bring Up Hardware. (Refer Development Platforms)
Connect RC663 to your microcontroller. (Refer mifarekdf-rc663)
5.10.1.2. About the Example¶
This is an example project for provisioning the SE05x for running other SE05x MIFARE DESFire EV2 examples. This example Creates the required Se05x secure objects for further use by other examples.
5.10.1.3. The two AES key storage for NFC application in SE05x¶
This example calls the - InitialSetupSe050()
:
which inits, allocates and sets the AES keys.
The keyIDs are as below
#define MFDFEV2_KEYID (EX_SSS_OBJID_DEMO_MFDF_START)
#define MFDFEV2_CK_AUTH (EX_SSS_OBJID_DEMO_MFDF_START + 1)
#define MFDFEV2_CK_CHANGED_KEYID (EX_SSS_OBJID_DEMO_MFDF_START + 2)
#define MFDFEV2_CK_REVERT_KEYID (EX_SSS_OBJID_DEMO_MFDF_START + 3)
#define MFDFEV2_DK_AUTH (EX_SSS_OBJID_DEMO_MFDF_START + 4)
#define MFDFEV2_DK_MASTERKEY (EX_SSS_OBJID_DEMO_MFDF_START + 5)
#define MFDFEV2_DK_CHANGED_KEYID (EX_SSS_OBJID_DEMO_MFDF_START + 6)
#define MFDFEV2_DK_DIVERSIFY_AGAIN_KEYID (EX_SSS_OBJID_DEMO_MFDF_START + 7)
#define EX_SSS_OBJID_DEMO_MFDF_START 0x7D5DF000u
5.10.1.3.1. Key values¶
The key that is provisioned into SE05x is called the oldKey and newKey and it takes the values as below.
const uint8_t oldKeyValue[KEY_BIT_LEN / 8] = { 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
const uint8_t newKeyValue[KEY_BIT_LEN / 8] = { 0x01, 0x02, 0x03, 0x04,
0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c,
0x0d, 0x0e, 0x0f, 0x10 };
5.10.1.4. Running the Demo¶
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo
If everything is setup correctly the output would be as follows:
sss:INFO :atr (Len=35)
00 A0 00 00 03 96 04 03 E8 00 FE 02 0B 03 E8 08
01 00 00 00 00 64 00 00 0A 4A 43 4F 50 34 20 41
54 50 4F
sss:WARN :Communication channel is Plain.
sss:WARN :!!!Not recommended for production use.!!!
App:INFO :SE050 prepared successfully for MIFARE DESFire EV2 examples
App:INFO :ex_sss Finished