語言

RSACng.TrySignHash 方法

定義

嘗試用目前的金鑰簽署雜湊值,並將簽章寫入提供的緩衝區。

public:
 override bool TrySignHash(ReadOnlySpan<System::Byte> hash, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding, [Runtime::InteropServices::Out] int % bytesWritten);
public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten);
override this.TrySignHash : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding * int -> bool
Public Overrides Function TrySignHash (hash As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding, ByRef bytesWritten As Integer) As Boolean

參數

hash
ReadOnlySpan<Byte>

要簽名的資料的雜湊值。

destination
Span<Byte>

接收 RSA 簽名的緩衝區。

hashAlgorithm
HashAlgorithmName

用來產生資料雜湊值的雜湊演算法。

padding
RSASignaturePadding

填充物。

bytesWritten
Int32

當此方法回傳時,包含寫入 destination的總位元組數。 此參數被視為未初始化。

傳回

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

適用於