Επεξεργασία

Κοινή χρήση μέσω


ECDsa.TrySignData Method

Definition

Overloads

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

Attempts to compute the ECDSA digital signature for the specified read-only span of bytes into the provided destination by using the specified hashing algorithm and the current key.

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

Attempts to create the ECDSA signature for the specified data in the indicated format into the provided buffer.

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

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

Attempts to compute the ECDSA digital signature for the specified read-only span of bytes into the provided destination by using the specified hashing algorithm and the current key.

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

Parameters

data
ReadOnlySpan<Byte>

The data to be signed.

destination
Span<Byte>

The buffer to receive the signature.

hashAlgorithm
HashAlgorithmName

The algorithm to use to hash the data for signing.

bytesWritten
Int32

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

Returns

false if destination is not long enough to receive the signature.

Applies to

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

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

Attempts to create the ECDSA signature for the specified data in the indicated format into the provided buffer.

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

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