>Hi there,
>is there anybody who has used chilkat for SFTP-Transfer using key-authentication?
>I tried using ssh-keygen generated key-pairs, also in openssh-format and puTTYgen-keys. All without any success. I can check some of them by using the Rebex Tiny-SFTP-Server and Filezilla but when I try to load a key with Chilkat (9.5.0.77) it fails.
>Can someone point me the right direction?
>Thanks in advance
>Thomas
Thomas, a few points.
1. Try with the latest Chilkat version. Current version is 91 (just launched).
2. Always look at .LastErrorText (or its variants). What's in there is usually quite informative and able to provide meaningful hints.
3. Can you share your code? This works for me (using OpenSSH generated keys stored at a Rebex server as authorized_keys, as you already tried).
m.sftp = CREATEOBJECT("Chilkat_9_5_0.SFTP")
m.sftp.Connect("localhost", 2222)
m.sshk = CREATEOBJECT("Chilkat_9_5_0.SSHKey")
m.pkt = m.sshk.LoadText(GETFILE("pem"))
m.sshk.password = "secret"
m.sshk.FromOpenSshPrivateKey(m.pkt)
m.sftp.AuthenticatePk("tester", m.sshk)
m.sftp.InitializeSftp()
m.fh = m.sftp.OpenFile("test.jpg", "writeOnly", "createTruncate")
m.sftp.UploadFile(m.fh, GETFILE("jpg"))
m.sftp.CloseHandle(m.fh)
----------------------------------
António Tavares Lopes