DSA.TrySignData Method

Definition

Overloads

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

Attempts to create the DSA signature for the specified data into the provided buffer.

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

Attempts to create the DSA signature for the specified data in the indicated format and place it into the provided buffer.

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

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Attempts to create the DSA signature for the specified data into the provided buffer.

C#
public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten);

Parameters

data
ReadOnlySpan<Byte>

The data to hash and sign.

destination
Span<Byte>

The byte span to receive the signature.

hashAlgorithm
HashAlgorithmName

The name of the hash algorithm to use.

bytesWritten
Int32

When this method returns, contains a value that indicates the number of bytes written to destination.

Returns

true if destination is large enough to receive the result; otherwise, false.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1

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

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Attempts to create the DSA signature for the specified data in the indicated format and place it into the provided buffer.

C#
public bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten);

Parameters

data
ReadOnlySpan<Byte>

The data to hash and sign.

destination
Span<Byte>

The buffer to receive the signature.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value.

signatureFormat
DSASignatureFormat

The encoding format to use for the signature.

bytesWritten
Int32

When this method returns, contains a value that indicates the number of bytes written to destination. This parameter is treated as uninitialized.

Returns

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

Exceptions

signatureFormat is not a known format.

hashAlgorithm has a null or empty Name.

An error occurred in the signing operation.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 5, 6, 7, 8, 9, 10