NXP Reader Library  v17.1.0.2535
Commands_SecureMessaging

These Components implement the MIFARE MFNTAG42XDNA Secure Messaging related commands. More...

Collaboration diagram for Commands_SecureMessaging:

Functions

phStatus_t phalMfNtag42XDna_AuthenticateEv2 (void *pDataParams, uint8_t bFirstAuth, uint16_t wOption, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen, uint8_t bLenPcdCapsIn, uint8_t *bPcdCapsIn, uint8_t *bPcdCapsOut, uint8_t *bPdCapsOut)
 Performs an First or Non First Authentication depending upon bFirstAuth Parameter. More...
 

Authentication Modes

#define PHAL_MFNTAG42XDNA_NOT_AUTHENTICATED   0xFFU
 No authentication.
 
#define PHAL_MFNTAG42XDNA_AUTHENTICATE   0x0AU
 D40 Authentication; 0x0A.
 
#define PHAL_MFNTAG42XDNA_AUTHENTICATEISO   0x1AU
 ISO Authentication; 0x1A.
 
#define PHAL_MFNTAG42XDNA_AUTHENTICATEAES   0xAAU
 AES Authentication; 0xAA.
 
#define PHAL_MFNTAG42XDNA_AUTHENTICATEEV2   0x71U
 EV2 First Authentication; 0x71.
 
#define PHAL_MFNTAG42XDNA_AUTH_TYPE_EV2   0x01U
 Auth Type as EV2.
 
#define PHAL_MFNTAG42XDNA_AUTH_TYPE_LRP   0x02U
 Auth Type as LRP.
 
#define PHAL_MFNTAG42XDNA_AUTH_TYPE_UNKNOWN   0xFFU
 Auth Type as Unknown.
 
#define PHAL_MFNTAG42XDNA_CMD_AUTHENTICATE_PART2   0x77U
 EV2 NonFirst Authenticate; 0x77.
 
#define PHAL_MFNTAG42XDNA_AUTHNONFIRST_NON_LRP   0x0000U
 Non First Auth in regular EV2 auth Mode.
 
#define PHAL_MFNTAG42XDNA_AUTHFIRST_NON_LRP   0x0001U
 First Auth in regular EV2 auth Mode.
 
#define PHAL_MFNTAG42XDNA_AUTHNONFIRST_LRP   0x0002U
 Non First Auth in LRP mode.
 
#define PHAL_MFNTAG42XDNA_AUTHFIRST_LRP   0x0003U
 First Auth in LRP mode.
 

Diversification options to be used with Authenticate command.

#define PHAL_MFNTAG42XDNA_NO_DIVERSIFICATION   0xFFFFU
 No diversification.
 
#define PHAL_MFNTAG42XDNA_DIV_METHOD_ENCR   PH_CRYPTOSYM_DIV_MODE_DESFIRE
 Encryption based method of diversification.
 
#define PHAL_MFNTAG42XDNA_DIV_METHOD_CMAC   PH_CRYPTOSYM_DIV_MODE_MIFARE_PLUS
 CMAC based method of diversification.
 

Detailed Description

These Components implement the MIFARE MFNTAG42XDNA Secure Messaging related commands.

Function Documentation

◆ phalMfNtag42XDna_AuthenticateEv2()

phStatus_t phalMfNtag42XDna_AuthenticateEv2 ( void *  pDataParams,
uint8_t  bFirstAuth,
uint16_t  wOption,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t  bKeyNoCard,
uint8_t pDivInput,
uint8_t  bDivLen,
uint8_t  bLenPcdCapsIn,
uint8_t bPcdCapsIn,
uint8_t bPcdCapsOut,
uint8_t bPdCapsOut 
)

Performs an First or Non First Authentication depending upon bFirstAuth Parameter.

This will be using the AES128 keys and will generate and verify the contents based on generic AES algorithm.

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]bFirstAuth[In] One of the below options.
[in]wOption[In] Diversification option can be one of
[in]wKeyNo[In] Key number in keystore of software or SAM.
[in]wKeyVer[In] Key version 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.
[in]bLenPcdCapsIn[In] Length of PcdCapsIn. Always zero for following authentication
[in]bPcdCapsIn[In] PCD Capabilities.
[out]bPcdCapsOut[Out] PCD Capabilities.
[out]bPdCapsOut[Out] PD Capabilities.