Tsckey export

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
kaffeburk
Posts: 214
Joined: Mon 29 Jan 2007 08:03

Tsckey export

Post by kaffeburk » Mon 05 Aug 2019 16:18

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;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Tsckey export

Post by ViktorV » Tue 13 Aug 2019 09:37

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.

Post Reply