The Verify method will use one of the selected algorithms
(RSA or DSA) with MD5 digest, together with readable data and the
owner's digital signature to verify if the signature
is correct. As a result, a Boolean value
True/False will be returned from the
calculation. To verify the signature, you must have the public key
of the owner set in the SecretKey
property. If you wish to use
SHA1 digest instead of
MD5, you should use
RSA+SHA1 or
DSA+SHA1 constants.
You should receive the PublicKey from the owner - you cannot
generate one by yourself. This is because the public key is
derived from the owner's private key - which only the real owner
possesses.
When you have the owner's public key, readable data
which you believe he signed, and his signature, you can
verify it with the following code:
Dim crypt As New
wodCryptCom
Dim i_blob As New MemBlob
Dim sig_blob As New MemBlob
Dim Key As New Keys
sig_blob.FromBase64 ("MC4CFQDoYDKp8Owxfp5iAmI5MIumvLY3BgIVAK5bqQgQ9W3OGA7DgCtML40uuKBL")
Key.Load "c:\keys\dsa.pem" ' this is only public key
i_blob.Text = "data to be
signed"
crypt.Type = DSA
crypt.SecretKey = Key.PublicKey(DSAkey)
Debug.Print crypt.Verify(i_blob,
sig_blob)
result:
True