<p>Are asymmetrical cryptographic keys fundamentally inter-convertible between the major key container formats? For example, can I convert an X.509 key file into a PGP or OpenGPG key file? </p>

<p>And--assuming the answer is yes--is it "security neutral" to keep one key pair in whatever format and convert into whichever container file format is needed for the occasion?</p>

<p>I'm getting a little tired of maintaining so many key pairs for X.509, OpenGPG, and SSH, when they're all RSA at the heart.</p>

[{'answer_id': 57408, 'author': 'tqbf', 'author_id': 5674, 'author_profile': 'https://Stackoverflow.com/users/5674', 'pm_score': 4, 'selected': True, 'text': '<p>Yes and no: yes, the RSA keys embedded into certificates and privkeys are just numbers. You can extract them from the certificate and use them to build keys in other formats. This is commonly done to convert between different certificate formats. </p>\n\n<p>PGP has some support for X.509 for S/MIME, but no ability to use X.509 privkeys verbatim. </p>\n\n<p>SSH has some beta support for directly using X.509 keys and certificates.</p>\n'}, {'answer_id': 143534, 'author': 'JJarava', 'author_id': 12344, 'author_profile': 'https://Stackoverflow.com/users/12344', 'pm_score': 0, 'selected': False, 'text': '<p>I\'d also have a look at OpenSSL. It has so many different -in and -out functions that will likely be able to convert certs. from one type to the other.</p>\n\n<p>Have a look at <a href="http://marc.info/?l=openssl-users&amp;m=105162569405053&amp;w=2" rel="nofollow noreferrer">http://marc.info/?l=openssl-users&amp;m=105162569405053&amp;w=2</a></p>\n'}, {'answer_id': 2515945, 'author': 'Jérôme Pouiller', 'author_id': 301717, 'author_profile': 'https://Stackoverflow.com/users/301717', 'pm_score': 2, 'selected': False, 'text': '<p>You will found how to convert kes between these containers there:\n<a href="http://sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG,-OpenSsh-and-OpenSSL" rel="nofollow noreferrer">http://sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG,-OpenSsh-and-OpenSSL</a></p>\n'}]
['https://Stackoverflow.com/questions/57384', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5548/']