How to create PEM certificates in Linux ?


Today i was installing Oracle Mobile Security Suite and I had to create PKCS12 certificate and PEM 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 PEM files along with PKCS12 SSL files.
If you are wondering what is a PEM file, then let me tell you in a simple words:
PEM file is a partially 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 PEM 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:
  • command : openssl x509 -req -days 3650 -in Your_request.csr -signkey Your_Privatekey.key -out Your_cert.crt

7. Generate the PEM file
  • command : cat Your_Privatekey.key Your_Certificate.crt > Your_PEM.pem
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© Ganesh Sairam's Oracle Blog
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top