sshclient: "Key is not ready storage is no set message"

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Fontaine
Posts: 5
Joined: Fri 09 Dec 2011 14:21
Location: Rennes France

sshclient: "Key is not ready storage is no set message"

Post by Fontaine » Mon 02 Jan 2012 17:16

I try to add an sshclient in my application, mode password key.
when i add key(ScFileStorage1->Keys->Add(Key);) => error message.

What is the pb please?
a part of my code:
ScSSHClient1 = new TScSSHClient(Owner);
ScFileStorage1 = new TScFileStorage(Owner);
ScSSHClient1->HostName = Item->SubItems->Strings[0];// address
ScSSHClient1->Port = 22;
ScSSHClient1->User = "andromede"; //login
ScSSHClient1->Authentication = atPassword;
ScSSHClient1->Password = "andro[1)ADM"; //psw

TScKey *Key = ScFileStorage1->Keys->FindKey(ScSSHClient1->HostName);
if ((Key == NULL) || (!Key->Ready))
{

Key = new TScKey(NULL);
try {

Key->KeyName = ScSSHClient1->HostName;
ScFileStorage1->Keys->Add(Key);
}
catch (Exception &exception) {
Key->Free();
throw;
}


Best regards

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 04 Jan 2012 15:03

You can not add to the storage an empty key. You should load it from file or generate the key and only after this add it to the storage.

Post Reply