NXP Reader Library  v17.1.0.2535
Commands_SymmetricKeyManagement

Describes about the NTAG X DNA Symmetric Key Management commands. More...

Collaboration diagram for Commands_SymmetricKeyManagement:

Modules

 Defines
 Macro Definitions for Symmetric Key Management commands.
 

Functions

phStatus_t phalNtagXDna_ChangeKey (void *pDataParams, uint16_t wOption, uint16_t wCurrKeyNo, uint16_t wCurrKeyVer, uint16_t wNewKeyNo, uint16_t wNewKeyVer, uint8_t bKeyNoCard, uint8_t *pKeyPolicy, uint8_t *pDivInput, uint8_t bDivLen)
 Depending on the currently selected AID, this command update a key of the tag or of an application AKS (Active Key Set). More...
 
phStatus_t phalNtagXDna_GetKeySettings (void *pDataParams, uint8_t bOption, uint8_t **ppResponse, uint16_t *pRspLen)
 Gets Application Key Setting for the application. More...
 
phStatus_t phalNtagXDna_GetKeyVersion (void *pDataParams, uint8_t bKeyNo, uint8_t **ppResponse, uint16_t *pRspLen)
 Reads out the current key version of any key stored on the tag. More...
 

Detailed Description

Describes about the NTAG X DNA Symmetric Key Management commands.

Function Documentation

◆ phalNtagXDna_ChangeKey()

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

Depending on the currently selected AID, this command update a key of the tag 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 tag 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 tag.
  • 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
  • Bit[7 - 6]:
    • With the type of the key if targeting AppMasterKey or CryptoRequestKey,
      • 10 : KeyType.AES128
      • 11 : KeyType.AES256
    • RFU otherwise
  • Bit[5 - 0]: Application Master or CryptoRequest Key.
    • 0x00 - 0x04: Application Keys
    • 0x10 - 0x17: CryptoRequest Keys
[in]pKeyPolicy[In] Defines the allowed crypto operations with the targeted key. Optional present if targeting CryptoRequest Key.
[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.

◆ phalNtagXDna_GetKeySettings()

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

Gets 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 tag in case of Tag / 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 tag.
  • 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.

◆ phalNtagXDna_GetKeyVersion()

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

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

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
XXXX
  • Depending on status codes return by tag.
  • 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.
[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.