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)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
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)

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
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

簽署作業發生錯誤。

適用於