security/nss/doc/nroff/certutil.1

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 '\" t
michael@0 2 .\" Title: CERTUTIL
michael@0 3 .\" Author: [see the "Authors" section]
michael@0 4 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
michael@0 5 .\" Date: 5 June 2014
michael@0 6 .\" Manual: NSS Security Tools
michael@0 7 .\" Source: nss-tools
michael@0 8 .\" Language: English
michael@0 9 .\"
michael@0 10 .TH "CERTUTIL" "1" "5 June 2014" "nss-tools" "NSS Security Tools"
michael@0 11 .\" -----------------------------------------------------------------
michael@0 12 .\" * Define some portability stuff
michael@0 13 .\" -----------------------------------------------------------------
michael@0 14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
michael@0 15 .\" http://bugs.debian.org/507673
michael@0 16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
michael@0 17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
michael@0 18 .ie \n(.g .ds Aq \(aq
michael@0 19 .el .ds Aq '
michael@0 20 .\" -----------------------------------------------------------------
michael@0 21 .\" * set default formatting
michael@0 22 .\" -----------------------------------------------------------------
michael@0 23 .\" disable hyphenation
michael@0 24 .nh
michael@0 25 .\" disable justification (adjust text to left margin only)
michael@0 26 .ad l
michael@0 27 .\" -----------------------------------------------------------------
michael@0 28 .\" * MAIN CONTENT STARTS HERE *
michael@0 29 .\" -----------------------------------------------------------------
michael@0 30 .SH "NAME"
michael@0 31 certutil \- Manage keys and certificate in both NSS databases and other NSS tokens
michael@0 32 .SH "SYNOPSIS"
michael@0 33 .HP \w'\fBcertutil\fR\ 'u
michael@0 34 \fBcertutil\fR [\fIoptions\fR] [[\fIarguments\fR]]
michael@0 35 .SH "STATUS"
michael@0 36 .PP
michael@0 37 This documentation is still work in progress\&. Please contribute to the initial review in
michael@0 38 \m[blue]\fBMozilla NSS bug 836477\fR\m[]\&\s-2\u[1]\d\s+2
michael@0 39 .SH "DESCRIPTION"
michael@0 40 .PP
michael@0 41 The Certificate Database Tool,
michael@0 42 \fBcertutil\fR, is a command\-line utility that can create and modify certificate and key databases\&. It can specifically list, generate, modify, or delete certificates, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database\&.
michael@0 43 .PP
michael@0 44 Certificate issuance, part of the key and certificate management process, requires that keys and certificates be created in the key database\&. This document discusses certificate and key database management\&. For information on the security module database management, see the
michael@0 45 \fBmodutil\fR
michael@0 46 manpage\&.
michael@0 47 .SH "COMMAND OPTIONS AND ARGUMENTS"
michael@0 48 .PP
michael@0 49 Running
michael@0 50 \fBcertutil\fR
michael@0 51 always requires one and only one command option to specify the type of certificate operation\&. Each command option may take zero or more arguments\&. The command option
michael@0 52 \fB\-H\fR
michael@0 53 will list all the command options and their relevant arguments\&.
michael@0 54 .PP
michael@0 55 \fBCommand Options\fR
michael@0 56 .PP
michael@0 57 \-A
michael@0 58 .RS 4
michael@0 59 Add an existing certificate to a certificate database\&. The certificate database should already exist; if one is not present, this command option will initialize one by default\&.
michael@0 60 .RE
michael@0 61 .PP
michael@0 62 \-B
michael@0 63 .RS 4
michael@0 64 Run a series of commands from the specified batch file\&. This requires the
michael@0 65 \fB\-i\fR
michael@0 66 argument\&.
michael@0 67 .RE
michael@0 68 .PP
michael@0 69 \-C
michael@0 70 .RS 4
michael@0 71 Create a new binary certificate file from a binary certificate request file\&. Use the
michael@0 72 \fB\-i\fR
michael@0 73 argument to specify the certificate request file\&. If this argument is not used,
michael@0 74 \fBcertutil\fR
michael@0 75 prompts for a filename\&.
michael@0 76 .RE
michael@0 77 .PP
michael@0 78 \-D
michael@0 79 .RS 4
michael@0 80 Delete a certificate from the certificate database\&.
michael@0 81 .RE
michael@0 82 .PP
michael@0 83 \-E
michael@0 84 .RS 4
michael@0 85 Add an email certificate to the certificate database\&.
michael@0 86 .RE
michael@0 87 .PP
michael@0 88 \-F
michael@0 89 .RS 4
michael@0 90 Delete a private key from a key database\&. Specify the key to delete with the \-n argument\&. Specify the database from which to delete the key with the
michael@0 91 \fB\-d\fR
michael@0 92 argument\&. Use the
michael@0 93 \fB\-k\fR
michael@0 94 argument to specify explicitly whether to delete a DSA, RSA, or ECC key\&. If you don\*(Aqt use the
michael@0 95 \fB\-k\fR
michael@0 96 argument, the option looks for an RSA key matching the specified nickname\&.
michael@0 97 .sp
michael@0 98 When you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using \-D\&. Some smart cards do not let you remove a public key you have generated\&. In such a case, only the private key is deleted from the key pair\&. You can display the public key with the command certutil \-K \-h tokenname\&.
michael@0 99 .RE
michael@0 100 .PP
michael@0 101 \-G
michael@0 102 .RS 4
michael@0 103 Generate a new public and private key pair within a key database\&. The key database should already exist; if one is not present, this command option will initialize one by default\&. Some smart cards can store only one key pair\&. If you create a new key pair for such a card, the previous pair is overwritten\&.
michael@0 104 .RE
michael@0 105 .PP
michael@0 106 \-H
michael@0 107 .RS 4
michael@0 108 Display a list of the command options and arguments\&.
michael@0 109 .RE
michael@0 110 .PP
michael@0 111 \-K
michael@0 112 .RS 4
michael@0 113 List the key ID of keys in the key database\&. A key ID is the modulus of the RSA key or the publicValue of the DSA key\&. IDs are displayed in hexadecimal ("0x" is not shown)\&.
michael@0 114 .RE
michael@0 115 .PP
michael@0 116 \-L
michael@0 117 .RS 4
michael@0 118 List all the certificates, or display information about a named certificate, in a certificate database\&. Use the \-h tokenname argument to specify the certificate database on a particular hardware or software token\&.
michael@0 119 .RE
michael@0 120 .PP
michael@0 121 \-M
michael@0 122 .RS 4
michael@0 123 Modify a certificate\*(Aqs trust attributes using the values of the \-t argument\&.
michael@0 124 .RE
michael@0 125 .PP
michael@0 126 \-N
michael@0 127 .RS 4
michael@0 128 Create new certificate and key databases\&.
michael@0 129 .RE
michael@0 130 .PP
michael@0 131 \-O
michael@0 132 .RS 4
michael@0 133 Print the certificate chain\&.
michael@0 134 .RE
michael@0 135 .PP
michael@0 136 \-R
michael@0 137 .RS 4
michael@0 138 Create a certificate request file that can be submitted to a Certificate Authority (CA) for processing into a finished certificate\&. Output defaults to standard out unless you use \-o output\-file argument\&. Use the \-a argument to specify ASCII output\&.
michael@0 139 .RE
michael@0 140 .PP
michael@0 141 \-S
michael@0 142 .RS 4
michael@0 143 Create an individual certificate and add it to a certificate database\&.
michael@0 144 .RE
michael@0 145 .PP
michael@0 146 \-T
michael@0 147 .RS 4
michael@0 148 Reset the key database or token\&.
michael@0 149 .RE
michael@0 150 .PP
michael@0 151 \-U
michael@0 152 .RS 4
michael@0 153 List all available modules or print a single named module\&.
michael@0 154 .RE
michael@0 155 .PP
michael@0 156 \-V
michael@0 157 .RS 4
michael@0 158 Check the validity of a certificate and its attributes\&.
michael@0 159 .RE
michael@0 160 .PP
michael@0 161 \-W
michael@0 162 .RS 4
michael@0 163 Change the password to a key database\&.
michael@0 164 .RE
michael@0 165 .PP
michael@0 166 \-\-merge
michael@0 167 .RS 4
michael@0 168 Merge two databases into one\&.
michael@0 169 .RE
michael@0 170 .PP
michael@0 171 \-\-upgrade\-merge
michael@0 172 .RS 4
michael@0 173 Upgrade an old database and merge it into a new database\&. This is used to migrate legacy NSS databases (cert8\&.db
michael@0 174 and
michael@0 175 key3\&.db) into the newer SQLite databases (cert9\&.db
michael@0 176 and
michael@0 177 key4\&.db)\&.
michael@0 178 .RE
michael@0 179 .PP
michael@0 180 \fBArguments\fR
michael@0 181 .PP
michael@0 182 Arguments modify a command option and are usually lower case, numbers, or symbols\&.
michael@0 183 .PP
michael@0 184 \-a
michael@0 185 .RS 4
michael@0 186 Use ASCII format or allow the use of ASCII format for input or output\&. This formatting follows RFC 1113\&. For certificate requests, ASCII output defaults to standard output unless redirected\&.
michael@0 187 .RE
michael@0 188 .PP
michael@0 189 \-b validity\-time
michael@0 190 .RS 4
michael@0 191 Specify a time at which a certificate is required to be valid\&. Use when checking certificate validity with the
michael@0 192 \fB\-V\fR
michael@0 193 option\&. The format of the
michael@0 194 \fIvalidity\-time\fR
michael@0 195 argument is
michael@0 196 \fIYYMMDDHHMMSS[+HHMM|\-HHMM|Z]\fR, which allows offsets to be set relative to the validity end time\&. Specifying seconds (\fISS\fR) is optional\&. When specifying an explicit time, use a Z at the end of the term,
michael@0 197 \fIYYMMDDHHMMSSZ\fR, to close it\&. When specifying an offset time, use
michael@0 198 \fIYYMMDDHHMMSS+HHMM\fR
michael@0 199 or
michael@0 200 \fIYYMMDDHHMMSS\-HHMM\fR
michael@0 201 for adding or subtracting time, respectively\&.
michael@0 202 .sp
michael@0 203 If this option is not used, the validity check defaults to the current system time\&.
michael@0 204 .RE
michael@0 205 .PP
michael@0 206 \-c issuer
michael@0 207 .RS 4
michael@0 208 Identify the certificate of the CA from which a new certificate will derive its authenticity\&. Use the exact nickname or alias of the CA certificate, or use the CA\*(Aqs email address\&. Bracket the issuer string with quotation marks if it contains spaces\&.
michael@0 209 .RE
michael@0 210 .PP
michael@0 211 \-d [prefix]directory
michael@0 212 .RS 4
michael@0 213 Specify the database directory containing the certificate and key database files\&.
michael@0 214 .sp
michael@0 215 \fBcertutil\fR
michael@0 216 supports two types of databases: the legacy security databases (cert8\&.db,
michael@0 217 key3\&.db, and
michael@0 218 secmod\&.db) and new SQLite databases (cert9\&.db,
michael@0 219 key4\&.db, and
michael@0 220 pkcs11\&.txt)\&.
michael@0 221 .sp
michael@0 222 NSS recognizes the following prefixes:
michael@0 223 .sp
michael@0 224 .RS 4
michael@0 225 .ie n \{\
michael@0 226 \h'-04'\(bu\h'+03'\c
michael@0 227 .\}
michael@0 228 .el \{\
michael@0 229 .sp -1
michael@0 230 .IP \(bu 2.3
michael@0 231 .\}
michael@0 232 \fBsql:\fR
michael@0 233 requests the newer database
michael@0 234 .RE
michael@0 235 .sp
michael@0 236 .RS 4
michael@0 237 .ie n \{\
michael@0 238 \h'-04'\(bu\h'+03'\c
michael@0 239 .\}
michael@0 240 .el \{\
michael@0 241 .sp -1
michael@0 242 .IP \(bu 2.3
michael@0 243 .\}
michael@0 244 \fBdbm:\fR
michael@0 245 requests the legacy database
michael@0 246 .RE
michael@0 247 .sp
michael@0 248 If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE\&. If NSS_DEFAULT_DB_TYPE is not set then
michael@0 249 \fBdbm:\fR
michael@0 250 is the default\&.
michael@0 251 .RE
michael@0 252 .PP
michael@0 253 \-e
michael@0 254 .RS 4
michael@0 255 Check a certificate\*(Aqs signature during the process of validating a certificate\&.
michael@0 256 .RE
michael@0 257 .PP
michael@0 258 \-\-email email\-address
michael@0 259 .RS 4
michael@0 260 Specify the email address of a certificate to list\&. Used with the \-L command option\&.
michael@0 261 .RE
michael@0 262 .PP
michael@0 263 \-f password\-file
michael@0 264 .RS 4
michael@0 265 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\&.
michael@0 266 .RE
michael@0 267 .PP
michael@0 268 \-g keysize
michael@0 269 .RS 4
michael@0 270 Set a key size to use when generating new public and private key pairs\&. The minimum is 512 bits and the maximum is 16384 bits\&. The default is 1024 bits\&. Any size between the minimum and maximum is allowed\&.
michael@0 271 .RE
michael@0 272 .PP
michael@0 273 \-h tokenname
michael@0 274 .RS 4
michael@0 275 Specify the name of a token to use or act on\&. If not specified the default token is the internal database slot\&.
michael@0 276 .RE
michael@0 277 .PP
michael@0 278 \-i input_file
michael@0 279 .RS 4
michael@0 280 Pass an input file to the command\&. Depending on the command option, an input file can be a specific certificate, a certificate request file, or a batch file of commands\&.
michael@0 281 .RE
michael@0 282 .PP
michael@0 283 \-k key\-type\-or\-id
michael@0 284 .RS 4
michael@0 285 Specify the type or specific ID of a key\&.
michael@0 286 .sp
michael@0 287 The valid key type options are rsa, dsa, ec, or all\&. The default value is rsa\&. Specifying the type of key can avoid mistakes caused by duplicate nicknames\&. Giving a key type generates a new key pair; giving the ID of an existing key reuses that key pair (which is required to renew certificates)\&.
michael@0 288 .RE
michael@0 289 .PP
michael@0 290 \-l
michael@0 291 .RS 4
michael@0 292 Display detailed information when validating a certificate with the \-V option\&.
michael@0 293 .RE
michael@0 294 .PP
michael@0 295 \-m serial\-number
michael@0 296 .RS 4
michael@0 297 Assign a unique serial number to a certificate being created\&. This operation should be performed by a CA\&. If no serial number is provided a default serial number is made from the current time\&. Serial numbers are limited to integers
michael@0 298 .RE
michael@0 299 .PP
michael@0 300 \-n nickname
michael@0 301 .RS 4
michael@0 302 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\&.
michael@0 303 .RE
michael@0 304 .PP
michael@0 305 \-o output\-file
michael@0 306 .RS 4
michael@0 307 Specify the output file name for new certificates or binary certificate requests\&. 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\&.
michael@0 308 .RE
michael@0 309 .PP
michael@0 310 \-P dbPrefix
michael@0 311 .RS 4
michael@0 312 Specify the prefix used on the certificate and key database file\&. This argument is provided to support legacy servers\&. Most applications do not use a database prefix\&.
michael@0 313 .RE
michael@0 314 .PP
michael@0 315 \-p phone
michael@0 316 .RS 4
michael@0 317 Specify a contact telephone number to include in new certificates or certificate requests\&. Bracket this string with quotation marks if it contains spaces\&.
michael@0 318 .RE
michael@0 319 .PP
michael@0 320 \-q pqgfile or curve\-name
michael@0 321 .RS 4
michael@0 322 Read an alternate PQG value from the specified file when generating DSA key pairs\&. If this argument is not used,
michael@0 323 \fBcertutil\fR
michael@0 324 generates its own PQG value\&. PQG files are created with a separate DSA utility\&.
michael@0 325 .sp
michael@0 326 Elliptic curve name is one of the ones from SUITE B: nistp256, nistp384, nistp521
michael@0 327 .sp
michael@0 328 If NSS has been compiled with support curves outside of SUITE B: sect163k1, nistk163, sect163r1, sect163r2, nistb163, sect193r1, sect193r2, sect233k1, nistk233, sect233r1, nistb233, sect239k1, sect283k1, nistk283, sect283r1, nistb283, sect409k1, nistk409, sect409r1, nistb409, sect571k1, nistk571, sect571r1, nistb571, secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, nistp192, secp224k1, secp224r1, nistp224, secp256k1, secp256r1, secp384r1, secp521r1, prime192v1, prime192v2, prime192v3, prime239v1, prime239v2, prime239v3, c2pnb163v1, c2pnb163v2, c2pnb163v3, c2pnb176v1, c2tnb191v1, c2tnb191v2, c2tnb191v3, c2pnb208w1, c2tnb239v1, c2tnb239v2, c2tnb239v3, c2pnb272w1, c2pnb304w1, c2tnb359w1, c2pnb368w1, c2tnb431r1, secp112r1, secp112r2, secp128r1, secp128r2, sect113r1, sect113r2 sect131r1, sect131r2
michael@0 329 .RE
michael@0 330 .PP
michael@0 331 \-r
michael@0 332 .RS 4
michael@0 333 Display a certificate\*(Aqs binary DER encoding when listing information about that certificate with the \-L option\&.
michael@0 334 .RE
michael@0 335 .PP
michael@0 336 \-s subject
michael@0 337 .RS 4
michael@0 338 Identify a particular certificate owner for new certificates or certificate requests\&. Bracket this string with quotation marks if it contains spaces\&. The subject identification format follows RFC #1485\&.
michael@0 339 .RE
michael@0 340 .PP
michael@0 341 \-t trustargs
michael@0 342 .RS 4
michael@0 343 Specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database\&. There are three available trust categories for each certificate, expressed in the order
michael@0 344 \fISSL, email, object signing\fR
michael@0 345 for each trust setting\&. In each category position, use none, any, or all of the attribute codes:
michael@0 346 .sp
michael@0 347 .RS 4
michael@0 348 .ie n \{\
michael@0 349 \h'-04'\(bu\h'+03'\c
michael@0 350 .\}
michael@0 351 .el \{\
michael@0 352 .sp -1
michael@0 353 .IP \(bu 2.3
michael@0 354 .\}
michael@0 355 \fBp\fR
michael@0 356 \- Valid peer
michael@0 357 .RE
michael@0 358 .sp
michael@0 359 .RS 4
michael@0 360 .ie n \{\
michael@0 361 \h'-04'\(bu\h'+03'\c
michael@0 362 .\}
michael@0 363 .el \{\
michael@0 364 .sp -1
michael@0 365 .IP \(bu 2.3
michael@0 366 .\}
michael@0 367 \fBP\fR
michael@0 368 \- Trusted peer (implies p)
michael@0 369 .RE
michael@0 370 .sp
michael@0 371 .RS 4
michael@0 372 .ie n \{\
michael@0 373 \h'-04'\(bu\h'+03'\c
michael@0 374 .\}
michael@0 375 .el \{\
michael@0 376 .sp -1
michael@0 377 .IP \(bu 2.3
michael@0 378 .\}
michael@0 379 \fBc\fR
michael@0 380 \- Valid CA
michael@0 381 .RE
michael@0 382 .sp
michael@0 383 .RS 4
michael@0 384 .ie n \{\
michael@0 385 \h'-04'\(bu\h'+03'\c
michael@0 386 .\}
michael@0 387 .el \{\
michael@0 388 .sp -1
michael@0 389 .IP \(bu 2.3
michael@0 390 .\}
michael@0 391 \fBT\fR
michael@0 392 \- Trusted CA (implies c)
michael@0 393 .RE
michael@0 394 .sp
michael@0 395 .RS 4
michael@0 396 .ie n \{\
michael@0 397 \h'-04'\(bu\h'+03'\c
michael@0 398 .\}
michael@0 399 .el \{\
michael@0 400 .sp -1
michael@0 401 .IP \(bu 2.3
michael@0 402 .\}
michael@0 403 \fBC\fR
michael@0 404 \- trusted CA for client authentication (ssl server only)
michael@0 405 .RE
michael@0 406 .sp
michael@0 407 .RS 4
michael@0 408 .ie n \{\
michael@0 409 \h'-04'\(bu\h'+03'\c
michael@0 410 .\}
michael@0 411 .el \{\
michael@0 412 .sp -1
michael@0 413 .IP \(bu 2.3
michael@0 414 .\}
michael@0 415 \fBu\fR
michael@0 416 \- user
michael@0 417 .RE
michael@0 418 .sp
michael@0 419 The attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks\&. For example:
michael@0 420 .sp
michael@0 421 \fB\-t "TCu,Cu,Tu"\fR
michael@0 422 .sp
michael@0 423 Use the \-L option to see a list of the current certificates and trust attributes in a certificate database\&.
michael@0 424 .RE
michael@0 425 .PP
michael@0 426 \-u certusage
michael@0 427 .RS 4
michael@0 428 Specify a usage context to apply when validating a certificate with the \-V option\&.
michael@0 429 .sp
michael@0 430 The contexts are the following:
michael@0 431 .sp
michael@0 432 .RS 4
michael@0 433 .ie n \{\
michael@0 434 \h'-04'\(bu\h'+03'\c
michael@0 435 .\}
michael@0 436 .el \{\
michael@0 437 .sp -1
michael@0 438 .IP \(bu 2.3
michael@0 439 .\}
michael@0 440 \fBC\fR
michael@0 441 (as an SSL client)
michael@0 442 .RE
michael@0 443 .sp
michael@0 444 .RS 4
michael@0 445 .ie n \{\
michael@0 446 \h'-04'\(bu\h'+03'\c
michael@0 447 .\}
michael@0 448 .el \{\
michael@0 449 .sp -1
michael@0 450 .IP \(bu 2.3
michael@0 451 .\}
michael@0 452 \fBV\fR
michael@0 453 (as an SSL server)
michael@0 454 .RE
michael@0 455 .sp
michael@0 456 .RS 4
michael@0 457 .ie n \{\
michael@0 458 \h'-04'\(bu\h'+03'\c
michael@0 459 .\}
michael@0 460 .el \{\
michael@0 461 .sp -1
michael@0 462 .IP \(bu 2.3
michael@0 463 .\}
michael@0 464 \fBS\fR
michael@0 465 (as an email signer)
michael@0 466 .RE
michael@0 467 .sp
michael@0 468 .RS 4
michael@0 469 .ie n \{\
michael@0 470 \h'-04'\(bu\h'+03'\c
michael@0 471 .\}
michael@0 472 .el \{\
michael@0 473 .sp -1
michael@0 474 .IP \(bu 2.3
michael@0 475 .\}
michael@0 476 \fBR\fR
michael@0 477 (as an email recipient)
michael@0 478 .RE
michael@0 479 .sp
michael@0 480 .RS 4
michael@0 481 .ie n \{\
michael@0 482 \h'-04'\(bu\h'+03'\c
michael@0 483 .\}
michael@0 484 .el \{\
michael@0 485 .sp -1
michael@0 486 .IP \(bu 2.3
michael@0 487 .\}
michael@0 488 \fBO\fR
michael@0 489 (as an OCSP status responder)
michael@0 490 .RE
michael@0 491 .sp
michael@0 492 .RS 4
michael@0 493 .ie n \{\
michael@0 494 \h'-04'\(bu\h'+03'\c
michael@0 495 .\}
michael@0 496 .el \{\
michael@0 497 .sp -1
michael@0 498 .IP \(bu 2.3
michael@0 499 .\}
michael@0 500 \fBJ\fR
michael@0 501 (as an object signer)
michael@0 502 .RE
michael@0 503 .RE
michael@0 504 .PP
michael@0 505 \-v valid\-months
michael@0 506 .RS 4
michael@0 507 Set the number of months a new certificate will be valid\&. The validity period begins at the current system time unless an offset is added or subtracted with the
michael@0 508 \fB\-w\fR
michael@0 509 option\&. If this argument is not used, the default validity period is three months\&.
michael@0 510 .RE
michael@0 511 .PP
michael@0 512 \-w offset\-months
michael@0 513 .RS 4
michael@0 514 Set an offset from the current system time, in months, for the beginning of a certificate\*(Aqs validity period\&. Use when creating the certificate or adding it to a database\&. Express the offset in integers, using a minus sign (\-) to indicate a negative offset\&. If this argument is not used, the validity period begins at the current system time\&. The length of the validity period is set with the \-v argument\&.
michael@0 515 .RE
michael@0 516 .PP
michael@0 517 \-X
michael@0 518 .RS 4
michael@0 519 Force the key and certificate database to open in read\-write mode\&. This is used with the
michael@0 520 \fB\-U\fR
michael@0 521 and
michael@0 522 \fB\-L\fR
michael@0 523 command options\&.
michael@0 524 .RE
michael@0 525 .PP
michael@0 526 \-x
michael@0 527 .RS 4
michael@0 528 Use
michael@0 529 \fBcertutil\fR
michael@0 530 to generate the signature for a certificate being created or added to a database, rather than obtaining a signature from a separate CA\&.
michael@0 531 .RE
michael@0 532 .PP
michael@0 533 \-y exp
michael@0 534 .RS 4
michael@0 535 Set an alternate exponent value to use in generating a new RSA public key for the database, instead of the default value of 65537\&. The available alternate values are 3 and 17\&.
michael@0 536 .RE
michael@0 537 .PP
michael@0 538 \-z noise\-file
michael@0 539 .RS 4
michael@0 540 Read a seed value from the specified file to generate a new private and public key pair\&. This argument makes it possible to use hardware\-generated seed values or manually create a value from the keyboard\&. The minimum file size is 20 bytes\&.
michael@0 541 .RE
michael@0 542 .PP
michael@0 543 \-0 SSO_password
michael@0 544 .RS 4
michael@0 545 Set a site security officer password on a token\&.
michael@0 546 .RE
michael@0 547 .PP
michael@0 548 \-1 | \-\-keyUsage keyword,keyword
michael@0 549 .RS 4
michael@0 550 Set an X\&.509 V3 Certificate Type Extension in the certificate\&. There are several available keywords:
michael@0 551 .sp
michael@0 552 .RS 4
michael@0 553 .ie n \{\
michael@0 554 \h'-04'\(bu\h'+03'\c
michael@0 555 .\}
michael@0 556 .el \{\
michael@0 557 .sp -1
michael@0 558 .IP \(bu 2.3
michael@0 559 .\}
michael@0 560 digitalSignature
michael@0 561 .RE
michael@0 562 .sp
michael@0 563 .RS 4
michael@0 564 .ie n \{\
michael@0 565 \h'-04'\(bu\h'+03'\c
michael@0 566 .\}
michael@0 567 .el \{\
michael@0 568 .sp -1
michael@0 569 .IP \(bu 2.3
michael@0 570 .\}
michael@0 571 nonRepudiation
michael@0 572 .RE
michael@0 573 .sp
michael@0 574 .RS 4
michael@0 575 .ie n \{\
michael@0 576 \h'-04'\(bu\h'+03'\c
michael@0 577 .\}
michael@0 578 .el \{\
michael@0 579 .sp -1
michael@0 580 .IP \(bu 2.3
michael@0 581 .\}
michael@0 582 keyEncipherment
michael@0 583 .RE
michael@0 584 .sp
michael@0 585 .RS 4
michael@0 586 .ie n \{\
michael@0 587 \h'-04'\(bu\h'+03'\c
michael@0 588 .\}
michael@0 589 .el \{\
michael@0 590 .sp -1
michael@0 591 .IP \(bu 2.3
michael@0 592 .\}
michael@0 593 dataEncipherment
michael@0 594 .RE
michael@0 595 .sp
michael@0 596 .RS 4
michael@0 597 .ie n \{\
michael@0 598 \h'-04'\(bu\h'+03'\c
michael@0 599 .\}
michael@0 600 .el \{\
michael@0 601 .sp -1
michael@0 602 .IP \(bu 2.3
michael@0 603 .\}
michael@0 604 keyAgreement
michael@0 605 .RE
michael@0 606 .sp
michael@0 607 .RS 4
michael@0 608 .ie n \{\
michael@0 609 \h'-04'\(bu\h'+03'\c
michael@0 610 .\}
michael@0 611 .el \{\
michael@0 612 .sp -1
michael@0 613 .IP \(bu 2.3
michael@0 614 .\}
michael@0 615 certSigning
michael@0 616 .RE
michael@0 617 .sp
michael@0 618 .RS 4
michael@0 619 .ie n \{\
michael@0 620 \h'-04'\(bu\h'+03'\c
michael@0 621 .\}
michael@0 622 .el \{\
michael@0 623 .sp -1
michael@0 624 .IP \(bu 2.3
michael@0 625 .\}
michael@0 626 crlSigning
michael@0 627 .RE
michael@0 628 .sp
michael@0 629 .RS 4
michael@0 630 .ie n \{\
michael@0 631 \h'-04'\(bu\h'+03'\c
michael@0 632 .\}
michael@0 633 .el \{\
michael@0 634 .sp -1
michael@0 635 .IP \(bu 2.3
michael@0 636 .\}
michael@0 637 critical
michael@0 638 .RE
michael@0 639 .RE
michael@0 640 .PP
michael@0 641 \-2
michael@0 642 .RS 4
michael@0 643 Add a basic constraint extension to a certificate that is being created or added to a database\&. This extension supports the certificate chain verification process\&.
michael@0 644 \fBcertutil\fR
michael@0 645 prompts for the certificate constraint extension to select\&.
michael@0 646 .sp
michael@0 647 X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 648 .RE
michael@0 649 .PP
michael@0 650 \-3
michael@0 651 .RS 4
michael@0 652 Add an authority key ID extension to a certificate that is being created or added to a database\&. This extension supports the identification of a particular certificate, from among multiple certificates associated with one subject name, as the correct issuer of a certificate\&. The Certificate Database Tool will prompt you to select the authority key ID extension\&.
michael@0 653 .sp
michael@0 654 X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 655 .RE
michael@0 656 .PP
michael@0 657 \-4
michael@0 658 .RS 4
michael@0 659 Add a CRL distribution point extension to a certificate that is being created or added to a database\&. This extension identifies the URL of a certificate\*(Aqs associated certificate revocation list (CRL)\&.
michael@0 660 \fBcertutil\fR
michael@0 661 prompts for the URL\&.
michael@0 662 .sp
michael@0 663 X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 664 .RE
michael@0 665 .PP
michael@0 666 \-5 | \-\-nsCertType keyword,keyword
michael@0 667 .RS 4
michael@0 668 Add an X\&.509 V3 certificate type extension to a certificate that is being created or added to the database\&. There are several available keywords:
michael@0 669 .sp
michael@0 670 .RS 4
michael@0 671 .ie n \{\
michael@0 672 \h'-04'\(bu\h'+03'\c
michael@0 673 .\}
michael@0 674 .el \{\
michael@0 675 .sp -1
michael@0 676 .IP \(bu 2.3
michael@0 677 .\}
michael@0 678 sslClient
michael@0 679 .RE
michael@0 680 .sp
michael@0 681 .RS 4
michael@0 682 .ie n \{\
michael@0 683 \h'-04'\(bu\h'+03'\c
michael@0 684 .\}
michael@0 685 .el \{\
michael@0 686 .sp -1
michael@0 687 .IP \(bu 2.3
michael@0 688 .\}
michael@0 689 sslServer
michael@0 690 .RE
michael@0 691 .sp
michael@0 692 .RS 4
michael@0 693 .ie n \{\
michael@0 694 \h'-04'\(bu\h'+03'\c
michael@0 695 .\}
michael@0 696 .el \{\
michael@0 697 .sp -1
michael@0 698 .IP \(bu 2.3
michael@0 699 .\}
michael@0 700 smime
michael@0 701 .RE
michael@0 702 .sp
michael@0 703 .RS 4
michael@0 704 .ie n \{\
michael@0 705 \h'-04'\(bu\h'+03'\c
michael@0 706 .\}
michael@0 707 .el \{\
michael@0 708 .sp -1
michael@0 709 .IP \(bu 2.3
michael@0 710 .\}
michael@0 711 objectSigning
michael@0 712 .RE
michael@0 713 .sp
michael@0 714 .RS 4
michael@0 715 .ie n \{\
michael@0 716 \h'-04'\(bu\h'+03'\c
michael@0 717 .\}
michael@0 718 .el \{\
michael@0 719 .sp -1
michael@0 720 .IP \(bu 2.3
michael@0 721 .\}
michael@0 722 sslCA
michael@0 723 .RE
michael@0 724 .sp
michael@0 725 .RS 4
michael@0 726 .ie n \{\
michael@0 727 \h'-04'\(bu\h'+03'\c
michael@0 728 .\}
michael@0 729 .el \{\
michael@0 730 .sp -1
michael@0 731 .IP \(bu 2.3
michael@0 732 .\}
michael@0 733 smimeCA
michael@0 734 .RE
michael@0 735 .sp
michael@0 736 .RS 4
michael@0 737 .ie n \{\
michael@0 738 \h'-04'\(bu\h'+03'\c
michael@0 739 .\}
michael@0 740 .el \{\
michael@0 741 .sp -1
michael@0 742 .IP \(bu 2.3
michael@0 743 .\}
michael@0 744 objectSigningCA
michael@0 745 .RE
michael@0 746 .sp
michael@0 747 .RS 4
michael@0 748 .ie n \{\
michael@0 749 \h'-04'\(bu\h'+03'\c
michael@0 750 .\}
michael@0 751 .el \{\
michael@0 752 .sp -1
michael@0 753 .IP \(bu 2.3
michael@0 754 .\}
michael@0 755 critical
michael@0 756 .RE
michael@0 757 .sp
michael@0 758 X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 759 .RE
michael@0 760 .PP
michael@0 761 \-6 | \-\-extKeyUsage keyword,keyword
michael@0 762 .RS 4
michael@0 763 Add an extended key usage extension to a certificate that is being created or added to the database\&. Several keywords are available:
michael@0 764 .sp
michael@0 765 .RS 4
michael@0 766 .ie n \{\
michael@0 767 \h'-04'\(bu\h'+03'\c
michael@0 768 .\}
michael@0 769 .el \{\
michael@0 770 .sp -1
michael@0 771 .IP \(bu 2.3
michael@0 772 .\}
michael@0 773 serverAuth
michael@0 774 .RE
michael@0 775 .sp
michael@0 776 .RS 4
michael@0 777 .ie n \{\
michael@0 778 \h'-04'\(bu\h'+03'\c
michael@0 779 .\}
michael@0 780 .el \{\
michael@0 781 .sp -1
michael@0 782 .IP \(bu 2.3
michael@0 783 .\}
michael@0 784 clientAuth
michael@0 785 .RE
michael@0 786 .sp
michael@0 787 .RS 4
michael@0 788 .ie n \{\
michael@0 789 \h'-04'\(bu\h'+03'\c
michael@0 790 .\}
michael@0 791 .el \{\
michael@0 792 .sp -1
michael@0 793 .IP \(bu 2.3
michael@0 794 .\}
michael@0 795 codeSigning
michael@0 796 .RE
michael@0 797 .sp
michael@0 798 .RS 4
michael@0 799 .ie n \{\
michael@0 800 \h'-04'\(bu\h'+03'\c
michael@0 801 .\}
michael@0 802 .el \{\
michael@0 803 .sp -1
michael@0 804 .IP \(bu 2.3
michael@0 805 .\}
michael@0 806 emailProtection
michael@0 807 .RE
michael@0 808 .sp
michael@0 809 .RS 4
michael@0 810 .ie n \{\
michael@0 811 \h'-04'\(bu\h'+03'\c
michael@0 812 .\}
michael@0 813 .el \{\
michael@0 814 .sp -1
michael@0 815 .IP \(bu 2.3
michael@0 816 .\}
michael@0 817 timeStamp
michael@0 818 .RE
michael@0 819 .sp
michael@0 820 .RS 4
michael@0 821 .ie n \{\
michael@0 822 \h'-04'\(bu\h'+03'\c
michael@0 823 .\}
michael@0 824 .el \{\
michael@0 825 .sp -1
michael@0 826 .IP \(bu 2.3
michael@0 827 .\}
michael@0 828 ocspResponder
michael@0 829 .RE
michael@0 830 .sp
michael@0 831 .RS 4
michael@0 832 .ie n \{\
michael@0 833 \h'-04'\(bu\h'+03'\c
michael@0 834 .\}
michael@0 835 .el \{\
michael@0 836 .sp -1
michael@0 837 .IP \(bu 2.3
michael@0 838 .\}
michael@0 839 stepUp
michael@0 840 .RE
michael@0 841 .sp
michael@0 842 .RS 4
michael@0 843 .ie n \{\
michael@0 844 \h'-04'\(bu\h'+03'\c
michael@0 845 .\}
michael@0 846 .el \{\
michael@0 847 .sp -1
michael@0 848 .IP \(bu 2.3
michael@0 849 .\}
michael@0 850 msTrustListSign
michael@0 851 .RE
michael@0 852 .sp
michael@0 853 .RS 4
michael@0 854 .ie n \{\
michael@0 855 \h'-04'\(bu\h'+03'\c
michael@0 856 .\}
michael@0 857 .el \{\
michael@0 858 .sp -1
michael@0 859 .IP \(bu 2.3
michael@0 860 .\}
michael@0 861 critical
michael@0 862 .RE
michael@0 863 .sp
michael@0 864 X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 865 .RE
michael@0 866 .PP
michael@0 867 \-7 emailAddrs
michael@0 868 .RS 4
michael@0 869 Add a comma\-separated list of email addresses to the subject alternative name extension of a certificate or certificate request that is being created or added to the database\&. Subject alternative name extensions are described in Section 4\&.2\&.1\&.7 of RFC 3280\&.
michael@0 870 .RE
michael@0 871 .PP
michael@0 872 \-8 dns\-names
michael@0 873 .RS 4
michael@0 874 Add a comma\-separated list of DNS names to the subject alternative name extension of a certificate or certificate request that is being created or added to the database\&. Subject alternative name extensions are described in Section 4\&.2\&.1\&.7 of RFC 3280\&.
michael@0 875 .RE
michael@0 876 .PP
michael@0 877 \-\-extAIA
michael@0 878 .RS 4
michael@0 879 Add the Authority Information Access extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 880 .RE
michael@0 881 .PP
michael@0 882 \-\-extSIA
michael@0 883 .RS 4
michael@0 884 Add the Subject Information Access extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 885 .RE
michael@0 886 .PP
michael@0 887 \-\-extCP
michael@0 888 .RS 4
michael@0 889 Add the Certificate Policies extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 890 .RE
michael@0 891 .PP
michael@0 892 \-\-extPM
michael@0 893 .RS 4
michael@0 894 Add the Policy Mappings extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 895 .RE
michael@0 896 .PP
michael@0 897 \-\-extPC
michael@0 898 .RS 4
michael@0 899 Add the Policy Constraints extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 900 .RE
michael@0 901 .PP
michael@0 902 \-\-extIA
michael@0 903 .RS 4
michael@0 904 Add the Inhibit Any Policy Access extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 905 .RE
michael@0 906 .PP
michael@0 907 \-\-extSKID
michael@0 908 .RS 4
michael@0 909 Add the Subject Key ID extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 910 .RE
michael@0 911 .PP
michael@0 912 \-\-extNC
michael@0 913 .RS 4
michael@0 914 Add a Name Constraint extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&.
michael@0 915 .RE
michael@0 916 .PP
michael@0 917 \-\-empty\-password
michael@0 918 .RS 4
michael@0 919 Use empty password when creating new certificate database with \-N\&.
michael@0 920 .RE
michael@0 921 .PP
michael@0 922 \-\-keyAttrFlags attrflags
michael@0 923 .RS 4
michael@0 924 PKCS #11 key Attributes\&. Comma separated list of key attribute flags, selected from the following list of choices: {token | session} {public | private} {sensitive | insensitive} {modifiable | unmodifiable} {extractable | unextractable}
michael@0 925 .RE
michael@0 926 .PP
michael@0 927 \-\-keyOpFlagsOn opflags, \-\-keyOpFlagsOff opflags
michael@0 928 .RS 4
michael@0 929 PKCS #11 key Operation Flags\&. Comma separated list of one or more of the following: {token | session} {public | private} {sensitive | insensitive} {modifiable | unmodifiable} {extractable | unextractable}
michael@0 930 .RE
michael@0 931 .PP
michael@0 932 \-\-source\-dir certdir
michael@0 933 .RS 4
michael@0 934 Identify the certificate database directory to upgrade\&.
michael@0 935 .RE
michael@0 936 .PP
michael@0 937 \-\-source\-prefix certdir
michael@0 938 .RS 4
michael@0 939 Give the prefix of the certificate and key databases to upgrade\&.
michael@0 940 .RE
michael@0 941 .PP
michael@0 942 \-\-upgrade\-id uniqueID
michael@0 943 .RS 4
michael@0 944 Give the unique ID of the database to upgrade\&.
michael@0 945 .RE
michael@0 946 .PP
michael@0 947 \-\-upgrade\-token\-name name
michael@0 948 .RS 4
michael@0 949 Set the name of the token to use while it is being upgraded\&.
michael@0 950 .RE
michael@0 951 .PP
michael@0 952 \-@ pwfile
michael@0 953 .RS 4
michael@0 954 Give the name of a password file to use for the database being upgraded\&.
michael@0 955 .RE
michael@0 956 .SH "USAGE AND EXAMPLES"
michael@0 957 .PP
michael@0 958 Most of the command options in the examples listed here have more arguments available\&. The arguments included in these examples are the most common ones or are used to illustrate a specific scenario\&. Use the
michael@0 959 \fB\-H\fR
michael@0 960 option to show the complete list of arguments for each command option\&.
michael@0 961 .PP
michael@0 962 \fBCreating New Security Databases\fR
michael@0 963 .PP
michael@0 964 Certificates, keys, and security modules related to managing certificates are stored in three related databases:
michael@0 965 .sp
michael@0 966 .RS 4
michael@0 967 .ie n \{\
michael@0 968 \h'-04'\(bu\h'+03'\c
michael@0 969 .\}
michael@0 970 .el \{\
michael@0 971 .sp -1
michael@0 972 .IP \(bu 2.3
michael@0 973 .\}
michael@0 974 cert8\&.db or cert9\&.db
michael@0 975 .RE
michael@0 976 .sp
michael@0 977 .RS 4
michael@0 978 .ie n \{\
michael@0 979 \h'-04'\(bu\h'+03'\c
michael@0 980 .\}
michael@0 981 .el \{\
michael@0 982 .sp -1
michael@0 983 .IP \(bu 2.3
michael@0 984 .\}
michael@0 985 key3\&.db or key4\&.db
michael@0 986 .RE
michael@0 987 .sp
michael@0 988 .RS 4
michael@0 989 .ie n \{\
michael@0 990 \h'-04'\(bu\h'+03'\c
michael@0 991 .\}
michael@0 992 .el \{\
michael@0 993 .sp -1
michael@0 994 .IP \(bu 2.3
michael@0 995 .\}
michael@0 996 secmod\&.db or pkcs11\&.txt
michael@0 997 .RE
michael@0 998 .PP
michael@0 999 These databases must be created before certificates or keys can be generated\&.
michael@0 1000 .sp
michael@0 1001 .if n \{\
michael@0 1002 .RS 4
michael@0 1003 .\}
michael@0 1004 .nf
michael@0 1005 certutil \-N \-d [sql:]directory
michael@0 1006 .fi
michael@0 1007 .if n \{\
michael@0 1008 .RE
michael@0 1009 .\}
michael@0 1010 .PP
michael@0 1011 \fBCreating a Certificate Request\fR
michael@0 1012 .PP
michael@0 1013 A certificate request contains most or all of the information that is used to generate the final certificate\&. This request is submitted separately to a certificate authority and is then approved by some mechanism (automatically or by human review)\&. Once the request is approved, then the certificate is generated\&.
michael@0 1014 .sp
michael@0 1015 .if n \{\
michael@0 1016 .RS 4
michael@0 1017 .\}
michael@0 1018 .nf
michael@0 1019 $ certutil \-R \-k key\-type\-or\-id [\-q pqgfile|curve\-name] \-g key\-size \-s subject [\-h tokenname] \-d [sql:]directory [\-p phone] [\-o output\-file] [\-a]
michael@0 1020 .fi
michael@0 1021 .if n \{\
michael@0 1022 .RE
michael@0 1023 .\}
michael@0 1024 .PP
michael@0 1025 The
michael@0 1026 \fB\-R\fR
michael@0 1027 command options requires four arguments:
michael@0 1028 .sp
michael@0 1029 .RS 4
michael@0 1030 .ie n \{\
michael@0 1031 \h'-04'\(bu\h'+03'\c
michael@0 1032 .\}
michael@0 1033 .el \{\
michael@0 1034 .sp -1
michael@0 1035 .IP \(bu 2.3
michael@0 1036 .\}
michael@0 1037 \fB\-k\fR
michael@0 1038 to specify either the key type to generate or, when renewing a certificate, the existing key pair to use
michael@0 1039 .RE
michael@0 1040 .sp
michael@0 1041 .RS 4
michael@0 1042 .ie n \{\
michael@0 1043 \h'-04'\(bu\h'+03'\c
michael@0 1044 .\}
michael@0 1045 .el \{\
michael@0 1046 .sp -1
michael@0 1047 .IP \(bu 2.3
michael@0 1048 .\}
michael@0 1049 \fB\-g\fR
michael@0 1050 to set the keysize of the key to generate
michael@0 1051 .RE
michael@0 1052 .sp
michael@0 1053 .RS 4
michael@0 1054 .ie n \{\
michael@0 1055 \h'-04'\(bu\h'+03'\c
michael@0 1056 .\}
michael@0 1057 .el \{\
michael@0 1058 .sp -1
michael@0 1059 .IP \(bu 2.3
michael@0 1060 .\}
michael@0 1061 \fB\-s\fR
michael@0 1062 to set the subject name of the certificate
michael@0 1063 .RE
michael@0 1064 .sp
michael@0 1065 .RS 4
michael@0 1066 .ie n \{\
michael@0 1067 \h'-04'\(bu\h'+03'\c
michael@0 1068 .\}
michael@0 1069 .el \{\
michael@0 1070 .sp -1
michael@0 1071 .IP \(bu 2.3
michael@0 1072 .\}
michael@0 1073 \fB\-d\fR
michael@0 1074 to give the security database directory
michael@0 1075 .RE
michael@0 1076 .PP
michael@0 1077 The new certificate request can be output in ASCII format (\fB\-a\fR) or can be written to a specified file (\fB\-o\fR)\&.
michael@0 1078 .PP
michael@0 1079 For example:
michael@0 1080 .sp
michael@0 1081 .if n \{\
michael@0 1082 .RS 4
michael@0 1083 .\}
michael@0 1084 .nf
michael@0 1085 $ certutil \-R \-k rsa \-g 1024 \-s "CN=John Smith,O=Example Corp,L=Mountain View,ST=California,C=US" \-d sql:$HOME/nssdb \-p 650\-555\-0123 \-a \-o cert\&.cer
michael@0 1086
michael@0 1087 Generating key\&. This may take a few moments\&.\&.\&.
michael@0 1088
michael@0 1089 .fi
michael@0 1090 .if n \{\
michael@0 1091 .RE
michael@0 1092 .\}
michael@0 1093 .PP
michael@0 1094 \fBCreating a Certificate\fR
michael@0 1095 .PP
michael@0 1096 A valid certificate must be issued by a trusted CA\&. This can be done by specifying a CA certificate (\fB\-c\fR) that is stored in the certificate database\&. If a CA key pair is not available, you can create a self\-signed certificate using the
michael@0 1097 \fB\-x\fR
michael@0 1098 argument with the
michael@0 1099 \fB\-S\fR
michael@0 1100 command option\&.
michael@0 1101 .sp
michael@0 1102 .if n \{\
michael@0 1103 .RS 4
michael@0 1104 .\}
michael@0 1105 .nf
michael@0 1106 $ certutil \-S \-k rsa|dsa|ec \-n certname \-s subject [\-c issuer |\-x] \-t trustargs \-d [sql:]directory [\-m serial\-number] [\-v valid\-months] [\-w offset\-months] [\-p phone] [\-1] [\-2] [\-3] [\-4] [\-5 keyword] [\-6 keyword] [\-7 emailAddress] [\-8 dns\-names] [\-\-extAIA] [\-\-extSIA] [\-\-extCP] [\-\-extPM] [\-\-extPC] [\-\-extIA] [\-\-extSKID]
michael@0 1107 .fi
michael@0 1108 .if n \{\
michael@0 1109 .RE
michael@0 1110 .\}
michael@0 1111 .PP
michael@0 1112 The series of numbers and
michael@0 1113 \fB\-\-ext*\fR
michael@0 1114 options set certificate extensions that can be added to the certificate when it is generated by the CA\&. Interactive prompts will result\&.
michael@0 1115 .PP
michael@0 1116 For example, this creates a self\-signed certificate:
michael@0 1117 .sp
michael@0 1118 .if n \{\
michael@0 1119 .RS 4
michael@0 1120 .\}
michael@0 1121 .nf
michael@0 1122 $ certutil \-S \-s "CN=Example CA" \-n my\-ca\-cert \-x \-t "C,C,C" \-1 \-2 \-5 \-m 3650
michael@0 1123 .fi
michael@0 1124 .if n \{\
michael@0 1125 .RE
michael@0 1126 .\}
michael@0 1127 .PP
michael@0 1128 The interative prompts for key usage and whether any extensions are critical and responses have been ommitted for brevity\&.
michael@0 1129 .PP
michael@0 1130 From there, new certificates can reference the self\-signed certificate:
michael@0 1131 .sp
michael@0 1132 .if n \{\
michael@0 1133 .RS 4
michael@0 1134 .\}
michael@0 1135 .nf
michael@0 1136 $ certutil \-S \-s "CN=My Server Cert" \-n my\-server\-cert \-c "my\-ca\-cert" \-t "u,u,u" \-1 \-5 \-6 \-8 \-m 730
michael@0 1137 .fi
michael@0 1138 .if n \{\
michael@0 1139 .RE
michael@0 1140 .\}
michael@0 1141 .PP
michael@0 1142 \fBGenerating a Certificate from a Certificate Request\fR
michael@0 1143 .PP
michael@0 1144 When a certificate request is created, a certificate can be generated by using the request and then referencing a certificate authority signing certificate (the
michael@0 1145 \fIissuer\fR
michael@0 1146 specified in the
michael@0 1147 \fB\-c\fR
michael@0 1148 argument)\&. The issuing certificate must be in the certificate database in the specified directory\&.
michael@0 1149 .sp
michael@0 1150 .if n \{\
michael@0 1151 .RS 4
michael@0 1152 .\}
michael@0 1153 .nf
michael@0 1154 certutil \-C \-c issuer \-i cert\-request\-file \-o output\-file [\-m serial\-number] [\-v valid\-months] [\-w offset\-months] \-d [sql:]directory [\-1] [\-2] [\-3] [\-4] [\-5 keyword] [\-6 keyword] [\-7 emailAddress] [\-8 dns\-names]
michael@0 1155 .fi
michael@0 1156 .if n \{\
michael@0 1157 .RE
michael@0 1158 .\}
michael@0 1159 .PP
michael@0 1160 For example:
michael@0 1161 .sp
michael@0 1162 .if n \{\
michael@0 1163 .RS 4
michael@0 1164 .\}
michael@0 1165 .nf
michael@0 1166 $ certutil \-C \-c "my\-ca\-cert" \-i /home/certs/cert\&.req \-o cert\&.cer \-m 010 \-v 12 \-w 1 \-d sql:$HOME/nssdb \-1 nonRepudiation,dataEncipherment \-5 sslClient \-6 clientAuth \-7 jsmith@example\&.com
michael@0 1167 .fi
michael@0 1168 .if n \{\
michael@0 1169 .RE
michael@0 1170 .\}
michael@0 1171 .PP
michael@0 1172 \fBListing Certificates\fR
michael@0 1173 .PP
michael@0 1174 The
michael@0 1175 \fB\-L\fR
michael@0 1176 command option lists all of the certificates listed in the certificate database\&. The path to the directory (\fB\-d\fR) is required\&.
michael@0 1177 .sp
michael@0 1178 .if n \{\
michael@0 1179 .RS 4
michael@0 1180 .\}
michael@0 1181 .nf
michael@0 1182 $ certutil \-L \-d sql:/home/my/sharednssdb
michael@0 1183
michael@0 1184 Certificate Nickname Trust Attributes
michael@0 1185 SSL,S/MIME,JAR/XPI
michael@0 1186
michael@0 1187 CA Administrator of Instance pki\-ca1\*(Aqs Example Domain ID u,u,u
michael@0 1188 TPS Administrator\*(Aqs Example Domain ID u,u,u
michael@0 1189 Google Internet Authority ,,
michael@0 1190 Certificate Authority \- Example Domain CT,C,C
michael@0 1191 .fi
michael@0 1192 .if n \{\
michael@0 1193 .RE
michael@0 1194 .\}
michael@0 1195 .PP
michael@0 1196 Using additional arguments with
michael@0 1197 \fB\-L\fR
michael@0 1198 can return and print the information for a single, specific certificate\&. For example, the
michael@0 1199 \fB\-n\fR
michael@0 1200 argument passes the certificate name, while the
michael@0 1201 \fB\-a\fR
michael@0 1202 argument prints the certificate in ASCII format:
michael@0 1203 .sp
michael@0 1204 .if n \{\
michael@0 1205 .RS 4
michael@0 1206 .\}
michael@0 1207 .nf
michael@0 1208 $ certutil \-L \-d sql:$HOME/nssdb \-a \-n my\-ca\-cert
michael@0 1209 \-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-
michael@0 1210 MIIB1DCCAT2gAwIBAgICDkIwDQYJKoZIhvcNAQEFBQAwFTETMBEGA1UEAxMKRXhh
michael@0 1211 bXBsZSBDQTAeFw0xMzAzMTMxOTEwMjlaFw0xMzA2MTMxOTEwMjlaMBUxEzARBgNV
michael@0 1212 BAMTCkV4YW1wbGUgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJ4Kzqvz
michael@0 1213 JyBVgFqDXRYSyTBNw1DrxUU/3GvWA/ngjAwHEv0Cul/6sO/gsCvnABHiH6unns6x
michael@0 1214 XRzPORlC2WY3gkk7vmlsLvYpyecNazAi/NAwVnU/66HOsaoVFWE+gBQo99UrN2yk
michael@0 1215 0BiK/GMFlLm5dXQROgA9ZKKyFdI0LIXtf6SbAgMBAAGjMzAxMBEGCWCGSAGG+EIB
michael@0 1216 AQQEAwIHADAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQEAwICBDANBgkqhkiG9w0B
michael@0 1217 AQUFAAOBgQA6chkzkACN281d1jKMrc+RHG2UMaQyxiteaLVZO+Ro1nnRUvseDf09
michael@0 1218 XKYFwPMJjWCihVku6bw/ihZfuMHhxK22Nue6inNQ6eDu7WmrqL8z3iUrQwxs+WiF
michael@0 1219 ob2rb8XRVVJkzXdXxlk4uo3UtNvw8sAz7sWD71qxKaIHU5q49zijfg==
michael@0 1220 \-\-\-\-\-END CERTIFICATE\-\-\-\-\-
michael@0 1221 .fi
michael@0 1222 .if n \{\
michael@0 1223 .RE
michael@0 1224 .\}
michael@0 1225 .PP
michael@0 1226 For a human\-readable display
michael@0 1227 .sp
michael@0 1228 .if n \{\
michael@0 1229 .RS 4
michael@0 1230 .\}
michael@0 1231 .nf
michael@0 1232 $ certutil \-L \-d sql:$HOME/nssdb \-n my\-ca\-cert
michael@0 1233 Certificate:
michael@0 1234 Data:
michael@0 1235 Version: 3 (0x2)
michael@0 1236 Serial Number: 3650 (0xe42)
michael@0 1237 Signature Algorithm: PKCS #1 SHA\-1 With RSA Encryption
michael@0 1238 Issuer: "CN=Example CA"
michael@0 1239 Validity:
michael@0 1240 Not Before: Wed Mar 13 19:10:29 2013
michael@0 1241 Not After : Thu Jun 13 19:10:29 2013
michael@0 1242 Subject: "CN=Example CA"
michael@0 1243 Subject Public Key Info:
michael@0 1244 Public Key Algorithm: PKCS #1 RSA Encryption
michael@0 1245 RSA Public Key:
michael@0 1246 Modulus:
michael@0 1247 9e:0a:ce:ab:f3:27:20:55:80:5a:83:5d:16:12:c9:30:
michael@0 1248 4d:c3:50:eb:c5:45:3f:dc:6b:d6:03:f9:e0:8c:0c:07:
michael@0 1249 12:fd:02:ba:5f:fa:b0:ef:e0:b0:2b:e7:00:11:e2:1f:
michael@0 1250 ab:a7:9e:ce:b1:5d:1c:cf:39:19:42:d9:66:37:82:49:
michael@0 1251 3b:be:69:6c:2e:f6:29:c9:e7:0d:6b:30:22:fc:d0:30:
michael@0 1252 56:75:3f:eb:a1:ce:b1:aa:15:15:61:3e:80:14:28:f7:
michael@0 1253 d5:2b:37:6c:a4:d0:18:8a:fc:63:05:94:b9:b9:75:74:
michael@0 1254 11:3a:00:3d:64:a2:b2:15:d2:34:2c:85:ed:7f:a4:9b
michael@0 1255 Exponent: 65537 (0x10001)
michael@0 1256 Signed Extensions:
michael@0 1257 Name: Certificate Type
michael@0 1258 Data: none
michael@0 1259
michael@0 1260 Name: Certificate Basic Constraints
michael@0 1261 Data: Is a CA with no maximum path length\&.
michael@0 1262
michael@0 1263 Name: Certificate Key Usage
michael@0 1264 Critical: True
michael@0 1265 Usages: Certificate Signing
michael@0 1266
michael@0 1267 Signature Algorithm: PKCS #1 SHA\-1 With RSA Encryption
michael@0 1268 Signature:
michael@0 1269 3a:72:19:33:90:00:8d:db:cd:5d:d6:32:8c:ad:cf:91:
michael@0 1270 1c:6d:94:31:a4:32:c6:2b:5e:68:b5:59:3b:e4:68:d6:
michael@0 1271 79:d1:52:fb:1e:0d:fd:3d:5c:a6:05:c0:f3:09:8d:60:
michael@0 1272 a2:85:59:2e:e9:bc:3f:8a:16:5f:b8:c1:e1:c4:ad:b6:
michael@0 1273 36:e7:ba:8a:73:50:e9:e0:ee:ed:69:ab:a8:bf:33:de:
michael@0 1274 25:2b:43:0c:6c:f9:68:85:a1:bd:ab:6f:c5:d1:55:52:
michael@0 1275 64:cd:77:57:c6:59:38:ba:8d:d4:b4:db:f0:f2:c0:33:
michael@0 1276 ee:c5:83:ef:5a:b1:29:a2:07:53:9a:b8:f7:38:a3:7e
michael@0 1277 Fingerprint (MD5):
michael@0 1278 86:D8:A5:8B:8A:26:BE:9E:17:A8:7B:66:10:6B:27:80
michael@0 1279 Fingerprint (SHA1):
michael@0 1280 48:78:09:EF:C5:D4:0C:BD:D2:64:45:59:EB:03:13:15:F7:A9:D6:F7
michael@0 1281
michael@0 1282 Certificate Trust Flags:
michael@0 1283 SSL Flags:
michael@0 1284 Valid CA
michael@0 1285 Trusted CA
michael@0 1286 User
michael@0 1287 Email Flags:
michael@0 1288 Valid CA
michael@0 1289 Trusted CA
michael@0 1290 User
michael@0 1291 Object Signing Flags:
michael@0 1292 Valid CA
michael@0 1293 Trusted CA
michael@0 1294 User
michael@0 1295
michael@0 1296 .fi
michael@0 1297 .if n \{\
michael@0 1298 .RE
michael@0 1299 .\}
michael@0 1300 .PP
michael@0 1301 \fBListing Keys\fR
michael@0 1302 .PP
michael@0 1303 Keys are the original material used to encrypt certificate data\&. The keys generated for certificates are stored separately, in the key database\&.
michael@0 1304 .PP
michael@0 1305 To list all keys in the database, use the
michael@0 1306 \fB\-K\fR
michael@0 1307 command option and the (required)
michael@0 1308 \fB\-d\fR
michael@0 1309 argument to give the path to the directory\&.
michael@0 1310 .sp
michael@0 1311 .if n \{\
michael@0 1312 .RS 4
michael@0 1313 .\}
michael@0 1314 .nf
michael@0 1315 $ certutil \-K \-d sql:$HOME/nssdb
michael@0 1316 certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services "
michael@0 1317 < 0> rsa 455a6673bde9375c2887ec8bf8016b3f9f35861d Thawte Freemail Member\*(Aqs Thawte Consulting (Pty) Ltd\&. ID
michael@0 1318 < 1> rsa 40defeeb522ade11090eacebaaf1196a172127df Example Domain Administrator Cert
michael@0 1319 < 2> rsa 1d0b06f44f6c03842f7d4f4a1dc78b3bcd1b85a5 John Smith user cert
michael@0 1320 .fi
michael@0 1321 .if n \{\
michael@0 1322 .RE
michael@0 1323 .\}
michael@0 1324 .PP
michael@0 1325 There are ways to narrow the keys listed in the search results:
michael@0 1326 .sp
michael@0 1327 .RS 4
michael@0 1328 .ie n \{\
michael@0 1329 \h'-04'\(bu\h'+03'\c
michael@0 1330 .\}
michael@0 1331 .el \{\
michael@0 1332 .sp -1
michael@0 1333 .IP \(bu 2.3
michael@0 1334 .\}
michael@0 1335 To return a specific key, use the
michael@0 1336 \fB\-n\fR\fIname\fR
michael@0 1337 argument with the name of the key\&.
michael@0 1338 .RE
michael@0 1339 .sp
michael@0 1340 .RS 4
michael@0 1341 .ie n \{\
michael@0 1342 \h'-04'\(bu\h'+03'\c
michael@0 1343 .\}
michael@0 1344 .el \{\
michael@0 1345 .sp -1
michael@0 1346 .IP \(bu 2.3
michael@0 1347 .\}
michael@0 1348 If there are multiple security devices loaded, then the
michael@0 1349 \fB\-h\fR\fItokenname\fR
michael@0 1350 argument can search a specific token or all tokens\&.
michael@0 1351 .RE
michael@0 1352 .sp
michael@0 1353 .RS 4
michael@0 1354 .ie n \{\
michael@0 1355 \h'-04'\(bu\h'+03'\c
michael@0 1356 .\}
michael@0 1357 .el \{\
michael@0 1358 .sp -1
michael@0 1359 .IP \(bu 2.3
michael@0 1360 .\}
michael@0 1361 If there are multiple key types available, then the
michael@0 1362 \fB\-k\fR\fIkey\-type\fR
michael@0 1363 argument can search a specific type of key, like RSA, DSA, or ECC\&.
michael@0 1364 .RE
michael@0 1365 .PP
michael@0 1366 \fBListing Security Modules\fR
michael@0 1367 .PP
michael@0 1368 The devices that can be used to store certificates \-\- both internal databases and external devices like smart cards \-\- are recognized and used by loading security modules\&. The
michael@0 1369 \fB\-U\fR
michael@0 1370 command option lists all of the security modules listed in the
michael@0 1371 secmod\&.db
michael@0 1372 database\&. The path to the directory (\fB\-d\fR) is required\&.
michael@0 1373 .sp
michael@0 1374 .if n \{\
michael@0 1375 .RS 4
michael@0 1376 .\}
michael@0 1377 .nf
michael@0 1378 $ certutil \-U \-d sql:/home/my/sharednssdb
michael@0 1379
michael@0 1380 slot: NSS User Private Key and Certificate Services
michael@0 1381 token: NSS Certificate DB
michael@0 1382
michael@0 1383 slot: NSS Internal Cryptographic Services
michael@0 1384 token: NSS Generic Crypto Services
michael@0 1385 .fi
michael@0 1386 .if n \{\
michael@0 1387 .RE
michael@0 1388 .\}
michael@0 1389 .PP
michael@0 1390 \fBAdding Certificates to the Database\fR
michael@0 1391 .PP
michael@0 1392 Existing certificates or certificate requests can be added manually to the certificate database, even if they were generated elsewhere\&. This uses the
michael@0 1393 \fB\-A\fR
michael@0 1394 command option\&.
michael@0 1395 .sp
michael@0 1396 .if n \{\
michael@0 1397 .RS 4
michael@0 1398 .\}
michael@0 1399 .nf
michael@0 1400 certutil \-A \-n certname \-t trustargs \-d [sql:]directory [\-a] [\-i input\-file]
michael@0 1401 .fi
michael@0 1402 .if n \{\
michael@0 1403 .RE
michael@0 1404 .\}
michael@0 1405 .PP
michael@0 1406 For example:
michael@0 1407 .sp
michael@0 1408 .if n \{\
michael@0 1409 .RS 4
michael@0 1410 .\}
michael@0 1411 .nf
michael@0 1412 $ certutil \-A \-n "CN=My SSL Certificate" \-t "u,u,u" \-d sql:/home/my/sharednssdb \-i /home/example\-certs/cert\&.cer
michael@0 1413 .fi
michael@0 1414 .if n \{\
michael@0 1415 .RE
michael@0 1416 .\}
michael@0 1417 .PP
michael@0 1418 A related command option,
michael@0 1419 \fB\-E\fR, is used specifically to add email certificates to the certificate database\&. The
michael@0 1420 \fB\-E\fR
michael@0 1421 command has the same arguments as the
michael@0 1422 \fB\-A\fR
michael@0 1423 command\&. The trust arguments for certificates have the format
michael@0 1424 \fISSL,S/MIME,Code\-signing\fR, so the middle trust settings relate most to email certificates (though the others can be set)\&. For example:
michael@0 1425 .sp
michael@0 1426 .if n \{\
michael@0 1427 .RS 4
michael@0 1428 .\}
michael@0 1429 .nf
michael@0 1430 $ certutil \-E \-n "CN=John Smith Email Cert" \-t ",Pu," \-d sql:/home/my/sharednssdb \-i /home/example\-certs/email\&.cer
michael@0 1431 .fi
michael@0 1432 .if n \{\
michael@0 1433 .RE
michael@0 1434 .\}
michael@0 1435 .PP
michael@0 1436 \fBDeleting Certificates to the Database\fR
michael@0 1437 .PP
michael@0 1438 Certificates can be deleted from a database using the
michael@0 1439 \fB\-D\fR
michael@0 1440 option\&. The only required options are to give the security database directory and to identify the certificate nickname\&.
michael@0 1441 .sp
michael@0 1442 .if n \{\
michael@0 1443 .RS 4
michael@0 1444 .\}
michael@0 1445 .nf
michael@0 1446 certutil \-D \-d [sql:]directory \-n "nickname"
michael@0 1447 .fi
michael@0 1448 .if n \{\
michael@0 1449 .RE
michael@0 1450 .\}
michael@0 1451 .PP
michael@0 1452 For example:
michael@0 1453 .sp
michael@0 1454 .if n \{\
michael@0 1455 .RS 4
michael@0 1456 .\}
michael@0 1457 .nf
michael@0 1458 $ certutil \-D \-d sql:/home/my/sharednssdb \-n "my\-ssl\-cert"
michael@0 1459 .fi
michael@0 1460 .if n \{\
michael@0 1461 .RE
michael@0 1462 .\}
michael@0 1463 .PP
michael@0 1464 \fBValidating Certificates\fR
michael@0 1465 .PP
michael@0 1466 A certificate contains an expiration date in itself, and expired certificates are easily rejected\&. However, certificates can also be revoked before they hit their expiration date\&. Checking whether a certificate has been revoked requires validating the certificate\&. Validation can also be used to ensure that the certificate is only used for the purposes it was initially issued for\&. Validation is carried out by the
michael@0 1467 \fB\-V\fR
michael@0 1468 command option\&.
michael@0 1469 .sp
michael@0 1470 .if n \{\
michael@0 1471 .RS 4
michael@0 1472 .\}
michael@0 1473 .nf
michael@0 1474 certutil \-V \-n certificate\-name [\-b time] [\-e] [\-u cert\-usage] \-d [sql:]directory
michael@0 1475 .fi
michael@0 1476 .if n \{\
michael@0 1477 .RE
michael@0 1478 .\}
michael@0 1479 .PP
michael@0 1480 For example, to validate an email certificate:
michael@0 1481 .sp
michael@0 1482 .if n \{\
michael@0 1483 .RS 4
michael@0 1484 .\}
michael@0 1485 .nf
michael@0 1486 $ certutil \-V \-n "John Smith\*(Aqs Email Cert" \-e \-u S,R \-d sql:/home/my/sharednssdb
michael@0 1487 .fi
michael@0 1488 .if n \{\
michael@0 1489 .RE
michael@0 1490 .\}
michael@0 1491 .PP
michael@0 1492 \fBModifying Certificate Trust Settings\fR
michael@0 1493 .PP
michael@0 1494 The trust settings (which relate to the operations that a certificate is allowed to be used for) can be changed after a certificate is created or added to the database\&. This is especially useful for CA certificates, but it can be performed for any type of certificate\&.
michael@0 1495 .sp
michael@0 1496 .if n \{\
michael@0 1497 .RS 4
michael@0 1498 .\}
michael@0 1499 .nf
michael@0 1500 certutil \-M \-n certificate\-name \-t trust\-args \-d [sql:]directory
michael@0 1501 .fi
michael@0 1502 .if n \{\
michael@0 1503 .RE
michael@0 1504 .\}
michael@0 1505 .PP
michael@0 1506 For example:
michael@0 1507 .sp
michael@0 1508 .if n \{\
michael@0 1509 .RS 4
michael@0 1510 .\}
michael@0 1511 .nf
michael@0 1512 $ certutil \-M \-n "My CA Certificate" \-d sql:/home/my/sharednssdb \-t "CTu,CTu,CTu"
michael@0 1513 .fi
michael@0 1514 .if n \{\
michael@0 1515 .RE
michael@0 1516 .\}
michael@0 1517 .PP
michael@0 1518 \fBPrinting the Certificate Chain\fR
michael@0 1519 .PP
michael@0 1520 Certificates can be issued in
michael@0 1521 \fIchains\fR
michael@0 1522 because every certificate authority itself has a certificate; when a CA issues a certificate, it essentially stamps that certificate with its own fingerprint\&. The
michael@0 1523 \fB\-O\fR
michael@0 1524 prints the full chain of a certificate, going from the initial CA (the root CA) through ever intermediary CA to the actual certificate\&. For example, for an email certificate with two CAs in the chain:
michael@0 1525 .sp
michael@0 1526 .if n \{\
michael@0 1527 .RS 4
michael@0 1528 .\}
michael@0 1529 .nf
michael@0 1530 $ certutil \-d sql:/home/my/sharednssdb \-O \-n "jsmith@example\&.com"
michael@0 1531 "Builtin Object Token:Thawte Personal Freemail CA" [E=personal\-freemail@thawte\&.com,CN=Thawte Personal Freemail CA,OU=Certification Services Division,O=Thawte Consulting,L=Cape Town,ST=Western Cape,C=ZA]
michael@0 1532
michael@0 1533 "Thawte Personal Freemail Issuing CA \- Thawte Consulting" [CN=Thawte Personal Freemail Issuing CA,O=Thawte Consulting (Pty) Ltd\&.,C=ZA]
michael@0 1534
michael@0 1535 "(null)" [E=jsmith@example\&.com,CN=Thawte Freemail Member]
michael@0 1536 .fi
michael@0 1537 .if n \{\
michael@0 1538 .RE
michael@0 1539 .\}
michael@0 1540 .PP
michael@0 1541 \fBResetting a Token\fR
michael@0 1542 .PP
michael@0 1543 The device which stores certificates \-\- both external hardware devices and internal software databases \-\- can be blanked and reused\&. This operation is performed on the device which stores the data, not directly on the security databases, so the location must be referenced through the token name (\fB\-h\fR) as well as any directory path\&. If there is no external token used, the default value is internal\&.
michael@0 1544 .sp
michael@0 1545 .if n \{\
michael@0 1546 .RS 4
michael@0 1547 .\}
michael@0 1548 .nf
michael@0 1549 certutil \-T \-d [sql:]directory \-h token\-name \-0 security\-officer\-password
michael@0 1550 .fi
michael@0 1551 .if n \{\
michael@0 1552 .RE
michael@0 1553 .\}
michael@0 1554 .PP
michael@0 1555 Many networks have dedicated personnel who handle changes to security tokens (the security officer)\&. This person must supply the password to access the specified token\&. For example:
michael@0 1556 .sp
michael@0 1557 .if n \{\
michael@0 1558 .RS 4
michael@0 1559 .\}
michael@0 1560 .nf
michael@0 1561 $ certutil \-T \-d sql:/home/my/sharednssdb \-h nethsm \-0 secret
michael@0 1562 .fi
michael@0 1563 .if n \{\
michael@0 1564 .RE
michael@0 1565 .\}
michael@0 1566 .PP
michael@0 1567 \fBUpgrading or Merging the Security Databases\fR
michael@0 1568 .PP
michael@0 1569 Many networks or applications may be using older BerkeleyDB versions of the certificate database (cert8\&.db)\&. Databases can be upgraded to the new SQLite version of the database (cert9\&.db) using the
michael@0 1570 \fB\-\-upgrade\-merge\fR
michael@0 1571 command option or existing databases can be merged with the new
michael@0 1572 cert9\&.db
michael@0 1573 databases using the
michael@0 1574 \fB\-\-\-merge\fR
michael@0 1575 command\&.
michael@0 1576 .PP
michael@0 1577 The
michael@0 1578 \fB\-\-upgrade\-merge\fR
michael@0 1579 command must give information about the original database and then use the standard arguments (like
michael@0 1580 \fB\-d\fR) to give the information about the new databases\&. The command also requires information that the tool uses for the process to upgrade and write over the original database\&.
michael@0 1581 .sp
michael@0 1582 .if n \{\
michael@0 1583 .RS 4
michael@0 1584 .\}
michael@0 1585 .nf
michael@0 1586 certutil \-\-upgrade\-merge \-d [sql:]directory [\-P dbprefix] \-\-source\-dir directory \-\-source\-prefix dbprefix \-\-upgrade\-id id \-\-upgrade\-token\-name name [\-@ password\-file]
michael@0 1587 .fi
michael@0 1588 .if n \{\
michael@0 1589 .RE
michael@0 1590 .\}
michael@0 1591 .PP
michael@0 1592 For example:
michael@0 1593 .sp
michael@0 1594 .if n \{\
michael@0 1595 .RS 4
michael@0 1596 .\}
michael@0 1597 .nf
michael@0 1598 $ certutil \-\-upgrade\-merge \-d sql:/home/my/sharednssdb \-\-source\-dir /opt/my\-app/alias/ \-\-source\-prefix serverapp\- \-\-upgrade\-id 1 \-\-upgrade\-token\-name internal
michael@0 1599 .fi
michael@0 1600 .if n \{\
michael@0 1601 .RE
michael@0 1602 .\}
michael@0 1603 .PP
michael@0 1604 The
michael@0 1605 \fB\-\-merge\fR
michael@0 1606 command only requires information about the location of the original database; since it doesn\*(Aqt change the format of the database, it can write over information without performing interim step\&.
michael@0 1607 .sp
michael@0 1608 .if n \{\
michael@0 1609 .RS 4
michael@0 1610 .\}
michael@0 1611 .nf
michael@0 1612 certutil \-\-merge \-d [sql:]directory [\-P dbprefix] \-\-source\-dir directory \-\-source\-prefix dbprefix [\-@ password\-file]
michael@0 1613 .fi
michael@0 1614 .if n \{\
michael@0 1615 .RE
michael@0 1616 .\}
michael@0 1617 .PP
michael@0 1618 For example:
michael@0 1619 .sp
michael@0 1620 .if n \{\
michael@0 1621 .RS 4
michael@0 1622 .\}
michael@0 1623 .nf
michael@0 1624 $ certutil \-\-merge \-d sql:/home/my/sharednssdb \-\-source\-dir /opt/my\-app/alias/ \-\-source\-prefix serverapp\-
michael@0 1625 .fi
michael@0 1626 .if n \{\
michael@0 1627 .RE
michael@0 1628 .\}
michael@0 1629 .PP
michael@0 1630 \fBRunning certutil Commands from a Batch File\fR
michael@0 1631 .PP
michael@0 1632 A series of commands can be run sequentially from a text file with the
michael@0 1633 \fB\-B\fR
michael@0 1634 command option\&. The only argument for this specifies the input file\&.
michael@0 1635 .sp
michael@0 1636 .if n \{\
michael@0 1637 .RS 4
michael@0 1638 .\}
michael@0 1639 .nf
michael@0 1640 $ certutil \-B \-i /path/to/batch\-file
michael@0 1641 .fi
michael@0 1642 .if n \{\
michael@0 1643 .RE
michael@0 1644 .\}
michael@0 1645 .SH "NSS DATABASE TYPES"
michael@0 1646 .PP
michael@0 1647 NSS originally used BerkeleyDB databases to store security information\&. The last versions of these
michael@0 1648 \fIlegacy\fR
michael@0 1649 databases are:
michael@0 1650 .sp
michael@0 1651 .RS 4
michael@0 1652 .ie n \{\
michael@0 1653 \h'-04'\(bu\h'+03'\c
michael@0 1654 .\}
michael@0 1655 .el \{\
michael@0 1656 .sp -1
michael@0 1657 .IP \(bu 2.3
michael@0 1658 .\}
michael@0 1659 cert8\&.db for certificates
michael@0 1660 .RE
michael@0 1661 .sp
michael@0 1662 .RS 4
michael@0 1663 .ie n \{\
michael@0 1664 \h'-04'\(bu\h'+03'\c
michael@0 1665 .\}
michael@0 1666 .el \{\
michael@0 1667 .sp -1
michael@0 1668 .IP \(bu 2.3
michael@0 1669 .\}
michael@0 1670 key3\&.db for keys
michael@0 1671 .RE
michael@0 1672 .sp
michael@0 1673 .RS 4
michael@0 1674 .ie n \{\
michael@0 1675 \h'-04'\(bu\h'+03'\c
michael@0 1676 .\}
michael@0 1677 .el \{\
michael@0 1678 .sp -1
michael@0 1679 .IP \(bu 2.3
michael@0 1680 .\}
michael@0 1681 secmod\&.db for PKCS #11 module information
michael@0 1682 .RE
michael@0 1683 .PP
michael@0 1684 BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously\&. NSS has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues\&. Still, NSS requires more flexibility to provide a truly shared security database\&.
michael@0 1685 .PP
michael@0 1686 In 2009, NSS introduced a new set of databases that are SQLite databases rather than BerkeleyDB\&. These new databases provide more accessibility and performance:
michael@0 1687 .sp
michael@0 1688 .RS 4
michael@0 1689 .ie n \{\
michael@0 1690 \h'-04'\(bu\h'+03'\c
michael@0 1691 .\}
michael@0 1692 .el \{\
michael@0 1693 .sp -1
michael@0 1694 .IP \(bu 2.3
michael@0 1695 .\}
michael@0 1696 cert9\&.db for certificates
michael@0 1697 .RE
michael@0 1698 .sp
michael@0 1699 .RS 4
michael@0 1700 .ie n \{\
michael@0 1701 \h'-04'\(bu\h'+03'\c
michael@0 1702 .\}
michael@0 1703 .el \{\
michael@0 1704 .sp -1
michael@0 1705 .IP \(bu 2.3
michael@0 1706 .\}
michael@0 1707 key4\&.db for keys
michael@0 1708 .RE
michael@0 1709 .sp
michael@0 1710 .RS 4
michael@0 1711 .ie n \{\
michael@0 1712 \h'-04'\(bu\h'+03'\c
michael@0 1713 .\}
michael@0 1714 .el \{\
michael@0 1715 .sp -1
michael@0 1716 .IP \(bu 2.3
michael@0 1717 .\}
michael@0 1718 pkcs11\&.txt, a listing of all of the PKCS #11 modules, contained in a new subdirectory in the security databases directory
michael@0 1719 .RE
michael@0 1720 .PP
michael@0 1721 Because the SQLite databases are designed to be shared, these are the
michael@0 1722 \fIshared\fR
michael@0 1723 database type\&. The shared database type is preferred; the legacy format is included for backward compatibility\&.
michael@0 1724 .PP
michael@0 1725 By default, the tools (\fBcertutil\fR,
michael@0 1726 \fBpk12util\fR,
michael@0 1727 \fBmodutil\fR) assume that the given security databases follow the more common legacy type\&. Using the SQLite databases must be manually specified by using the
michael@0 1728 \fBsql:\fR
michael@0 1729 prefix with the given security directory\&. For example:
michael@0 1730 .sp
michael@0 1731 .if n \{\
michael@0 1732 .RS 4
michael@0 1733 .\}
michael@0 1734 .nf
michael@0 1735 $ certutil \-L \-d sql:/home/my/sharednssdb
michael@0 1736 .fi
michael@0 1737 .if n \{\
michael@0 1738 .RE
michael@0 1739 .\}
michael@0 1740 .PP
michael@0 1741 To set the shared database type as the default type for the tools, set the
michael@0 1742 \fBNSS_DEFAULT_DB_TYPE\fR
michael@0 1743 environment variable to
michael@0 1744 \fBsql\fR:
michael@0 1745 .sp
michael@0 1746 .if n \{\
michael@0 1747 .RS 4
michael@0 1748 .\}
michael@0 1749 .nf
michael@0 1750 export NSS_DEFAULT_DB_TYPE="sql"
michael@0 1751 .fi
michael@0 1752 .if n \{\
michael@0 1753 .RE
michael@0 1754 .\}
michael@0 1755 .PP
michael@0 1756 This line can be set added to the
michael@0 1757 ~/\&.bashrc
michael@0 1758 file to make the change permanent\&.
michael@0 1759 .PP
michael@0 1760 Most applications do not use the shared database by default, but they can be configured to use them\&. For example, this how\-to article covers how to configure Firefox and Thunderbird to use the new shared NSS databases:
michael@0 1761 .sp
michael@0 1762 .RS 4
michael@0 1763 .ie n \{\
michael@0 1764 \h'-04'\(bu\h'+03'\c
michael@0 1765 .\}
michael@0 1766 .el \{\
michael@0 1767 .sp -1
michael@0 1768 .IP \(bu 2.3
michael@0 1769 .\}
michael@0 1770 https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto
michael@0 1771 .RE
michael@0 1772 .PP
michael@0 1773 For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:
michael@0 1774 .sp
michael@0 1775 .RS 4
michael@0 1776 .ie n \{\
michael@0 1777 \h'-04'\(bu\h'+03'\c
michael@0 1778 .\}
michael@0 1779 .el \{\
michael@0 1780 .sp -1
michael@0 1781 .IP \(bu 2.3
michael@0 1782 .\}
michael@0 1783 https://wiki\&.mozilla\&.org/NSS_Shared_DB
michael@0 1784 .RE
michael@0 1785 .SH "SEE ALSO"
michael@0 1786 .PP
michael@0 1787 pk12util (1)
michael@0 1788 .PP
michael@0 1789 modutil (1)
michael@0 1790 .PP
michael@0 1791 \fBcertutil\fR
michael@0 1792 has arguments or operations that use features defined in several IETF RFCs\&.
michael@0 1793 .sp
michael@0 1794 .RS 4
michael@0 1795 .ie n \{\
michael@0 1796 \h'-04'\(bu\h'+03'\c
michael@0 1797 .\}
michael@0 1798 .el \{\
michael@0 1799 .sp -1
michael@0 1800 .IP \(bu 2.3
michael@0 1801 .\}
michael@0 1802 http://tools\&.ietf\&.org/html/rfc5280
michael@0 1803 .RE
michael@0 1804 .sp
michael@0 1805 .RS 4
michael@0 1806 .ie n \{\
michael@0 1807 \h'-04'\(bu\h'+03'\c
michael@0 1808 .\}
michael@0 1809 .el \{\
michael@0 1810 .sp -1
michael@0 1811 .IP \(bu 2.3
michael@0 1812 .\}
michael@0 1813 http://tools\&.ietf\&.org/html/rfc1113
michael@0 1814 .RE
michael@0 1815 .sp
michael@0 1816 .RS 4
michael@0 1817 .ie n \{\
michael@0 1818 \h'-04'\(bu\h'+03'\c
michael@0 1819 .\}
michael@0 1820 .el \{\
michael@0 1821 .sp -1
michael@0 1822 .IP \(bu 2.3
michael@0 1823 .\}
michael@0 1824 http://tools\&.ietf\&.org/html/rfc1485
michael@0 1825 .RE
michael@0 1826 .PP
michael@0 1827 The NSS wiki has information on the new database design and how to configure applications to use it\&.
michael@0 1828 .sp
michael@0 1829 .RS 4
michael@0 1830 .ie n \{\
michael@0 1831 \h'-04'\(bu\h'+03'\c
michael@0 1832 .\}
michael@0 1833 .el \{\
michael@0 1834 .sp -1
michael@0 1835 .IP \(bu 2.3
michael@0 1836 .\}
michael@0 1837 https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto
michael@0 1838 .RE
michael@0 1839 .sp
michael@0 1840 .RS 4
michael@0 1841 .ie n \{\
michael@0 1842 \h'-04'\(bu\h'+03'\c
michael@0 1843 .\}
michael@0 1844 .el \{\
michael@0 1845 .sp -1
michael@0 1846 .IP \(bu 2.3
michael@0 1847 .\}
michael@0 1848 https://wiki\&.mozilla\&.org/NSS_Shared_DB
michael@0 1849 .RE
michael@0 1850 .SH "ADDITIONAL RESOURCES"
michael@0 1851 .PP
michael@0 1852 For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at
michael@0 1853 \m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&.
michael@0 1854 .PP
michael@0 1855 Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto
michael@0 1856 .PP
michael@0 1857 IRC: Freenode at #dogtag\-pki
michael@0 1858 .SH "AUTHORS"
michael@0 1859 .PP
michael@0 1860 The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&.
michael@0 1861 .PP
michael@0 1862 Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&.
michael@0 1863 .SH "LICENSE"
michael@0 1864 .PP
michael@0 1865 Licensed under the Mozilla Public License, v\&. 2\&.0\&. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla\&.org/MPL/2\&.0/\&.
michael@0 1866 .SH "NOTES"
michael@0 1867 .IP " 1." 4
michael@0 1868 Mozilla NSS bug 836477
michael@0 1869 .RS 4
michael@0 1870 \%https://bugzilla.mozilla.org/show_bug.cgi?id=836477
michael@0 1871 .RE

mercurial