ECDsaCng.VerifyData Method

Definition

Verifies a digital signature.

Overloads

VerifyData(Byte[], Byte[])

Verifies the digital signature of the specified data.

VerifyData(Stream, Byte[])

Verifies the digital signature of the specified data stream, reading to the end of the stream.

VerifyData(Byte[], Int32, Int32, Byte[])

Verifies a signature for the specified length of data, beginning at the specified offset.

VerifyData(Byte[], Byte[])

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Verifies the digital signature of the specified data.

C#
public bool VerifyData(byte[] data, byte[] signature);

Parameters

data
Byte[]

The data that was signed.

signature
Byte[]

The signature to be verified.

Returns

true if the signature is valid; otherwise, false.

Exceptions

data or signature is null.

Remarks

This method generates a signature for the given data by hashing the input data using the HashAlgorithm property, and then signing the result.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5

VerifyData(Stream, Byte[])

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Verifies the digital signature of the specified data stream, reading to the end of the stream.

C#
public bool VerifyData(System.IO.Stream data, byte[] signature);
C#
[System.Security.SecurityCritical]
public bool VerifyData(System.IO.Stream data, byte[] signature);

Parameters

data
Stream

The data stream that was signed.

signature
Byte[]

The signature to be verified.

Returns

true if the signature is valid; otherwise, false.

Attributes

Exceptions

data or signature is null.

Remarks

This method hashes the input data by using the HashAlgorithm property before verification.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5

VerifyData(Byte[], Int32, Int32, Byte[])

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Verifies a signature for the specified length of data, beginning at the specified offset.

C#
public bool VerifyData(byte[] data, int offset, int count, byte[] signature);
C#
[System.Security.SecurityCritical]
public bool VerifyData(byte[] data, int offset, int count, byte[] signature);

Parameters

data
Byte[]

The data that was signed.

offset
Int32

The location in the data at which the signed data begins.

count
Int32

The length of the data, in characters, following offset that will be signed.

signature
Byte[]

The signature to be verified.

Returns

true if the signature is valid; otherwise, false.

Attributes

Exceptions

offset or count is less then zero.

-or-

offset or count is larger than the length of the byte array passed in the data parameter.

data or signature is null.

Remarks

This method hashes the input data by using the HashAlgorithm property before verification.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
Windows Desktop 3.0, 3.1, 5