Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.1k views
in .NET FTP by (1.3k points)
Hi,

I have a web application that configures an SFTP connection, and requires the user to insert the (server's) public key, which we save in the database instead of in a file. But when trying to add a known host to my connection, the only options available to me are:

conn.KnownHosts.AddKnownHost(..) which requires a filename (which I'm trying to avoid), or
conn.KnownHosts.AddHostKey(..) which requires a parameter of type EnterpriseDT.Net.Ssh.Routrek.PKI.PublicKey.

Is there any way of converting a string to this type, so that I can add it directly to the connection without using a file?

Thanks!

2 Answers

0 votes
by (162k points)
There isn't actually a way to do this, which is a bit surprising I suppose.

I've added a new method:

public void AddKnownHost(string host, byte[] publicKeyFile)


Email support to get a pre-release build - we hope to release a new version of edtFTPnet/PRO by the end of this week.
0 votes
by (1.3k points)
That's helpful. Thanks very much!

Categories

...