Redigera

Dela via


DSA.VerifySignature Method

Definition

Overloads

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

Verifies that a digital signature is valid for the provided hash.

VerifySignature(Byte[], Byte[])

When overridden in a derived class, verifies the DSA signature for the specified data.

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Verifies that a digital signature is valid for a provided data hash.

VerifySignature(Byte[], Byte[], DSASignatureFormat)

Verifies that a digital signature is valid for the provided hash.

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Verifies that a digital signature is valid for the provided hash.

public:
 bool VerifySignature(ReadOnlySpan<System::Byte> hash, ReadOnlySpan<System::Byte> signature, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public bool VerifySignature (ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.VerifySignature : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.DSASignatureFormat -> bool
Public Function VerifySignature (hash As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte), signatureFormat As DSASignatureFormat) As Boolean

Parameters

hash
ReadOnlySpan<Byte>

The signed hash.

signature
ReadOnlySpan<Byte>

The signature to verify.

signatureFormat
DSASignatureFormat

The encoding format for signature.

Returns

true if the digital signature is valid for the provided data; otherwise, false.

Exceptions

signatureFormat is not a known format.

An error occurred in the verification operation.

Applies to

VerifySignature(Byte[], Byte[])

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

When overridden in a derived class, verifies the DSA signature for the specified data.

public:
 abstract bool VerifySignature(cli::array <System::Byte> ^ rgbHash, cli::array <System::Byte> ^ rgbSignature);
public abstract bool VerifySignature (byte[] rgbHash, byte[] rgbSignature);
abstract member VerifySignature : byte[] * byte[] -> bool
Public MustOverride Function VerifySignature (rgbHash As Byte(), rgbSignature As Byte()) As Boolean

Parameters

rgbHash
Byte[]

The hash of the data signed with rgbSignature.

rgbSignature
Byte[]

The signature to be verified for rgbData.

Returns

true if rgbSignature matches the signature computed using the specified hash algorithm and key on rgbHash; otherwise, false.

Exceptions

The implementation type only supports legacy DSA (FIPS 186-2), and the hash value is not 20 bytes long.

-or-

Verifying the signature otherwise failed.

See also

Applies to

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Verifies that a digital signature is valid for a provided data hash.

public:
 virtual bool VerifySignature(ReadOnlySpan<System::Byte> hash, ReadOnlySpan<System::Byte> signature);
public virtual bool VerifySignature (ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature);
abstract member VerifySignature : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
override this.VerifySignature : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
Public Overridable Function VerifySignature (hash As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte)) As Boolean

Parameters

hash
ReadOnlySpan<Byte>

The data hash to verify.

signature
ReadOnlySpan<Byte>

The signature to be verify.

Returns

true if the digital signature is valid for the hash; otherwise, false.

Exceptions

The implementation type only supports legacy DSA (FIPS 186-2), and the hash value is not 20 bytes long.

-or-

Verifying the signature otherwise failed.

Remarks

The default implementation of this method calls VerifySignature(Byte[], Byte[]) after copying the spans to arrays. Derived types should override this method to avoid the intermediate array creation.

Applies to

VerifySignature(Byte[], Byte[], DSASignatureFormat)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Verifies that a digital signature is valid for the provided hash.

public:
 bool VerifySignature(cli::array <System::Byte> ^ rgbHash, cli::array <System::Byte> ^ rgbSignature, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public bool VerifySignature (byte[] rgbHash, byte[] rgbSignature, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.VerifySignature : byte[] * byte[] * System.Security.Cryptography.DSASignatureFormat -> bool
Public Function VerifySignature (rgbHash As Byte(), rgbSignature As Byte(), signatureFormat As DSASignatureFormat) As Boolean

Parameters

rgbHash
Byte[]

The signed hash.

rgbSignature
Byte[]

The signature to verify.

signatureFormat
DSASignatureFormat

The encoding format for rgbSignature.

Returns

true if the digital signature is valid for the provided data; otherwise, false.

Exceptions

rgbHash or rgbSignature is null.

signatureFormat is not a known format.

An error occurred in the verification operation.

Applies to