Key Validators

Key Validators validate the quality of keys, foremost as a result of incoming CSRs. There are currently three types of Key Validators.

Key Validator Types

RSA Key Validator

The RSA Key Validator inspects RSA key parameters and validates key quality beyond key length and size. This key validator can enforce the CA/B-Forum requirements on public keys, and also performs the following tests on the RSA exponent and modulus:

  • That the value of the public exponent is an odd number equal to 3 or more.
  • That the public exponent is in the range between 2^16+1 and 2^256-1.
  • That the modulus is an odd number, not the power of a prime, and have no factors smaller than 752.

ECC Key Validator

The ECC Key validator inspects the full public key validation (NIST SP 56A) routine on ECC keys.

Blacklist Key Validator

This validator compares public keys against a blacklist of known bad public keys, such as the Debian bad keys.

The blacklist is empty by default and must be filled manually. PrimeKey can provide a blacklist of Debian weak keys as created by the Metasploit project.

The public key blacklisted entries can be added using the CLI:

bin/ejbca.sh ca updatepublickeyblacklist --command add --dir <directory of blacklisted public keys>		

where the directory contains public key files in PEM format. If you have a list of PEM formatted private keys, you can create the public key entries, and CSRs to test with using these commands:

openssl req -key blacklisted-privatekey.pem -out blacklisted.csr -new
openssl rsa -in blacklisted-privatekey.pem -pubout > tmp/blacklisted-publickey.pem

You can import a blacklist fingerprint file (a file with one blacklist fingerprint per line) with:

bin/ejbca.sh ca updatepublickeyblacklist --command add --mode fingerprint --keyspecs RSA2048 --dir <directory where blacklist fingerprint file resides>			

You can also remove fingerprints using the fingerprint file:

bin/ejbca.sh ca updatepublickeyblacklist --command remove --mode fingerprint --dir <directory where blacklist fingerprint file resides>

Common Key Validator Settings

SettingDescription

Certificate Validity Not Before

Only perform validation if certificate validity NotBefore matches the condition, i.e. is less than or greater than the given date. If no date is set, this condition is not used. Date in the format 2017-02-28 will for example only validate certificates valid from the 28th of February 2017.

Certificate Validity Not After

Only perform validation if certificate validity NotAfter matches the condition.

The format of the date entered is 'yyyy-MM-dd [HH:mm:ss]', for example 2022-08-25 for the 25th of August 2022, or if you want to specify a time '2022-08-25 14:50:55'. The displayed date is converted to the server's timezone, and you can specify timezone as well '2022-08-25 14:50:55-0000' for UTC.