wodKey Load method - WeOnlyDo Discussion board

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

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

Hi,
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;
begin
KeyData := '-----BEGIN RSA PRIVATE KEY-----.......';
CoInitialize(nil);
SFTP := TwodSFTP.Create(nil);
SFTP.Hostname := xxx;
SFTP.Login := xxx;
SFTP.Authentication := 2;
SFTP.Timeout := 10000;
SFTP.Blocking := false;
SSHKey := CreateOleObject('WeOnlyDo.Keys.1');
SSHKey.Load(KeyData);

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?

Thanks,
Bernhard


Complete thread: