Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.SSH.ClientAuthentication

Feature notes: SSH implementation notes

Classes, interfaces and records

interfaceiSSHGetAuthData

iSSHGetAuthData is the CLIENT-side callback interface the tSSHClientXxxAuthentication classes (below) call back into to obtain credentials and to hand the server's userauth banner up to the application; it is implemented by TstCustomSSHClient itself, which forwards the calls to its own OnGetClientPassword/ClientKey/ OnSetBanner published members, so application code normally never implements this interface directly, only assigns those SSH-client properties/events. There is no server-side counterpart of this interface - the SSH server uses the separate iSSHGetAuthDataServer interface instead.

function GetAuthData(const aUsername: string; const aMethod : string; aChange : Boolean = False) : tBytes;
Called by the password/public-key authentication methods to fetch the credential to send for aUsername: for aMethod = 'password' this returns the (UTF-8 encoded) password, honoring aChange to request a NEW password on a server-issued change request; for aMethod = 'publickey' it returns the public... Full description »
function GetPrivateKey: iSignPrivateKey;
Called by tSSHClientPublicKeyAuthentication.Execute to obtain the private key matching the public key already returned from GetAuthData, so it can sign the userauth request. Full description »
procedure SetBanner(const aBanner, aLang: string);
Called when the server sends an SSH_MSG_USERAUTH_BANNER during login, so the application can display the server's pre-authentication banner text/language to the user. On TstCustomSSHClient this simply raises the OnSetBanner event - an application hooks that event rather than implementing SetBanner itself.

interfaceiSSHClientAuthentication

function GetService: string; function GetUsername: string; procedure SetService(const Value: string); procedure SetUsername(const Value: string); function Execute(const aTransport : iTransport; const aAuthData : iSSHGetAuthData; var aMustCont : Boolean; var aAuthThatCanCont: string) : Boolean; property Username: string read GetUsername write SetUsername; property Service: string read GetService write SetService;

classtSSHClientAuthentication

inherits from tObjectMapping

implements iSSHClientAuthentication

constructor Create; virtual;

classtSSHClientNoneAuthentication

inherits from tSSHClientAuthentication

(no public members)

classtSSHClientPasswordAuthentication

inherits from tSSHClientAuthentication

(no public members)

classtSSHClientPublicKeyAuthentication

inherits from tSSHClientAuthentication

(no public members)

Types (enumerations, sets, aliases)

typetSSHClientAuthenticationClass

  tSSHClientAuthenticationClass = class of tSSHClientAuthentication;