Share via


ECDsa.SignHash 方法

定义

重载

SignHash(Byte[])

为指定的哈希值生成数字签名。

SignHash(ReadOnlySpan<Byte>)

计算指定哈希值的 ECDSA 签名。

SignHash(Byte[], DSASignatureFormat)

采用指定格式为指定的哈希值计算 ECDSA 签名。

SignHash(ReadOnlySpan<Byte>, DSASignatureFormat)

采用指定格式为指定的哈希值计算 ECDSA 签名。

SignHash(ReadOnlySpan<Byte>, Span<Byte>)

将指定哈希值的 ECDSA 签名计算到提供的缓冲区中。

SignHash(ReadOnlySpan<Byte>, Span<Byte>, DSASignatureFormat)

将指定格式的指定哈希值的 ECDSA 签名计算到提供的缓冲区中。

SignHash(Byte[])

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

为指定的哈希值生成数字签名。

public:
 abstract cli::array <System::Byte> ^ SignHash(cli::array <System::Byte> ^ hash);
public abstract byte[] SignHash (byte[] hash);
abstract member SignHash : byte[] -> byte[]
Public MustOverride Function SignHash (hash As Byte()) As Byte()

参数

hash
Byte[]

待签名数据的哈希值。

返回

Byte[]

指定哈希值的数字签名。

例外

hash 参数为 null

适用于

SignHash(ReadOnlySpan<Byte>)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

计算指定哈希值的 ECDSA 签名。

public:
 cli::array <System::Byte> ^ SignHash(ReadOnlySpan<System::Byte> hash);
public byte[] SignHash (ReadOnlySpan<byte> hash);
member this.SignHash : ReadOnlySpan<byte> -> byte[]
Public Function SignHash (hash As ReadOnlySpan(Of Byte)) As Byte()

参数

hash
ReadOnlySpan<Byte>

待签名数据的哈希值。

返回

Byte[]

指定哈希值的数字签名。

例外

签名时出错。

注解

此方法将使用 IeeeP1363FixedFieldConcatenation 对签名进行编码。 若要使用不同的签名格式,请使用 SignHash(ReadOnlySpan<Byte>, DSASignatureFormat)

适用于

SignHash(Byte[], DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

采用指定格式为指定的哈希值计算 ECDSA 签名。

public:
 cli::array <System::Byte> ^ SignHash(cli::array <System::Byte> ^ hash, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignHash (byte[] hash, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignHash : byte[] * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignHash (hash As Byte(), signatureFormat As DSASignatureFormat) As Byte()

参数

hash
Byte[]

要签名的哈希值。

signatureFormat
DSASignatureFormat

要用于签名的编码格式。

返回

Byte[]

指定数据的 ECDSA 签名。

例外

hashnull

signatureFormat 不是已知格式。

签名时出错。

适用于

SignHash(ReadOnlySpan<Byte>, DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

采用指定格式为指定的哈希值计算 ECDSA 签名。

public:
 cli::array <System::Byte> ^ SignHash(ReadOnlySpan<System::Byte> hash, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public byte[] SignHash (ReadOnlySpan<byte> hash, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignHash : ReadOnlySpan<byte> * System.Security.Cryptography.DSASignatureFormat -> byte[]
Public Function SignHash (hash As ReadOnlySpan(Of Byte), signatureFormat As DSASignatureFormat) As Byte()

参数

hash
ReadOnlySpan<Byte>

待签名数据的哈希值。

signatureFormat
DSASignatureFormat

要用于签名的编码格式。

返回

Byte[]

指定哈希值的数字签名。

例外

signatureFormat 不是已知格式。

签名时出错。

适用于

SignHash(ReadOnlySpan<Byte>, Span<Byte>)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

将指定哈希值的 ECDSA 签名计算到提供的缓冲区中。

public:
 int SignHash(ReadOnlySpan<System::Byte> hash, Span<System::Byte> destination);
public int SignHash (ReadOnlySpan<byte> hash, Span<byte> destination);
member this.SignHash : ReadOnlySpan<byte> * Span<byte> -> int
Public Function SignHash (hash As ReadOnlySpan(Of Byte), destination As Span(Of Byte)) As Integer

参数

hash
ReadOnlySpan<Byte>

待签名数据的哈希值。

destination
Span<Byte>

要接收签名的缓冲区。

返回

写入 destination 的总字节数。

例外

签名时出错。

中的 destination 缓冲区太小,无法保存签名。

注解

此方法将使用 IeeeP1363FixedFieldConcatenation 对签名进行编码。 若要使用不同的签名格式,请使用 SignHash(ReadOnlySpan<Byte>, Span<Byte>, DSASignatureFormat)

适用于

SignHash(ReadOnlySpan<Byte>, Span<Byte>, DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

将指定格式的指定哈希值的 ECDSA 签名计算到提供的缓冲区中。

public:
 int SignHash(ReadOnlySpan<System::Byte> hash, Span<System::Byte> destination, System::Security::Cryptography::DSASignatureFormat signatureFormat);
public int SignHash (ReadOnlySpan<byte> hash, Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat);
member this.SignHash : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.DSASignatureFormat -> int
Public Function SignHash (hash As ReadOnlySpan(Of Byte), destination As Span(Of Byte), signatureFormat As DSASignatureFormat) As Integer

参数

hash
ReadOnlySpan<Byte>

待签名数据的哈希值。

destination
Span<Byte>

要接收签名的缓冲区。

signatureFormat
DSASignatureFormat

要用于签名的编码格式。

返回

写入 destination 的总字节数。

例外

signatureFormat 不是已知格式。

签名时出错。

中的 destination 缓冲区太小,无法保存签名。

适用于