2

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?

1
  • How i can generate a valid .prk file. This is a road block issue, please help me. Commented Nov 22, 2012 at 4:37

1 Answer 1

1

We can use PUTTYGEN to generate a private/public key pair.

Steps are:

  1. Open Putty Key Generator
  2. Click on the Conversions menu and select "Import Key"
  3. Select the key you wish to import and click on the "Open" button.
  4. Click on the “Save Public Key” button.
  5. Name the key and click on the "Save" button

Happy Programing... :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.