Udostępnij przez


RSACng.VerifyHash Metoda

Definicja

Przeciążenia

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

Sprawdza dane, które zostały podpisane i zostały już skróty za pomocą określonego algorytmu i trybu uzupełniania.

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

Sprawdza, czy podpis cyfrowy jest prawidłowy, określając wartość skrótu w podpisie przy użyciu określonego algorytmu wyznaczania wartości skrótu i uzupełniania oraz porównując go z podaną wartością skrótu.

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

Sprawdza dane, które zostały podpisane i zostały już skróty za pomocą określonego algorytmu i trybu uzupełniania.

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

Parametry

hash
Byte[]

Skrót do zweryfikowania.

signature
Byte[]

Podpis danych.

hashAlgorithm
HashAlgorithmName

Nazwa algorytmu skrótu.

padding
RSASignaturePadding

Tryb dopełnienia.

Zwraca

true jeśli podpis weryfikuje skrót; w przeciwnym razie , false.

Wyjątki

hash to null.

-lub-

signature to null.

-lub-

padding to null.

Wartość właściwości hashAlgorithm właściwości Name to null lub Empty.

padding nie jest równe Pkcs1 lub Pss.

-lub-

Podpis jest źle sformatowany. (Tylko w .NET Framework 4.6 i 4.6.1; począwszy od .NET Framework 4.6.2, metoda zwraca false wartość , jeśli podpis jest nieprawidłowo sformatowany.

Dotyczy

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

Sprawdza, czy podpis cyfrowy jest prawidłowy, określając wartość skrótu w podpisie przy użyciu określonego algorytmu wyznaczania wartości skrótu i uzupełniania oraz porównując go z podaną wartością skrótu.

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

Parametry

hash
ReadOnlySpan<Byte>

Wartość skrótu podpisanych danych.

signature
ReadOnlySpan<Byte>

Dane podpisu do zweryfikowania.

hashAlgorithm
HashAlgorithmName

Algorytm skrótu użyty do utworzenia wartości skrótu.

padding
RSASignaturePadding

Tryb dopełnienia.

Zwraca

true jeśli podpis jest prawidłowy; w przeciwnym razie , false.

Dotyczy