Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have someone's ssh public key and I want to encrypt a message with it so that he is the only one who can read it. However, a simple import with gpg --import doesn't work because the format is different.

How can I convert the public key (in the format as they appear in authorized_keys) to a format that gpg can import?

share|improve this question
add comment

1 Answer 1

The two keys each serve a different purpose, and as a result are not interchangeable.

Specifically, SSH keys are basic asymmetric key pairs, much of the values that PGP keys require, are not present in SSH.

You could substitute the missing certificate value by self-signing the SSH key, but this seems flakey, and cannot guarantee it will import into GPG.

Best to obtain a generated GPG key from this person.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.