Hi, please try this Delphi example to implement a simple host key repository that keeps all known and verified by user SFTP host-keys and automatically accepts connections to these hosts.
The SFTP Component provides all necessary remote host information through the OnVerifyServer event: host name, key type, finger-print, and host-key bytes. You can save this information, e.g. as a string to the TStringList object in your program. This allows you to easily save the string list content to the disk, and load the list next time you run the app.
The sources are available on GitHub