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

PrivateKeyFile

Represents private key information.
public Certificate Certificate { get; }

Gets the public key certificate associated with this key, or null if no certificate data has been passed to the constructor.

Gets the supported host algorithms for this key file.

public Key Key { get; }

Gets the key.

public PrivateKeyFile(Key key)

Initializes a new instance of the PrivateKeyFile class.

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(string fileName, string passPhrase, string certificateFileName)

Initializes a new instance of the PrivateKeyFile class.

public PrivateKeyFile(Stream privateKey, string passPhrase)

Initializes a new instance of the PrivateKeyFile class.

public PrivateKeyFile(Stream privateKey, string passPhrase, Stream certificate)

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.