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

hashAlgorithmName 屬性值為 nullEmpty

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

適用於