NXP Reader Library  v17.1.0.2535

These Components implement the MIFARE DESFire security related commands. More...

Collaboration diagram for Commands_Security:

Modules

 Defines
 These are common diversification definitions for ChangeKey and Authenticate.
 

Functions

phStatus_t phalMfdf_Authenticate (void *pDataParams, uint16_t wOption, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen)
 Performs an Authentication with the specified key number. More...
 
phStatus_t phalMfdf_AuthenticateISO (void *pDataParams, uint16_t wOption, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen)
 Performs an DES Authentication in ISO CBS send mode. More...
 
phStatus_t phalMfdf_AuthenticateAES (void *pDataParams, uint16_t wOption, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen)
 Performs an AES Authentication. More...
 
phStatus_t phalMfdf_ChangeKeySettings (void *pDataParams, uint8_t bKeySettings)
 Changes the master key settings on PICC and application level. More...
 
phStatus_t phalMfdf_GetKeySettings (void *pDataParams, uint8_t *pKeySettings)
 Gets information on the PICC and application master key settings. More...
 
phStatus_t phalMfdf_ChangeKey (void *pDataParams, uint16_t wOption, uint16_t wOldKeyNo, uint16_t wOldKeyVer, uint16_t wNewKeyNo, uint16_t wNewKeyVer, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen)
 Changes any key on the PICC. More...
 
phStatus_t phalMfdf_GetKeyVersion (void *pDataParams, uint8_t bKeyNo, uint8_t *pKeyVersion)
 Reads out the current key version of any key stored on the PICC. More...
 

Detailed Description

These Components implement the MIFARE DESFire security related commands.

Function Documentation

◆ phalMfdf_Authenticate()

phStatus_t phalMfdf_Authenticate ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t  bKeyNoCard,
uint8_t pDivInput,
uint8_t  bDivLen 
)

Performs an Authentication with the specified key number.

This command supports the backward compatiable D40 authentication. The command can be used with DES and 2K3DES keys and performs DESFire4 native authentication.

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]wOption[In] One of the below options.
[in]wKeyNo[In] Key number in keystore to authenticate with.
[in]wKeyVer[In] Key version in the key store.
[in]bKeyNoCard[In] Key number on card.
[in]pDivInput[In] Diversification input. Can be NULL.
[in]bDivLen[In] Length of diversification input max 31B.

◆ phalMfdf_AuthenticateISO()

phStatus_t phalMfdf_AuthenticateISO ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t  bKeyNoCard,
uint8_t pDivInput,
uint8_t  bDivLen 
)

Performs an DES Authentication in ISO CBS send mode.

The command can be used with DES,3DES and 3K3DES keys.

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]wOption[In] One of the below options.
[in]wKeyNo[In] Key number in keystore to authenticate with.
[in]wKeyVer[In] Key version in the key store.
[in]bKeyNoCard[In] Key number on card.
[in]pDivInput[In] Diversification input. Can be NULL.
[in]bDivLen[In] Length of diversification input max 31B.

◆ phalMfdf_AuthenticateAES()

phStatus_t phalMfdf_AuthenticateAES ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t  bKeyNoCard,
uint8_t pDivInput,
uint8_t  bDivLen 
)

Performs an AES Authentication.

The command should be used with AES128 keys.

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]wOption[In] One of the below options.
[in]wKeyNo[In] Key number in keystore to authenticate with.
[in]wKeyVer[In] Key version in the key store.
[in]bKeyNoCard[In] Key number on card.
[in]pDivInput[In] Diversification input. Can be NULL.
[in]bDivLen[In] Length of diversification input max 31B.

◆ phalMfdf_ChangeKeySettings()

phStatus_t phalMfdf_ChangeKeySettings ( void *  pDataParams,
uint8_t  bKeySettings 
)

Changes the master key settings on PICC and application level.

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]bKeySettings[In] New key settings to be changed.

◆ phalMfdf_GetKeySettings()

phStatus_t phalMfdf_GetKeySettings ( void *  pDataParams,
uint8_t pKeySettings 
)

Gets information on the PICC and application master key settings.

Note
In addition it returns the maximum number of keys which are configured for the selected application.
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.
[out]pKeySettings[Out] Key setting of the currently selected application identifier.

◆ phalMfdf_ChangeKey()

phStatus_t phalMfdf_ChangeKey ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wOldKeyNo,
uint16_t  wOldKeyVer,
uint16_t  wNewKeyNo,
uint16_t  wNewKeyVer,
uint8_t  bKeyNoCard,
uint8_t pDivInput,
uint8_t  bDivLen 
)

Changes any key 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]wOption[In] One of the below options.
[in]wOldKeyNo[In] Old key number in keystore of software or SAM.
[in]wOldKeyVer[In] Old key number in keystore of software or SAM.
[in]wNewKeyNo[In] New key number in keystore of software or SAM.
[in]wNewKeyVer[In] New key number in keystore of software or SAM.
[in]bKeyNoCard[In] Key number on card.
[in]pDivInput[In] Diversification input. Can be NULL.
[in]bDivLen[In] Length of diversification input max 31B.

◆ phalMfdf_GetKeyVersion()

phStatus_t phalMfdf_GetKeyVersion ( void *  pDataParams,
uint8_t  bKeyNo,
uint8_t pKeyVersion 
)

Reads out the current key version of any key stored 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]bKeyNo[In] Key number on card.
[out]pKeyVersion[Out] The version of the specified key.