RSACng.VerifyHash 方法

定义

验证已签名且已使用指定算法和填充模式进行哈希处理的数据。

重载

名称 说明
VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

验证已签名且已使用指定算法和填充模式进行哈希处理的数据。

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

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

VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

验证已签名且已使用指定算法和填充模式进行哈希处理的数据。

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.

例外

hashnull

-或-

signaturenull

-或-

paddingnull

Name的属性值hashAlgorithmnullEmpty

padding 不等于 Pkcs1Pss

-或-

签名格式不正确。 (仅在 .NET Framework 4.6 和 4.6.1 中;从 .NET Framework 4.6.2 开始,如果签名格式不正确,该方法将返回 false

适用于

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

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

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

参数

hash
ReadOnlySpan<Byte>

已签名数据的哈希值。

signature
ReadOnlySpan<Byte>

要验证的签名数据。

hashAlgorithm
HashAlgorithmName

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

padding
RSASignaturePadding

填充模式。

返回

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

适用于