SshPublicKey Class
Namespace: Rebex.Net
Assembly: Rebex.Networking.dll (version 7.0.9119)
Represents SSH public key (RSA, DSA, ECDSA, EdDSA or X.509 certificate).
Syntax
public class SshPublicKey
Inherited Members
Constructors
Name | Description |
---|---|
SshPublicKey(Certificate) | Creates a certificate-based SSH key for use with SSH/SFTP client that support X.509 certificate authentication. |
SshPublicKey(CertificateChain) | Creates a certificate-based SSH key for use with SSH/SFTP client that support X.509 certificate authentication. |
SshPublicKey(AsymmetricKeyAlgorithm) | Creates an SSH public key based on the specified asymmetric algorithm object. |
SshPublicKey(PublicKeyInfo) | Creates an SSH public key based on the specified PublicKeyInfo object. |
SshPublicKey(Byte[]) | Loads a SSH2 public key from the specified raw data. |
SshPublicKey(Stream) | Loads an SSH2 public key from the specified stream. |
SshPublicKey(AsymmetricAlgorithm) | Creates an SSH public key based on the specified AsymmetricAlgorithm object, such as RSA (all platforms), DSA (all platforms) or ECDsa (.NET 5 or higher). |
SshPublicKey(String) | Loads an SSH2 public key from the specified file. |
Properties
Name | Description |
---|---|
Comment | Gets or sets the key comment. The comment is used while saving in some formats. |
Fingerprint | Gets the public key fingerprint. |
KeyAlgorithm | Gets the key algorithm. |
KeyAlgorithmId | Gets the key algorithm ID |
KeySize | Gets the key size, in bits. |
Methods
Name | Description |
---|---|
Equals(SshPublicKey) | Determines whether the specified key is the same key as the specified key. |
Equals(Object) | Determines whether the specified object is the same key as the specified key. |
GetCertificate() | Returns the underlying X509 certificate. |
GetCertificateChain() | Returns the underlying X509 certificate and its chain (for certificate-based keys). |
GetDSAParameters() | Gets the DSA parameters for a DSA key. May only be used for DSA public keys. |
GetHashCode() | A hash function for this type. |
GetPublicKey() | Gets the public key in SSH format (or raw X.509 data of the leaf certificate). |
GetPublicKeyInfo() | Returns the public key info for this key. |
GetRSAParameters() | Gets the RSA parameters for a RSA key. May only be used for RSA public keys. |
LoadPublicKeys(Stream) | Loads public keys in ~/.ssh/authorized_keys file format. |
LoadPublicKeys(String) | Loads public keys in ~/.ssh/authorized_keys file format. |
Parse(String) | Parses a single SSH public key in ~/.ssh/authorized_keys format. |
SavePublicKey(Stream) | Saves the public key into the supplied stream in Base64-encoded SSH2 public key format. |
SavePublicKey(Stream, SshPublicKeyFormat) | Saves the public key into the supplied stream in the specified format. |
SavePublicKey(String) | Saves the public key into the supplied stream in Base64-encoded SSH2 public key format. |
SavePublicKey(String, SshPublicKeyFormat) | Saves the public key into the supplied stream in the specified format. |