Verify Method

Verifies a digital signature using a key.

Syntax

ANSI (Cross Platform)
int Verify(const char* lpszKeyName, const char* lpszAlgorithm, int bIsDigest);

Unicode (Windows)
INT Verify(LPCWSTR lpszKeyName, LPCWSTR lpszAlgorithm, BOOL bIsDigest);
- (BOOL)verify:(NSString*)keyName :(NSString*)algorithm :(BOOL)isDigest;
#define MID_AZUREKEYS_VERIFY 25

CLOUDKEYS_EXTERNAL int CLOUDKEYS_CALL CloudKeys_AzureKeys_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method verifies a digital signature using the key specified by KeyName and the given Algorithm. The VersionId configuration setting can be used to target a specific key version. If the signature is successfully verified, this method returns true, otherwise it returns false.

The message data is taken from the input stream supplied via the SetInputStream method, the specified InputFile, or the InputData property. The digital signature data is taken from the specified OutputFile or the OutputData property.

The Algorithm parameter specifies which algorithm was used to sign the data. Possible values are:

  • ES256: ECDSA using P-256 and SHA-256.
  • ES256K: ECDSA using P-256K and SHA-256.
  • ES384: ECDSA using P-384 and SHA-384.
  • ES512: ECDSA using P-521 and SHA-512.
  • PS256: RSASSA-PSS using SHA-256 and MGF1 with SHA-256.
  • PS384: RSASSA-PSS using SHA-384 and MGF1 with SHA-384.
  • PS512: RSASSA-PSS using SHA-512 and MGF1 with SHA-512.
  • RS256: RSASSA-PKCS1-v1_5 using SHA-256.
  • RS384: RSASSA-PKCS1-v1_5 using SHA-384.
  • RS512: RSASSA-PKCS1-v1_5 using SHA-512.

The IsDigest parameter specifies whether the message data is the original message (false) or a message digest (true). When a message digest is supplied, keep in mind that it must be the exact same digest that was used at signing time, regardless of whether it has been recomputed.

If IsDigest is false, the class will automatically compute an appropriate message digest before the request is made. In such cases, the computed digest is made available via the MessageDigest configuration setting.

Error Handling (C++)

This method returns a Boolean value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2022 /n software inc. - All rights reserved.
Cloud Keys 2020 C++ Edition - Version 20.0 [Build 8157]