RSACng.VerifyHash RSACng.VerifyHash RSACng.VerifyHash RSACng.VerifyHash Method

Definition

Overloads

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

Verifies data that was signed and already hashed with the specified algorithm and padding mode.

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

VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) 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

Parameters

hash
Byte[]

The hash to verify.

signature
Byte[]

The signature of the data.

Returns

true if the signature verifies for the hash; otherwise, false.

Exceptions

hash is null.

-or-

signature is null.

-or-

padding is null.

The value of the Name property of hashAlgorithm is null or Empty.

padding does not equal Pkcs1 or Pss.

-or-

The signature is badly formatted. (In the .NET Framework 4.6 and 4.6.1 only; starting with the .NET Framework 4.6.2, the method returns false if a signature is badly formatted.

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) 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

Parameters

signature
ReadOnlySpan<Byte>

Returns

Applies to