NXP Reader Library  v17.1.0.2535
Commands_ASymmetricKeyManagement

Describes about the MIFARE DUOX ASymmetric Key Management commands. More...

Collaboration diagram for Commands_ASymmetricKeyManagement:

Modules

 Defines
 Macro Definitions for ASymmetric Key Management commands.
 

Functions

phStatus_t phalMfDuoX_ManageKeyPair (void *pDataParams, uint8_t bComOption, uint8_t bKeyNo, uint8_t bOption, uint8_t bCurveID, uint8_t *pKeyPolicy, uint8_t bWriteAccess, uint32_t dwKUCLimit, uint16_t wPrivKey_No, uint16_t wPrivKey_Pos, uint8_t **ppResponse, uint16_t *pRspLen)
 Creates or updates a private key entry by generating a key pair or importing a private key. More...
 
phStatus_t phalMfDuoX_ManageCARootKey (void *pDataParams, uint8_t bComOption, uint8_t bKeyNo, uint8_t bCurveID, uint8_t *pAccessRights, uint8_t bWriteAccess, uint8_t bReadAccess, uint8_t bCRLFile, uint8_t *pCRLFileAID, uint16_t wPubKey_No, uint16_t wPubKey_Pos, uint8_t *pIssuer, uint8_t bIssuerLen)
 Creates or updates a public key entry for storing a CARootKey. More...
 
phStatus_t phalMfDuoX_ExportKey (void *pDataParams, uint8_t bComOption, uint8_t bOption, uint8_t bKeyNo, uint8_t **ppResponse, uint16_t *pRspLen)
 Exports the public key value of a DUOXPrivateKey or CARootKey. More...
 

Detailed Description

Describes about the MIFARE DUOX ASymmetric Key Management commands.

Function Documentation

◆ phalMfDuoX_ManageKeyPair()

phStatus_t phalMfDuoX_ManageKeyPair ( void *  pDataParams,
uint8_t  bComOption,
uint8_t  bKeyNo,
uint8_t  bOption,
uint8_t  bCurveID,
uint8_t pKeyPolicy,
uint8_t  bWriteAccess,
uint32_t  dwKUCLimit,
uint16_t  wPrivKey_No,
uint16_t  wPrivKey_Pos,
uint8_t **  ppResponse,
uint16_t pRspLen 
)

Creates or updates a private key entry by generating a key pair or importing a private key.

Note
  • bComOption will be
    • Communication mode of the targeted key
    • If targeting not yet existing key, default CommMode defined by SetConfiguration for option DUOX Key Management should be used. Default is Fully Enciphered.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • The values provided in bComOption is not supported.
PH_ERR_KEY
  • If Key type is not DUOX.
  • The Key format is not Binary (Uncompressed Point Representation).
  • The Key pair is not Private type.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bComOption[In] Indicates the mode of communication to be used while exchanging the data to PICC.
[in]bKeyNo[In] Key number of the key to be managed.
  • At PICC level, two keys are supported.
  • At application level, up to five keys are supported.
[in]bOption[In] Target action to perform. Should be one of the below values.
[in]bCurveID[In] The targeted curve. Should be one of the below values.
[in]pKeyPolicy[In] Defines the allowed crypto operations with the targeted key.
[in]bWriteAccess[In] Defines the CommMode and access right required to update the key with Cmd.ManageKeyPair. Should contain below information.
  • Bits[7 - 6]: RFU
  • Bits[5 - 4]: Communication Modes, One of the below values.
  • Bits[3 - 0]: Access Rights, One of the below values.
    • At PICC Level
      • 0x00 : PICC Master Key
      • 0x01 : VC Configuration Key
      • 0x02 : DUOX-based Delegated Application Management
      • 0x03 - 0x0D: DUOX-specific access rights
      • 0x0E : Free Access
      • 0x0F : No Access or RFU
    • At Application Level
      • 0x00 - 0x0D: Authentication Required
      • 0x0D : [Optional] Free Access over I2C, Authentication required over NFC
      • 0x0E : Free Access
      • 0x0F : No Access or RFU
[in]dwKUCLimit[In] Defines the key usage limit of the targeted key.
  • 0x00000000: Key Usage Counter Limit is disabled
  • Any other value: Key Usage Counter Limit enabled with the given value (LSB first).
[in]wPrivKey_No[In] Key number in KeyStore of Private Key.
[in]wPrivKey_Pos[In] Key position in KeyStore of Private Key.
[out]ppResponse[Out] The Public Key in uncompressed point representation format.
[out]pRspLen[Out] Length of bytes available in ppResponse buffer.

◆ phalMfDuoX_ManageCARootKey()

