NXP Reader Library  v17.1.0.2535
Commands_ApplicationManagement

These Components implement the MIFARE DESFire EVx Application Management related commands. More...

Collaboration diagram for Commands_ApplicationManagement:

Functions

phStatus_t phalMfdfEVx_CreateApplication (void *pDataParams, uint8_t bOption, uint8_t *pAid, uint8_t bKeySettings1, uint8_t bKeySettings2, uint8_t bKeySettings3, uint8_t *pKeySetValues, uint8_t *pISOFileId, uint8_t *pISODFName, uint8_t bISODFNameLen)
 Creates new applications on the PICC. More...
 
phStatus_t phalMfdfEVx_DeleteApplication (void *pDataParams, uint8_t *pAid, uint8_t *pDAMMAC, uint8_t bDAMMAC_Len)
 Permanently deletes the applications on the PICC. More...
 
phStatus_t phalMfdfEVx_CreateDelegatedApplication (void *pDataParams, uint8_t bOption, uint8_t *pAid, uint8_t *pDamParams, uint8_t bKeySettings1, uint8_t bKeySettings2, uint8_t bKeySettings3, uint8_t *pKeySetValues, uint8_t *pISOFileId, uint8_t *pISODFName, uint8_t bISODFNameLen, uint8_t *pEncK, uint8_t *pDAMMAC)
 Creates new Delegated application For delegated application creation, the PICC level (AID 0x000000) must have been selected. More...
 
phStatus_t phalMfdfEVx_SelectApplication (void *pDataParams, uint8_t bOption, uint8_t *pAid, uint8_t *pAid2)
 Selects one particular application on the PICC for further access. More...
 
phStatus_t phalMfdfEVx_GetApplicationIDs (void *pDataParams, uint8_t bOption, uint8_t **pAidBuff, uint8_t *pNumAid)
 Returns application identifiers of all applications on the PICC. More...
 
phStatus_t phalMfdfEVx_GetDFNames (void *pDataParams, uint8_t bOption, uint8_t *pDFBuffer, uint8_t *bDFInfoLen)
 Returns the Dedicated File(DF) names. More...
 
phStatus_t phalMfdfEVx_GetDelegatedInfo (void *pDataParams, uint8_t *pDAMSlot, uint8_t *pDamSlotVer, uint8_t *pQuotaLimit, uint8_t *pFreeBlocks, uint8_t *pAid)
 Parameters associated with the delegated application can be retrieved using this command. More...
 

Option to represent the selection of secondary application.

#define PHAL_MFDFEVX_SELECT_PRIMARY_APP   0x00U
 Option for Primary application selection.
 
#define PHAL_MFDFEVX_SELECT_SECOND_APP   0x01U
 Option for Secondary application selection.
 

Detailed Description

These Components implement the MIFARE DESFire EVx Application Management related commands.

Function Documentation

◆ phalMfdfEVx_CreateApplication()

phStatus_t phalMfdfEVx_CreateApplication ( void *  pDataParams,
uint8_t  bOption,
uint8_t pAid,
uint8_t  bKeySettings1,
uint8_t  bKeySettings2,
uint8_t  bKeySettings3,
uint8_t pKeySetValues,
uint8_t pISOFileId,
uint8_t pISODFName,
uint8_t  bISODFNameLen 
)

Creates new applications on the PICC.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Option to represent the present of ISO information.
[in]pAid[In] The application identifier to be used. Will be of 3 bytes with LSB first. If application 01 need to be created then the Aid will be 01 00 00.
[in]bKeySettings1[In] Application Key settings.
[in]bKeySettings2[In] Additional key settings.
[in]bKeySettings3[In] Additional key settings.
[in]pKeySetValues[In] The Key set values for the application. Should as mentioned below.
Byte0 = AKS Ver
Byte1 = Number of KeySets
Byte2 = MaxKeysize
Byte3 = Application KeySet Settings.
[in]pISOFileId[In] ISO File ID to be used. Will be two bytes.
[in]pISODFName[In] ISO DF Name to be used. Will be 16 bytes and can also be NULL based on the option.
[in]bISODFNameLen[In] Length of bytes available in ISODFName buffer.

◆ phalMfdfEVx_DeleteApplication()

phStatus_t phalMfdfEVx_DeleteApplication ( void *  pDataParams,
uint8_t pAid,
uint8_t pDAMMAC,
uint8_t  bDAMMAC_Len 
)

Permanently deletes the applications on the PICC.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pAid[In] The application identifier to be used. Will be of 3 bytes with LSB first.
If application 01 need to be deleted then the Aid will be 01 00 00.
[in]pDAMMAC[In] [Optional, present if PICCDAMAuthKey or NXPDAMAuthKey is used for authentication] The MAC calculated by the card issuer to allow delegated application deletion.
[in]bDAMMAC_Len[In] Length of bytes available in DAMMAC buffer.

◆ phalMfdfEVx_CreateDelegatedApplication()

