cookie CmValidateSignature

Description

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

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

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 CmAccess / 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 CmAccess / CmAccess2 performed for CmValidateSignature.

Syntax

public bool CmValidateSignature(CmAuthenticate Auth, byte[] Signature, byte[] PubKey)

Parameter

Auth contains the specification of the validation process (see class hmtoggle_plus1 CmAuthenticate).

Signature contains the signature to validate.

PubKey the public key needed for validation.

Return

The hash value used for the signature must always be set into Auth->Digest. The value Auth->Option is set to one of the following values: Direct, Extended, Serial. Depending on this value the following values must be set accordingly:

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

•Extended, Extended: Auth->EncryptionCodeOptions and Auth->FeatureCode have to have the same value as for CmValidateSignature. Auth->FirmCode and Auth->ProductCode have to match the values used for CmAccess / CmAccess2 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 CmAccess / CmAccess2 performed for CmValidateSignature.

 

Syntax

import cmapi
 
 
cmapi.CodeMeter().CmValidateSignature(
 pcmAuth: CMAUTHENTICATE, signature: bytes, pubkey: bytes) -> bool

Parameter

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

signature contains the buffer for the signature to validate.

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

Return

True if successful, False otherwise.