Authentication into SFTP server using PrivateKey - WeOnlyDo Discussion board

Authentication into SFTP server using PrivateKey (wodFtpDLX / wodFtpDLX.NET)

by Jasmine, Wednesday, April 01, 2015, 22:13 (1756 days ago) @ jxt
edited by Jasmine, Sunday, April 19, 2015, 13:51

Hi jxt.

You need to use different component (wodKeyManager, provided with wodFtpDLX.NET) to load your key from that format. Once loaded in wodKeyManager, you convert it to XML format, and then you can proceed without wodKeyManager in the future. Code would look like this:

dlx1 = New WeOnlyDo.Client.FtpDLX
key = New WeOnlyDo.Security.Cryptography.KeyManager

'do this only once, then you have format suitable for wodFtpDLX.NET
'TextBox1.Text = (key.ToXmlString(WeOnlyDo.Security.Cryptography.SSHKeyTypes.RSAKey, True))

dlx1.Protocol = WeOnlyDo.Client.Protocols.SFTP
dlx1.Hostname = "your_ip"
dlx1.Authentication = WeOnlyDo.Client.Authentications.PublicKey
dlx1.Login = "your_login"
dlx1.PrivateKey = "<RSAKeyValue><Modulus>...............</RSAKeyValue>"
dlx1.Blocking = True

Can you try that?

Warm regards,

Complete thread: