SSL Certs and CAs
Just for reference, I'm putting up the instructions for creating your own CA and certs and whatnot using OpenSSL.
Create a Random Seed File
cat /dev/random > $HOME/.rnd
- Let this command run for a while and kill it.
- In linux /dev/random or /dev/urandom will work fine.
- The openssl.cnf specifies the file used to seed the random number generator.
Generate a CA
- openssl req -out CA.pem -new -x509
- generates CA file CA.pem and CA key privkey.pem
Generate server certificate/key pair - no password required
- openssl genrsa -out server.key 1024
- openssl req -key server.key -new -out server.req
- openssl x509 -req -in server.req -CA CA.pem -CAkey privkey.pem -CAserial file.srl -out server.pem
*The content of file.srl is a two digit number. eg. 00; it's incremented when the CA issues a certificate. You can create this file by hand using a text editor. (I'm not sure if CA.sh minds having a newline at the end; for safety I would just put the two digits into the file and omit the newline.)
Generate client certificate/key pair
- Encrypt the client key with a passphrase
- openssl genrsa -des3 -out client.key 1024
- openssl req -key client.key -new -out client.req
- openssl x509 -req -in client.req -CA CA.pem -CAkey privkey.pem -CAserial file.srl -out client.pem
Posted by Peter at January 27, 2004 10:09 PM
Comments
i still do not understand how, where the file.srl is created and located
Hi Peter,
Need som help
1. I seem to be missing an important point i.e best way to install smime keys into Microsoft Outlook. I have tried most of the Help from the internet but i do not seem to be getting anywhere.
Do you have any proper Guidance into how i can achieve this. I have created all the keys (Root Certifikate und Public/Private key) using the tool "openssl x509". Following is the warning that i get when i want to send a message, ofcourse having believed that i have done all that have to be done to install the keys.
---------------------------
Microsoft Outlook
---------------------------
Diese Nachricht kann mit der gewählten Sicherheitseinstellung nicht gesichert werden. Ihre E-Mail-Adresse stimmt möglicherweise nicht mit der des Zertifikats überein, oder es besteht ein anderes Zertifikatproblem. Wollen Sie ohne Sicherheit fortfahren?
---------------------------
Ja Nein
---------------------------
2. How can i convert a certificates into p7b (.p7b) format
i still do not understand how, where the file.srl is created and located