DSA.TrySignData 方法

定义

尝试将指定数据的 DSA 签名创建到提供的缓冲区中。

重载

名称 说明
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

尝试将指定数据的 DSA 签名创建到提供的缓冲区中。

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

尝试以指示的格式为指定数据创建 DSA 签名,并将其置于提供的缓冲区中。

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

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

尝试将指定数据的 DSA 签名创建到提供的缓冲区中。

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的字节数。

返回

true 如果 destination 足够大以接收结果,则为 ;否则为 false

适用于

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

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

尝试以指示的格式为指定数据创建 DSA 签名,并将其置于提供的缓冲区中。

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的字节数。 此参数被视为未初始化。

返回

true 如果 destination 足够大,无法接收签名,则为 。否则为 false

例外

signatureFormat 不是已知格式。

hashAlgorithm 具有或 null 为空 Name

签名操作中发生错误。

适用于