Re: Server refused public-key
WinSCP 5.1 is over 10 years old. Please upgrade first. If it does not help, please post session log file. And more details about your server and how you setup the key.
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
Server Refused public-key signature despite accepting key.