The Verify method verifies whether or not data is consistent with a particular digital signature . It can verify data in a single call, or it can be called multiple times to verify data in a streaming fashion.
The digital signature (in the form of a byte array variant) to verify the data against must be placed in the Signature property. You must set this property before the last call (when bEndOfData is true) because this is when the signature check is actually performed.
The verification process itself consists of the reverse algorithm for digitally signing data. It hashes the data using SHA-1 (producing a 160-bit hash value) then decrypts the signature using the sender's Public Key specified in the PublicKey property and then compares the hash value to the decrypted signature. More specifically, the RSA OAEP method is used for verification.
Parameter | Description |
---|---|
vaSource | The data to verify in the form of a byte array variant. |
bEndOfData | This parameter indicates to the library whether or not there is more data to verify. If you only have a single block of data to verify, set this parameter to True. The library will then immediately return the result of the verification for the data provided in the vaSource parameter. If you can only provide a portion of the data to verify in the vaSource parameter and will provide more data later in a subsequent call to the Verify method, set this parameter to False. In this case, the library will process the data but not return a meaningful value. Only when the final portion of the data to verify has been provided (set the bEndOfData parameter to True!) will the library return the result of the verification. |
When bEndOfData is True, the library will return True or False indicating whether or not the data corresponds to the provided digital signature.
The PublicKey property must contain the public key to use during verification.
When calling the Verify method with the bEndOfData parameter specified as False, you cannot call any other Xceed Encryption control method (of the same instance of the control) until you have completed processing a stream of data by calling the Verify method with the bEndOfData parameter specified as True, or an error occurs, or the Reset method is called.
Declaration (DXceedEncryption) | Copy Code |
---|---|
HRESULT Verify( [in] VARIANT* vaSource, [in] VARIANT_BOOL bEndOfData, |
Declaration (IXceedEncryption) | Copy Code |
---|---|
|