NXP Reader Library  v17.1.0.2535
Commands_ApplicationManagement

Describes about the MIFARE DUOX Application Management commands. More...

Collaboration diagram for Commands_ApplicationManagement:

Modules

 Defines
 Macro Definitions for Application Management commands.
 

Functions

phStatus_t phalMfDuoX_CreateApplication (void *pDataParams, uint8_t bOption, uint8_t *pAid, uint8_t bKeySettings1, uint8_t bKeySettings2, uint8_t bKeySettings3, uint8_t *pKeySetValues, uint8_t bKeySetValuesLen, uint8_t *pISOFileId, uint8_t *pISODFName, uint8_t bISODFNameLen)
 Creates a New Application on the PICC. More...
 
phStatus_t phalMfDuoX_DeleteApplication (void *pDataParams, uint8_t *pAid, uint8_t *pDAMMAC, uint8_t bDAMMAC_Len)
 Permanently deletes the applications on the PICC. More...
 
phStatus_t phalMfDuoX_CreateDelegatedApplication (void *pDataParams, uint8_t bOption, uint8_t *pAid, uint8_t *pDamParams, uint8_t bDamParamsLen, uint8_t bKeySettings1, uint8_t bKeySettings2, uint8_t bKeySettings3, uint8_t *pKeySetValues, uint8_t bKeySetValuesLen, uint8_t *pISOFileId, uint8_t *pISODFName, uint8_t bISODFNameLen, uint8_t *pEncK, uint8_t bEncKLen, uint8_t *pDAMMAC, uint8_t bDAMMACLen, uint8_t *pInitK, uint8_t bInitKLen)
 Creates delegated applications on the PICC with limited memory consumption. More...
 
phStatus_t phalMfDuoX_SelectApplication (void *pDataParams, uint8_t bOption, uint8_t *pAid1, uint8_t *pAid2)
 Selects one particular application on the PICC for further access. More...
 
phStatus_t phalMfDuoX_GetApplicationIDs (void *pDataParams, uint8_t bOption, uint8_t **ppAidBuff, uint16_t *pAidLen)
 Returns application identifiers of all applications on the PICC. More...
 
phStatus_t phalMfDuoX_GetDFNames (void *pDataParams, uint8_t bOption, uint8_t **ppDFBuffer, uint16_t *pDFBufLen)
 Returns the Application IDentifiers together with a File ID and (optionally) a DF Name of all active applications with ISO/IEC 7816-4 support. More...
 
phStatus_t phalMfDuoX_GetDelegatedInfo (void *pDataParams, uint8_t *pDAMSlot, uint8_t *pDamSlotVer, uint8_t *pQuotaLimit, uint8_t *pFreeBlocks, uint8_t *pAid)
 Returns the DAMSlotVersion and QuotaLimit of a target DAM slot on the card. More...
 

Detailed Description

Describes about the MIFARE DUOX Application Management commands.

Function Documentation

◆ phalMfDuoX_CreateApplication()

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

Creates a New Application on the PICC.

The application is initialized according to the given settings. The application key of the active key set are initialized with the Default Application Key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending 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. Refer Application Key Settings from DataSheet.
[in]bKeySettings2[In] Several other key settings.
  • Bit[7 - 6]: KeyType of the application keys of the initial AKS
    • 00: Reserved
    • 01: Reserved
    • 10: AES128 KeyType
    • 11: AES256 KeyType
  • Bit[5] : Use of 2 byte ISO/IEC 7816-4 File Identifiers
    • 0: No 2 byte File Identifiers for files within the application
    • 1: 2 byte File Identifiers for files within the application required
  • Bit[4] : KeySett3 presence
    • 0: Disabled
    • 1: Enabled
  • Bit[3 - 0]: Number of application keys (n)
    • 0x00 - 0x0E: Maximum 14 Keys
    • 0x0F : Enable Application Master Temp Key
