Re: Remote command execution with single sign-on
Is there any API for checking the availability of the key in the cache
No.
and if it not available, any API to get eh server's host key?
You should not automate this. It would spoil security purpose of the verification.
Anyway, if you do not care about security, you can accept any host key with
SessionOptions.GiveUpSecurityAndAcceptAnySshHostKey
:
https://winscp.net/eng/docs/library_sessionoptions