i am having SSL .crt file and i want two file #1 key.pem and #2 cert.pem for node HTTPS.
any one have any idea that how i can generate these files?
thanks in advance.
If you want to generate Self Signed certificates, following are the commands (these command will generate certificate files in ./config/sslcerts folder)
mkdir -p ./config/sslcerts
openssl genrsa -out ./config/sslcerts/key.pem 4096
openssl req -new -key ./config/sslcerts/key.pem -out ./config/sslcerts/csr.pem
openssl x509 -req -days 365 -in ./config/sslcerts/csr.pem -signkey ./config/sslcerts/key.pem -out ./config/sslcerts/cert.pem
rm ./config/sslcerts/csr.pem
chmod 600 ./config/sslcerts/key.pem ./config/sslcerts/cert.pem
The key.pem is your private key. You can't get a private key from certificate because a certificate doesn't contain a private key.
You would have generated a public-private key pair. The crt file you have is your signed public key. You will have a different private key corresponding to your public key.