Convert key and certificate

1.6k views Asked by At

I am using Mac OS X. I have the following files

  • key.rtf
  • cert.rtf

These files are PEM encoded and contain the key and the certificate in text form (-----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY-----).

How can I:

  1. decrypt the private key with the passphrase I used to encrypt it and get it back in text form?
  2. get both files in PEM format as text (!) back?

The PEM encoding makes problems - if the files are stored as .key, .cert or anything like this, it works properly. But I need the text.

Thanks!

1

There are 1 answers

0
alve89 On BEST ANSWER

It is possible with this command: openssl rsa -in cert.pem -out server.key (I converted the files to a cert.pem file before).