[in]bKeySettings3[In] Additional optional key settings.
  • Bit[7 - 5]: RFU
  • Bit[4] : Application Deletion with Application Master Key
    • 0: Depending on PICC Master Key
    • 1: Always Enabled
  • Bit[3] : Reserved
  • Bit[2] : Application specific Capability data
    • 0: Disabled
    • 4: Enabled
  • Bit[1] : Application Specific VC Proximity Key
    • 0: Disabled
    • 2: Enabled
  • Bit[0] : Application KeySet
    • 0: Disabled
    • 1: Enabled
[in]pKeySetValues[In] The Key set values for the application. Should as mentioned below.
  • Byte0 = Application Key Set Version (ASKVersion)
  • Byte1 = Number of Key Sets (NoKeySets)
  • Byte2 = Maximum Key Size (MaxKeySize)
    • 0x10: Only AES128 Key Type is allowed (upto 16 bytes).
    • 0x20: Both AES128 and AES256 Key Types are allowed (upto 32 bytes).
  • Byte3 = Application KeySet Settings (AppKeySetSett)
    • Bit[7 - 4]: RFU
    • Bit[3 - 0]: Roll Key Access Rights.
      • 0x00 - 0x(n - 1): Active Authentication with specified Application Roll Key. (n: number of keys in Active KeySet)
      • 0x(n) - 0x0F : RFU
[in]bKeySetValuesLen[In] Length of bytes available in pKeySetValues buffer.
[in]pISOFileId[In] ISO File ID to be used. Will be two bytes.
[in]pISODFName[In] ISO DF Name to be used. Should one of the following
[in]bISODFNameLen[In] Length of bytes available in pISODFName buffer.

◆ phalMfDuoX_DeleteApplication()

phStatus_t phalMfDuoX_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.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending 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.
  • NULL if not targeting a PICCDAMAuthKey.
[in]bDAMMAC_Len[In] Length of bytes available in pDAMMAC buffer.

◆ phalMfDuoX_CreateDelegatedApplication()

phStatus_t phalMfDuoX_CreateDelegatedApplication ( void *  pDataParams,
uint8_t  bOption,
uint8_t pAid,
uint8_t pDamParams,
uint8_t  bDamParamsLen,
uint8_t  bKeySettings1,
uint8_t  bKeySettings2,
uint8_t  bKeySettings3,
uint8_t pKeySetValues,
uint8_t  bKeySetValuesLen,
uint8_t pISOFileId,
uint8_t pISODFName,
uint8_t  bISODFNameLen,
uint8_t pEncK,
uint8_t  bEncKLen,
uint8_t pDAMMAC,
uint8_t  bDAMMACLen,
uint8_t pInitK,
uint8_t  bInitKLen 
)

Creates delegated applications on the PICC with limited memory consumption.

The application is initialized according to the given settings. The application keys of the active key set are initialized with the provided Application DAM Default Key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending 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]bDamParamsLen[In] Length of bytes available in pDamParams buffer.
[in]bKeySettings1[In] Application Key settings. Refer Application Key Settings from DataSheet.
[in]bKeySettings2[In] Several other key settings.
  • Bit[7 - 6]: KeyType of the application keys of the initial AKS
    • 00: Reserved
    • 01: Reserved
    • 10: AES128 KeyType
    • 11: AES256 KeyType
  • Bit[5] : Use of 2 byte ISO/IEC 7816-4 File Identifiers
    • 0: No 2 byte File Identifiers for files within the application
    • 1: 2 byte File Identifiers for files within the application required
  • Bit[4] : KeySett3 presence
    • 0: Disabled
    • 1: Enabled
  • Bit[3 - 0]: Number of application keys (n)
    • 0x00 - 0x0E: Maximum 14 Keys
    • 0x0F : Enable Application Master Temp Key
[in]bKeySettings3[In] Additional optional key settings.
  • Bit[7 - 5]: RFU
  • Bit[4] : Application Deletion with Application Master Key
    • 0: Depending on PICC Master Key
    • 1: Always Enabled
  • Bit[3] : Reserved
  • Bit[2] : Application specific Capability data
    • 0: Disabled
    • 4: Enabled
  • Bit[1] : Application Specific VC Proximity Key
    • 0: Disabled
    • 2: Enabled
  • Bit[0] : Application KeySet
    • 0: Disabled
    • 1: Enabled
