RSACng.TrySignHash Method

Definition

Attempts to sign the hash with the current key, writing the signature into a provided buffer.

C#
public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten);

Parameters

hash
ReadOnlySpan<Byte>

The hash value of the data to be signed.

destination
Span<Byte>

The buffer to receive the RSA signature.

hashAlgorithm
HashAlgorithmName

The hash algorithm used to create the hash value of the data.

padding
RSASignaturePadding

The padding.

bytesWritten
Int32

When this method returns, the total number of bytes written into destination. This parameter is treated as uninitialized.

Returns

true if destination is long enough to receive the RSA signature; otherwise, false.

Applies to

Toode Versioonid
.NET 7, 8, 9, 10