How to setup an own Root Certificate Authority (CA)
This article describes how to setup an own Root Certificate Authority (CA) that allows to sign certificates and create Certificate Revocation Lists (CRL).
Setting up an own Root CA simplifies the certificate management in a larger installation, as not all certificates need to be distributed to all hosts. Instead, only the own certificate and the certificate + CRL of the CA have to be present on each host. All certificates that are signed by the CA are then automatically trusted, as long as their certificate is not listed in the current revocation list (CRL).

The CA can later on be used to sign any certificate, independent of the intended use-case (e.g. Webserver, OPC UA server, OPC UA client...).
Pre-requisites
- xca: X certificate and key management
Creating a new Root Certificate Authority using xca
- Open the tool xca.
- Create a new data base
Create a private key
- Go to the tab Private Keys and press New Key
- Provide a name for the key
- Press Create
For
security reasons, do not export the private key of the Certificate Authority unless there are good reasons to do so!
The private key of the CA allows you to sign any certificate which in turn is then trusted by every host/service that is trusting the CA!
Create a new certificate
- Go to the tab Certificates and press New Certificate
- Select Create a self signed certificate
Set the subject of the new certificate
- Go to the tab Subject
- Enter an internal name for the certificate
- Provide information about your organization (not mandatory, but best practice)
- Ensure to select the private key created in the previous steps
Set the extensions of the new certificate
- Go to the tab Extensions
- Set X509v3 Basic Constraints to:
- Type: Certification Authority
- Path length: 0 (only use a higher number, if sub-CAs shall be allowed)
- Select Critical
- Set Key identifier:
- Select X509v3 Subject Key Identifier
- Select X509v3 Authority Key Identifier
- Set validity as required
Set the key usage of the new certificate
- Go to the tab Key usage
- Set X509v3 Key Usage:
- Select Critical
- Select Certificate Sign, CRL Sign
- Press OK
Export the certificate
- Select the newly generated certificate and press Export
- Provide a file name for the certificate and ensure to set the file extension to .der
- Ensure that the export format is set to DER
- Press OK
Create a new revocation list (CRL)
- Go to the tab Revocation lists and press New CRL
- Setup the parameters as required
- Press OK
The CRL becomes invalid after the defined period has elapsed. Then, a new CRL must be created and distributed to all hosts!
Export the revocation list
- Select the newly generated revocation list and press Export
- Provide a file name for the revocation list and ensure to set the file extension to .crl
- Ensure that the export format is set to DER
- Press OK