此内容没有您所选择的语言版本。
10.8. Cloning a CA That Has Been Re-Keyed
When a certificate expires, it has to be replaced. This can either be done by renewing the certificate, which re-uses the original keypair to generate a new certificate, or it can be done by generating a new keypair and certificate. The second method is called re-keying.
When a CA is re-keyed, new keypairs are stored in its certificate database, and these are the keys references for normal operations. However, for cloning a subsystem, the cloning process checks for the CA private key IDs as stored in its
CS.cfg
configuration file — and those key IDs are not updated when the certificate database keys change.
If a CA has been re-keyed and then an administrator attempts to clone it, the cloned CA fails to generate any certificates for the certificates which were re-keyed, and it shows up in the error logs with this error:
CertUtil::createSelfSignedCert() - CA private key is null!
CertUtil::createSelfSignedCert() - CA private key is null!
To clone a CA that has been re-keyed:
- Find all of the private key IDs in the
CS.cfg
file.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Print all of the current private key IDs stored in the NSS database and compare them to the private key IDs stored in the
CS.cfg
file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, only the audit signing key is the same; the others have been changed. - Take the keys returned in step 2 and convert them from unsigned values (which is what
certutil
returns) to signed Java BigIntegers (which is how the keys are stored in the Certificate System database).This can be done with a calculator or by using the script in Example 10.1, “Certutil to BigInteger Conversion Program”. - Copy the new key values into the
CS.cfg
file.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Clone the CA as described in Section 10.2, “Cloning a CA”.
Example 10.1. Certutil to BigInteger Conversion Program
This Java program can convert the key output from
certutil
to the required BigInteger format.
Save this as a
.java
file, such as Test.java
.
Then, compile the file:
javac Test.java
# javac Test.java