User manual

NXP Semiconductors
UM10663
NXP Reader Library User Manual
UM10663
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2013. All rights reserved.
User Manual
COMPANY PUBLIC
Rev. 1.224 July 2013
257412
12 of 47
*pDataParams: pointer to the HAL layer data parameter structure.
bKeyNo: key number in EEPROM in range 0x00 - 0xFF.
returnValues:
PH_ERR_SUCCESS
- operation successful.
Other: depending on implementation and underlaying component.
2.1.6 MFAuthent
- phhalHw_Rc663_MfcAuthenticate_Int()
This function performs MFAuthent command (entire three pass Authentication procedure
to the given EEPROM block of the card) with key currently loaded in the Key buffer. If
Authentication passes through all three phases successfully, then the EEPROM block is
fully accessible for data manipulation MIFARE Classic commands: reading, writing,
increment, decrement, restore and data transfer. For MIFARE Classic, if once access to
the block is obtained, then access to entire sector (4 blocks) retains until next attempt to
authenticate to any EEPROM block of card.[2]
Note:
This function does not provide any loading into the Key buffer. The key intended to
be used for the authentication needs to be loaded by
phhalHw_Rc663_Cmd_LoadKey()
function
(
section 2.1.4). In case of using the key from the key storage area of PCD’s
EEPROM see an alternative to this function
phalMfc_Authenticate()
in section 2.4.2.
phStatus_t phhalHw_Rc663_MfcAuthenticate_Int(
phhalHw_Rc663_DataParams_t * pDataParams, [In]
uint8_t bBlockNo, [In]
uint8_t bKeyType, [In]
uint8_t * pUid ); [In]
*pDataParams: pointer to the HAL layer data parameter structure.
Set
pDataParams->pKeyStoreDataParams = NULL
to run EEPROM key store branch.
bBlockNo: number of block in EEPROM of the card to authenticate to. Authentication to
block enables access to entire section which the block is part of. In case of the MIFARE
Classic it must be in range from 0 to 63.
bKeyType: can be either
PHAL_MFC_KEYA
or
PHAL_MFC_KEYB
. In case of MIFARE Classic
each block can be authenticated by using anyone of these two keys specified for that
block.[2]
*pUid: pointer to UID of the card to be authenticated. Each card has its own unique
identification number.
Note: In this function there is no pointer to array containing 6 byte key used for
authentication. Thus before calling this function, the key intended to be used for
authentication must be loaded into the Key buffer by the function
phhalHw_Rc663_Cmd_LoadKey()
see section 2.1.4. or by the
phKeyStore_SetKey()
see
section 2.1.14. In case of key stored in MKA see
phalMfc_Authenticate()
in section 2.4.2
as an alternative to this function.
returnValues:
PH_ERR_AUTH_ERROR:
Authentication procedure fails, if the key currently loaded in the Key
buffer of reader does not match with key for given block in card tried to be accessed.
PH_ERR_INVALID_PARAMETER
wKeyVersion
other than NULL.
bKeyType
other than
PHAL_MFC_KEYA
or
PHAL_MFC_KEYB
.