Redigera

Dela via


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.

public:
 bool VerifyData(cli::array <System::Byte> ^ data, cli::array <System::Byte> ^ signature);
public bool VerifyData (byte[] data, byte[] signature);
override this.VerifyData : byte[] * byte[] -> bool
member this.VerifyData : byte[] * byte[] -> bool
Public Function VerifyData (data As Byte(), signature As Byte()) As Boolean

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

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.

public:
 bool VerifyData(System::IO::Stream ^ data, cli::array <System::Byte> ^ signature);
public bool VerifyData (System.IO.Stream data, byte[] signature);
[System.Security.SecurityCritical]
public bool VerifyData (System.IO.Stream data, byte[] signature);
override this.VerifyData : System.IO.Stream * byte[] -> bool
[<System.Security.SecurityCritical>]
member this.VerifyData : System.IO.Stream * byte[] -> bool
member this.VerifyData : System.IO.Stream * byte[] -> bool
Public Function VerifyData (data As Stream, signature As Byte()) As Boolean

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

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.

public:
 bool VerifyData(cli::array <System::Byte> ^ data, int offset, int count, cli::array <System::Byte> ^ signature);
public bool VerifyData (byte[] data, int offset, int count, byte[] signature);
[System.Security.SecurityCritical]
public bool VerifyData (byte[] data, int offset, int count, byte[] signature);
override this.VerifyData : byte[] * int * int * byte[] -> bool
[<System.Security.SecurityCritical>]
member this.VerifyData : byte[] * int * int * byte[] -> bool
member this.VerifyData : byte[] * int * int * byte[] -> bool
Public Function VerifyData (data As Byte(), offset As Integer, count As Integer, signature As Byte()) As Boolean

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