OpenSSL instructions (from a message board post by Andrew Smith. I’m not sure of the original source).
When I was working with this previosly, I created a simple script to automate these tasks. I just had to supply the server name and it created the certs that I needed to deploy.
Useful Links:
OpenSSL Homepage:
http://www.openssl.org
OpenSSL Win32 Binary (Get this, only install the Toolkit Part):
[url=“http://www.opensa.org/download”]http://www.opensa.org/download[/url]
Steps to Create a simple Root Certificate and Public Certificate
At a command prompt in a directory with openssl.exe in your PATH
and openssl.cfg in the same directory:
PART 1
- openssl md5 * > rand.dat
- openssl genrsa -rand rand.dat 1024 > cakey.pem
- openssl req -new -key cakey.pem -out cacsr.pem -config openssl.cfg
- openssl x509 -in cacsr.pem -out cacert.pem -req -signkey cakey.pem -days 365
At this point you have a key and certificate for a self-signed root CA.
Now you can use it to sign certificate requests.
(In the same directory as before)
- openssl genrsa -rand rand.dat 1024 > mykey.pem
- openssl req -new -key mykey.pem -out mycsr.pem -config openssl.cfg
option 1 – 3) openssl x509 -in mycsr.pem -CA cacert.pem -CAkey
cakey.pem -CAcreateserial -req -out mycert.pem -days 365
option 2 – 3) openssl x509 -in mycsr.pem -CA cacert.pem -CAkey
cakey.pem -CAserial serialfile.srl -req -out mycert.pem -days 365
Now you should be good to go. The following files can be used to configure an HTTPS listener for our software, Apache, IIS, or whatever. Note that conversion from PEM to DER may be required for certain software.
Main Files:
mykey.pem your public cert’s private key, PEM encoded
mycert.pem your public certificate, PEM encoded
cacert.pem your root certificate, PEM encoded
Leftover files:
mycsr.pem your certificate’s signing request
cacsr.pem your root certificate’s signing request
cakey.pem your root cert’s private key, needed for signing future certificates
Steps to Create a simple Self-Signed Certificate
At a command prompt in a directory with openssl.exe in your PATH
and openssl.cfg in the same directory:
- openssl md5 * > rand.dat
- openssl genrsa -rand rand.dat -des3 1024 > passwordkey.pem
- generates private key (enter a passphrase)
2a) openssl rsa -in passwordkey.pem -out nopasswordkey.pem
- removes passphrase from key (optional)
- openssl req -new -key nopasswordkey.pem -out csr.pem -config openssl.cfg
- creates signing request (enter information as prompted)
- openssl x509 -in csr.pem -out cert.pem -req -signkey
nopasswordkey.pem -days 365
- creates signed certificate
- openssl x509 -inform PEM -in cert.pem -outform DER -out cert.der
- converts your certificate to DER format
- openssl rsa -inform PEM -in nopasswordkey.pem -outform DER -out
nopasswordkey.der
- converts your key to DER format
You now have a key and a certificate in DER format. The certificate is its own CA and can be used as the CA Certificate when configuring a B2B HTTPS listener.
Steps for Creating PKCS12 Objects from a Certificate & Key
Note: you need these three files