NXP Reader Library  v17.1.0.2535
Commands_KeyManagement

These Components implement the MIFARE NTAG 42xDNA Key Management related commands. More...

Collaboration diagram for Commands_KeyManagement:

Functions

phStatus_t phalMfNtag42XDna_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 phalMfNtag42XDna_GetKeyVersion (void *pDataParams, uint8_t bKeyNo, uint8_t bKeySetNo, uint8_t *pKeyVersion, uint8_t *bRxLen)
 Reads out the current key version of any key stored on the PICC. More...
 

Diversification options to be used with ChangeKey command.

#define PHAL_MFNTAG42XDNA_CHGKEY_NO_DIVERSIFICATION   0xFFFFU
 No diversification.
 
#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_NEW_KEY   0x0002U
 Bit 1. More...
 
#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_OLD_KEY   0x0004U
 Bit 2 indicating old key was diversified.
 
#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_NEW_KEY_ONERND   0x0008U
 Bit 3 indicating new key diversification using one rnd. More...
 
#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_OLD_KEY_ONERND   0x0010U
 Bit 4 indicating old key diversification using one rnd. More...
 
#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_METHOD_CMAC   0x0020U
 Bit 5 indicating key diversification method based on CMAC. More...
 

Detailed Description

These Components implement the MIFARE NTAG 42xDNA Key Management related commands.

Macro Definition Documentation

◆ PHAL_MFNTAG42XDNA_CHGKEY_DIV_NEW_KEY

#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_NEW_KEY   0x0002U

Bit 1.

Indicating diversification of new key requred.

◆ PHAL_MFNTAG42XDNA_CHGKEY_DIV_NEW_KEY_ONERND

#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_NEW_KEY_ONERND   0x0008U

Bit 3 indicating new key diversification using one rnd.

Default is two rounds.

◆ PHAL_MFNTAG42XDNA_CHGKEY_DIV_OLD_KEY_ONERND

#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_OLD_KEY_ONERND   0x0010U

Bit 4 indicating old key diversification using one rnd.

Default is two rounds.

◆ PHAL_MFNTAG42XDNA_CHGKEY_DIV_METHOD_CMAC

#define PHAL_MFNTAG42XDNA_CHGKEY_DIV_METHOD_CMAC   0x0020U

Bit 5 indicating key diversification method based on CMAC.

Default is Encryption method

Function Documentation

◆ phalMfNtag42XDna_ChangeKey()

phStatus_t phalMfNtag42XDna_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.

◆ phalMfNtag42XDna_GetKeyVersion()

phStatus_t phalMfNtag42XDna_GetKeyVersion ( void *  pDataParams,
uint8_t  bKeyNo,
uint8_t  bKeySetNo,
uint8_t pKeyVersion,
uint8_t bRxLen 
)

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.
[in]bKeySetNo[In] 1 byte Key set number. Optional as it is passed only when bit[6] of bKeyNo is set.
[out]pKeyVersion[Out] The version of the specified key.
[out]bRxLen[Out] Length of bytes available in KeyVersion buffer.