Edit

Share via


MLDsa.VerifyData Method

Definition

Overloads

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

Verifies that the specified signature is valid for this key and the provided data.

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Verifies that the specified signature is valid for this key and the provided data.

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

Source:
MLDsa.cs

Verifies that the specified signature is valid for this key and the provided data.

public bool VerifyData(byte[] data, byte[] signature, byte[]? context = default);
member this.VerifyData : byte[] * byte[] * byte[] -> bool
Public Function VerifyData (data As Byte(), signature As Byte(), Optional context As Byte() = Nothing) As Boolean

Parameters

data
Byte[]

The data to verify.

signature
Byte[]

The signature to verify.

context
Byte[]

The context value which was provided during signing.

The default value is null.

Returns

true if the signature validates the data; otherwise, false.

Exceptions

data or signature is null.

context has a length in excess of 255 bytes.

This instance has been disposed.

An error occurred while verifying the data.

Remarks

A null context is treated as empty.

Applies to

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Source:
MLDsa.cs
Source:
MLDsa.cs

Verifies that the specified signature is valid for this key and the provided data.

public bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, ReadOnlySpan<byte> context = default);
member this.VerifyData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
Public Function VerifyData (data As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte), Optional context As ReadOnlySpan(Of Byte) = Nothing) As Boolean

Parameters

data
ReadOnlySpan<Byte>

The data to verify.

signature
ReadOnlySpan<Byte>

The signature to verify.

context
ReadOnlySpan<Byte>

The context value which was provided during signing.

The default value is an empty buffer.

Returns

true if the signature validates the data; otherwise, false.

Exceptions

context has a Length in excess of 255 bytes.

This instance has been disposed.

The instance represents only a public key.

-or-

An error occurred while verifying the data.

Applies to