MLDsa.SignPreHash 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| 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>
要签名的哈希。
要接收签名的缓冲区。 它的长度必须完全 SignatureSizeInBytes。
- hashAlgorithmOid
- String
用于创建哈希的哈希算法的 OID。
- 属性
例外
hashAlgorithmOid 是 null。
缓冲区的 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。
返回
- 属性
例外
hash 或 hashAlgorithmOid 为 null.
验证数据时出错。
hashAlgorithmOid 不是格式正确的 OID。
-或-
hashAlgorithmOid 是一种已知的算法, hash 没有预期的长度。
-或-
实例仅表示公钥。
-或-
对哈希进行签名时出错。