Table of Contents

Method LoadAsync

Namespace
SshSharp
Assembly
SshSharp.dll

LoadAsync(string, string?, CancellationToken)

Reads and parses a private key file.

public static Task<SshPrivateKey> LoadAsync(string path, string? passphrase = null, CancellationToken cancellationToken = default)

Parameters

path string
passphrase string
cancellationToken CancellationToken

Returns

Task<SshPrivateKey>

Exceptions

FormatException

The text is not a supported private key, or the passphrase is wrong or missing.