NXP Reader Library  v17.1.0.2535
ASymmetric

Interfaces for ASymmetric keys of KeyStore component. More...

Collaboration diagram for ASymmetric:

Modules

 Common Definitions
 Definitions for ASymetric keys of KeyStore component.
 

Functions

phStatus_t phKeyStore_SetKeyASym (void *pDataParams, uint16_t wKeyNo, uint16_t wPos, uint16_t wKeyType, uint16_t wKeyInfo, uint8_t *pKey, uint16_t wKeyLen)
 Change a Asymmetric Private or Public key entry in Un-compressed Binary format. More...
 
phStatus_t phKeyStore_GetKeyASym (void *pDataParams, uint16_t wKeyNo, uint16_t wPos, uint16_t wKeyPairType, uint16_t *pKeyType, uint8_t *pCurveID, uint8_t *pKey, uint16_t *pKeyLen)
 Get a asymmetric key. More...
 
phStatus_t phKeyStore_GetCurveID (void *pDataParams, uint16_t wKeyNo, uint16_t wPos, uint8_t *pCurveID)
 Get a asymmetric key ECC Curve ID. More...
 

Detailed Description

Interfaces for ASymmetric keys of KeyStore component.

Function Documentation

◆ phKeyStore_SetKeyASym()

phStatus_t phKeyStore_SetKeyASym ( void *  pDataParams,
uint16_t  wKeyNo,
uint16_t  wPos,
uint16_t  wKeyType,
uint16_t  wKeyInfo,
uint8_t pKey,
uint16_t  wKeyLen 
)

Change a Asymmetric Private or Public key entry in Un-compressed Binary format.

Note
  • This interface should be called more than ones to load Private or Public Key.
  • One Key number at a specific position can hold both Private and Public Key.
  • Public Key alone can be stored also.
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]wKeyNo[In] Key number of the KeyStore to be loaded.
[in]wPos[In] Position at which the Key should be updated.
  • Should be the Key position to set the key to DataParams pKeyEntries member.
[in]wKeyType[In] New Key type of the KeyEntry (predefined type of KeyType).
[in]wKeyInfo[In] Type of Key pair and Curve to save.
  • Refer Key Pair to save.
  • Refer CurveID for type of Curve available in pKey buffer.
[in]pKey[In] Pointer to the key itself.
  • Private Key should be equal to the provided CurveID in wKeyInfo parameter.
  • Public Key should be twice the length of Private Key including the Uncompressed notation at beginning of the buffer.
[in]wKeyLen[In] Length of bytes available in pKey buffer.

◆ phKeyStore_GetKeyASym()

phStatus_t phKeyStore_GetKeyASym ( void *  pDataParams,
uint16_t  wKeyNo,
uint16_t  wPos,
uint16_t  wKeyPairType,
uint16_t pKeyType,
uint8_t pCurveID,
uint8_t pKey,
uint16_t pKeyLen 
)

Get a asymmetric key.

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]wKeyNo[In] Key number of the KeyStore to be retrieved.
[in]wPos[In] Position at which the Key should be retrieved.
  • Should be the Key position to get the key from DataParams pKeyEntries member.
[in]wKeyPairType[In] Type of Key-pair to be retrieved.
[in]pKeyType[In] Type of key being saved earlier.
[in]pCurveID[In] One of the Curve ID's.
[out]pKey[Out] Pointer to the key itself. The buffer size should be equal or greater than the Size of the stored key.
[out]pKeyLen[Out] Length of bytes available in pKey buffer.

◆ phKeyStore_GetCurveID()

phStatus_t phKeyStore_GetCurveID ( void *  pDataParams,
uint16_t  wKeyNo,
uint16_t  wPos,
uint8_t pCurveID 
)

Get a asymmetric key ECC Curve ID.

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]wKeyNo[In] Key number of the KeyStore to be retrieved.
[in]wPos[In] Position at which the Key should be retrieved.
  • Should be the Key position to get the key from DataParams pKeyEntries member.
[out]pCurveID[Out] Provided the CurveID of the provided Key informations. Will return one of the following mentioned in Curve ID's