The example below demonstrates how to set up the SFTP Public Key Authorization for the SFTP Client component.
sftp.Server := 'sftp-host';
sftp.Port := 22;
sftp.UserKey.Clear();
sftp.UserKey.PrivateKeyFile := 'rsa-private-key';
sftp.UserKey.PassPhrase := 'private-key-password';
sftp.UserName := 'user-name';
sftp.Open();
Alternatively, you can load the private key from a stream, Delphi string list, or array of bytes.
sftp.UserKey.Load(privateKeyBytes);
Article ID: 107, Created: August 8, 2018 at 1:49 PM, Modified: October 30, 2018 at 12:47 PM