NSS Tools crlutil 编辑
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
Options and Arguments
Options | |
Specify the prefix used on the | |
Use ASCII format or allow the use of ASCII format for input and output. This formatting follows RFC #1113.
| |
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. | |
The
| |
Specify type of CRL. possible types are: 0 - SEC_KRL_TYPE, 1 - SEC_CRL_TYPE. This option is obsolete | |
CRL Generation script syntax:
CRL generation script file has the following syntax:
- Line with comments should have <bold>#</bold> as a first symbol of a line
- Set "this update" or "next update" CRL fields:
Field "next update" is optional. Time should be in GeneralizedTime format (YYYYMMDDhhmmssZ).update=YYYYMMDDhhmmssZ
nextupdate=YYYYMMDDhhmmssZ
For example:20050204153000Z
- Add an extension to a CRL or a crl certificate entry:
Where:addext
extension-namecritical/non-critical
[
arg1[
arg2...]]
extension-name
: string value of a name of known extensions.critical/non-critical
: is 1 when extension is critical and 0 otherwise.arg1, arg2
: specific to extension type extension parametersaddext
uses the range that was set earlier byaddcert
and will install an extension to every cert entries within the range.See "Implemented extensions" for more information regarding extensions and theirs parameters.
- Add certificate entries(s) to CRL:
Where:addcert
range daterange
: two integer values separated bydash
: range of certificates that will be added by this command.dash
is used as a delimiter. Only one cert will be added if there is no delimiter.date
: revocation date of a cert. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ). - Remove certificate entry(s) from CRL
Where:rmcert
rangerange
: two integer values separated bydash
: range of certificates that will be added by this command.dash
is used as a delimiter. Only one cert will be added if there is no delimiter. - Change range of certificate entry(s) in CRL
Where:range
new-rangenew-range
: two integer values separated bydash
: range of certificates that will be added by this command.dash
is used as a delimiter. Only one cert will be added if there is no delimiter.
Implemented Extensions
The extensions defined for CRL provide methods for associating additional attributes with CRLs of theirs entries. For more information see RFC #3280
- Add The Authority Key Identifier extension:
The authority key identifier extension provides a means of identifying the public key corresponding to the private key used to sign a CRL.
Where:authKeyId
critical [key-id | dn cert-serial]authKeyIdent
: identifies the name of an extensioncritical
: value of 1 of 0. Should be set to 1 if this extension is critical or 0 otherwise.key-id
: key identifier represented in octet string.dn:
: is a CA distinguished namecert-serial
: authority certificate serial number. - Add Issuer Alternative Name extension:
The issuer alternative names extension allows additional identities to be associated with the issuer of the CRL. Defined options include an rfc822 name (electronic mail address), a DNS name, an IP address, and a URI.
Where:issuerAltNames
non-critical name-listsubjAltNames
: identifies the name of an extension
should be set to 0 since this is non-critical extensionname-list
: comma separated list of names - Add CRL Number extension:
The CRL number is a non-critical CRL extension which conveys a monotonically increasing sequence number for a given CRL scope and CRL issuer. This extension allows users to easily determine when a particular CRL supersedes another CRL
Where:crlNumber
non-critical numbercrlNumber
: identifies the name of an extensioncritical
: should be set to 0 since this is non-critical extensionnumber
: value oflong
which identifies the sequential number of a CRL. - Add Revocation Reason Code extension:
The reasonCode is a non-critical CRL entry extension that identifies the reason for the certificate revocation.
Where:reasonCode
non-critical codereasonCode
: identifies the name of an extensionnon-critical
: should be set to 0 since this is non-critical extensioncode
: the following codes are available:unspecified (0),
keyCompromise (1),
cACompromise (2),
affiliationChanged (3),
superseded (4),
cessationOfOperation (5),
certificateHold (6),
removeFromCRL (8),
privilegeWithdrawn (9),
aACompromise (10) - Add Invalidity Date extension:
The invalidity date is a non-critical CRL entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid.
invalidityDate non-critical date
Where:crlNumber
: identifies the name of an extensionnon-critical
: should be set to 0 since this is non-critical extensiondate
: invalidity date of a cert. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ).
Usage
-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]
- Creating or modifying a CRL:
- Listing all CRls or a named CRL:
- Deleting CRL from db:
- Erasing CRLs from db:
- Import CRL from file:
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
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:
The CRL Management Tool displays output similar to the following:
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
crlutil -M -d
certdir-n
cert-nickname<<EOF
update=20050204153000Z
addcert 40-60 20050105153000Z
EOF
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论