Monthly Archive for February, 2011

OpenSSL: Create a self-signed Certificate

This post is just a sticky note, because for testing purposes I have to create a self-signed certificate from time to time.

openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

These commands have been taken from here.

OpenSSL: Convert & Merge Key with Certificate

This second sticky note describes how to (1) convert a P12 file to PEM, and how to (2) merge a PEM and a CRT file to P12.

# covert
openssl pkcs12 -nocerts -in key_in.p12 -out key.pem
 
# merge
openssl pkcs12 -export -inkey key.pem -in pki.crt -out key_out.p12

These commands have been taken from here.