Page 1 of 1

Tsckey export

Posted: Mon 05 Aug 2019 16:18
by kaffeburk
Hello,

Playing around with Tsckey.ExportTo;

ScSSHClient.PrivateKeyName is the name of a valid working key stored in MyStorage.

But regardless if i put a filename or a stream in the parameter i get error "Key not ready". I also attach the project (without key, i assume you have test keys at hand).

https://www.dropbox.com/s/oiwohi106cm2g ... n.rar?dl=0


procedure TForm1.Button2Click(Sender: TObject);
var
aKey : Tsckey;
PrivKey : String;
s : String;
ss : TStringStream;
ts : TMemoryStream;
iFPubKey : Boolean;
psw : String;
Cipher : TScSymmetricAlgorithm;
KeyFormat: TScKeyFormat;
comment : String;

begin
PrivKey:=ScSSHClient.PrivateKeyName;
aKey:=MyStorage.Keys.FindKey(PrivKey);
ss:=TStringStream.Create;
ts :=TMemoryStream.Create;

if aKey<>Nil then Begin
psw:='';
aKey.ExportTo('myKeyFile', False, '');
// m.Lines.Add(ts.DataString);
End;
ts.Free;
ss.Free;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
aKey : Tsckey;
PrivKey : String;
s : String;
ss : TStringStream;
ts : TMemoryStream;
iFPubKey : Boolean;
psw : String;
Cipher : TScSymmetricAlgorithm;
KeyFormat: TScKeyFormat;
comment : String;

begin
PrivKey:=ScSSHClient.PrivateKeyName;
aKey:=MyStorage.Keys.FindKey(PrivKey);
ss:=TStringStream.Create;
ts :=TMemoryStream.Create;

if aKey<>Nil then Begin
psw:='';
aKey.ExportTo(ss, False, '');
// m.Lines.Add(ts.DataString);
End;
ts.Free;
ss.Free;
end;

Re: Tsckey export

Posted: Tue 13 Aug 2019 09:37
by ViktorV
Thank you for the information. We have already fixed the issue.
This fix will be included into the next SecureBridge build that we are planning to release within two weeks.