NXP Reader Library  v17.1.0.2535
Commands_Utility

Describes about the NTAG X DNA Utility functions. These are not part of actual NTAG X DNA data sheet rather its for internal purpose. More...

Collaboration diagram for Commands_Utility:

Modules

 Defines
 Macro Definitions for Utility interface support.
 

Functions

phStatus_t phalNtagXDna_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Perform a GetConfig command. More...
 
phStatus_t phalNtagXDna_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Perform a SetConfig command. More...
 
phStatus_t phalNtagXDna_ResetAuthentication (void *pDataParams)
 Reset the authentication. More...
 
phStatus_t phalNtagXDna_CalculateMACSDM (void *pDataParams, uint8_t bSdmOption, uint16_t wKeyNo_SDMMac, uint16_t wKeyVer_SDMMac, uint8_t *pUid, uint8_t bUidLen, uint8_t *pSDMReadCtr, uint8_t *pInData, uint16_t wInDataLen, uint8_t **ppSDMMAC, uint16_t *pSDMMACLen)
 Performs computation of SDM MAC information. More...
 
phStatus_t phalNtagXDna_VerifySDMSignature (void *pDataParams, uint16_t wPubKeyNo_SDMSig, uint16_t wPubKeyPos_SDMSig, uint8_t *pInData, uint16_t wInDataLen, uint8_t *pSignature, uint16_t wSigLen)
 Performs verification of SDM Signature information. More...
 
phStatus_t phalNtagXDna_DecryptSDMENCFileData (void *pDataParams, uint8_t bSdmOption, uint16_t wKeyNo_SDMEnc, uint16_t wKeyVer_SDMEnc, uint8_t *pUid, uint8_t bUidLen, uint8_t *pSDMReadCtr, uint8_t *pEncData, uint16_t wEncDataLen, uint8_t **ppPlainData, uint16_t *pPlainDataLen)
 Performs decryption of SDM File Data. More...
 
phStatus_t phalNtagXDna_DecryptSDMPICCData (void *pDataParams, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t *pEncData, uint16_t wEncDataLen, uint8_t **ppPlainData, uint16_t *pPlainDataLen)
 Performs decryption of SDM PICC Data. More...
 

Detailed Description

Describes about the NTAG X DNA Utility functions. These are not part of actual NTAG X DNA data sheet rather its for internal purpose.

Function Documentation

◆ phalNtagXDna_GetConfig()

phStatus_t phalNtagXDna_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Perform a GetConfig command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the return buffer is null
PH_ERR_UNSUPPORTED_PARAMETERIf configuration (wConfig) option provided is not supported.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration to read. Will be one of the below values. for list of supported configurations refer Configuration Identifier
[out]pValue[Out] The value for the mentioned configuration.

◆ phalNtagXDna_SetConfig()

phStatus_t phalNtagXDna_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Perform a SetConfig command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_UNSUPPORTED_PARAMETERIf configuration (wConfig) option provided is not supported.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration to set. Will be one of the below values. for list of supported configurations refer Configuration Identifier
[in]wValue[In] The value for the mentioned configuration.

◆ phalNtagXDna_ResetAuthentication()

phStatus_t phalNtagXDna_ResetAuthentication ( void *  pDataParams)

Reset the 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.

◆ phalNtagXDna_CalculateMACSDM()

phStatus_t phalNtagXDna_CalculateMACSDM ( void *  pDataParams,
uint8_t  bSdmOption,
uint16_t  wKeyNo_SDMMac,
uint16_t  wKeyVer_SDMMac,
uint8_t pUid,
uint8_t  bUidLen,
uint8_t pSDMReadCtr,
uint8_t pInData,
uint16_t  wInDataLen,
uint8_t **  ppSDMMAC,
uint16_t pSDMMACLen 
)

Performs computation of SDM MAC information.

