NXP Reader Library  v17.1.0.2535
Commands_SymmetricKeyManagement

Describes about the MIFARE DUOX Symmetric Key Management commands. More...

Collaboration diagram for Commands_SymmetricKeyManagement:

Modules

 Defines
 Macro Definitions for Symmetric Key Management commands.
 

Functions

phStatus_t phalMfDuoX_ChangeKey (void *pDataParams, uint16_t wOption, uint16_t wCurrKeyNo, uint16_t wCurrKeyVer, uint16_t wNewKeyNo, uint16_t wNewKeyVer, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen)
 Depending on the currently selected AID, this command update a key of the PICC or of an application AKS (Active Key Set). More...
 
phStatus_t phalMfDuoX_ChangeKeyEv2 (void *pDataParams, uint16_t wOption, uint16_t wCurrKeyNo, uint16_t wCurrKeyVer, uint16_t wNewKeyNo, uint16_t wNewKeyVer, uint8_t bKeySetNo, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen)
 Depending on the currently selected AID, this command update a key of the PICC or of an specified application key set. More...
 
phStatus_t phalMfDuoX_InitializeKeySet (void *pDataParams, uint8_t bKeySetNo, uint8_t bKeyType)
 Depending on the currently selected application, initialize the key set with specific index. More...
 
phStatus_t phalMfDuoX_FinalizeKeySet (void *pDataParams, uint8_t bKeySetNo, uint8_t bKeySetVersion)
 Finalizes KeySet targeted by specified KeySet number. More...
 
phStatus_t phalMfDuoX_RollKeySet (void *pDataParams, uint8_t bKeySetNo)
 RollKeySet changes the ActiveKeySet to key set currently targeted with bKeySetNumber. More...
 
phStatus_t phalMfDuoX_GetKeySettings (void *pDataParams, uint8_t bOption, uint8_t **ppResponse, uint16_t *pRspLen)
 Gets PICC Key Settings of the PICC or Application Key Setting for the application. More...
 
phStatus_t phalMfDuoX_ChangeKeySettings (void *pDataParams, uint8_t bKeySettings)
 Changes the PICC Key settings of the PICC or Application Key Settings of the Application. More...
 
phStatus_t phalMfDuoX_GetKeyVersion (void *pDataParams, uint8_t bKeyNo, uint8_t bKeySetNo, uint8_t **ppResponse, uint16_t *pRspLen)
 Reads out the current key version of any key stored on the PICC. More...
 

Detailed Description

Describes about the MIFARE DUOX Symmetric Key Management commands.

Function Documentation

◆ phalMfDuoX_ChangeKey()

phStatus_t phalMfDuoX_ChangeKey ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wCurrKeyNo,
uint16_t  wCurrKeyVer,
uint16_t  wNewKeyNo,
uint16_t  wNewKeyVer,
uint8_t  bKeyNoCard,
uint8_t pDivInput,
uint8_t  bDivLen 
)

Depending on the currently selected AID, this command update a key of the PICC or of an application AKS (Active Key Set).

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • If the buffer is null.
  • For invalid card key numbers (bKeyNoCard) at PICC or Application level.
  • If Diversification is higher than Max Diversification Length.
PH_ERR_KEYKeyType not supported.
PH_ERR_AUTH_ERRORIf command is called without prior authentication.
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]wOption[In] Option to be used for diversifying the Current and New key.
[in]wCurrKeyNo[In] Current key number in KeyStore of software.
[in]wCurrKeyVer[In] Current key version in KeyStore of software.
[in]wNewKeyNo[In] New key number in KeyStore of software.
[in]wNewKeyVer[In] New key version in KeyStore of software.
[in]bKeyNoCard[In] Key number of the key to be changed. To be ORed with
  • If at PICC level,
    • Bit[7 - 6]: With the type of the key.
    • Bit[5 - 0]: PICC level keys.
  • If at application level,
    • Bit[7 - 6]: Secondary Application indicator.
    • Bit[5 - 0]: Application level keys (0x00 - 0x0D)
    • Bit[5 - 0]: Application level keys (0x00 - 0x0D)
[in]pDivInput[In] Diversification input to be used for diversifying the key. Can be NULL.
[in]bDivLen[In] Length of bytes available in pDivInput buffer.

◆ phalMfDuoX_ChangeKeyEv2()

phStatus_t phalMfDuoX_ChangeKeyEv2 ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wCurrKeyNo,
uint16_t  wCurrKeyVer,
uint16_t  wNewKeyNo,
uint16_t  wNewKeyVer,
uint8_t  bKeySetNo,
uint8_t  bKeyNoCard,
uint8_t pDivInput,
uint8_t  bDivLen 
)

