hello every one. How can I create a PEM file from a ssl certificate? These are the files I have available: .crt, server.csr and server.key.
Any ideas?
Thanks
hello every one. How can I create a PEM file from a ssl certificate? These are the files I have available: .crt, server.csr and server.key.
Any ideas?
Thanks
A pem file contains the certificate and the private key. It depends on the format you certificate/key are in, but probably it's as simple as this:
cat server.crt server.key > server.pem
Your keys may already be in PEM format, but just named with .crt or .key.
If they begin with -----BEGIN and you can read them in a text editor (they use base64, which is readable in ASCII, not binary format), they are in PEM format.
If the file is in binary, for the server.crt, you would use openssl x509 -inform DER -outform PEM -in server.crt -out server.crt.pem
For server.key, use openssl rsa
in place of openssl x509
.
The server.key is likely your private key, and the .crt file is the returned, signed, x509 certificate.
If this is for a Web server, and you cannot specify loading a separate private and public key, you may need to concatenate the two files. For this use: cat server.crt server.key > server.includesprivatekey.pem
. I would recommend naming files with "includesprivatekey" to help you manage the permissions you keep with this file.
Additionally, if you doesnot want ask passphrase, then need to run the following command
openssl rsa -in server.key -out server.key
HTH