
CA.pl -newreq (openssl req -config /etc/openssl.cnf -new -keyout newreq.pem -out newreq.pem \ -days 365) |
CA.pl -sign (openssl ca -config /etc/openssl.cnf -policy policy_anything -out newcert.pem \ -infiles newreq.pem) |
You private key is in newreq.pem -PRIVATE KEY- and your certificate is in newcert.pem -CERTIFICATE-
To revoke a certificate simply issue the command:
openssl -revoke newcert.pem |
openssl ca -gencrl -config /etc/openssl.cnf -out crl/sopac-ca.crl |
This Certificate Revokation List (CRL) file should be made available on your web site.
openssl ca -gencrl -config /etc/openssl.cnf -crldays 7 -crlexts crl_ext \ -out crl/sopac-ca.crl |
The user sends you its old certificate request or create a new one based on its private key.
First you have to revoke the previous certificate and sign again the certificate request.
To find the old certificate, look in the index.txt file for the Distinguished Name (DN) corresponding to the request. Get the serial Number <xx>, and use the file cert/<xx>.pem as certificate for the revocation procedure.
You may want to sign the request manually because you have to ensure that the start date and end date of validity of the new certificate are correct.
openssl ca -config /etc/openssl.cnf -policy policy_anything -out newcert.pem \ -infiles newreq.pem -startdate [now] -enddate [previous enddate+365days] |
replace [now] and [previous enddate+365days] by the correct values.
openssl x509 -in newcert.pem -noout -text |
There are a few requirements when you are a Certificate Authority (CA):
You must publish your root CA Certificate, so that it can be widely installed in applications.
You must publish the revocation list.
You must display a certificate detail, provided its serial number
You must provide a form for users to submit certificate requests.
All these requirements can be done using a web server and some scripting.
FIXME: some code here for the web interface...