How to convert .pem into .key?

2019-03-08 03:34发布

I already have purchased SSL certificate and i have received certificate and a .pem file as a private key? from the supplier; now i need to convert this .pem key into .key for bitnami Redmine Apache web server in order to make it work.

How do I go about doing this what what program or commands to do this? I am a newbie in terms of using Openssl etc to do this.

Any advice would be much appreciated!

Thank you.

5条回答
劳资没心,怎么记你
2楼-- · 2019-03-08 03:51

I assume you want the DER encoded version of your PEM private key. So :

openssl rsa -outform der -in private.pem -out private.key
查看更多
唯我独甜
3楼-- · 2019-03-08 03:51

CA's don't asks for your private keys they only asks for CSR to issue a certificate for you if they have your private key its possible that your SSL certificate will be compromised and end up being revoked, your .key file is generated upon CSR generation most probably its somewhere on your PC where you generated the CSR. That's why private key is called "Private" because not anyone can have that file except you.

查看更多
聊天终结者
4楼-- · 2019-03-08 04:03

If you're looking for a file to use in httpd-ssl.conf as a value for SSLCertificateKeyFile, a PEM file should work just fine.

See this SO question/answer for more details on the SSL options in that file.

Why is SSLCertificateKeyFile needed for Apache?

查看更多
Viruses.
5楼-- · 2019-03-08 04:10

openssl rsa -in privkey.pem -out private.key does the job.

查看更多
Viruses.
6楼-- · 2019-03-08 04:11
openssl x509 -outform der -in your-cert.pem -out your-cert.crt
查看更多
登录 后发表回答