edtFTPnet/PRO - Secure FTP component for .NET | Free Trial | Pricing
Add a hostname/public key pair to the known hosts data.

Namespace: EnterpriseDT.Net.Ftp.Ssh
Assembly: edtFTPnetPRO (in edtFTPnetPRO.dll) Version: 9.4.0.40

Syntax

C#
public void AddKnownHost(
	string host,
	string publicKeyFile
)
Visual Basic
Public Sub AddKnownHost ( _
	host As String, _
	publicKeyFile As String _
)
Visual C++
public:
void AddKnownHost(
	String^ host, 
	String^ publicKeyFile
)

Parameters

host
Type: System..::..String
hostname
publicKeyFile
Type: System..::..String
public key file for host

Remarks

Server public keys can also be maintained in their own key file and be used for server validation without adding them to the known_hosts file using this method. SSH public key files have two standard formats - OpenSSH and SECSH. Both these public key formats are supported. Formats can be recognized by their first line as shown below:
  1. OpenSSH (DSA) - OpenSSH format as a DSA public key. The first line begins with "ssh-dss AAAAB3NzaC1kc3MAA ...".
  2. OpenSSH (RSA) - OpenSSH format as a DSA public key. The first line begins with "ssh-rsa AAAAB3NzaC1yc2EAA ...".
  3. SECSH - SECSH format. The first line begins with "---- BEGIN SSH2 PUBLIC KEY ----"
You can convert between OpenSSH and SECSH formats using OpenSSH's ssh-keygen utility (which by default generates OpenSSH keys).

See Also