Table of Contents

Method SignAsync

Namespace
SshSharp
Assembly
SshSharp.dll

SignAsync(SshSignRequest, CancellationToken)

Signs Data with Algorithm, one of SignatureAlgorithms; the algorithm fixes the hash, and a service that signs a digest hashes the data first. Purpose says what the signature is for (logging in, or an SSH signature with its Namespace), so the signer can refuse what its policy does not allow by throwing.

public abstract ValueTask<byte[]> SignAsync(SshSignRequest request, CancellationToken cancellationToken)

Parameters

request SshSignRequest
cancellationToken CancellationToken

Returns

ValueTask<byte[]>

The signature: the PKCS#1 v1.5 signature for RSA, the 64-byte signature for Ed25519, and for ECDSA the signature in EcdsaSignatureFormat. SshSharp encodes it as SSH carries it.

Remarks

A ValueTask<TResult>, unlike SshSharp's public methods: this is a callback that many signers answer at once (a key in memory), so it should not allocate a task each time.