I want to list all the private keys available for the user to use for authenticaton, so I did this:
for x := 0 to ssh_keystore.Keys.Count - 1 do
begin
akey:=ssh_Keystore.Keys[x];
if akey.IsPrivate then
serverreg.private_key_edit.Items.Add(ssh_Keystore.Keys[x].KeyName);
end;
The .IsPrivate does not seem to be set even though I have several keys that show in the design time editor as being private.
Keystorage question (isprivate)
It's using the same path because if I remove the "if akey.IsPrivate then"Dimon wrote:I could not reproduce the problem.
Please make sure that you use the same path in design time and in run time.
I then see all the key names in the combo box.
When I use the design time editor it checks the isprivate box when a private key is selected, so I am not sure what I am doing wrong.
I got it working, apparently you have to manually set the key ready property to true for example:Dimon wrote:I could not reproduce the problem.
Please make sure that you use the same path in design time and in run time.
for x := 0 to ssh_keystore.Keys.Count - 1 do
begin
akey:= ssh_Keystore.Keys.KeyByName(ssh_Keystore.Keys[x].KeyName);
akey.Ready:=true;
if akey.Ready then
begin
if akey.IsPrivate then
serverreg.private_key_edit.Items.Add(akey.KeyName);
end;
end;