Depending on the currently selected AID, this command update a key of the PICC or of an specified application key set.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • If the buffer is null.
  • For invalid card key numbers (bKeyNoCard) at PICC or Application level.
  • For invalid KeySet number (bKeySetNo) at Application level.
  • If Diversification is higher than Max Diversification Length.
PH_ERR_KEYKeyType not supported.
PH_ERR_AUTH_ERRORIf command is called without prior authentication.
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]wOption[In] Option to be used for diversifying the Current and New key.
[in]wCurrKeyNo[In] Current key number in KeyStore of software.
[in]wCurrKeyVer[In] Current key version in KeyStore of software.
[in]wNewKeyNo[In] New key number in KeyStore of software.
[in]wNewKeyVer[In] New key version in KeyStore of software.
[in]bKeySetNo[In] Key set number within targeted application.
[in]bKeyNoCard[In] Key number of the key to be changed. To be ORed with
  • If at PICC level,
    • Bit[7 - 6]: With the type of the key.
    • Bit[5 - 0]: PICC level keys.
  • If at application level,
[in]pDivInput[In] Diversification input to be used for diversifying the key. Can be NULL.
[in]bDivLen[In] Length of bytes available in pDivInput buffer.

◆ phalMfDuoX_InitializeKeySet()

phStatus_t phalMfDuoX_InitializeKeySet ( void *  pDataParams,
uint8_t  bKeySetNo,
uint8_t  bKeyType 
)

Depending on the currently selected application, initialize the key set with specific index.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • For invalid KeySet number (bKeySetNo).
  • For invalid Key Type (bKeyType).
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]bKeySetNo[In] Key set number within targeted application. ORed with Secondary Application indicator.
[in]bKeyType[In] One of the below mentioned options.

◆ phalMfDuoX_FinalizeKeySet()

phStatus_t phalMfDuoX_FinalizeKeySet ( void *  pDataParams,
uint8_t  bKeySetNo,
uint8_t  bKeySetVersion 
)

Finalizes KeySet targeted by specified KeySet number.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETERFor invalid KeySet number (bKeySetNo).
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]bKeySetNo[In] Key set number within targeted application. ORed with Secondary Application indicator.
[in]bKeySetVersion[In] KeySet version of the key set to be finalized.

◆ phalMfDuoX_RollKeySet()

phStatus_t phalMfDuoX_RollKeySet ( void *  pDataParams,
uint8_t  bKeySetNo 
)

RollKeySet changes the ActiveKeySet to key set currently targeted with bKeySetNumber.

Remarks
After successful execution, the keys of new AKS can be used only after authentication.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETERFor invalid KeySet number (bKeySetNo).
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]bKeySetNo[In] Key set number within targeted application. ORed with Secondary Application indicator.

◆ phalMfDuoX_GetKeySettings()

phStatus_t phalMfDuoX_GetKeySettings ( void *  pDataParams,
uint8_t  bOption,
uint8_t **  ppResponse,
uint16_t pRspLen 
)

Gets PICC Key Settings of the PICC or Application Key Setting for the application.

In addition it returns the number of keys which are configured for the selected application and if applicable the AppKeySetSettings.

Note: The Option information will not be exchanged to PICC in case of PICC / Application Key Settings.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is 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 be used for information retrieval. One of the below values.
[out]ppResponse[Out] Returns the key settings.
[out]pRspLen[Out] Length bytes available in ppKeySettings buffer.

◆ phalMfDuoX_ChangeKeySettings()

phStatus_t phalMfDuoX_ChangeKeySettings ( void *  pDataParams,
uint8_t  bKeySettings 
)

Changes the PICC Key settings of the PICC or Application Key Settings of the Application.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is 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]bKeySettings[In] New key settings to be updated.

◆ phalMfDuoX_GetKeyVersion()

phStatus_t phalMfDuoX_GetKeyVersion ( void *  pDataParams,
uint8_t  bKeyNo,
uint8_t  bKeySetNo,
uint8_t **  ppResponse,
uint16_t pRspLen 
)

Reads out the current key version of any key stored on the PICC.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is 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]bKeyNo[In] Key number of the targeted key.
[in]bKeySetNo[In] Key set number to be used for retrieval.
[out]ppResponse[Out] Key set versions of the selected application ordered by ascending key set number, i.e. starting with the AKS.
[out]pRspLen[Out] Length of bytes available in ppResponse buffer.