SSL Client Certificate Creation
From Antiflux Wiki
To obtain a client certificate signed by the Antiflux CA:
- Create a directory in which to store your key and certificate:
mkdir $HOME/.ssl ; cd $HOME/.ssl
- Generate a key (where user is your username):
openssl genrsa -out $HOME/.ssl/user.key 1024
- Ensure the key is not readable by other users:
chmod 0600 $HOME/.ssl/user.key
- Generate a certificate signing request (CSR):
openssl req -new -key $HOME/.ssl/user.key -out $HOME/.ssl/user.csr
- E-mail the CSR (NOT the key) to root:
mail [email protected] < $HOME/.ssl/user.csr
The following steps are for administrators only:
- Export the CSR to a file called user.csr in /etc/ssl/antiflux
- Sign the CSR:
cd /etc/ssl/antiflux ; make sign
- Move the certificate to the client certificates directory:
mv /etc/ssl/antiflux/user.cert /etc/ssl/private/user.crt
- Create a PKCS#12 file:
cd /etc/ssl/client ; openssl pkcs12 -export -clcerts -in user.crt -inkey user.key -out user.p12
- Send the certificate and PKCS#12 files to the user.
The PKCS#12 file (user.p12) can then be imported into most browsers and IMAP clients. The key (user.key) and certificate (user.crt) should be stored in the user's home directory ($HOME/.ssl, for example). The certificate file can be world readable, but the key should only readable by the user.
Note: "make sign" will delete the CSR, so make a copy ahead of time if you're going to want it later.