语言

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。

适用于