CmEmbedded_4c_transp CmValidateSignature

Description

CmValidateSignature validates a passed signature using the passed public key and the ECDSA algorithm.

  • C, C++

Syntax

int CMAPIENTRY CmValidateSignature(CMAUTHENTICATE *pcmAuth, CMBYTE *pbSignature, CMUINT cbSignature, CMBYTE *pbPubKey, CMUINT cbPubKey);

Parameter

pcmAuth contains the specification of the validation process (see structure hmtoggle_plus1 CMAUTHENTICATE).

pbSignature contains the buffer for the signature to validate.

cbSignature contains the length of the pbSignature buffer.

pbPubKey contains the buffer for the public key needed for validation.

cbPubKey contains the length of the pbPubKey buffer.

Return

The hash value used for the signature must always be set into pcmAuth->mabDigest. The value pcmAuth->mflCtrl is set to one of the following values: CM_AUTH_DIRECT, CM_AUTH_EXTENDED,CM_AUTH_EXTENDED2, CM_AUTH_SERIAL. Depending on this value the following values must be set accordingly:

•CM_AUTH_DIRECT: All other values are ignored and can be set to 0.

•CM_AUTH_EXTENDED, CM_AUTH_EXTENDED2: pcmAuth->mulEncryptionCodeOptions and pcmAuth->mulFeatureCode have to have the same value as for CmValidateSignature. pcmAuth->mulFirmCode and pcmAuth->mulProductCode have to match the values used for CmAccess2 performed for CmCalculateSignature.

•CM_AUTH_SERIAL: pcmAuth->mulEncryptionCodeOptions has to have the same value as for CmCalculateSignature. pcmAuth->mcmBoxInfo.musBoxMask and pcmAuth->mcmBoxInfo.mulSerialNumber have to be set to identify the signing box. pcmAuth->mulFirmCode and pcmAuth->mulProductCode have to match the values used for CmAccess2 performed for CmValidateSignature.

performed for CmValidateSignature.

•Serial: Auth->EncryptionCodeOptions has to have the same value as for CmCalculateSignature: Auth->BoxInfo.BoxMask and Auth->BoxInfo.SerialNumber have to be set to identify the signing box. Auth->FirmCode and Auth->ProductCode have to match the values used for CmAccess2 performed for CmValidateSignature.