SshPrivateKey Constructor
Namespace: Rebex.Net
Assembly: Rebex.Networking.dll (version 7.0.9313)
SshPrivateKey(Certificate)
Creates a certificate-based SSH key for use with SSH/SFTP servers that support X.509 certificate authentication.
Declaration
public SshPrivateKey(Certificate certificate)
Parameters
| Type | Name | Description |
|---|---|---|
| Certificate | certificate | X.509 certificate. |
SshPrivateKey(CertificateChain)
Creates a certificate-based SSH key for use with SSH/SFTP client that support X.509 certificate authentication.
Declaration
public SshPrivateKey(CertificateChain chain)
Parameters
| Type | Name | Description |
|---|---|---|
| CertificateChain | chain | X.509 certificate chain. |
SshPrivateKey(String, String)
Loads a private key in PKCS #8, PuTTY, OpenSSH or SSLeay-format from the specified path.
Declaration
public SshPrivateKey(string path, string password = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | A path to the private key. |
| String | password | Password used to encrypted the private key, or null if no password needed. |
SshPrivateKey(Stream, String)
Loads a private key in PKCS #8, PuTTY, OpenSSH or SSLeay-format from the specified stream.
Declaration
public SshPrivateKey(Stream input, string password = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | input | A stream from which to load the private key. |
| String | password | Password used to encrypted the private key, or null if no password needed. |
SshPrivateKey(Byte[], String)
Loads a private key in PKCS #8, PuTTY, OpenSSH or SSLeay-format from the specified raw data.
Declaration
public SshPrivateKey(byte[] data, string password = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | data | Raw private key data. |
| String | password | Password used to encrypted the private key, or null if no password needed. |
SshPrivateKey(AsymmetricAlgorithm)
Creates an SSH private key based on the specified AsymmetricAlgorithm object, such as RSA (all platforms), DSA (all platforms) or ECDsa (.NET 5 or higher).
Declaration
public SshPrivateKey(AsymmetricAlgorithm algorithm)
Parameters
| Type | Name | Description |
|---|---|---|
| AsymmetricAlgorithm | algorithm | A suitable AsymmetricAlgorithm object. |
SshPrivateKey(AsymmetricKeyAlgorithm)
Creates an SSH private key based on the specified AsymmetricKeyAlgorithm object.
Declaration
public SshPrivateKey(AsymmetricKeyAlgorithm algorithm)
Parameters
| Type | Name | Description |
|---|---|---|
| AsymmetricKeyAlgorithm | algorithm | An AsymmetricKeyAlgorithm object. |