Represents private key information.
public class PrivateKeyFile : IPrivateKeySource, IDisposable
Inheritance
The following private keys are supported:
The following encryption algorithms are supported for OpenSSL traditional PEM:
Private keys in OpenSSL PKCS#8 PEM format can be encrypted using any cipher method BouncyCastle supports.
The following encryption algorithms are supported for ssh.com format:
The following encryption algorithms are supported for OpenSSH key format:
The following encryption algorithms are supported for PuTTY key format:
Initializes a new instance of the Renci.SshNet.PrivateKeyFile class.
public PrivateKeyFile(Key key)
Parameters
key
Key
The key.
Initializes a new instance of the Renci.SshNet.PrivateKeyFile class.
public PrivateKeyFile(Stream privateKey)
Parameters
privateKey
Stream
The private key.
Initializes a new instance of the Renci.SshNet.PrivateKeyFile class.
public PrivateKeyFile(string fileName)
Parameters
fileName
string
The path of the private key file.
This method calls System.IO.File.Open(System.String,System.IO.FileMode) internally, this method does not catch exceptions from System.IO.File.Open(System.String,System.IO.FileMode).
ExceptionsfileName
is null.
Initializes a new instance of the Renci.SshNet.PrivateKeyFile class.
public PrivateKeyFile(string fileName, string? passPhrase)
Parameters
fileName
string
The path of the private key file.
passPhrase
string?
The pass phrase for the private key.
This method calls System.IO.File.Open(System.String,System.IO.FileMode) internally, this method does not catch exceptions from System.IO.File.Open(System.String,System.IO.FileMode).
ExceptionsfileName
is null.
Initializes a new instance of the Renci.SshNet.PrivateKeyFile class.
public PrivateKeyFile(string fileName, string? passPhrase, string? certificateFileName)
Parameters
fileName
string
The path of the private key file.
passPhrase
string?
The pass phrase for the private key.
certificateFileName
string?
The path of a certificate file which certifies the private key.
fileName
is null.
Initializes a new instance of the Renci.SshNet.PrivateKeyFile class.
public PrivateKeyFile(Stream privateKey, string? passPhrase)
Parameters
privateKey
Stream
The private key.
passPhrase
string?
The pass phrase.
privateKey
is null.
Initializes a new instance of the Renci.SshNet.PrivateKeyFile class.
public PrivateKeyFile(Stream privateKey, string? passPhrase, Stream? certificate)
Parameters
privateKey
Stream
The private key.
passPhrase
string?
The pass phrase for the private key.
certificate
Stream?
A certificate which certifies the private key.
Gets the public key certificate associated with this key, or null if no certificate data has been passed to the constructor.
public Certificate? Certificate { get; }
Property Value
Gets the supported host algorithms for this key file.
public IReadOnlyCollection<HostAlgorithm> HostKeyAlgorithms { get; }
Property Value
Gets the key.
public Key Key { get; }
Property Value
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
true to release both managed and unmanaged resources; false to release only unmanaged resources.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4