TScServerKeyValidationEvent = procedure(Sender: TObject; NewServerKey: TScKey; var Accept: boolean) of object;


property OnServerKeyValidate: TScServerKeyValidationEvent;



Occurs if the key received from the server and the key specified in HostKeyName does not coincide.


If the client connects to the server for the first time and does not have the server public key, it is possible to accept the key received from the server. This key will be stored in Storage. It will be used to authenticate the server in the future. But in this case to provide safety, you ought to verify in any way (e.g. by phone) the key print. If you trust the server, set the Accept to True to establish the connection.

To get the key print, use the GetFingerprint method.

To save a key to the Storage, specify the key name (NewServerKey.KeyName) and invoke KeyStorage.Keys.Add(NewServerKey).



Sender - the object that raised the event;
NewServerKey - the public key received from the server;
Accept - when Accept is set to True, the server is considered valid, and the server authentication is successful. When Accept is set to False, the server is considered invalid and the connection is closed.


See Also




SecureBridge Components, Copyright © 2007-2021 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support