FtpDLX.Net connection with key file - WeOnlyDo Discussion board

FtpDLX.Net connection with key file (General questions)

by permission, Thursday, October 18, 2007, 03:44 (6246 days ago)

Hi

I am trying to use ftpDLX.net to connect to a secure SFTP server for transfer. I have been provided with a ppk file put have no idea how to apply this in order to connect, any help would be greatly appreciated, thanks
code so far is below

Ftp1.Hostname = ConfigurationManager.AppSettings[ FTPServer ];
Ftp1.Login = ConfigurationManager.AppSettings[ FTPUser ];
Ftp1.Password = ConfigurationManager.AppSettings[ FTPPass ];
Ftp1.RemotePath = ConfigurationManager.AppSettings[ FTPDir ];
Ftp1.Protocol = WeOnlyDo.Client.Protocols.SFTP;
Ftp1.Port = 22;

Thanks

Re: FtpDLX.Net connection with key file

by wodDamir, Thursday, October 18, 2007, 08:47 (6246 days ago) @ permission

Hi,

In order to connect to server using PrivateKey, you should set Authentication and PrivateKey Properties.

I.e:

Ftp1.Authentication = Authentications.PublicKey;
Ftp1.PrivateKey = <....>

I would suggest that you use PuttyGen to convert the key to OpenSSH format, and then convert it to XML string (using .Net classes). After that just Pass it to the component, and it should work.

Hope I helped.

Regards,
Damba

Re: FtpDLX.Net connection with key file

by permission, Thursday, October 18, 2007, 09:04 (6246 days ago) @ wodDamir

Awesome, so I actualy place the contents of the key file in the Ftp1.PrivateKey value?

But I need to convert the file do I??? Do you have an example of what this should look like once converted??

Thanks

Re: FtpDLX.Net connection with key file

by wodDamir, Thursday, October 18, 2007, 09:13 (6246 days ago) @ permission

Hi,

The XML representation of the key should look something like this:

<RSAKeyValue><Modulus>.....</RSAKeyValue>

You can find more information here:

http://www.weonlydo.com/FtpDLX.NET/Help/index.html?page=WeOnlyDo.Client.FTP~WeOnlyDo.Client.FtpDLX~PrivateKey.html

Regards,
Damba

Re: FtpDLX.Net connection with key file

by permission, Thursday, October 18, 2007, 09:30 (6246 days ago) @ wodDamir

ok, I have managed to convert it to OpenSSH, looks something like this
ssh-rsa AAAAB3NzaC1yc2..........................
just not sure what the XML nodes should be and how to split or convert this into an xml string, checked out the link but nothing on the XML structure required for this object, any ideas where I can grab this or any info on its structure

Thanks again for all your help

Re: FtpDLX.Net connection with key file

by wodDamir, Thursday, October 18, 2007, 09:51 (6246 days ago) @ permission

Hi,

Actually, that is a Public Key. You need a Private Key. Public key is used on server, while private key is used for the client.

the ToXmlString is supported by many Cryptography classes embedded in .Net. However, you can also simply assign the Private key file contents to the PrivateKey Property. I believe that would work too.

I.e:

Ftp1.PrivateKey = line1 + line2 + etc.

Can you try that?

Regards,
Damba

Re: FtpDLX.Net connection with key file

by permission, Friday, October 19, 2007, 01:16 (6245 days ago) @ wodDamir

I get
failed to import Private Key
when I do the sugesstion above, so pretty much write the ppk file to the private key

Re: FtpDLX.Net connection with key file

by wodDamir, Friday, October 19, 2007, 08:33 (6245 days ago) @ permission

Hi,

Is there any chance you could send us that key to techsupport@weonlydo.com ?

We'll check it out and let you know how it can be used with wodFtpDLX.Net for connecting to server.

Regards,
Damba

Re: FtpDLX.Net connection with key file

by permission, Friday, October 19, 2007, 08:38 (6245 days ago) @ wodDamir

just sent it

thanks