RSACng.VerifyHash 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
驗證已簽署且已依指定演算法與填充模式雜湊的資料。
多載
| 名稱 | Description |
|---|---|
| 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
例外狀況
-或-
簽名格式很糟糕。 (僅在.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