rp
asked on
vb.net how to verify signature made by signdata
Dim sign As Byte() = privatekey.SignData(data, "SHA1")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
- datatoverify - is data before signed ?
- signeddata - is data after signed
- key - is the public or private key
Function VerifySignedHash(ByVal DataToVerify() As Byte, ByVal SignedData() As Byte, ByVal Key As RSAParameters) As Boolean
Try
' Create a new instance of RSACryptoServiceProvider using the
' key from RSAParameters.
Dim RSAalg As New RSACryptoServiceProvider
RSAalg.ImportParameters(Ke
' Verify the data using the signature. Pass a new instance of SHA1CryptoServiceProvider
' to specify the use of SHA1 for hashing.
Return RSAalg.VerifyData(DataToVe
Catch e As CryptographicException
Console.WriteLine(e.Messag
Return False
End Try
End Function