Table of Contents

Method RemoveKeyAsync

Namespace
SshSharp
Assembly
SshSharp.dll

RemoveKeyAsync(SshPrivateKey, CancellationToken)

Removes one key from the agent (ssh-add -d): one from GetKeysAsync(CancellationToken), or the key a file holds.

public Task RemoveKeyAsync(SshPrivateKey key, CancellationToken cancellationToken = default)

Parameters

key SshPrivateKey
cancellationToken CancellationToken

Returns

Task

Exceptions

SshException

The agent is not running or does not hold the key (AgentFailed).