RSACng.VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) 方法
定義
驗證已簽署且已使用指定演算法和填補模式雜湊處理的資料。Verifies data that was signed and already hashed with the specified algorithm and padding mode.
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[]
要驗證的雜湊。The hash to verify.
- signature
- Byte[]
資料的簽章。The signature of the data.
- hashAlgorithm
- HashAlgorithmName
雜湊演算法名稱。The hash algorithm name.
- padding
- RSASignaturePadding
填補模式。The padding mode.
傳回
如果雜湊的簽章驗證無誤,則為 true
;否則為 false
。true
if the signature verifies for the hash; otherwise, false
.
例外狀況
hash
為 null
。hash
is null
.
-或--or-
signature
為 null
。signature
is null
.
-或--or-
padding
為 null
。padding
is null
.
hashAlgorithm
的 Name 屬性值為 null
或 Empty。The value of the Name property of hashAlgorithm
is null
or Empty.
padding
不等於 Pkcs1 或 Pss。padding
does not equal Pkcs1 or Pss.
-或--or-
簽章的格式不正確。The signature is badly formatted. 僅限 .NET Framework 4.6.NET Framework 4.6 和 4.6.1;從 .NET Framework 4.6.2.NET Framework 4.6.2 開始,如果簽章的格式不正確,此方法會傳回 false
。(In the .NET Framework 4.6.NET Framework 4.6 and 4.6.1 only; starting with the .NET Framework 4.6.2.NET Framework 4.6.2, the method returns false
if a signature is badly formatted.