Lenguaje

MLDsa.SignPreHash Método

Definición

Firma el hash especificado mediante el algoritmo de firma pre-hash FIPS 204.

Sobrecargas

Nombre Description
SignPreHash(ReadOnlySpan<Byte>, Span<Byte>, String, ReadOnlySpan<Byte>)

Firma el hash especificado mediante el algoritmo de firma pre-hash FIPS 204, escribiendo la firma en el búfer proporcionado.

SignPreHash(Byte[], String, Byte[])

Firma el hash especificado mediante el algoritmo de firma pre-hash FIPS 204.

SignPreHash(ReadOnlySpan<Byte>, Span<Byte>, String, ReadOnlySpan<Byte>)

Source:
MLDsa.cs
Source:
MLDsa.cs
Source:
MLDsa.cs

Firma el hash especificado mediante el algoritmo de firma pre-hash FIPS 204, escribiendo la firma en el búfer proporcionado.

[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void SignPreHash(ReadOnlySpan<byte> hash, Span<byte> destination, string hashAlgorithmOid, ReadOnlySpan<byte> context = default);
public void SignPreHash(ReadOnlySpan<byte> hash, Span<byte> destination, string hashAlgorithmOid, ReadOnlySpan<byte> context = default);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.SignPreHash : ReadOnlySpan<byte> * Span<byte> * string * ReadOnlySpan<byte> -> unit
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)

Parámetros

hash
ReadOnlySpan<Byte>

Hash que se va a firmar.

destination
Span<Byte>

Búfer que va a recibir la firma. Su longitud debe ser exactamente SignatureSizeInBytes.

hashAlgorithmOid
String

Identificador OID del algoritmo hash usado para crear el hash.

context
ReadOnlySpan<Byte>

Valor opcional específico del contexto para limitar el ámbito de la firma.

El valor predeterminado es un búfer vacío.

Atributos

Excepciones

hashAlgorithmOid es null.

El búfer de destination es la longitud incorrecta para recibir la firma.

context tiene un Length exceso de 255 bytes.

Esta instancia se ha eliminado.

hashAlgorithmOid no es un OID con formato correcto.

-o bien-

hashAlgorithmOid es un algoritmo conocido y hash no tiene la longitud esperada.

-o bien-

La instancia solo representa una clave pública.

-o bien-

Error al firmar el hash.

Se aplica a

SignPreHash(Byte[], String, Byte[])

Source:
MLDsa.cs
Source:
MLDsa.cs
Source:
MLDsa.cs

Firma el hash especificado mediante el algoritmo de firma pre-hash FIPS 204.

[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public byte[] SignPreHash(byte[] hash, string hashAlgorithmOid, byte[]? context = default);
public byte[] SignPreHash(byte[] hash, string hashAlgorithmOid, byte[]? context = default);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.SignPreHash : byte[] * string * byte[] -> byte[]
member this.SignPreHash : byte[] * string * byte[] -> byte[]
Public Function SignPreHash (hash As Byte(), hashAlgorithmOid As String, Optional context As Byte() = Nothing) As Byte()

Parámetros

hash
Byte[]

Hash que se va a firmar.

hashAlgorithmOid
String

Identificador OID del algoritmo hash usado para crear el hash.

context
Byte[]

Valor opcional específico del contexto para limitar el ámbito de la firma.

El valor por defecto es null.

Devoluciones

Byte[]
Atributos

Excepciones

hash o hashAlgorithmOid es null.

Error al comprobar los datos.

hashAlgorithmOid no es un OID con formato correcto.

-o bien-

hashAlgorithmOid es un algoritmo conocido y hash no tiene la longitud esperada.

-o bien-

La instancia solo representa una clave pública.

-o bien-

Error al firmar el hash.

Se aplica a