Page 1 of 1

ScSSHClient Failure

Posted: Thu 04 Aug 2016 09:35
by bauerh
Hello,
I work with the C ++ Builder Xe

ScSSHClient1->; HostName = "111. 111. 111. 11";
Key->; KeyName = ScSSHClient1->; HostName;
Key->; ImportFrom ("C: \\temp \\PublicKey. TXT");
ScSSHClient1->; Authentication=atPublicKey;
ScSSHClient1->; PrivateKeyName = Key->; KeyName;
ScSSHClient1->; HostKeyName = Key->; KeyName;
ScSSHClient1->; Connect ();

I get the following error message:
The Data can Be signed by a non private key

The Key functions with Firefox->; FireFtp
Can somebody help me?

Re: ScSSHClient Failure

Posted: Thu 04 Aug 2016 12:20
by ViktorV
The error most likely occurs due to that in the TScSSHClient.PrivateKeyName property you have specified not the private key, but the public one. This property must contain the private key and its value must differ from the TScSSHClient.HostKeyName property value.
To solve the issue, please specify the private key in the TScSSHClient.PrivateKeyName property and try to reproduce the error.

Re: ScSSHClient Failure

Posted: Thu 04 Aug 2016 14:38
by bauerh
I have exchanged private key for the publicly Key.
the same error message
Which value needs TScSSHClient. HostKeyName?

Re: ScSSHClient Failure

Posted: Thu 04 Aug 2016 15:25
by ViktorV
The TScSSHClient.HostKeyName property should contain the name of the server public key that is stored in KeyStorage. See more details about this property in SecureBridge help: https://www.devart.com/sbridge/docs/tsc ... eyname.htm
Please make sure you have specified the private key in the TScSSHClient.PrivateKeyName property. For this, you can use the TScKey.IsPrivate property. See more details about this property in SecureBridge help: https://www.devart.com/sbridge/docs/tsc ... rivate.htm

Re: ScSSHClient Failure

Posted: Fri 05 Aug 2016 10:27
by bauerh
I go crazy

I have 3 things

1. IP Adress 111.111.111.11
2. 2. UserName DD
3. 3 PrivateKey FileName= PrivateKey.TXT
-----BEGIN RSA PRIVATE KEY-----
???????????????????????????????
?????????????J+I/hQIL2h8MDgXQ==
-----END RSA PRIVATE KEY-----

any more I do not need



TScKey *Key = ScFileStorage1->Keys->FindKey(ScSSHClient1->HostName);
Key = new TScKey(NULL);

ScSSHClient1->; HostName = "111. 111. 111. 11";
ScSSHClient1->; User = DD
Key->; KeyName = ScSSHClient1->HostName;
Key->ImportFrom("C:\\temp\\PrivateKey.TXT") ;

if(Key->IsPrivate) {ShowMessage("private");}
else {ShowMessage("not private");}

Answer = private

ScSSHClient1->Connect();
Answer = Private key not found

Re: ScSSHClient Failure

Posted: Mon 08 Aug 2016 06:31
by bauerh
if nobody can help me ?

Re: ScSSHClient Failure

Posted: Mon 08 Aug 2016 12:40
by ViktorV
Please check whether the issue is reproduced when connecting to SSH server using our SSHClientApp demo project. You can find the SSHClientApp project in the %SecureBridgeDemos%\SSHClientApp directory. %SecureBridgeDemos% is the SecureBridge Demo projects installation path on your computer.
If the issue is not reproduced on our SSHClientApp demo project, please compose a complete sample demonstrating the described behavior and send it to viktorv*devart*com, in order for us to be able to answer you in more detail.

Re: ScSSHClient Failure

Posted: Wed 10 Aug 2016 10:57
by bauerh
hello, viktor
many thanks for your help

This has been absent :

void __fastcall TMain1::ScSSHClient1ServerKeyValidate(TObject *Sender, TScKey *NewServerKey,
bool &Accept)
{
String fp, msg;
TScKey *Key = ScFileStorage1->Keys->FindKey(ScSSHClient1->HostName);
if ((Key == NULL) || (!Key->Ready)) {
NewServerKey->GetFingerprint(haMD5, fp);
msg = "The authenticity of the server can not be verified.\n";
msg += "Fingerprint for the key received from server: " + fp + ".\n";
msg += "Key length: " + IntToStr(NewServerKey->BitCount) + " bits.\n";
msg += "Are you sure you want to continue connecting?";

if (MessageDlg(msg, mtConfirmation, TMsgDlgButtons() << mbOK << mbCancel, 0) == mrOk) {
Key = new TScKey(NULL);
try {
Key->Assign(NewServerKey);
Key->KeyName = ScSSHClient1->HostName;
ScFileStorage1->Keys->Add(Key);
}
catch (Exception &exception) {
Key->Free();
throw;
}

Accept = true;
}
}
}
//---------------------------------------------------------------------------

Re: ScSSHClient Failure

Posted: Wed 10 Aug 2016 11:32
by ViktorV
It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about SecureBridge.