SlhDsa.SignPreHash 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
| SignPreHash(ReadOnlySpan<Byte>, Span<Byte>, String, ReadOnlySpan<Byte>) |
Signs the specified hash using the FIPS 205 pre-hash signing algorithm, writing the signature into the provided buffer. |
| SignPreHash(Byte[], String, Byte[]) |
Signs the specified hash using the FIPS 205 pre-hash signing algorithm. |
SignPreHash(ReadOnlySpan<Byte>, Span<Byte>, String, ReadOnlySpan<Byte>)
- Source:
- SlhDsa.cs
Signs the specified hash using the FIPS 205 pre-hash signing algorithm, writing the signature into the provided buffer.
public void SignPreHash(ReadOnlySpan<byte> hash, Span<byte> destination, string hashAlgorithmOid, ReadOnlySpan<byte> context = default);
member this.SignPreHash : ReadOnlySpan<byte> * Span<byte> * string * ReadOnlySpan<byte> -> unit
Public Sub SignPreHash (hash As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithmOid As String, Optional context As ReadOnlySpan(Of Byte) = Nothing)
Parameters
- hash
- ReadOnlySpan<Byte>
The hash to sign.
The buffer to receive the signature. Its length must be exactly SignatureSizeInBytes.
- hashAlgorithmOid
- String
The OID of the hash algorithm used to create the hash.
- context
- ReadOnlySpan<Byte>
An optional context-specific value to limit the scope of the signature.
The default value is an empty buffer.
Exceptions
hashAlgorithmOid is null.
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.
hashAlgorithmOid is not a well-formed OID.
-or-
hashAlgorithmOid is a well-known algorithm and hash does not have the expected length.
-or-
The instance represents only a public key.
-or-
An error occurred while signing the hash.
Applies to
SignPreHash(Byte[], String, Byte[])
- Source:
- SlhDsa.cs
Signs the specified hash using the FIPS 205 pre-hash signing algorithm.
public byte[] SignPreHash(byte[] hash, string hashAlgorithmOid, byte[]? context = default);
member this.SignPreHash : byte[] * string * byte[] -> byte[]
Public Function SignPreHash (hash As Byte(), hashAlgorithmOid As String, Optional context As Byte() = Nothing) As Byte()
Parameters
- hash
- Byte[]
The hash to sign.
- hashAlgorithmOid
- String
The OID of the hash algorithm used to create the hash.
- context
- Byte[]
An optional context-specific value to limit the scope of the signature.
The default value is null.
Returns
Exceptions
hash or hashAlgorithmOid is null.
context has a length in excess of 255 bytes.
This instance has been disposed.
hashAlgorithmOid is not a well-formed OID.
-or-
hashAlgorithmOid is a well-known algorithm and hash does not have the expected length.
-or-
The instance represents only a public key.
-or-
An error occurred while signing the hash.
Remarks
A null context is treated as empty.