Using the Certificate Revocation List Management Tool

Newsgroup: mozilla.dev.tech.crypto

The Certificate Revocation List (CRL) Management Tool is a command-line utility that can list, generate, modify, or delete CRLs within the NSS security database file(s) and list, create, modify or delete certificates entries in a particular CRL.

The key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation.

This document discusses certificate revocation list management. For information on security module database management, see Using the Security Module Database Tool. For information on certificate and key database management, see Using the Certificate Database Tool.

Availability

See the release notes for the platforms this tool is available on.

Syntax

To run the Certificate Revocation List Management Tool, type the command

crlutil option [arguments]

where options and arguments are combinations of the options and arguments listed in the following section. Each command takes one option. Each option may take zero or more arguments. To see a usage string, issue the command without options, or with the -H option.

Options and Arguments

Options specify an action and are uppercase. Option arguments modify an action and are lowercase. Certificate Revocation List Management Tool command options and their arguments are defined as follows:

Options

-G

Create new Certificate Revocation List(CRL).

-D

Delete Certificate Revocation List from cert database.

-I

Import a CRL to the cert database

-E

Erase all CRLs of specified type from the cert database

-L

List existing CRL located in cert database file.

-M

Modify existing CRL which can be located in cert db or in arbitrary file. If located in file it should be encoded in ASN.1 encode format.

Arguments

-B

Bypass CA signature checks.

-P dbprefix

Specify the prefix used on the NSS security database files (for example, my_cert8.db and my_key3.db). This option is provided as a special case. Changing the names of the certificate and key databases is not recommended.

-a

Use ASCII format or allow the use of ASCII format for input and output. This formatting follows RFC #1113.

-c crl-gen-file

Specify script file that will be used to control crl generation/modification. See crl-cript-file format below. If options -M|-G is used and -c crl-script-file is not specified, crlutil will read script data from standard input.

-d directory

Specify the database directory containing the certificate and key database files. On Unix the Certificate Database Tool defaults to $HOME/.netscape (that is, ~/.netscape). On Windows NT the default is the current directory.

The NSS database files must reside in the same directory.

-i crl-import-file

Specify the file which contains the CRL to import

-f password-file

Specify a file that will automatically supply the password to include in a certificate or to access a certificate database. This is a plain-text file containing one password. Be sure to prevent unauthorized access to this file.

-l algorithm-name

Specify a specific signature algorithm. List of possible algorithms: MD2 | MD4 | MD5 | SHA1 | SHA256 | SHA384 | SHA512

-n nickname

Specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. Bracket the nickname string with quotation marks if it contains spaces.

-o output-file

Specify the output file name for new CRL. Bracket the output-file string with quotation marks if it contains spaces. If this argument is not used the output destination defaults to standard output.

-t crl-type

Specify type of CRL. possible types are: 0 - SEC_KRL_TYPE, 1 - SEC_CRL_TYPE. This option is obsolete

-u url

Specify the url.

CRL Generation script syntax:

CRL generation script file has the following syntax:

Implemented Extensions

The extensions defined for CRL provide methods for associating additional attributes with CRLs of theirs entries. For more information see RFC #3280

Usage

The Certificate Revocation List Management Tool's capabilities are grouped as follows, using these combinations of options and arguments. Options and arguments in square brackets are optional, those without square brackets are required.

-G|-M -c crl-gen-file -n nickname [-i crl] [-u url] [-d keydir] [-P dbprefix] [-l alg] [-a] [-B]
-L [-n crl-name] [-d krydir]
crlutil -D -n nickname [-d keydir] [-P dbprefix]
crlutil -E [-d keydir] [-P dbprefix]
crlutil -I -i crl [-t crlType] [-u url] [-d keydir] [-P dbprefix] [-B]

Examples

Creating a New CRL
Listing CRLs in a Database
Deleting CRL from a Database
Importing CRL into a Database
Modifiying CRL in a Database

Creating a New CRL

This example creates a new CRL and importing it in to a Database in the specified directory:

crlutil -G -d certdir -n cert-nickname -c crl-script-file

or

crlutil -G -d certdir -n cert-nickname <<EOF
update=20050204153000Z
addcert 34-40 20050104153000Z
EOF

Where cert-nickname is the name the new CRL will be signed with.

Listing CRLs in a Database

This example lists all the CRLs in the NSS database in the specified directory:

crlutil -L -d certdir

The CRL Management Tool displays output similar to the following:

CRL Name              CRL Type

CN=NSS Test CA,O=BOGUS NSS,L=Mountain View,ST=California,C=US  CRL
CN=John Smith,O=Netscape,L=Mountain View,ST=California,C=US  CRL

To view a particular CRL user should specify -n nickname parameter.
crlutil -L -d certdir -n nickname

CRL Info:
:
    Version: 2 (0x1)
    Signature Algorithm: PKCS #1 MD5 With RSA Encryption
    Issuer: "CN=NSS Test CA,O=BOGUS NSS,L=Mountain View,ST=California,C=US"
    This Update: Wed Feb 23 12:08:38 2005
    Entry (1):
        Serial Number: 40 (0x28)
        Revocation Date: Wed Feb 23 12:08:10 2005
    Entry (2):
        Serial Number: 42 (0x2a)
        Revocation Date: Wed Feb 23 12:08:40 2005

Deleting CRL from a Database

This example deletes CRL from a database in the specified directory:

crlutil -D -n nickname -d certdir

Importing CRL into a Database

This example imports CRL into a database:

crlutil -I -i crl-file -d certdir

File should has binary format of ASN.1 encoded CRL data.

Modifying CRL in a Database

This example modifies a new CRL and importing it in to a Database in the specified directory:

crlutil -G -d certdir -n cert-nickname -c crl-script-file

or

crlutil -M -d certdir -n cert-nickname <<EOF
update=20050204153000Z
addcert 40-60 20050105153000Z
EOF

The CRL Management Tool extracts existing CRL from a database, will modify and sign with certificate cert-nickname and will store it in database. To modify while importing CRL from file user should supply -i import-crl-file option.