Edit

Share via


MLDsa.SignData Method

Definition

Overloads

SignData(Byte[], Byte[])

Signs the specified data.

SignData(ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)

Signs the specified data, writing the signature into the provided buffer.

SignData(Byte[], Byte[])

Source:
MLDsa.cs

Signs the specified data.

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

Parameters

data
Byte[]

The data to sign.

context
Byte[]

An optional context-specific value to limit the scope of the signature.

The default value is null.

Returns

Byte[]

ML-DSA signature for the specified data.

Exceptions

data is null.

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 signing the data.

Remarks

A null context is treated as empty.

Applies to

SignData(ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)

Source:
MLDsa.cs
Source:
MLDsa.cs

Signs the specified data, writing the signature into the provided buffer.

public void SignData(ReadOnlySpan<byte> data, Span<byte> destination, ReadOnlySpan<byte> context = default);
member this.SignData : ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> -> unit
Public Sub SignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), Optional context As ReadOnlySpan(Of Byte) = Nothing)

Parameters

data
ReadOnlySpan<Byte>

The data to sign.

destination
Span<Byte>

The buffer to receive the signature. Its length must be exactly SignatureSizeInBytes.

context
ReadOnlySpan<Byte>

An optional context-specific value to limit the scope of the signature.

The default value is an empty buffer.

Exceptions

The buffer in destination is the incorrect length to receive the signature.

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 signing the data.

Applies to