ECDsa.TrySignData 方法

定义

重载

TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

尝试使用指定的哈希算法和当前密钥,将指定的只读字节范围的 ECDSA 数字签名计算入提供的目标。

TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat, Int32)

尝试在提供的缓冲区中以指定的格式为指定的数据创建 ECDSA 签名。

TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

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

尝试使用指定的哈希算法和当前密钥,将指定的只读字节范围的 ECDSA 数字签名计算入提供的目标。

public:
 virtual bool TrySignData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, [Runtime::InteropServices::Out] int % bytesWritten);
public virtual bool TrySignData (ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten);
abstract member TrySignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * int -> bool
override this.TrySignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * int -> bool
Public Overridable Function TrySignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, ByRef bytesWritten As Integer) As Boolean

参数

data
ReadOnlySpan<Byte>

要签名的数据。

destination
Span<Byte>

要接收签名的缓冲区。

hashAlgorithm
HashAlgorithmName

用于对签名的数据进行哈希处理的算法。

bytesWritten
Int32

此方法返回时,为写入 destination 的字节总数。 该参数未经初始化即被处理。

返回

如果 destination 不够长,无法接收签名,则为 false

适用于

TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat, Int32)

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

尝试在提供的缓冲区中以指定的格式为指定的数据创建 ECDSA 签名。

public:
 bool TrySignData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::DSASignatureFormat signatureFormat, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TrySignData (ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten);
member this.TrySignData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.DSASignatureFormat * int -> bool
Public Function TrySignData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, signatureFormat As DSASignatureFormat, ByRef bytesWritten As Integer) As Boolean

参数

data
ReadOnlySpan<Byte>

要进行哈希处理和签名的数据。

destination
Span<Byte>

要接收签名的缓冲区。

hashAlgorithm
HashAlgorithmName

要用于创建哈希值的哈希算法。

signatureFormat
DSASignatureFormat

要用于签名的编码格式。

bytesWritten
Int32

此方法返回时,包含一个指示写入 destination 的字节数的值。 该参数未经初始化即被处理。

返回

如果 destination 的大小足以接收签名,则为 true;否则为 false

例外

signatureFormat 不是已知格式。

hashAlgorithm 具有 null 或空的 Name

签名时出错。

适用于