Today i was installing Oracle Mobile Security Suite and I had to create PKCS12 certificate files for the OMSS servers. So i did a lot of googling and I was really surprised to see how easy it to create such files as it took me hardly a few minutes to create the PKCS12 SSL files.
If you are wondering what is a PKCS12 file, then let me tell you in a simple words:
PKCS12 is a fully encrypted certificate which can be made by combining a RSA Private Key(xxx.key) and a SSL certificate (xxx.crt)
Below are the steps to create a PKCS files:
1. Login in as ROOT
2. Create a directory in any location in Linux File system, so I am creating a directory in root file system as "openssl" and navigate to the folder
- command : mkdir /openssl
- command : cd openssl
3. Copy the sample openssl.conf file from the location "/etc/pki/tls" to the above created directory location
- command : cp /etc/pki/tls/openssl.conf /openssl
4. Generate a RSA Private key (eg: Your_Privatekey.key)
- command : openssl genrsa -out Your_Privatekey.key 4096
5. Generate a Certificate Signing Request (eg: Your_request.csr) and you can self sign the certificate:
- command : openssl req -new -key Your_Privatekey.key -out Your_request.csr -config openssl.cnf
6. Generate a self-signed public certificate (eg: Your_Certificate.crt) based on the request:
- openssl x509 -req -days 3650 -in Your_request.csr -signkey Your_key.key -out Your_cert.crt
7. Generate a PKCS#12 file:
- openssl pkcs12 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -in Your_cert.crt -inkey Your_Privatekey.key -out Your_pkcs12.pfx -name "<Any_Name>"
This post concludes the creation of PCKS12 files in Linux.
0 comments