NXP NFC Reader Library
v4.040.05.011646
|
This is only a wrapper layer to abstract the different KeyStore implementations. More...
![]() |
Modules | |
Component : Software | |
Keystore implementation in Software. | |
PhKeyStore_Rc663 | |
Macros | |
#define | PH_KEYSTORE_INVALID_ID 0xFFFFU |
ID used for various parameters as a invalid default. | |
#define | PH_KEYSTORE_DEFAULT_ID 0x0000 |
ID used for various parameters as a default. | |
Functions | |
phStatus_t | phKeyStore_FormatKeyEntry (void *pDataParams, uint16_t wKeyNo, uint16_t wNewKeyType) |
Format a key entry to a new KeyType. More... | |
phStatus_t | phKeyStore_SetKey (void *pDataParams, uint16_t wKeyNo, uint16_t wKeyVersion, uint16_t wKeyType, uint8_t *pNewKey, uint16_t wNewKeyVersion) |
Change a key entry at a given version. More... | |
phStatus_t | phKeyStore_SetKeyAtPos (void *pDataParams, uint16_t wKeyNo, uint16_t wPos, uint16_t wKeyType, uint8_t *pNewKey, uint16_t wNewKeyVersion) |
Change a key entry at the specified position. More... | |
phStatus_t | phKeyStore_SetKUC (void *pDataParams, uint16_t wKeyNo, uint16_t wRefNoKUC) |
Change the KUC of a key entry. More... | |
phStatus_t | phKeyStore_SetFullKeyEntry (void *pDataParams, uint16_t wNoOfKeys, uint16_t wKeyNo, uint16_t wNewRefNoKUC, uint16_t wNewKeyType, uint8_t *pNewKeys, uint16_t *pNewKeyVersionList) |
Change a full key entry. More... | |
phStatus_t | phKeyStore_GetKeyEntry (void *pDataParams, uint16_t wKeyNo, uint16_t wKeyVersionBufSize, uint16_t *wKeyVersion, uint16_t *wKeyVersionLength, uint16_t *pKeyType) |
Get a key entry information block. More... | |
phStatus_t | phKeyStore_GetKey (void *pDataParams, uint16_t wKeyNo, uint16_t wKeyVersion, uint8_t bKeyBufSize, uint8_t *pKey, uint16_t *pKeyType) |
Get a key. More... | |
phStatus_t | phKeyStore_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue) |
Set configuration parameter. More... | |
phStatus_t | phKeyStore_SetConfigStr (void *pDataParams, uint16_t wConfig, uint8_t *pBuffer, uint16_t wBufferLength) |
Set configuration parameter. More... | |
phStatus_t | phKeyStore_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue) |
Get configuration parameter. More... | |
phStatus_t | phKeyStore_GetConfigStr (void *pDataParams, uint16_t wConfig, uint8_t **ppBuffer, uint16_t *pBufferLength) |
Get configuration parameter. More... | |
phStatus_t | phKeyStore_ChangeKUC (void *pDataParams, uint16_t wRefNoKUC, uint32_t dwLimit) |
Change a key usage counter entry. More... | |
phStatus_t | phKeyStore_GetKUC (void *pDataParams, uint16_t wRefNoKUC, uint32_t *pdwLimit, uint32_t *pdwCurVal) |
Obtain a key usage counter entry. More... | |
Key Types | |
#define | PH_KEYSTORE_KEY_TYPE_AES128 0x00U |
AES 128 Key [16]. More... | |
#define | PH_KEYSTORE_KEY_TYPE_AES192 0x01U |
AES 192 Key [24]. More... | |
#define | PH_KEYSTORE_KEY_TYPE_AES256 0x02U |
AES 256 Key [32]. More... | |
#define | PH_KEYSTORE_KEY_TYPE_DES 0x03U |
DES Single Key. More... | |
#define | PH_KEYSTORE_KEY_TYPE_2K3DES 0x04U |
2 Key Triple Des. More... | |
#define | PH_KEYSTORE_KEY_TYPE_3K3DES 0x05U |
3 Key Triple Des. More... | |
#define | PH_KEYSTORE_KEY_TYPE_MIFARE 0x06U |
MIFARE (R) Key. More... | |
#define | PH_KEYSTORE_KEY_TYPE_MIFARE_SIZE 0x0CU |
Size of an MIFARE Key. More... | |
#define | PH_KEYSTORE_KEY_TYPE_AES128_SIZE 0x10U |
Size of an AES128 Key. More... | |
KeyStoreConfigs | |
#define | PH_KEYSTORE_CONFIG_SET_DEFAULT 0xFFFFU |
Reset all bit of SET param. More... | |
This is only a wrapper layer to abstract the different KeyStore implementations.
#define PH_KEYSTORE_KEY_TYPE_AES128 0x00U |
AES 128 Key [16].
#define PH_KEYSTORE_KEY_TYPE_AES192 0x01U |
AES 192 Key [24].
#define PH_KEYSTORE_KEY_TYPE_AES256 0x02U |
AES 256 Key [32].
#define PH_KEYSTORE_KEY_TYPE_DES 0x03U |
DES Single Key.
#define PH_KEYSTORE_KEY_TYPE_2K3DES 0x04U |
2 Key Triple Des.
#define PH_KEYSTORE_KEY_TYPE_3K3DES 0x05U |
3 Key Triple Des.
#define PH_KEYSTORE_KEY_TYPE_MIFARE 0x06U |
MIFARE (R) Key.
#define PH_KEYSTORE_KEY_TYPE_MIFARE_SIZE 0x0CU |
Size of an MIFARE Key.
#define PH_KEYSTORE_KEY_TYPE_AES128_SIZE 0x10U |
Size of an AES128 Key.
#define PH_KEYSTORE_CONFIG_SET_DEFAULT 0xFFFFU |
Reset all bit of SET param.
Format a key entry to a new KeyType.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wKeyNo | KeyEntry number to be Formatted. |
[in] | wNewKeyType | New Key type of the KeyEntry (predefined type of KeyType). |
phStatus_t phKeyStore_SetKey | ( | void * | pDataParams, |
uint16_t | wKeyNo, | ||
uint16_t | wKeyVersion, | ||
uint16_t | wKeyType, | ||
uint8_t * | pNewKey, | ||
uint16_t | wNewKeyVersion | ||
) |
Change a key entry at a given version.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wKeyNo | Key number of the key to be loaded. |
[in] | wKeyVersion | Key version of the key to be loaded. |
[in] | wKeyType | Key type of the key to be loaded. |
[in] | pNewKey | Pointer to the key itself. |
[in] | wNewKeyVersion | New Key version of the key to be updated. |
phStatus_t phKeyStore_SetKeyAtPos | ( | void * | pDataParams, |
uint16_t | wKeyNo, | ||
uint16_t | wPos, | ||
uint16_t | wKeyType, | ||
uint8_t * | pNewKey, | ||
uint16_t | wNewKeyVersion | ||
) |
Change a key entry at the specified position.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wKeyNo | Key number of the key to be loaded. |
[in] | wPos | Key position to be updated. |
[in] | wKeyType | Key type of the key to be loaded. |
[in] | pNewKey | Pointer to the key itself. |
[in] | wNewKeyVersion | New Key version of the key to be updated. |
Change the KUC of a key entry.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wKeyNo | KeyEntry number. |
[in] | wRefNoKUC | Reference Number of the key usage counter used together with that key. |
phStatus_t phKeyStore_SetFullKeyEntry | ( | void * | pDataParams, |
uint16_t | wNoOfKeys, | ||
uint16_t | wKeyNo, | ||
uint16_t | wNewRefNoKUC, | ||
uint16_t | wNewKeyType, | ||
uint8_t * | pNewKeys, | ||
uint16_t * | pNewKeyVersionList | ||
) |
Change a full key entry.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wNoOfKeys | Number of keys in pNewKeys. |
[in] | wKeyNo | Key number of the key to be loaded. |
[in] | wNewRefNoKUC | Number of the key usage counter used together with that key. |
[in] | wNewKeyType | Key type of the key (if the current keyType of KeyEntry is different, error). |
[in] | pNewKeys | Array of Keys to load. |
[in] | pNewKeyVersionList | KeyVersionList of the key to be loaded . |
phStatus_t phKeyStore_GetKeyEntry | ( | void * | pDataParams, |
uint16_t | wKeyNo, | ||
uint16_t | wKeyVersionBufSize, | ||
uint16_t * | wKeyVersion, | ||
uint16_t * | wKeyVersionLength, | ||
uint16_t * | pKeyType | ||
) |
Get a key entry information block.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wKeyNo | Key number of the key entry of interest. |
[in] | wKeyVersionBufSize | Buffer Size of wKeyVersion in Bytes. |
[out] | wKeyVersion | Array for version information. |
[out] | wKeyVersionLength | Length of valid data in wKeyVersion. |
[out] | pKeyType | Type of the key. |
phStatus_t phKeyStore_GetKey | ( | void * | pDataParams, |
uint16_t | wKeyNo, | ||
uint16_t | wKeyVersion, | ||
uint8_t | bKeyBufSize, | ||
uint8_t * | pKey, | ||
uint16_t * | pKeyType | ||
) |
Get a key.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wKeyNo | Key number of the key to be retrieved. |
[in] | wKeyVersion | Key version of the key to be retrieved. |
[in] | bKeyBufSize | Size of the key buffer. |
[out] | pKey | Pointer to the key itself. |
[out] | pKeyType | Type of the key. |
Set configuration parameter.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wConfig | Configuration Identifier |
[in] | wValue | Configuration Value |
phStatus_t phKeyStore_SetConfigStr | ( | void * | pDataParams, |
uint16_t | wConfig, | ||
uint8_t * | pBuffer, | ||
uint16_t | wBufferLength | ||
) |
Set configuration parameter.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wConfig | Configuration Identifier. |
[in] | pBuffer | Buffer containing the configuration string. |
[in] | wBufferLength | Length of configuration string. |
Get configuration parameter.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wConfig | Configuration Identifier |
[out] | pValue | Configuration Value |
phStatus_t phKeyStore_GetConfigStr | ( | void * | pDataParams, |
uint16_t | wConfig, | ||
uint8_t ** | ppBuffer, | ||
uint16_t * | pBufferLength | ||
) |
Get configuration parameter.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wConfig | Configuration Identifier |
[out] | ppBuffer | Pointer to the buffer containing the configuration string. |
[out] | pBufferLength | Amount of valid bytes in the configuration string buffer. |
Change a key usage counter entry.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wRefNoKUC | Number of key entry. |
[in] | dwLimit | Limit of the Key Usage Counter |
phStatus_t phKeyStore_GetKUC | ( | void * | pDataParams, |
uint16_t | wRefNoKUC, | ||
uint32_t * | pdwLimit, | ||
uint32_t * | pdwCurVal | ||
) |
Obtain a key usage counter entry.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wRefNoKUC | number of the key usage counter to be looked at (00h to 0Fh) |
[out] | pdwLimit | Currently Set Limit in the KUC |
[out] | pdwCurVal | Currently set value in the KUC |