Failed to import private key - how to overcome? (wodSFTP / wodSFTP.NET / wodSFTPdll)
I am struggling to connect to an SFTP server. I have the following code:
[code]
WeOnlyDo.Security.Cryptography.KeyManager keyM = new WeOnlyDo.Security.Cryptography.KeyManager();
keyM.Load(privateKeyFile, password);
WeOnlyDo.Client.FtpDLX wodFtpDLX = new WeOnlyDo.Client.FtpDLX();
wodFtpDLX.LicenseKey = licenseKey;
wodFtpDLX.Protocol = WeOnlyDo.Client.Protocols.SFTP;
wodFtpDLX.Authentication = WeOnlyDo.Client.Authentications.PublicKey;
wodFtpDLX.Hostname = ftpAddress;
wodFtpDLX.Login = userName;
wodFtpDLX.PrivateKey = keyM.PrivateKey(WeOnlyDo.Security.Cryptography.SSHKeyTypes.RSAKey);
wodFtpDLX.Blocking = true;
wodFtpDLX.Connect();
[/code]
If the private key password is incorrect, I get the Failed to import private key error immediately so I know the key is being loaded without issue. The error is only being raised when I try to connect to the server. It is immediate so I am guessing it is when the key is trying to be loaded on to the client. Have I set any of the properties incorrectly or are there any which I have failed to set?
Much appreciated.
Complete thread:
- Failed to import private key - how to overcome? - PaulM, 2012-01-27, 19:11
- Re: Failed to import private key - how to overcome - woddrazen, 2012-01-27, 19:36
- Re: Failed to import private key - how to overcome - PaulM, 2012-01-27, 19:49
- Re: Failed to import private key - how to overcome - woddrazen, 2012-01-27, 19:50
- Re: Failed to import private key - how to overcome - PaulM, 2012-01-27, 19:49
- Re: Failed to import private key - how to overcome - woddrazen, 2012-01-27, 19:36