- Create a self-signed SSL Certificate using OpenSSL. SSL Certificate is a bit of code on your web server that provides security for your online communications. SSL certificate also contains identification information(i.e your organisational information).
openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
- Create .pem file => A .pem(Privacy Enhanced Mail) file is a container format that may just include the public certificate or the entire certificate chain (private key, public key, root certificates).
cat server.key > server.pem
cat server.crt >> server.pem
- Create .pkcs12 file => A PKCS12(Public-Key Cryptography Standards) defines an archive-file format for storing server certificates, intermediate certificate if any and private key into a single encryptable file.
openssl pkcs12 -export -in server.pem -out keystore.pkcs12
Reference https://www.openssl.org/