public static Verify ( byte dataToVerify, byte signature, RSAParameters publicKey, string hashAlgorithm = "SHA512", RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048 ) : bool | ||
dataToVerify | byte | |
signature | byte | |
publicKey | RSAParameters | |
hashAlgorithm | string | |
rsaKeyLength | RsaKeyLengths | |
return | bool |
public static bool Verify(byte[] dataToVerify, byte[] signature, RSAParameters publicKey, string hashAlgorithm = "SHA512", RsaKeyLengths rsaKeyLength = RsaKeyLengths.Bit2048)
{
using (var rsa = CreateRsa(rsaKeyLength))
{
rsa.ImportParameters(publicKey);
var verified = rsa.VerifyData(dataToVerify, signature, hashAlgorithm);
return verified;
}
}
}