RSAOpenSsl.VerifyHash 方法

定义

通过使用指定的哈希算法和填充方式计算签名中的哈希值,然后将其与提供的哈希值进行比较来验证数字签名是否有效。

public:
 override bool VerifyHash(cli::array <System::Byte> ^ hash, cli::array <System::Byte> ^ signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);
public override bool VerifyHash (byte[] hash, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
override this.VerifyHash : byte[] * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Overrides Function VerifyHash (hash As Byte(), signature As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Boolean

参数

hash
Byte[]

已签名数据的哈希值。

signature
Byte[]

要验证的签名数据。

hashAlgorithm
HashAlgorithmName

用于创建哈希值的哈希算法。

padding
RSASignaturePadding

填充模式。

返回

如果签名有效,则为 true;否则为 false

例外

hashpaddingnull

hashAlgorithm.NamenullEmpty

padding 未知或不受此实现支持。

适用于