Share via


DSACryptoServiceProvider.VerifyHash(Byte[], String, Byte[]) Metodo

Definizione

Verifica i dati della firma specificata confrontandola con la firma calcolata per il valore hash specificato.

public:
 bool VerifyHash(cli::array <System::Byte> ^ rgbHash, System::String ^ str, cli::array <System::Byte> ^ rgbSignature);
public bool VerifyHash (byte[] rgbHash, string? str, byte[] rgbSignature);
public bool VerifyHash (byte[] rgbHash, string str, byte[] rgbSignature);
member this.VerifyHash : byte[] * string * byte[] -> bool
Public Function VerifyHash (rgbHash As Byte(), str As String, rgbSignature As Byte()) As Boolean

Parametri

rgbHash
Byte[]

Valore hash dei dati da firmare.

str
String

Nome dell'algoritmo hash usato per creare il valore hash dei dati.

rgbSignature
Byte[]

Dati della firma da verificare.

Restituisce

true se la firma risulta valida; in caso contrario, false.

Eccezioni

Il valore del parametro rgbHash è null.

-oppure-

Il valore del parametro rgbSignature è null.

Non è possibile acquisire il provider del servizio di crittografia (CSP).

-oppure-

Non è possibile verificare la firma.

Commenti

Questo metodo verifica la DSA firma digitale prodotta da SignHash.

Se il str parametro è null, viene usato l'algoritmo hash predefinito (SHA1). Gli algoritmi hash validi sono SHA1.

A causa di problemi di collisione con SHA1, Microsoft consiglia un modello di sicurezza basato su SHA256 o superiore.

Si applica a

Vedi anche