MLDsa.SignPreHash 方法

定义

重载

名称 说明
SignPreHash(ReadOnlySpan<Byte>, Span<Byte>, String, ReadOnlySpan<Byte>)

使用 FIPS 204 预哈希签名算法对指定的哈希进行签名,并将签名写入提供的缓冲区。

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

使用 FIPS 204 预哈希签名算法对指定的哈希进行签名。

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

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

使用 FIPS 204 预哈希签名算法对指定的哈希进行签名,并将签名写入提供的缓冲区。

[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)

参数

hash
ReadOnlySpan<Byte>

要签名的哈希。

destination
Span<Byte>

要接收签名的缓冲区。 它的长度必须完全 SignatureSizeInBytes

hashAlgorithmOid
String

用于创建哈希的哈希算法的 OID。

context
ReadOnlySpan<Byte>

一个可选的特定于上下文的值,用于限制签名的范围。

默认值为空缓冲区。

属性

例外

hashAlgorithmOidnull

缓冲区的 destination 接收长度不正确。

context Length超过 255 个字节。

此实例已释放。

hashAlgorithmOid 不是格式正确的 OID。

-或-

hashAlgorithmOid 是一种已知的算法, hash 没有预期的长度。

-或-

实例仅表示公钥。

-或-

对哈希进行签名时出错。

适用于

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

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

使用 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()

参数

hash
Byte[]

要签名的哈希。

hashAlgorithmOid
String

用于创建哈希的哈希算法的 OID。

context
Byte[]

一个可选的特定于上下文的值,用于限制签名的范围。

默认值为 null

返回

Byte[]
属性

例外

hashhashAlgorithmOidnull.

验证数据时出错。

hashAlgorithmOid 不是格式正确的 OID。

-或-

hashAlgorithmOid 是一种已知的算法, hash 没有预期的长度。

-或-

实例仅表示公钥。

-或-

对哈希进行签名时出错。

适用于