I will show you how to generate the following files using OpenSSL.
- Private Key
- Certificate Signing Request
- X.509 Certificate/Public Key
- PKCS12 Keystore
Generate the Private Key with 1024 key size – test.key
- openssl genrsa -out test.key 1024
Generate the Certificate Signing Request – test.csr
- openssl req -new -key test.key -out test.csr
Generate the X.509 Certificate/Public Key which has 365 effective days – test.cert
- openssl x509 –req –days 365 -in test.csr -signkey test.key -sha1 –out test.cert
Generate the PKCS12 Keystore – text.p12
- openssl pkcs12 -name test -export -in test.cert -inkey test.key -out test.p12
Done =)