0 votes
by (120 points)
edited

We want to use a private key when authenticating/loging in. Our public/private keys were created using PGP and are saved in a .asc file. When the SshPrivateKey class constructor is given .asc file name for its path parameter an "Invalid key format" error is thrown. It appears that the .asc file format is not not supported by Rebex. Is there any way to convert the .asc file to a Rebex compatible format?

by (144k points)
edited

At the moment, Rebex supports the following private key formats: 1) PKCS #8 format. 2) PuTTY PPKv2 format. 3) OpenSSH/OpenSSL SSLeay format.

PGP's .asc files are not supported, but if you find a way to convert it to one of the above formats, it should work. We will look into this format as well and let you know what we find.

1 Answer

0 votes
by (144k points)
edited by

I found a discussion about converting PGP keys to SSH keys. The following process is described:

  • Remove the password from the .asc key.
  • Use openpgp2ssh utility (part of Monkeysphere framework) to convert the PGP key to SSH key.
  • Re-encrypt both the original PGP key and the converted key.

Monkeysphere is available for many Linux distros, but I have not been able to found any Windows binaries yet.

However, why do you actually need to convert the key? Physically, it will be the same key, but what purpose will that serve? Why not simply generate a new SSH key?

...