CmEmbedded_4c_transp CmGetPublicKey

Description

CmGetPublicKey returns a public key from the CmContainer. The CmContainer usually stores private keys only. With this request the CmContainer calculates the corresponding public key using Elliptic Curve Cryptography (ECC).

  • C, C++

Syntax

int CMAPIENTRY CmGetPublicKey(HCMSysEntry hcmse, CMAUTHENTICATE *pcmAuth, CMBYTE *pbPubKey, CMUINT cbPubKey);

Parameter

hcmse contains a handle opened by CmAccess2 ( Entry Access).

pcmAuth contains the specification of the desired public key (see structure hmtoggle_plus1 CMAUTHENTICATE).

pbPubKey contains the buffer for the public key.

cbPubKey contains the length of the pbPubKey buffer.

Return

The return value is TRUE, if the public key is returned, FALSE if not.

Notes

The pcmAuth structure has to be almost completely empty. The only value that has to be set is mflCtrl which has to be set to one of the following values: CM_AUTH_HIDDENDATA, CM_AUTH_SECRETDATA, CM_AUTH_SERIALKEY.

The value CM_AUTH_FIRMKEY is invalid here as this function cannot directly calculate the public key for the Firm Key. To calculate the public key for the Firm Key for Firm Item X calculate the public key for FSB entry 99:x Secret Data 128.

CM_AUTH_PISK (Product Item Secret Key) has been introduced with CodeMeter Version 6.0 (License Transfer).