phStatus_t phalMfDuoX_ManageCARootKey ( void *  pDataParams,
uint8_t  bComOption,
uint8_t  bKeyNo,
uint8_t  bCurveID,
uint8_t pAccessRights,
uint8_t  bWriteAccess,
uint8_t  bReadAccess,
uint8_t  bCRLFile,
uint8_t pCRLFileAID,
uint16_t  wPubKey_No,
uint16_t  wPubKey_Pos,
uint8_t pIssuer,
uint8_t  bIssuerLen 
)

Creates or updates a public key entry for storing a CARootKey.

Note
  • bComOption will be
    • Communication mode of the targeted key
    • If targeting not yet existing key, default CommMode defined by SetConfiguration for option DUOX Key Management should be used. Default is Fully Enciphered.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • The values provided in bComOption is not supported.
PH_ERR_KEY
  • If Key type is not DUOX.
  • The Key format is not Binary (Uncompressed Point Representation).
  • The Key pair is not Public type.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bComOption[In] Indicates the mode of communication to be used while exchanging the data to PICC.
[in]bKeyNo[In] Key number of the key to be managed.
  • At PICC level, two keys are supported.
  • At application level, up to five keys are supported.
[in]bCurveID[In] The targeted curve. Should be one of the below values.
[in]pAccessRights[In] Access rights associated with the CARootKey. Should be 2 byte.
[in]bWriteAccess[In] Defines the CommMode and access right required to update the key with Cmd.ManageCARootKey. Should contain below information.
  • Bits[7 - 6]: RFU
  • Bits[5 - 4]: Communication Modes, One of the below values.
  • Bits[3 - 0]: Access Rights, One of the below values.
    • At PICC Level
      • 0x00 : PICC Master Key
      • 0x01 : VC Configuration Key
      • 0x02 : DUOX-based Delegated Application Management
      • 0x03 - 0x0D: DUOX-specific access rights
      • 0x0E : Free Access
      • 0x0F : No Access or RFU
    • At Application Level
      • 0x00 - 0x0D: Authentication Required
      • 0x0D : [Optional] Free Access over I2C, Authentication required over NFC
      • 0x0E : Free Access
      • 0x0F : No Access or RFU
[in]bReadAccess[In] Defines the CommMode and access right required to read the key with Cmd.ExportKey. Should contain below information.
  • Bits[7 - 6]: RFU
  • Bits[5 - 4]: Communication Modes, One of the below values.
  • Bits[3 - 0]: Access Rights, One of the below values.
    • At PICC Level
      • 0x00 : PICC Master Key
      • 0x01 : VC Configuration Key
      • 0x02 : DUOX-based Delegated Application Management
      • 0x03 - 0x0D: DUOX-specific access rights
      • 0x0E : Free Access
      • 0x0F : No Access or RFU
    • At Application Level
      • 0x00 - 0x0D: Authentication Required
      • 0x0D : [Optional] Free Access over I2C, Authentication required over NFC
      • 0x0E : Free Access
      • 0x0F : No Access or RFU
[in]bCRLFile[In] Defines if certificate revocation is enabled and what file holds the CRL.
  • Bit[7] : Certificate Revocation
    • 0x00 : Disabled
    • 0x01 : Enabled
  • Bit[6 - 5]: RFU
  • Bit[6 - 5]: CRL File
    • 0x0000: RFU, if Bit7 is 0.
    • Others: File Number, if Bit7 is 1.
[in]pCRLFileAID[In] The application identifier holding the CRL file. Will be of 3 bytes with LSB first. If application 01 need to be created, then the Aid will be 01 00 00.
[in]wPubKey_No[In] Key number in KeyStore of Public Key.
[in]wPubKey_Pos[In] Key position in KeyStore of Public Key.
[in]pIssuer[In] The Trusted issuer name. Should be one of the following.
  • NULL in case if No trusted issuer name check required.
  • The Trusted issuer information otherwise. Ranging from 1 - 255 bytes
[in]bIssuerLen[In] Length of bytes available in pIssuer buffer.

◆ phalMfDuoX_ExportKey()

phStatus_t phalMfDuoX_ExportKey ( void *  pDataParams,
uint8_t  bComOption,
uint8_t  bOption,
uint8_t  bKeyNo,
uint8_t **  ppResponse,
uint16_t pRspLen 
)

Exports the public key value of a DUOXPrivateKey or CARootKey.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf DataParams is null.
PH_ERR_INVALID_PARAMETER
  • If the buffer is null.
  • The values provided in bComOption is not supported.
XXXX
  • Depending on status codes return by PICC.
  • Other Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bComOption[In] Indicates the mode of communication to be used while exchanging the data to PICC.
[in]bOption[In] Target Key Type for Exporting.
[in]bKeyNo[In] Key number of the key to be exported.
  • At PICC level, two keys are supported.
  • At application level, up to five keys are supported.
[out]ppResponse[Out] The Public Key in uncompressed point representation format.
[out]pRspLen[Out] Length of bytes available in ppResponse buffer.