phStatus_t phalMfdfEVx_CreateDelegatedApplication ( void *  pDataParams,
uint8_t  bOption,
uint8_t pAid,
uint8_t pDamParams,
uint8_t  bKeySettings1,
uint8_t  bKeySettings2,
uint8_t  bKeySettings3,
uint8_t pKeySetValues,
uint8_t pISOFileId,
uint8_t pISODFName,
uint8_t  bISODFNameLen,
uint8_t pEncK,
uint8_t pDAMMAC 
)

Creates new Delegated application For delegated application creation, the PICC level (AID 0x000000) must have been selected.

An active authentication with the PICCDAMAuthKey is required.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Option to represent the present of ISO information.
[in]pAid[In] The application identifier to be used. Will be of 3 bytes with LSB first. If application 01 need to be created then the Aid will be 01 00 00.
[in]pDamParams[In] The DAM information. Should as mentioned below.
Byte0 = DAM Slot No [LSB]
Byte1 = DAM Slot No [MSB]
Byte2 = DAM Slot Version
Byte3 = Quota Limit [LSB]
Byte4 = Quota Limit [MSB]
[in]bKeySettings1[In] Application Key settings.
[in]bKeySettings2[In] Additional key settings.
[in]bKeySettings3[In] Additional key settings.
[in]pKeySetValues[In] The Key set values for the application. Should as mentioned below.
Byte0 = AKS ver
Byte1 = Number of KeySets
Byte2 = MaxKeysize
Byte3 = Application KeySet Settings.
[in]pISOFileId[In] ISO File ID to be used. Will be two bytes.
[in]pISODFName[In] ISO DF Name to be used. Will be 16 bytes and can also be NULL based on the option.
[in]bISODFNameLen[In] Length of bytes available in ISODFName buffer.
[in]pEncK[In] Encrypted initial application key. 32 bytes long.
[in]pDAMMAC[In] 8 byte DAM MAC.

◆ phalMfdfEVx_SelectApplication()

phStatus_t phalMfdfEVx_SelectApplication ( void *  pDataParams,
uint8_t  bOption,
uint8_t pAid,
uint8_t pAid2 
)

Selects one particular application on the PICC for further access.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] One of the below options.
[in]pAid[In] The primary application identifier to be used. Will be of 3 bytes with LSB first. If application 01 need to be selected then the Aid will be 01 00 00.
[in]pAid2[In] The secondary application identifier to be used. Will be of 3 bytes with LSB first. If application 01 need to be selected then the Aid will be 01 00 00.

◆ phalMfdfEVx_GetApplicationIDs()

phStatus_t phalMfdfEVx_GetApplicationIDs ( void *  pDataParams,
uint8_t  bOption,
uint8_t **  pAidBuff,
uint8_t pNumAid 
)

Returns application identifiers of all applications on the PICC.

Remarks
This response will be PH_ERR_SUCCESS if all the application ids can be obtained in one call. If not, then PH_ERR_SUCCESS_CHAINING is returned. The user has to call this function with bOption = PH_EXCHANGE_RXCHAINING to get the remaining AIDs.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_SUCCESS_CHAININGOperation successful with chaining.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] One of the below options.
[out]pAidBuff[Out] The available identifiers of the application(s).
[out]pNumAid[Out] The number of available application(s).

◆ phalMfdfEVx_GetDFNames()

phStatus_t phalMfdfEVx_GetDFNames ( void *  pDataParams,
uint8_t  bOption,
uint8_t pDFBuffer,
uint8_t bDFInfoLen 
)

Returns the Dedicated File(DF) names.

Remarks
The pDFBuffer will be filled with 3 byte AID + 2 byte ISO FID + 1 - 16 bytes DF Name at a time. If there are more DFs, then status PH_ERR_SUCCESS_CHAINING is returned. The caller should call this again with bOption = PH_EXCHANGE_RXCHAINING.

CAUTION: This should not be called with AES or ISO authentication DOING SO WILL DAMAGE THE DESFIRE Card

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_SUCCESS_CHAININGMore DF Names to be returned
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] One of the below options.
[out]pDFBuffer[Out] The ISO information about the application. At a time the information of one application will be returned. The buffer should be 21 (3 + 2 + 16) bytes long.
[out]bDFInfoLen[Out] Length of bytes available in DFBuffer buffer.

◆ phalMfdfEVx_GetDelegatedInfo()

phStatus_t phalMfdfEVx_GetDelegatedInfo ( void *  pDataParams,
uint8_t pDAMSlot,
uint8_t pDamSlotVer,
uint8_t pQuotaLimit,
uint8_t pFreeBlocks,
uint8_t pAid 
)

Parameters associated with the delegated application can be retrieved using this command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pDAMSlot[In] Slot number associated with the memory space of the targeted delegated application. LSB first.
[out]pDamSlotVer[Out] Slot version associated with the memory space of the targeted delegated application.
[out]pQuotaLimit[Out] Maximal memory consumption of the targeted delegated application (in 32-byte blocks).
[out]pFreeBlocks[Out] Amount of unallocated memory of the targeted delegated application (in 32-byte blocks).
[out]pAid[Out] Application Identifier of the targeted DAM slot. This parameter is set to 0x000000 if the DAM slot targeted by DAMSlotNo exists on the card, but is currently not occupied with an application, i.e. the latest application has been deleted.