CompositeMLDsa.SignData Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| SignData(ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>) |
Signs the specified data, writing the signature into the provided buffer. |
| SignData(Byte[], Byte[]) |
Signs the specified data. |
SignData(ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)
- Source:
- CompositeMLDsa.cs
Signs the specified data, writing the signature into the provided buffer.
public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, ReadOnlySpan<byte> context = default);
member this.SignData : ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> -> int
Public Function SignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), Optional context As ReadOnlySpan(Of Byte) = Nothing) As Integer
Parameters
- data
- ReadOnlySpan<Byte>
The data to sign.
The buffer to receive the signature. Its length must be at least MaxSignatureSizeInBytes.
- context
- ReadOnlySpan<Byte>
An optional context-specific value to limit the scope of the signature.
The default value is an empty buffer.
Returns
The number of bytes written to the destination buffer.
Exceptions
destination is less than MaxSignatureSizeInBytes in length.
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
SignData(Byte[], Byte[])
- Source:
- CompositeMLDsa.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
The Composite ML-DSA signature of 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.