An intermediate certificate authority (CA) is an entity that can sign certificates on behalf of the root CA. The root CA signs the intermediate certificate, forming a chain of trust.
The purpose of using an intermediate CA is primarily for security. The root key can be kept offline and used as infrequently as possible. If the intermediate key is compromised, the root CA can revoke the intermediate certificate and create a new intermediate cryptographic pair.
Prepare the directory
The root CA files are kept in /etc/pki/CA. Choose a different directory (/etc/pki/CA/intermediate) to store the intermediate CA files.
Create the same directory structure used for the root CA files. It’s convenient to also create a csr directory to hold certificate signing requests.
Add a crlnumber file to the intermediate CA directory tree. crlnumber is used to keep track of certificate revocation lists.
Copy the intermediate CA configuration file from /etc/pki/CA/openssl.cnf to /etc/pki/CA/intermediate/openssl.cnf.
The following options have been changed compared to the root CA configuration file:
Create the intermediate key
Create the intermediate key (GatwardIT-TLS.key). Encrypt the intermediate key with AES 256-bit encryption and a strong password.
Create the intermediate certificate
Use the intermediate key to create a certificate signing request (CSR). The details should generally match the root CA. The Common Name, however, must be different.
To create an intermediate certificate, use the root CA with the v3_intermediate_ca extension to sign the intermediate CSR. The intermediate certificate should be valid for a shorter period than the root certificate. Ten years would be reasonable.
Verify the intermediate certificate
As we did for the root certificate, check that the details of the intermediate certificate are correct.
Verify the intermediate certificate against the root certificate. An OK indicates that the chain of trust is intact.
Create the certificate chain file
When an application (eg, a web browser) tries to verify a certificate signed by the intermediate CA, it must also verify the intermediate certificate against the root certificate. To complete the chain of trust, create a CA certificate chain to present to the application.
To create the CA certificate chain, concatenate the intermediate and root certificates together. We will use this file later to verify certificates signed by the intermediate CA.
Create initial CRL
A certificate revocation list (CRL) provides a list of certificates that have been revoked. A client application, such as a web browser, can use a CRL to check a server’s authenticity. A server application, such as Apache or OpenVPN, can use a CRL to deny access to clients that are no longer trusted.
You can check the contents of the CRL with the crl tool.
You should re-create the CRL at regular intervals. By default, the CRL expires after 30 days. This is controlled by the default_crl_days option in the [ CA_default ] section.