in reply to net::sftp::foreign, where to put public keys

You can tell Net::SFTP::Foreign the path to the key as follows:
my $sftp = Net::SFTP::Foreign->new($host, user => $user, more => [-i => $key]);

On Windows, you can also use the Net::SSH2 backend, Net::SFTP::Foreign::Backend::Net_SSH2, that supports password authentication without requiring any other module.