<PackageReference Include="SSH.NET" Version="2020.0.1" />

PrivateKeyFile

public class PrivateKeyFile : IDisposable
Represents private key information.
public HostAlgorithm HostKey { get; }

Gets the host key.

public PrivateKeyFile(Stream privateKey)

Initializes a new instance of the PrivateKeyFile class.

public PrivateKeyFile(string fileName)

Initializes a new instance of the PrivateKeyFile class.

public PrivateKeyFile(string fileName, string passPhrase)

Initializes a new instance of the PrivateKeyFile class.

public PrivateKeyFile(Stream privateKey, string passPhrase)

Initializes a new instance of the PrivateKeyFile class.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

protected virtual void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources