I am moving an existing win service to staging server. I have only exe file of the win service.
When i start the service, it's throwing "invalid key format" error.
I analysed the exe file using a reflector and found that "PrivateKey" assigned to the "SFTP" object is throwing the error. code is given below:
SFTPInfo info=new SFTPInfo();
DataRow current = (DataRow)enumerator.Current;
info.Server = Conversions.ToString(current["SSHServer"]);
info.Login = Conversions.ToString(current["SSHLogin"]);
info.Key = (byte[])current["SSHKey"];
Where SSHKey is from the DB table and it's in binary format (converted .prk file to binary)
How i can generate a valid private key and configue it?