語言

ECDsa.TrySignData 方法

定義

嘗試以指定格式建立 ECDSA 簽章,並以指定格式進入所提供的緩衝區。

多載

名稱 Description
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.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的總位元組數。 此參數被視為未初始化。

傳回

false 如果 destination 時間不夠長,無法獲得簽名。

適用於

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

來源:
ECDsa.cs
來源:
ECDsa.cs
來源:
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位元組數的值。 此參數被視為未初始化。

傳回

true 如果 destination 足夠大以接收簽名;否則, false。

例外狀況

signatureFormat 不是一個已知的格式。

hashAlgorithm有 a null 或 空。Name

簽署操作發生錯誤。

適用於