wodKey Load method - WeOnlyDo Discussion board

wodKey Load method (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Bernhard K, Tuesday, June 19, 2018, 14:14 (1629 days ago)

I have one further problem with wodSFTP in Embarcadero Delphi.

I successfully can parametrize the SFTP component and use a Putty-generated private key file (.ppk) for authentication to connect to an SFTP-Server.
The wodKeys manual states that instead of loading the key from a file it is also possible to directly load it from a string with the load method, but I am not able to do this:

var v: variant;
KeyData:variant; //I also tried string;
KeyData := '-----BEGIN RSA PRIVATE KEY-----.......';
SFTP := TwodSFTP.Create(nil);
SFTP.Hostname := xxx;
SFTP.Login := xxx;
SFTP.Authentication := 2;
SFTP.Timeout := 10000;
SFTP.Blocking := false;
SSHKey := CreateOleObject('WeOnlyDo.Keys.1');

Here a EOLESysError exception (wrong variable type) is raised and I cannot continue.

So how can I successfully use an RSA private key that is stored in a string?


wodKey Load method

by Jasmine, Tuesday, June 19, 2018, 14:38 (1629 days ago) @ Bernhard K

Hi Bernhard,

When you declared key as string, did you receive sam error?

Are you able to load key from file?

Any chance you can send us EXE that demonstrates the problem, with sample key? We would like to debug it under the hood to see why this happens.


wodKey Load method

by Bernhard K, Tuesday, June 19, 2018, 16:03 (1629 days ago) @ Jasmine

when using Load with a string I get "Failed to import string from file' error...
I will prepare an exe but this will take some time!

Thanks for your excellent support!
Regards, Bernhard