[in]pKeySetValues[In] The Key set values for the application. Should as mentioned below.
  • Byte0 = Application Key Set Version (ASKVersion)
  • Byte1 = Number of Key Sets (NoKeySets)
  • Byte2 = Maximum Key Size (MaxKeySize)
    • 0x10: Only AES128 Key Type is allowed (upto 16 bytes).
    • 0x20: Both AES128 and AES256 Key Types are allowed (upto 32 bytes).
  • Byte3 = Application KeySet Settings (AppKeySetSett)
    • Bit[7 - 4]: RFU
    • Bit[3 - 0]: Roll Key Access Rights.
      • 0x00 - 0x(n - 1): Active Authentication with specified Application Roll Key. (n: number of keys in Active KeySet)
      • 0x(n) - 0x0F : RFU
[in]bKeySetValuesLen[In] Length of bytes available in pKeySetValues buffer.
[in]pISOFileId[In] ISO File ID to be used. Will be two bytes.
[in]pISODFName[In] ISO DF Name to be used. Should one of the following
[in]bISODFNameLen[In] Length of bytes available in pISODFName buffer.
[in]pEncK[In] Encrypted initial application key for the DAM application. Should be 32 bytes long.
  • Applicable on if in EV2 Authenticated State.
  • NULL if in DUOX Authenticated State.
[in]bEncKLen[In] Length of bytes available in pEncK buffer.
[in]pDAMMAC[In] The MAC calculated by the card issuer to allow delegated application creation. Should be 8 bytes long.
  • Applicable on if in EV2 Authenticated State.
  • NULL if in DUOX Authenticated State.
[in]bDAMMACLen[In] Length of bytes available in pDAMMAC buffer.
[in]pInitK[In] The initial application key for the DAM application. Should be 25 bytes long.
  • Applicable on if in DUOX Authenticated State.
  • NULL if in EV2 Authenticated State.
[in]bInitKLen[In] Length of bytes available in pInitK buffer.

◆ phalMfDuoX_SelectApplication()

phStatus_t phalMfDuoX_SelectApplication ( void *  pDataParams,
uint8_t  bOption,
uint8_t pAid1,
uint8_t pAid2 
)

Selects one particular application on the PICC for further access.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending 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]pAid1[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.

◆ phalMfDuoX_GetApplicationIDs()

phStatus_t phalMfDuoX_GetApplicationIDs ( void *  pDataParams,
uint8_t  bOption,
uint8_t **  ppAidBuff,
uint16_t pAidLen 
)

Returns application identifiers of all applications on the PICC.

Remarks
The status will be Success if all the application ids can be obtained in one call. If not, then Chaining is returned. The user has to call this interface 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 response.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • For Invalid buffering options (bOption).
XXXX
  • Depending on status codes return by PICC.
  • Other Depending 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]ppAidBuff[Out] The available identifiers of the application(s).
[out]pAidLen[Out] Length of bytes available in ppAidBuff buffer.

◆ phalMfDuoX_GetDFNames()

phStatus_t phalMfDuoX_GetDFNames ( void *  pDataParams,
uint8_t  bOption,
uint8_t **  ppDFBuffer,
uint16_t pDFBufLen 
)

Returns the Application IDentifiers together with a File ID and (optionally) a DF Name of all active applications with ISO/IEC 7816-4 support.

Remarks
The status will be Success if all the application DFName's can be obtained in one call. If not, then Chaining is returned. The user has to call this interface with bOption = PH_EXCHANGE_RXCHAINING to get the remaining DFName's.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_SUCCESS_CHAININGOperation successful with chaining response.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • For Invalid buffering options (bOption).
XXXX
  • Depending on status codes return by PICC.
  • Other Depending 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]ppDFBuffer[Out] The ISO information about the application.
[out]pDFBufLen[Out] Length of bytes available in pDFBuffer buffer.

◆ phalMfDuoX_GetDelegatedInfo()

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

Returns the DAMSlotVersion and QuotaLimit of a target DAM slot on the card.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending 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.