NXP Reader Library  v17.1.0.2535
Commands_SecureMessaging

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

Collaboration diagram for Commands_SecureMessaging:

Functions

phStatus_t phalMfprimeNtag_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_MFPRIMENTAG_NOT_AUTHENTICATED   0xFFU
 No authentication.
 
#define PHAL_MFPRIMENTAG_AUTHENTICATEEV2   0x71U
 EV2 First Authentication; 0x71.
 
#define PHAL_MFPRIMENTAG_AUTHNONFIRST_NON_LRP   0x0000U
 Non First Auth in regular EV2 auth Mode.
 
#define PHAL_MFPRIMENTAG_AUTHFIRST_NON_LRP   0x0001U
 First Auth in regular EV2 auth Mode.
 

Diversification options to be used with Authenticate command.

#define PHAL_MFPRIMENTAG_NO_DIVERSIFICATION   0xFFFFU
 No diversification.
 
#define PHAL_MFPRIMENTAG_DIV_METHOD_ENCR   PH_CRYPTOSYM_DIV_MODE_DESFIRE
 Encryption based method of diversification.
 
#define PHAL_MFPRIMENTAG_DIV_METHOD_CMAC   PH_CRYPTOSYM_DIV_MODE_MIFARE_PLUS
 CMAC based method of diversification.
 

Detailed Description

These Components implement the MIFARE MFPRIMENTAG Secure Messaging related commands.

Function Documentation

◆ phalMfprimeNtag_AuthenticateEv2()

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