Supports MAC Calculation using AES128 and AES 256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • If SDMOptions (bSdmOption) is not supported.
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf SDM Read Counter value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bSdmOption[In] SDM Option to indicate which parameters to be considered.
[in]wKeyNo_SDMMac[In] Key number to be used from KeyStore.
[in]wKeyVer_SDMMac[In] Key version to be used from KeyStore.
[in]pUid[In] UID of the card.
[in]bUidLen[In] Length of bytes available in pUid buffer.
[in]pSDMReadCtr[In] SDM Read Counter Input. Should be 4 bytes in Length.
[in]pInData[In] Data read out from PICC that is between SDMMacInputoffset until SDMMACOffset.
[in]wInDataLen[In] Length of bytes available in pInData buffer.
[out]ppSDMMAC[Out] Secure Dynamic MAC information.
[out]pSDMMACLen[Out] Length of bytes available in ppRespMac buffer.

◆ phalNtagXDna_VerifySDMSignature()

phStatus_t phalNtagXDna_VerifySDMSignature ( void *  pDataParams,
uint16_t  wPubKeyNo_SDMSig,
uint16_t  wPubKeyPos_SDMSig,
uint8_t pInData,
uint16_t  wInDataLen,
uint8_t pSignature,
uint16_t  wSigLen 
)

Performs verification of SDM Signature information.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
PH_ERR_VERIFICATION_FAILEDVerification of Message / Signature combination failed.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wPubKeyNo_SDMSig[In] Key number to be used from KeyStore.
[in]wPubKeyPos_SDMSig[In] Key position to be used from KeyStore.
[in]pInData[In] Data read out from PICC that is between SDMMacInputoffset until SDMMACOffset.
[in]wInDataLen[In] Length of bytes available in pInData buffer.
[in]pSignature[In] Secure Dynamic Signature information.
[in]wSigLen[In] Length of bytes available in pSignature buffer.

◆ phalNtagXDna_DecryptSDMENCFileData()

phStatus_t phalNtagXDna_DecryptSDMENCFileData ( void *  pDataParams,
uint8_t  bSdmOption,
uint16_t  wKeyNo_SDMEnc,
uint16_t  wKeyVer_SDMEnc,
uint8_t pUid,
uint8_t  bUidLen,
uint8_t pSDMReadCtr,
uint8_t pEncData,
uint16_t  wEncDataLen,
uint8_t **  ppPlainData,
uint16_t pPlainDataLen 
)

Performs decryption of SDM File Data.

Supports decryption using AES128 and AES 256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • If SDMOptions (bSdmOption) is not supported.
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf SDM Read Counter value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bSdmOption[In] SDM Option to indicate which parameters to be considered.
[in]wKeyNo_SDMEnc[In] Key number to be used from KeyStore.
[in]wKeyVer_SDMEnc[In] Key version to be used from KeyStore.
[in]pUid[In] UID of the card.
[in]bUidLen[In] Length of bytes available in pUid buffer.
[in]pSDMReadCtr[In] SDM Read Counter Input.
[in]pEncData[In] Encrypted NonASCII SDM Encrypted File data.
[in]wEncDataLen[In] Length of bytes available in pEncData buffer.
[out]ppPlainData[Out] The decrypted SDMFile data.
[out]pPlainDataLen[Out] Length of bytes available in ppPlainData buffer.

◆ phalNtagXDna_DecryptSDMPICCData()

phStatus_t phalNtagXDna_DecryptSDMPICCData ( void *  pDataParams,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t pEncData,
uint16_t  wEncDataLen,
uint8_t **  ppPlainData,
uint16_t pPlainDataLen 
)

Performs decryption of SDM PICC Data.

Supports decryption using AES128 and AES 256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf SDM Read Counter value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wKeyNo[In] Key number to be used from KeyStore.
[in]wKeyVer[In] Key version to be used from KeyStore.
[in]pEncData[In] Encrypted NonASCII SDM PICC data.
[in]wEncDataLen[In] Length of bytes available in pEncData buffer.
[out]ppPlainData[Out] The decrypted SDMPICC data.
[out]pPlainDataLen[Out] Length of bytes available in ppPlainData buffer.