# HG changeset patch # User Robert Relyea # Date 1621548343 25200 # Thu May 20 15:05:43 2021 -0700 # Node ID da25615e92c86aa6bd376fd86bf110d15999eb3c # Parent 2300e178c90fe6d3e170cf7d96556fce6d6b48e7 Bug 1712184 NSS tools manpages need to be updated to reflect that sqlite is the default database. This patch does 2 things: 1) update certutil.xml pk12util.xml modutil.xml and signver.xml to reflect the fact the the sql database is default. Many of these also has examples of specifying sql:dirname which is now the default. I did not replace them with dbm:dirname since we don't want to encourage regressing back. The one exception is in the paragraph explaining how to get to the old database format. 2) I ran make in the diretory to update the .1 and .html files generated from the .xml files. There are a number of old updates to the .xml files which haven't been picked up in their corresponding html or man page files. This updates are included in this patch. It is really only necessary to review the changes to the .xml files, the rest were reviewed when their patches were applied. bob Differential Revision: https://phabricator.services.mozilla.com/D115658 diff --git a/doc/certutil.xml b/doc/certutil.xml --- a/doc/certutil.xml +++ b/doc/certutil.xml @@ -203,17 +203,17 @@ If this option is not used, the validity Specify the database directory containing the certificate and key database files. certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). NSS recognizes the following prefixes: sql: requests the newer database dbm: requests the legacy database - If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE. If NSS_DEFAULT_DB_TYPE is not set then dbm: is the default. + If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE. If NSS_DEFAULT_DB_TYPE is not set then sql: is the default. --dump-ext-val OID For single cert, print binary DER encoding of extension OID. @@ -843,23 +843,23 @@ Comma separated list of one or more of t secmod.db or pkcs11.txt These databases must be created before certificates or keys can be generated. -certutil -N -d [sql:]directory +certutil -N -d directory Creating a Certificate Request 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. -$ 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] +$ certutil -R -k key-type-or-id [-q pqgfile|curve-name] -g key-size -s subject [-h tokenname] -d directory [-p phone] [-o output-file] [-a] The command options requires four arguments: to specify either the key type to generate or, when renewing a certificate, the existing key pair to use @@ -881,27 +881,27 @@ Comma separated list of one or more of t The new certificate request can be output in ASCII format () or can be written to a specified file (). For example: -$ 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 +$ certutil -R -k rsa -g 1024 -s "CN=John Smith,O=Example Corp,L=Mountain View,ST=California,C=US" -d $HOME/nssdb -p 650-555-0123 -a -o cert.cer Generating key. This may take a few moments... Creating a Certificate A valid certificate must be issued by a trusted CA. This can be done by specifying a CA certificate () that is stored in the certificate database. If a CA key pair is not available, you can create a self-signed certificate using the argument with the command option. -$ 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] +$ certutil -S -k rsa|dsa|ec -n certname -s subject [-c issuer |-x] -t trustargs -d 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] The series of numbers and options set certificate extensions that can be added to the certificate when it is generated by the CA. Interactive prompts will result. For example, this creates a self-signed certificate: $ certutil -S -s "CN=Example CA" -n my-ca-cert -x -t "C,C,C" -1 -2 -5 -m 3650 @@ -911,55 +911,55 @@ The interative prompts for key usage and From there, new certificates can reference the self-signed certificate: $ certutil -S -s "CN=My Server Cert" -n my-server-cert -c "my-ca-cert" -t ",," -1 -5 -6 -8 -m 730 Generating a Certificate from a Certificate Request When a certificate request is created, a certificate can be generated by using the request and then referencing a certificate authority signing certificate (the issuer specified in the argument). The issuing certificate must be in the certificate database in the specified directory. -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] +certutil -C -c issuer -i cert-request-file -o output-file [-m serial-number] [-v valid-months] [-w offset-months] -d directory [-1] [-2] [-3] [-4] [-5 keyword] [-6 keyword] [-7 emailAddress] [-8 dns-names] For example: -$ 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 +$ certutil -C -c "my-ca-cert" -i /home/certs/cert.req -o cert.cer -m 010 -v 12 -w 1 -d $HOME/nssdb -1 nonRepudiation,dataEncipherment -5 sslClient -6 clientAuth -7 jsmith@example.com Listing Certificates The command option lists all of the certificates listed in the certificate database. The path to the directory () is required. -$ certutil -L -d sql:/home/my/sharednssdb +$ certutil -L -d /home/my/sharednssdb Certificate Nickname Trust Attributes SSL,S/MIME,JAR/XPI CA Administrator of Instance pki-ca1's Example Domain ID u,u,u TPS Administrator's Example Domain ID u,u,u Google Internet Authority ,, Certificate Authority - Example Domain CT,C,C Using additional arguments with can return and print the information for a single, specific certificate. For example, the argument passes the certificate name, while the argument prints the certificate in ASCII format: -$ certutil -L -d sql:$HOME/nssdb -a -n my-ca-cert +$ certutil -L -d $HOME/nssdb -a -n my-ca-cert -----BEGIN CERTIFICATE----- MIIB1DCCAT2gAwIBAgICDkIwDQYJKoZIhvcNAQEFBQAwFTETMBEGA1UEAxMKRXhh bXBsZSBDQTAeFw0xMzAzMTMxOTEwMjlaFw0xMzA2MTMxOTEwMjlaMBUxEzARBgNV BAMTCkV4YW1wbGUgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJ4Kzqvz JyBVgFqDXRYSyTBNw1DrxUU/3GvWA/ngjAwHEv0Cul/6sO/gsCvnABHiH6unns6x XRzPORlC2WY3gkk7vmlsLvYpyecNazAi/NAwVnU/66HOsaoVFWE+gBQo99UrN2yk 0BiK/GMFlLm5dXQROgA9ZKKyFdI0LIXtf6SbAgMBAAGjMzAxMBEGCWCGSAGG+EIB AQQEAwIHADAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQEAwICBDANBgkqhkiG9w0B AQUFAAOBgQA6chkzkACN281d1jKMrc+RHG2UMaQyxiteaLVZO+Ro1nnRUvseDf09 XKYFwPMJjWCihVku6bw/ihZfuMHhxK22Nue6inNQ6eDu7WmrqL8z3iUrQwxs+WiF ob2rb8XRVVJkzXdXxlk4uo3UtNvw8sAz7sWD71qxKaIHU5q49zijfg== -----END CERTIFICATE----- For a human-readable display -$ certutil -L -d sql:$HOME/nssdb -n my-ca-cert +$ certutil -L -d $HOME/nssdb -n my-ca-cert Certificate: Data: Version: 3 (0x2) Serial Number: 3650 (0xe42) Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption Issuer: "CN=Example CA" Validity: Not Before: Wed Mar 13 19:10:29 2013 @@ -1022,17 +1022,17 @@ Certificate: Listing Keys Keys are the original material used to encrypt certificate data. The keys generated for certificates are stored separately, in the key database. To list all keys in the database, use the command option and the (required) argument to give the path to the directory. -$ certutil -K -d sql:$HOME/nssdb +$ certutil -K -d $HOME/nssdb certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services " < 0> rsa 455a6673bde9375c2887ec8bf8016b3f9f35861d Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID < 1> rsa 40defeeb522ade11090eacebaaf1196a172127df Example Domain Administrator Cert < 2> rsa 1d0b06f44f6c03842f7d4f4a1dc78b3bcd1b85a5 John Smith user cert There are ways to narrow the keys listed in the search results: @@ -1052,111 +1052,111 @@ certutil: Checking token "NSS Certificat Listing Security Modules 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 command option lists all of the security modules listed in the secmod.db database. The path to the directory () is required. -$ certutil -U -d sql:/home/my/sharednssdb +$ certutil -U -d /home/my/sharednssdb slot: NSS User Private Key and Certificate Services token: NSS Certificate DB uri: pkcs11:token=NSS%20Certificate%20DB;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203 slot: NSS Internal Cryptographic Services token: NSS Generic Crypto Services uri: pkcs11:token=NSS%20Generic%20Crypto%20Services;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203 Adding Certificates to the Database Existing certificates or certificate requests can be added manually to the certificate database, even if they were generated elsewhere. This uses the command option. -certutil -A -n certname -t trustargs -d [sql:]directory [-a] [-i input-file] +certutil -A -n certname -t trustargs -d directory [-a] [-i input-file] For example: -$ certutil -A -n "CN=My SSL Certificate" -t ",," -d sql:/home/my/sharednssdb -i /home/example-certs/cert.cer +$ certutil -A -n "CN=My SSL Certificate" -t ",," -d /home/my/sharednssdb -i /home/example-certs/cert.cer A related command option, , is used specifically to add email certificates to the certificate database. The command has the same arguments as the command. The trust arguments for certificates have the format SSL,S/MIME,Code-signing, so the middle trust settings relate most to email certificates (though the others can be set). For example: -$ certutil -E -n "CN=John Smith Email Cert" -t ",P," -d sql:/home/my/sharednssdb -i /home/example-certs/email.cer +$ certutil -E -n "CN=John Smith Email Cert" -t ",P," -d /home/my/sharednssdb -i /home/example-certs/email.cer Deleting Certificates to the Database Certificates can be deleted from a database using the option. The only required options are to give the security database directory and to identify the certificate nickname. -certutil -D -d [sql:]directory -n "nickname" +certutil -D -d directory -n "nickname" For example: -$ certutil -D -d sql:/home/my/sharednssdb -n "my-ssl-cert" +$ certutil -D -d /home/my/sharednssdb -n "my-ssl-cert" Validating Certificates 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 command option. -certutil -V -n certificate-name [-b time] [-e] [-u cert-usage] -d [sql:]directory +certutil -V -n certificate-name [-b time] [-e] [-u cert-usage] -d directory For example, to validate an email certificate: -$ certutil -V -n "John Smith's Email Cert" -e -u S,R -d sql:/home/my/sharednssdb +$ certutil -V -n "John Smith's Email Cert" -e -u S,R -d /home/my/sharednssdb Modifying Certificate Trust Settings 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. -certutil -M -n certificate-name -t trust-args -d [sql:]directory +certutil -M -n certificate-name -t trust-args -d directory For example: -$ certutil -M -n "My CA Certificate" -d sql:/home/my/sharednssdb -t "CT,CT,CT" +$ certutil -M -n "My CA Certificate" -d /home/my/sharednssdb -t "CT,CT,CT" Printing the Certificate Chain Certificates can be issued in chains because every certificate authority itself has a certificate; when a CA issues a certificate, it essentially stamps that certificate with its own fingerprint. The 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: -$ certutil -d sql:/home/my/sharednssdb -O -n "jsmith@example.com" +$ certutil -d /home/my/sharednssdb -O -n "jsmith@example.com" "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] "Thawte Personal Freemail Issuing CA - Thawte Consulting" [CN=Thawte Personal Freemail Issuing CA,O=Thawte Consulting (Pty) Ltd.,C=ZA] "(null)" [E=jsmith@example.com,CN=Thawte Freemail Member] Resetting a Token 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 () as well as any directory path. If there is no external token used, the default value is internal. -certutil -T -d [sql:]directory -h token-name -0 security-officer-password +certutil -T -d directory -h token-name -0 security-officer-password 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: -$ certutil -T -d sql:/home/my/sharednssdb -h nethsm -0 secret +$ certutil -T -d /home/my/sharednssdb -h nethsm -0 secret Upgrading or Merging the Security Databases 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 command option or existing databases can be merged with the new cert9.db databases using the command. The command must give information about the original database and then use the standard arguments (like ) 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. -certutil --upgrade-merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix --upgrade-id id --upgrade-token-name name [-@ password-file] +certutil --upgrade-merge -d directory [-P dbprefix] --source-dir directory --source-prefix dbprefix --upgrade-id id --upgrade-token-name name [-@ password-file] For example: -$ certutil --upgrade-merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- --upgrade-id 1 --upgrade-token-name internal +$ certutil --upgrade-merge -d /home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- --upgrade-id 1 --upgrade-token-name internal The command only requires information about the location of the original database; since it doesn't change the format of the database, it can write over information without performing interim step. -certutil --merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix [-@ password-file] +certutil --merge -d directory [-P dbprefix] --source-dir directory --source-prefix dbprefix [-@ password-file] For example: -$ certutil --merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- +$ certutil --merge -d /home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- Running certutil Commands from a Batch File A series of commands can be run sequentially from a text file with the command option. The only argument for this specifies the input file. $ certutil -B -i /path/to/batch-file @@ -1202,27 +1202,26 @@ BerkeleyDB. These new databases provide pkcs11.txt, a listing of all of the PKCS #11 modules, contained in a new subdirectory in the security databases directory Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility. -By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example: +By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type. +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example: -$ certutil -L -d sql:/home/my/sharednssdb +$ certutil -L -d dbm:/home/my/sharednssdb -To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql: -export NSS_DEFAULT_DB_TYPE="sql" +To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm: +export NSS_DEFAULT_DB_TYPE="dbm" This line can be set added to the ~/.bashrc file to make the change permanent. -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: https://wiki.mozilla.org/NSS_Shared_DB_Howto For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: diff --git a/doc/html/certutil.html b/doc/html/certutil.html --- a/doc/html/certutil.html +++ b/doc/html/certutil.html @@ -1,21 +1,21 @@ -CERTUTIL

Name

certutil — Manage keys and certificate in both NSS databases and other NSS tokens

Synopsis

certutil [options] [[arguments]]

STATUS

This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 +CERTUTIL

Name

certutil — Manage keys and certificate in both NSS databases and other NSS tokens

Synopsis

certutil [options] [[arguments]]

STATUS

This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477

Description

The Certificate Database Tool, certutil, 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.

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 modutil manpage.

Command Options and Arguments

Running certutil 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 -H will list all the command options and their relevant arguments.

Command Options

-A

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.

-B

Run a series of commands from the specified batch file. This requires the -i argument.

-C

Create a new binary certificate file from a binary certificate request file. Use the -i argument to specify the certificate request file. If this argument is not used, certutil prompts for a filename.

-D

Delete a certificate from the certificate database.

--rename

Change the database nickname of a certificate.

-E

Add an email certificate to the certificate database.

-F

Delete a private key and the associated certificate from a database. Specify the key to delete with the -n argument or the -k argument. Specify the database from which to delete the key with the -d argument.

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.

-G

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.

-H

Display a list of the command options and arguments.

-K

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).

-L

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.

-M

Modify a certificate's trust attributes using the values of the -t argument.

-N

Create new certificate and key databases.

-O

Print the certificate chain.

-R

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.

-S

Create an individual certificate and add it to a certificate database.

-T

Reset the key database or token.

-U

List all available modules or print a single named module.

-V

Check the validity of a certificate and its attributes.

-W

Change the password to a key database.

--merge

Merge two databases into one.

--upgrade-merge

Upgrade an old database and merge it into a new database. This is used to migrate legacy NSS databases (cert8.db and key3.db) into the newer SQLite databases (cert9.db and key4.db).

Arguments

Arguments modify a command option and are usually lower case, numbers, or symbols.

-a

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.

-b validity-time

Specify a time at which a certificate is required to be valid. Use when checking certificate validity with the -V option. The format of the validity-time argument is YYMMDDHHMMSS[+HHMM|-HHMM|Z], which allows offsets to be set relative to the validity end time. Specifying seconds (SS) is optional. When specifying an explicit time, use a Z at the end of the term, YYMMDDHHMMSSZ, to close it. When specifying an offset time, use YYMMDDHHMMSS+HHMM or YYMMDDHHMMSS-HHMM for adding or subtracting time, respectively. +For certificate requests, ASCII output defaults to standard output unless redirected.

--simple-self-signed

When printing the certificate chain, don't search for a chain if issuer name equals to subject name.

-b validity-time

Specify a time at which a certificate is required to be valid. Use when checking certificate validity with the -V option. The format of the validity-time argument is YYMMDDHHMMSS[+HHMM|-HHMM|Z], which allows offsets to be set relative to the validity end time. Specifying seconds (SS) is optional. When specifying an explicit time, use a Z at the end of the term, YYMMDDHHMMSSZ, to close it. When specifying an offset time, use YYMMDDHHMMSS+HHMM or YYMMDDHHMMSS-HHMM for adding or subtracting time, respectively.

If this option is not used, the validity check defaults to the current system time.

-c issuer

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's email address. Bracket the issuer string - with quotation marks if it contains spaces.

-d [prefix]directory

Specify the database directory containing the certificate and key database files.

certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt).

NSS recognizes the following prefixes:

  • sql: requests the newer database

  • dbm: requests the legacy database

If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE. If NSS_DEFAULT_DB_TYPE is not set then dbm: is the default.

--dump-ext-val OID

For single cert, print binary DER encoding of extension OID.

-e

Check a certificate's signature during the process of validating a certificate.

--email email-address

Specify the email address of a certificate to list. Used with the -L command option.

--extGeneric OID:critical-flag:filename[,OID:critical-flag:filename]...

+ with quotation marks if it contains spaces.

-d [prefix]directory

Specify the database directory containing the certificate and key database files.

certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt).

NSS recognizes the following prefixes:

  • sql: requests the newer database

  • dbm: requests the legacy database

If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE. If NSS_DEFAULT_DB_TYPE is not set then sql: is the default.

--dump-ext-val OID

For single cert, print binary DER encoding of extension OID.

-e

Check a certificate's signature during the process of validating a certificate.

--email email-address

Specify the email address of a certificate to list. Used with the -L command option.

--extGeneric OID:critical-flag:filename[,OID:critical-flag:filename]...

Add one or multiple extensions that certutil cannot encode yet, by loading their encodings from external files.

  • OID (example): 1.2.3.4

  • critical-flag: critical or not-critical

  • filename: full path to a file containing an encoded extension

-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.

-g keysize

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 2048 bits. Any size between the minimum and maximum is allowed.

-h tokenname

Specify the name of a token to use or act on. If not specified the default token is the internal database slot.

The name can also be a PKCS #11 URI. For example, the NSS internal certificate store can be unambiguously specified as "pkcs11:token=NSS%20Certificate%20DB". For details about the format, see RFC 7512.

-i input_file

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.

-k key-type-or-id

Specify the type or specific ID of a key.

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 @@ -50,17 +50,17 @@ of the attribute codes:

  • C - Trusted CA (implies c)

  • T - trusted CA for client authentication (ssl server only)

  • The attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks. For example:

    -t "TC,C,T"

    Use the -L option to see a list of the current certificates and trust attributes in a certificate database.

    - Note that the output of the -L option may include "u" flag, which means that there is a private key associated with the certificate. It is a dynamic flag and you cannot set it with certutil.

    -u certusage

    Specify a usage context to apply when validating a certificate with the -V option.

    The contexts are the following:

    • C (as an SSL client)

    • V (as an SSL server)

    • L (as an SSL CA)

    • A (as Any CA)

    • Y (Verify CA)

    • S (as an email signer)

    • R (as an email recipient)

    • O (as an OCSP status responder)

    • J (as an object signer)

    -v valid-months

    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 -w option. If this argument is not used, the default validity period is three months.

    -w offset-months

    Set an offset from the current system time, in months, + Note that the output of the -L option may include "u" flag, which means that there is a private key associated with the certificate. It is a dynamic flag and you cannot set it with certutil.

    -u certusage

    Specify a usage context to apply when validating a certificate with the -V option.

    The contexts are the following:

    • C (as an SSL client)

    • V (as an SSL server)

    • L (as an SSL CA)

    • A (as Any CA)

    • Y (Verify CA)

    • S (as an email signer)

    • R (as an email recipient)

    • O (as an OCSP status responder)

    • J (as an object signer)

    • I (as an IPSEC user)

    -v valid-months

    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 -w option. If this argument is not used, the default validity period is three months.

    -w offset-months

    Set an offset from the current system time, in months, for the beginning of a certificate's 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.

    -X

    Force the key and certificate database to open in read-write mode. This is used with the -U and -L command options.

    -x

    Use certutil to generate the signature for a certificate being created or added to a database, rather than obtaining a signature from a separate CA.

    -y exp

    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.

    --pss

    Restrict the generated certificate (with the -S option) or certificate request (with the -R option) to be used with the RSA-PSS signature scheme. This only works when the private key of the certificate or certificate request is RSA.

    --pss-sign

    Sign the generated certificate with the RSA-PSS signature scheme (with the -C or -S option). This only works when the private key of the signer's certificate is RSA. If the signer's certificate is restricted to RSA-PSS, it is not necessary to specify this option.

    -z noise-file

    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.

    -Z hashAlg

    Specify the hash algorithm to use with the -C, -S or -R command options. Possible keywords:

    • MD2

    • MD4

    • MD5

    • SHA1

    • SHA224

    • SHA256

    • SHA384

    • SHA512

    -0 SSO_password

    Set a site security officer password on a token.

    -1 | --keyUsage keyword,keyword

    Set an X.509 V3 Certificate Type Extension in the certificate. There are several available keywords:

    • digitalSignature

    • nonRepudiation @@ -105,16 +105,30 @@ of the attribute codes:

    • ocspResponder

    • stepUp

    • msTrustListSign

    • critical +

    • + x509Any +

    • + ipsecIKE +

    • + ipsecIKEEnd +

    • + ipsecIKEIntermediate +

    • + ipsecEnd +

    • + ipsecTunnel +

    • + ipsecUser

    X.509 certificate extensions are described in RFC 5280.

    -7 emailAddrs

    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.

    -8 dns-names

    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.

    --extAIA

    Add the Authority Information Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extSIA

    Add the Subject Information Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extCP

    Add the Certificate Policies extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extPM

    Add the Policy Mappings extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extPC

    Add the Policy Constraints extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extIA

    Add the Inhibit Any Policy Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extSKID

    Add the Subject Key ID extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extNC

    Add a Name Constraint extension to the certificate. X.509 certificate extensions are described in RFC 5280.

    --extSAN type:name[,type:name]...

    Create a Subject Alt Name extension with one or multiple names.

    -type: directory, dn, dns, edi, ediparty, email, ip, ipaddr, other, registerid, rfc822, uri, x400, x400addr

    --empty-password

    Use empty password when creating new certificate database with -N.

    --keyAttrFlags attrflags

    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}

    --keyOpFlagsOn opflags, --keyOpFlagsOff opflags

    PKCS #11 key Operation Flags. Comma separated list of one or more of the following: @@ -126,77 +140,77 @@ Comma separated list of one or more of t

    • cert8.db or cert9.db

    • key3.db or key4.db

    • secmod.db or pkcs11.txt

    These databases must be created before certificates or keys can be generated. -

    certutil -N -d [sql:]directory

    Creating a Certificate Request

    +

    certutil -N -d directory

    Creating a Certificate Request

    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. -

    $ 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]

    +

    $ certutil -R -k key-type-or-id [-q pqgfile|curve-name] -g key-size -s subject [-h tokenname] -d directory [-p phone] [-o output-file] [-a]

    The -R command options requires four arguments:

    • -k to specify either the key type to generate or, when renewing a certificate, the existing key pair to use

    • -g to set the keysize of the key to generate

    • -s to set the subject name of the certificate

    • -d to give the security database directory

    The new certificate request can be output in ASCII format (-a) or can be written to a specified file (-o).

    For example: -

    $ 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
    +	

    $ certutil -R -k rsa -g 1024 -s "CN=John Smith,O=Example Corp,L=Mountain View,ST=California,C=US" -d $HOME/nssdb -p 650-555-0123 -a -o cert.cer
     
     Generating key.  This may take a few moments...
     
     

    Creating a Certificate

    A valid certificate must be issued by a trusted CA. This can be done by specifying a CA certificate (-c) that is stored in the certificate database. If a CA key pair is not available, you can create a self-signed certificate using the -x argument with the -S command option. -

    $ 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]

    +

    $ certutil -S -k rsa|dsa|ec -n certname -s subject [-c issuer |-x] -t trustargs -d 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]

    The series of numbers and --ext* options set certificate extensions that can be added to the certificate when it is generated by the CA. Interactive prompts will result.

    For example, this creates a self-signed certificate:

    $ certutil -S -s "CN=Example CA" -n my-ca-cert -x -t "C,C,C" -1 -2 -5 -m 3650

    The interative prompts for key usage and whether any extensions are critical and responses have been ommitted for brevity.

    From there, new certificates can reference the self-signed certificate:

    $ certutil -S -s "CN=My Server Cert" -n my-server-cert -c "my-ca-cert" -t ",," -1 -5 -6 -8 -m 730

    Generating a Certificate from a Certificate Request

    When a certificate request is created, a certificate can be generated by using the request and then referencing a certificate authority signing certificate (the issuer specified in the -c argument). The issuing certificate must be in the certificate database in the specified directory. -

    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]

    +

    certutil -C -c issuer -i cert-request-file -o output-file [-m serial-number] [-v valid-months] [-w offset-months] -d directory [-1] [-2] [-3] [-4] [-5 keyword] [-6 keyword] [-7 emailAddress] [-8 dns-names]

    For example: -

    $ 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

    Listing Certificates

    +

    $ certutil -C -c "my-ca-cert" -i /home/certs/cert.req -o cert.cer -m 010 -v 12 -w 1 -d $HOME/nssdb -1 nonRepudiation,dataEncipherment -5 sslClient -6 clientAuth -7 jsmith@example.com

    Listing Certificates

    The -L command option lists all of the certificates listed in the certificate database. The path to the directory (-d) is required. -

    $ certutil -L -d sql:/home/my/sharednssdb
    +	

    $ certutil -L -d /home/my/sharednssdb
     
     Certificate Nickname                                         Trust Attributes
                                                                  SSL,S/MIME,JAR/XPI
     
     CA Administrator of Instance pki-ca1's Example Domain ID     u,u,u
     TPS Administrator's Example Domain ID                        u,u,u
     Google Internet Authority                                    ,,   
     Certificate Authority - Example Domain                       CT,C,C

    Using additional arguments with -L can return and print the information for a single, specific certificate. For example, the -n argument passes the certificate name, while the -a argument prints the certificate in ASCII format:

    -$ certutil -L -d sql:$HOME/nssdb -a -n my-ca-cert
    +$ certutil -L -d $HOME/nssdb -a -n my-ca-cert
     -----BEGIN CERTIFICATE-----
     MIIB1DCCAT2gAwIBAgICDkIwDQYJKoZIhvcNAQEFBQAwFTETMBEGA1UEAxMKRXhh
     bXBsZSBDQTAeFw0xMzAzMTMxOTEwMjlaFw0xMzA2MTMxOTEwMjlaMBUxEzARBgNV
     BAMTCkV4YW1wbGUgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJ4Kzqvz
     JyBVgFqDXRYSyTBNw1DrxUU/3GvWA/ngjAwHEv0Cul/6sO/gsCvnABHiH6unns6x
     XRzPORlC2WY3gkk7vmlsLvYpyecNazAi/NAwVnU/66HOsaoVFWE+gBQo99UrN2yk
     0BiK/GMFlLm5dXQROgA9ZKKyFdI0LIXtf6SbAgMBAAGjMzAxMBEGCWCGSAGG+EIB
     AQQEAwIHADAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQEAwICBDANBgkqhkiG9w0B
     AQUFAAOBgQA6chkzkACN281d1jKMrc+RHG2UMaQyxiteaLVZO+Ro1nnRUvseDf09
     XKYFwPMJjWCihVku6bw/ihZfuMHhxK22Nue6inNQ6eDu7WmrqL8z3iUrQwxs+WiF
     ob2rb8XRVVJkzXdXxlk4uo3UtNvw8sAz7sWD71qxKaIHU5q49zijfg==
     -----END CERTIFICATE-----
    -

    For a human-readable display

    $ certutil -L -d sql:$HOME/nssdb -n my-ca-cert
    +

    For a human-readable display

    $ certutil -L -d $HOME/nssdb -n my-ca-cert
     Certificate:
         Data:
             Version: 3 (0x2)
             Serial Number: 3650 (0xe42)
             Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption
             Issuer: "CN=Example CA"
             Validity:
                 Not Before: Wed Mar 13 19:10:29 2013
    @@ -254,78 +268,78 @@ Certificate:
                 Valid CA
                 Trusted CA
                 User
     
     

    Listing Keys

    Keys are the original material used to encrypt certificate data. The keys generated for certificates are stored separately, in the key database.

    To list all keys in the database, use the -K command option and the (required) -d argument to give the path to the directory. -

    $ certutil -K -d sql:$HOME/nssdb
    +	

    $ certutil -K -d $HOME/nssdb
     certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services                  "
     < 0> rsa      455a6673bde9375c2887ec8bf8016b3f9f35861d   Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID
     < 1> rsa      40defeeb522ade11090eacebaaf1196a172127df   Example Domain Administrator Cert
     < 2> rsa      1d0b06f44f6c03842f7d4f4a1dc78b3bcd1b85a5   John Smith user cert

    There are ways to narrow the keys listed in the search results:

    • To return a specific key, use the -n name argument with the name of the key.

    • If there are multiple security devices loaded, then the -h tokenname argument can search a specific token or all tokens.

    • If there are multiple key types available, then the -k key-type argument can search a specific type of key, like RSA, DSA, or ECC.

    Listing Security Modules

    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 -U command option lists all of the security modules listed in the secmod.db database. The path to the directory (-d) is required. -

    $ certutil -U -d sql:/home/my/sharednssdb
    +	

    $ certutil -U -d /home/my/sharednssdb
     
         slot: NSS User Private Key and Certificate Services                  
        token: NSS Certificate DB
          uri: pkcs11:token=NSS%20Certificate%20DB;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203
     
         slot: NSS Internal Cryptographic Services                            
        token: NSS Generic Crypto Services
          uri: pkcs11:token=NSS%20Generic%20Crypto%20Services;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203

    Adding Certificates to the Database

    Existing certificates or certificate requests can be added manually to the certificate database, even if they were generated elsewhere. This uses the -A command option. -

    certutil -A -n certname -t trustargs -d [sql:]directory [-a] [-i input-file]

    +

    certutil -A -n certname -t trustargs -d directory [-a] [-i input-file]

    For example: -

    $ certutil -A -n "CN=My SSL Certificate" -t ",," -d sql:/home/my/sharednssdb -i /home/example-certs/cert.cer

    +

    $ certutil -A -n "CN=My SSL Certificate" -t ",," -d /home/my/sharednssdb -i /home/example-certs/cert.cer

    A related command option, -E, is used specifically to add email certificates to the certificate database. The -E command has the same arguments as the -A command. The trust arguments for certificates have the format SSL,S/MIME,Code-signing, so the middle trust settings relate most to email certificates (though the others can be set). For example: -

    $ certutil -E -n "CN=John Smith Email Cert" -t ",P," -d sql:/home/my/sharednssdb -i /home/example-certs/email.cer

    Deleting Certificates to the Database

    +

    $ certutil -E -n "CN=John Smith Email Cert" -t ",P," -d /home/my/sharednssdb -i /home/example-certs/email.cer

    Deleting Certificates to the Database

    Certificates can be deleted from a database using the -D option. The only required options are to give the security database directory and to identify the certificate nickname. -

    certutil -D -d [sql:]directory -n "nickname"

    +

    certutil -D -d directory -n "nickname"

    For example: -

    $ certutil -D -d sql:/home/my/sharednssdb -n "my-ssl-cert"

    Validating Certificates

    +

    $ certutil -D -d /home/my/sharednssdb -n "my-ssl-cert"

    Validating Certificates

    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 -V command option. -

    certutil -V -n certificate-name [-b time] [-e] [-u cert-usage] -d [sql:]directory

    +

    certutil -V -n certificate-name [-b time] [-e] [-u cert-usage] -d directory

    For example, to validate an email certificate: -

    $ certutil -V -n "John Smith's Email Cert" -e -u S,R -d sql:/home/my/sharednssdb

    Modifying Certificate Trust Settings

    +

    $ certutil -V -n "John Smith's Email Cert" -e -u S,R -d /home/my/sharednssdb

    Modifying Certificate Trust Settings

    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. -

    certutil -M -n certificate-name -t trust-args -d [sql:]directory

    +

    certutil -M -n certificate-name -t trust-args -d directory

    For example: -

    $ certutil -M -n "My CA Certificate" -d sql:/home/my/sharednssdb -t "CT,CT,CT"

    Printing the Certificate Chain

    +

    $ certutil -M -n "My CA Certificate" -d /home/my/sharednssdb -t "CT,CT,CT"

    Printing the Certificate Chain

    Certificates can be issued in chains because every certificate authority itself has a certificate; when a CA issues a certificate, it essentially stamps that certificate with its own fingerprint. The -O 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: -

    $ certutil -d sql:/home/my/sharednssdb -O -n "jsmith@example.com"
    +	

    $ certutil -d /home/my/sharednssdb -O -n "jsmith@example.com"
     "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]
     
       "Thawte Personal Freemail Issuing CA - Thawte Consulting" [CN=Thawte Personal Freemail Issuing CA,O=Thawte Consulting (Pty) Ltd.,C=ZA]
     
         "(null)" [E=jsmith@example.com,CN=Thawte Freemail Member]

    Resetting a Token

    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 (-h) as well as any directory path. If there is no external token used, the default value is internal. -

    certutil -T -d [sql:]directory -h token-name -0 security-officer-password

    +

    certutil -T -d directory -h token-name -0 security-officer-password

    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: -

    $ certutil -T -d sql:/home/my/sharednssdb -h nethsm -0 secret

    Upgrading or Merging the Security Databases

    +

    $ certutil -T -d /home/my/sharednssdb -h nethsm -0 secret

    Upgrading or Merging the Security Databases

    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 --upgrade-merge command option or existing databases can be merged with the new cert9.db databases using the ---merge command.

    The --upgrade-merge command must give information about the original database and then use the standard arguments (like -d) 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. -

    certutil --upgrade-merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix --upgrade-id id --upgrade-token-name name [-@ password-file]

    +

    certutil --upgrade-merge -d directory [-P dbprefix] --source-dir directory --source-prefix dbprefix --upgrade-id id --upgrade-token-name name [-@ password-file]

    For example: -

    $ certutil --upgrade-merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- --upgrade-id 1 --upgrade-token-name internal

    +

    $ certutil --upgrade-merge -d /home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- --upgrade-id 1 --upgrade-token-name internal

    The --merge command only requires information about the location of the original database; since it doesn't change the format of the database, it can write over information without performing interim step. -

    certutil --merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix [-@ password-file]

    +

    certutil --merge -d directory [-P dbprefix] --source-dir directory --source-prefix dbprefix [-@ password-file]

    For example: -

    $ certutil --merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp-

    Running certutil Commands from a Batch File

    +

    $ certutil --merge -d /home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp-

    Running certutil Commands from a Batch File

    A series of commands can be run sequentially from a text file with the -B command option. The only argument for this specifies the input file.

    $ certutil -B -i /path/to/batch-file

    NSS Database Types

    NSS originally used BerkeleyDB databases to store security information. The last versions of these legacy databases are:

    • cert8.db for certificates

    • key3.db for keys

    • secmod.db for PKCS #11 module information @@ -333,18 +347,18 @@ The last versions of these

      • cert9.db for certificates

      • key4.db for keys

      • pkcs11.txt, a listing of all of the PKCS #11 modules, contained in a new subdirectory in the security databases directory -

    Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

    By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example:

    $ certutil -L -d sql:/home/my/sharednssdb

    To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql:

    export NSS_DEFAULT_DB_TYPE="sql"

    This line can be set added to the ~/.bashrc file to make the change permanent.

    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:

    • +

    Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

    By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type. +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example:

    $ certutil -L -d dbm:/home/my/sharednssdb

    To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm:

    export NSS_DEFAULT_DB_TYPE="dbm"

    This line can be set added to the ~/.bashrc file to make the change permanent.

    • https://wiki.mozilla.org/NSS_Shared_DB_Howto

    For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:

    • https://wiki.mozilla.org/NSS_Shared_DB

    See Also

    pk12util (1)

    modutil (1)

    certutil has arguments or operations that use features defined in several IETF RFCs.

    • http://tools.ietf.org/html/rfc5280

    • http://tools.ietf.org/html/rfc1113

    • http://tools.ietf.org/html/rfc1485 diff --git a/doc/html/derdump.html b/doc/html/derdump.html --- a/doc/html/derdump.html +++ b/doc/html/derdump.html @@ -1,7 +1,5 @@ -DERDUMP

      Name

      derdump — Dumps C-sequence strings from a DER encoded certificate file

      Synopsis

      derdump [-r] [-i input-file] [-o output-file]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 -

      Description

      derdump dumps C-sequence strings from a DER encode certificate file

      Options

      -r
      For formatted items, dump raw bytes as well
      -i DER encoded file
      Define an input file to use (default is stdin)
      -o output file
      Define an output file to use (default is stdout).

      Additional Resources

      NSS is maintained in conjunction with PKI and security-related projects through Mozilla dn Fedora. The most closely-related project is Dogtag PKI, with a project wiki at PKI Wiki.

      For information specifically about NSS, the NSS project wiki is located at Mozilla NSS site. The NSS site relates directly to NSS code changes and releases.

      Mailing lists: pki-devel@redhat.com and pki-users@redhat.com

      IRC: Freenode at #dogtag-pki

      Authors

      The NSS tools were written and maintained by developers with Netscape and now with Red Hat.

      +DERDUMP

      Name

      derdump — Dumps C-sequence strings from a DER encoded certificate file

      Synopsis

      derdump [-r] [-i input-file] [-o output-file]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 +

      Description

      derdump dumps C-sequence strings from a DER encode certificate file

      Options

      -r
      For formatted items, dump raw bytes as well
      -i DER encoded file
      Define an input file to use (default is stdin)
      -o output file
      Define an output file to use (default is stdout).

      Additional Resources

      NSS is maintained in conjunction with PKI and security-related projects through Mozilla dn Fedora. The most closely-related project is Dogtag PKI, with a project wiki at PKI Wiki.

      For information specifically about NSS, the NSS project wiki is located at Mozilla NSS site. The NSS site relates directly to NSS code changes and releases.

      Mailing lists: pki-devel@redhat.com and pki-users@redhat.com

      IRC: Freenode at #dogtag-pki

      Authors

      The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.

      Authors: Gerhardus Geldenhuis <gerhardus.geldenhuis@gmail.com>. Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com> -

      LICENSE

      Licensed under the Mozilla Public License, version 1.1, - and/or the GNU General Public License, version 2 or later, - and/or the GNU Lesser General Public License, version 2.1 or later. +

      LICENSE

      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/.

      diff --git a/doc/html/modutil.html b/doc/html/modutil.html --- a/doc/html/modutil.html +++ b/doc/html/modutil.html @@ -1,13 +1,13 @@ -MODUTIL

      Name

      modutil — Manage PKCS #11 module information within the security module database.

      Synopsis

      modutil [options] [[arguments]]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 +MODUTIL

      Name

      modutil — Manage PKCS #11 module information within the security module database.

      Synopsis

      modutil [options] [[arguments]]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477

      Description

      The Security Module Database Tool, modutil, is a command-line utility for managing PKCS #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete PKCS #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable FIPS 140-2 compliance, and assign default providers for cryptographic operations. This tool can also create certificate, key, and module security database files.

      The tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases.

      Options

      Running modutil always requires one (and only one) option to specify the type of module operation. Each option may take arguments, anywhere from none to multiple arguments. -

      Options

      -add modulename

      Add the named PKCS #11 module to the database. Use this option with the -libfile, -ciphers, and -mechanisms arguments.

      -changepw tokenname

      Change the password on the named token. If the token has not been initialized, this option initializes the password. Use this option with the -pwfile and -newpwfile arguments. A password is equivalent to a personal identification number (PIN).

      -chkfips

      Verify whether the module is in the given FIPS mode. true means to verify that the module is in FIPS mode, while false means to verify that the module is not in FIPS mode.

      -create

      Create new certificate, key, and module databases. Use the -dbdir directory argument to specify a directory. If any of these databases already exist in a specified directory, modutil returns an error message.

      -default modulename

      Specify the security mechanisms for which the named module will be a default provider. The security mechanisms are specified with the -mechanisms argument.

      -delete modulename

      Delete the named module. The default NSS PKCS #11 module cannot be deleted.

      -disable modulename

      Disable all slots on the named module. Use the -slot argument to disable a specific slot.

      The internal NSS PKCS #11 module cannot be disabled.

      -enable modulename

      Enable all slots on the named module. Use the -slot argument to enable a specific slot.

      -fips [true | false]

      Enable (true) or disable (false) FIPS 140-2 compliance for the default NSS module.

      -force

      Disable modutil's interactive prompts so it can be run from a script. Use this option only after manually testing each planned operation to check for warnings and to ensure that bypassing the prompts will cause no security lapses or loss of database integrity.

      -jar JAR-file

      Add a new PKCS #11 module to the database using the named JAR file. Use this command with the -installdir and -tempdir arguments. The JAR file uses the NSS PKCS #11 JAR format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the PKCS #11 module library file and other files such as documentation. This is covered in the JAR installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil.

      -list [modulename]

      Display basic information about the contents of the secmod.db file. Specifying a modulename displays detailed information about a particular module and its slots and tokens.

      -rawadd

      Add the module spec string to the secmod.db database.

      -rawlist

      Display the module specs for a specified module or for all loadable modules.

      -undefault modulename

      Specify the security mechanisms for which the named module will not be a default provider. The security mechanisms are specified with the -mechanisms argument.

      Arguments

      MODULE

      Give the security module to access.

      MODULESPEC

      Give the security module spec to load into the security database.

      -ciphers cipher-enable-list

      Enable specific ciphers in a module that is being added to the database. The cipher-enable-list is a colon-delimited list of cipher names. Enclose this list in quotation marks if it contains spaces.

      -dbdir [sql:]directory

      Specify the database directory in which to access or create security module database files.

      modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql: is not used, then the tool assumes that the given databases are in the old format.

      --dbprefix prefix

      Specify the prefix used on the database files, such as my_ for my_cert8.db. This option is provided as a special case. Changing the names of the certificate and key databases is not recommended.

      -installdir root-installation-directory

      Specify the root installation directory relative to which files will be installed by the -jar option. This directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory.

      -libfile library-file

      Specify a path to a library file containing the implementation of the PKCS #11 interface module that is being added to the database.

      -mechanisms mechanism-list

      Specify the security mechanisms for which a particular module will be flagged as a default provider. The mechanism-list is a colon-delimited list of mechanism names. Enclose this list in quotation marks if it contains spaces.

      The module becomes a default provider for the listed mechanisms when those mechanisms are enabled. If more than one module claims to be a particular mechanism's default provider, that mechanism's default provider is undefined.

      modutil supports several mechanisms: RSA, DSA, RC2, RC4, RC5, AES, DES, DH, SHA1, SHA256, SHA512, SSL, TLS, MD5, MD2, RANDOM (for random number generation), and FRIENDLY (meaning certificates are publicly readable).

      -newpwfile new-password-file

      Specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw option.

      -nocertdb

      Do not open the certificate or key databases. This has several effects:

      • With the -create command, only a module security file is created; certificate and key databases are not created.

      • With the -jar command, signatures on the JAR file are not checked.

      • With the -changepw command, the password on the NSS internal module cannot be set or changed, since this password is stored in the key database.

      -pwfile old-password-file

      Specify a text file containing a token's existing password so that a password can be entered automatically when the -changepw option is used to change passwords.

      -secmod secmodname

      Give the name of the security module database (like secmod.db) to load.

      -slot slotname

      Specify a particular slot to be enabled or disabled with the -enable or -disable options.

      -string CONFIG_STRING

      Pass a configuration string for the module being added to the database.

      -tempdir temporary-directory

      Give a directory location where temporary files are created during the installation by the -jar option. If no temporary directory is specified, the current directory is used.

      Usage and Examples

      Creating Database Files

      Before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. The only required argument is the database that where the databases will be located.

      modutil -create -dbdir [sql:]directory

      Adding a Cryptographic Module

      Adding a PKCS #11 module means submitting a supporting library file, enabling its ciphers, and setting default provider status for various security mechanisms. This can be done by supplying all of the information through modutil directly or by running a JAR file and install script. For the most basic case, simply upload the library:

      modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] 

      For example: -

      modutil -dbdir sql:/home/my/sharednssdb -add "Example PKCS #11 Module" -libfile "/tmp/crypto.so" -mechanisms RSA:DSA:RC2:RANDOM 
      +	

      Options

      -add modulename

      Add the named PKCS #11 module to the database. Use this option with the -libfile, -ciphers, and -mechanisms arguments.

      -changepw tokenname

      Change the password on the named token. If the token has not been initialized, this option initializes the password. Use this option with the -pwfile and -newpwfile arguments. A password is equivalent to a personal identification number (PIN).

      -chkfips

      Verify whether the module is in the given FIPS mode. true means to verify that the module is in FIPS mode, while false means to verify that the module is not in FIPS mode.

      -create

      Create new certificate, key, and module databases. Use the -dbdir directory argument to specify a directory. If any of these databases already exist in a specified directory, modutil returns an error message.

      -default modulename

      Specify the security mechanisms for which the named module will be a default provider. The security mechanisms are specified with the -mechanisms argument.

      -delete modulename

      Delete the named module. The default NSS PKCS #11 module cannot be deleted.

      -disable modulename

      Disable all slots on the named module. Use the -slot argument to disable a specific slot.

      The internal NSS PKCS #11 module cannot be disabled.

      -enable modulename

      Enable all slots on the named module. Use the -slot argument to enable a specific slot.

      -fips [true | false]

      Enable (true) or disable (false) FIPS 140-2 compliance for the default NSS module.

      -force

      Disable modutil's interactive prompts so it can be run from a script. Use this option only after manually testing each planned operation to check for warnings and to ensure that bypassing the prompts will cause no security lapses or loss of database integrity.

      -jar JAR-file

      Add a new PKCS #11 module to the database using the named JAR file. Use this command with the -installdir and -tempdir arguments. The JAR file uses the NSS PKCS #11 JAR format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the PKCS #11 module library file and other files such as documentation. This is covered in the JAR installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil.

      -list [modulename]

      Display basic information about the contents of the secmod.db file. Specifying a modulename displays detailed information about a particular module and its slots and tokens.

      -rawadd

      Add the module spec string to the secmod.db database.

      -rawlist

      Display the module specs for a specified module or for all loadable modules.

      -undefault modulename

      Specify the security mechanisms for which the named module will not be a default provider. The security mechanisms are specified with the -mechanisms argument.

      Arguments

      MODULE

      Give the security module to access.

      MODULESPEC

      Give the security module spec to load into the security database.

      -ciphers cipher-enable-list

      Enable specific ciphers in a module that is being added to the database. The cipher-enable-list is a colon-delimited list of cipher names. Enclose this list in quotation marks if it contains spaces.

      -dbdir directory

      Specify the database directory in which to access or create security module database files.

      modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix dbm: is not used, then the tool assumes that the given databases are in SQLite format.

      --dbprefix prefix

      Specify the prefix used on the database files, such as my_ for my_cert9.db. This option is provided as a special case. Changing the names of the certificate and key databases is not recommended.

      -installdir root-installation-directory

      Specify the root installation directory relative to which files will be installed by the -jar option. This directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory.

      -libfile library-file

      Specify a path to a library file containing the implementation of the PKCS #11 interface module that is being added to the database.

      -mechanisms mechanism-list

      Specify the security mechanisms for which a particular module will be flagged as a default provider. The mechanism-list is a colon-delimited list of mechanism names. Enclose this list in quotation marks if it contains spaces.

      The module becomes a default provider for the listed mechanisms when those mechanisms are enabled. If more than one module claims to be a particular mechanism's default provider, that mechanism's default provider is undefined.

      modutil supports several mechanisms: RSA, DSA, RC2, RC4, RC5, AES, DES, DH, SHA1, SHA256, SHA512, SSL, TLS, MD5, MD2, RANDOM (for random number generation), and FRIENDLY (meaning certificates are publicly readable).

      -newpwfile new-password-file

      Specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw option.

      -nocertdb

      Do not open the certificate or key databases. This has several effects:

      • With the -create command, only a module security file is created; certificate and key databases are not created.

      • With the -jar command, signatures on the JAR file are not checked.

      • With the -changepw command, the password on the NSS internal module cannot be set or changed, since this password is stored in the key database.

      -pwfile old-password-file

      Specify a text file containing a token's existing password so that a password can be entered automatically when the -changepw option is used to change passwords.

      -secmod secmodname

      Give the name of the security module database (like secmod.db) to load.

      -slot slotname

      Specify a particular slot to be enabled or disabled with the -enable or -disable options.

      -string CONFIG_STRING

      Pass a configuration string for the module being added to the database.

      -tempdir temporary-directory

      Give a directory location where temporary files are created during the installation by the -jar option. If no temporary directory is specified, the current directory is used.

      Usage and Examples

      Creating Database Files

      Before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. The only required argument is the database that where the databases will be located.

      modutil -create -dbdir directory

      Adding a Cryptographic Module

      Adding a PKCS #11 module means submitting a supporting library file, enabling its ciphers, and setting default provider status for various security mechanisms. This can be done by supplying all of the information through modutil directly or by running a JAR file and install script. For the most basic case, simply upload the library:

      modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] 

      For example: +

      modutil -dbdir /home/my/sharednssdb -add "Example PKCS #11 Module" -libfile "/tmp/crypto.so" -mechanisms RSA:DSA:RC2:RANDOM 
       
       Using database directory ... 
       Module "Example PKCS #11 Module" added to database.

      Installing a Cryptographic Module from a JAR File

      PKCS #11 modules can also be loaded using a JAR file, which contains all of the required libraries and an installation script that describes how to install the module. The JAR install script is described in more detail in the section called “JAR Installation File Format”.

      The JAR installation script defines the setup information for each platform that the module can be installed on. For example:

      Platforms { 
          Linux:5.4.08:x86 { 
             ModuleName { "Example PKCS #11 Module" } 
             ModuleFile { crypto.so } 
             DefaultMechanismFlags{0x0000} 
      @@ -20,17 +20,17 @@ Module "Example PKCS #11 Module" added t
                   Executable 
                   Path{ /tmp/setup.sh } 
                } 
             } 
          } 
          Linux:6.0.0:x86 { 
             EquivalentPlatform { Linux:5.4.08:x86 } 
          } 
      -} 

      Both the install script and the required libraries must be bundled in a JAR file, which is specified with the -jar argument.

      modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/home/my/sharednssdb
      +} 

      Both the install script and the required libraries must be bundled in a JAR file, which is specified with the -jar argument.

      modutil -dbdir /home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir /home/my/sharednssdb
       
       This installation JAR file was signed by: 
       ---------------------------------------------- 
       
       **SUBJECT NAME** 
       
       C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital ID
       Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS
      @@ -48,32 +48,32 @@ Successfully parsed installation script
       Current platform is Linux:5.4.08:x86 
       Using installation parameters for platform Linux:5.4.08:x86 
       Installed file crypto.so to /tmp/crypto.so
       Installed file setup.sh to ./pk11inst.dir/setup.sh 
       Executing "./pk11inst.dir/setup.sh"... 
       "./pk11inst.dir/setup.sh" executed successfully 
       Installed module "Example PKCS #11 Module" into module database 
       
      -Installation completed successfully 

      Adding Module Spec

      Each module has information stored in the security database about its configuration and parameters. These can be added or edited using the -rawadd command. For the current settings or to see the format of the module spec in the database, use the -rawlist option.

      modutil -rawadd modulespec

      Deleting a Module

      A specific PKCS #11 module can be deleted from the secmod.db database:

      modutil -delete modulename -dbdir [sql:]directory 

      Displaying Module Information

      The secmod.db database contains information about the PKCS #11 modules that are available to an application or server to use. The list of all modules, information about specific modules, and database configuration specs for modules can all be viewed.

      To simply get a list of modules in the database, use the -list command.

      modutil -list [modulename] -dbdir [sql:]directory 

      Listing the modules shows the module name, their status, and other associated security databases for certificates and keys. For example:

      modutil -list -dbdir sql:/home/my/sharednssdb 
      +Installation completed successfully 

      Adding Module Spec

      Each module has information stored in the security database about its configuration and parameters. These can be added or edited using the -rawadd command. For the current settings or to see the format of the module spec in the database, use the -rawlist option.

      modutil -rawadd modulespec

      Deleting a Module

      A specific PKCS #11 module can be deleted from the secmod.db database:

      modutil -delete modulename -dbdir directory 

      Displaying Module Information

      The secmod.db database contains information about the PKCS #11 modules that are available to an application or server to use. The list of all modules, information about specific modules, and database configuration specs for modules can all be viewed.

      To simply get a list of modules in the database, use the -list command.

      modutil -list [modulename] -dbdir directory 

      Listing the modules shows the module name, their status, and other associated security databases for certificates and keys. For example:

      modutil -list -dbdir /home/my/sharednssdb 
       
       Listing of PKCS #11 Modules
       -----------------------------------------------------------
         1. NSS Internal PKCS #11 Module
                slots: 2 slots attached
               status: loaded
       
                slot: NSS Internal Cryptographic Services                            
               token: NSS Generic Crypto Services
       	  uri: pkcs11:token=NSS%20Generic%20Crypto%20Services;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203
       
                slot: NSS User Private Key and Certificate Services                  
               token: NSS Certificate DB
       	  uri: pkcs11:token=NSS%20Certificate%20DB;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203
      ------------------------------------------------------------

      Passing a specific module name with the -list returns details information about the module itself, like supported cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on. For example:

       modutil -list "NSS Internal PKCS #11 Module" -dbdir sql:/home/my/sharednssdb
      +-----------------------------------------------------------

      Passing a specific module name with the -list returns details information about the module itself, like supported cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on. For example:

       modutil -list "NSS Internal PKCS #11 Module" -dbdir /home/my/sharednssdb
       
       -----------------------------------------------------------
       Name: NSS Internal PKCS #11 Module
       Library file: **Internal ONLY module**
       Manufacturer: Mozilla Foundation              
       Description: NSS Internal Crypto Services    
       PKCS #11 Version 2.20
       Library Version: 3.11
      @@ -107,28 +107,28 @@ Default Mechanism Flags: RSA:RC2:RC4:DES
         Token Name: NSS Certificate DB              
         Token Manufacturer: Mozilla Foundation              
         Token Model: NSS 3           
         Token Serial Number: 0000000000000000
         Token Version: 8.3
         Token Firmware Version: 0.0
         Access: NOT Write Protected
         Login Type: Login required
      -  User Pin: Initialized

      A related command, -rawlist returns information about the database configuration for the modules. (This information can be edited by loading new specs using the -rawadd command.)

       modutil -rawlist -dbdir sql:/home/my/sharednssdb
      +  User Pin: Initialized

      A related command, -rawlist returns information about the database configuration for the modules. (This information can be edited by loading new specs using the -rawadd command.)

       modutil -rawlist -dbdir /home/my/sharednssdb
        name="NSS Internal PKCS #11 Module" parameters="configdir=. certPrefix= keyPrefix= secmod=secmod.db flags=readOnly " NSS="trustOrder=75 cipherOrder=100 slotParams={0x00000001=[slotFlags=RSA,RC4,RC2,DES,DH,SHA1,MD5,MD2,SSL,TLS,AES,RANDOM askpw=any timeout=30 ] }  Flags=internal,critical"

      Setting a Default Provider for Security Mechanisms

      Multiple security modules may provide support for the same security mechanisms. It is possible to set a specific security module as the default provider for a specific security mechanism (or, conversely, to prohibit a provider from supplying those mechanisms).

      modutil -default modulename -mechanisms mechanism-list 

      To set a module as the default provider for mechanisms, use the -default command with a colon-separated list of mechanisms. The available mechanisms depend on the module; NSS supplies almost all common mechanisms. For example:

      modutil -default "NSS Internal PKCS #11 Module" -dbdir -mechanisms RSA:DSA:RC2 
       
       Using database directory c:\databases...
       
       Successfully changed defaults.

      Clearing the default provider has the same format:

      modutil -undefault "NSS Internal PKCS #11 Module" -dbdir -mechanisms MD2:MD5

      Enabling and Disabling Modules and Slots

      Modules, and specific slots on modules, can be selectively enabled or disabled using modutil. Both commands have the same format:

      modutil -enable|-disable modulename [-slot slotname] 

      For example:

      modutil -enable "NSS Internal PKCS #11 Module" -slot "NSS Internal Cryptographic Services                            " -dbdir .
       
      -Slot "NSS Internal Cryptographic Services                            " enabled.

      Be sure that the appropriate amount of trailing whitespace is after the slot name. Some slot names have a significant amount of whitespace that must be included, or the operation will fail.

      Enabling and Verifying FIPS Compliance

      The NSS modules can have FIPS 140-2 compliance enabled or disabled using modutil with the -fips option. For example:

      modutil -fips true -dbdir sql:/home/my/sharednssdb/
      +Slot "NSS Internal Cryptographic Services                            " enabled.

      Be sure that the appropriate amount of trailing whitespace is after the slot name. Some slot names have a significant amount of whitespace that must be included, or the operation will fail.

      Enabling and Verifying FIPS Compliance

      The NSS modules can have FIPS 140-2 compliance enabled or disabled using modutil with the -fips option. For example:

      modutil -fips true -dbdir /home/my/sharednssdb/
       
      -FIPS mode enabled.

      To verify that status of FIPS mode, run the -chkfips command with either a true or false flag (it doesn't matter which). The tool returns the current FIPS setting.

      modutil -chkfips false -dbdir sql:/home/my/sharednssdb/
      +FIPS mode enabled.

      To verify that status of FIPS mode, run the -chkfips command with either a true or false flag (it doesn't matter which). The tool returns the current FIPS setting.

      modutil -chkfips false -dbdir /home/my/sharednssdb/
       
      -FIPS mode enabled.

      Changing the Password on a Token

      Initializing or changing a token's password:

      modutil -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] 
      modutil -dbdir sql:/home/my/sharednssdb -changepw "NSS Certificate DB" 
      +FIPS mode enabled.

      Changing the Password on a Token

      Initializing or changing a token's password:

      modutil -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] 
      modutil -dbdir /home/my/sharednssdb -changepw "NSS Certificate DB" 
       
       Enter old password: 
       Incorrect password, try again... 
       Enter old password: 
       Enter new password: 
       Re-enter new password: 
       Token "Communicator Certificate DB" password changed successfully.

      JAR Installation File Format

      When a JAR file is run by a server, by modutil, or by any program that does not interpret JavaScript, a special information file must be included to install the libraries. There are several things to keep in mind with this file:

      • It must be declared in the JAR archive's manifest file. @@ -234,18 +234,18 @@ The last versions of these

        • cert9.db for certificates

        • key4.db for keys

        • pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory -

      Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

      By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example:

      modutil -create -dbdir sql:/home/my/sharednssdb

      To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql:

      export NSS_DEFAULT_DB_TYPE="sql"

      This line can be added to the ~/.bashrc file to make the change permanent for the user.

      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:

      • +

      Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

      By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type. +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example:

      modutil -create -dbdir dbm:/home/my/sharednssdb

      To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm:

      export NSS_DEFAULT_DB_TYPE="dbm"

      This line can be added to the ~/.bashrc file to make the change permanent for the user.

      • https://wiki.mozilla.org/NSS_Shared_DB_Howto

      For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:

      • https://wiki.mozilla.org/NSS_Shared_DB

      See Also

      certutil (1)

      pk12util (1)

      signtool (1)

      The NSS wiki has information on the new database design and how to configure applications to use it.

      • https://wiki.mozilla.org/NSS_Shared_DB_Howto

      • https://wiki.mozilla.org/NSS_Shared_DB

      Additional Resources

      For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at http://www.mozilla.org/projects/security/pki/nss/. The NSS site relates directly to NSS code changes and releases.

      Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto

      IRC: Freenode at #dogtag-pki

      Authors

      The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.

      Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>.

      LICENSE

      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/. diff --git a/doc/html/pk12util.html b/doc/html/pk12util.html --- a/doc/html/pk12util.html +++ b/doc/html/pk12util.html @@ -1,27 +1,27 @@ -PK12UTIL

      Name

      pk12util — Export and import keys and certificate to or from a PKCS #12 file and the NSS database

      Synopsis

      pk12util [-i p12File|-l p12File|-o p12File] [-d [sql:]directory] [-h tokenname] [-P dbprefix] [-r] [-v] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 -

      Description

      The PKCS #12 utility, pk12util, enables sharing certificates among any server that supports PKCS #12. The tool can import certificates and keys from PKCS #12 files into security databases, export certificates, and list certificates and keys.

      Options and Arguments

      Options

      -i p12file

      Import keys and certificates from a PKCS #12 file into a security database.

      -l p12file

      List the keys and certificates in PKCS #12 file.

      -o p12file

      Export keys and certificates from the security database to a PKCS #12 file.

      Arguments

      -c keyCipher

      Specify the key encryption algorithm.

      -C certCipher

      Specify the certiticate encryption algorithm.

      -d [sql:]directory

      Specify the database directory into which to import to or export from certificates and keys.

      pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql: is not used, then the tool assumes that the given databases are in the old format.

      -h tokenname

      Specify the name of the token to import into or export from.

      -k slotPasswordFile

      Specify the text file containing the slot's password.

      -K slotPassword

      Specify the slot's password.

      -m | --key-len keyLength

      Specify the desired length of the symmetric key to be used to encrypt the private key.

      -n | --cert-key-len certKeyLength

      Specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data.

      -n certname

      Specify the nickname of the cert and private key to export.

      The nickname can also be a PKCS #11 URI. For example, if you have a certificate named "my-server-cert" on the internal certificate store, it can be unambiguously specified as "pkcs11:token=NSS%20Certificate%20DB;object=my-server-cert". For details about the format, see RFC 7512.

      -P prefix

      Specify the prefix used on the certificate and key databases. This option is provided as a special case. +PK12UTIL

      Name

      pk12util — Export and import keys and certificate to or from a PKCS #12 file and the NSS database

      Synopsis

      pk12util [-i p12File|-l p12File|-o p12File] [-c keyCipher] [-C certCipher] [-d directory] [-h tokenname] [-m | --key-len keyLength] [-M hashAlg] [-n certname] [-P dbprefix] [-r] [-v] [--cert-key-len certKeyLength] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 +

      Description

      The PKCS #12 utility, pk12util, enables sharing certificates among any server that supports PKCS #12. The tool can import certificates and keys from PKCS #12 files into security databases, export certificates, and list certificates and keys.

      Options and Arguments

      Options

      -i p12file

      Import keys and certificates from a PKCS #12 file into a security database.

      -l p12file

      List the keys and certificates in PKCS #12 file.

      -o p12file

      Export keys and certificates from the security database to a PKCS #12 file.

      Arguments

      -c keyCipher

      Specify the key encryption algorithm.

      -C certCipher

      Specify the certiticate encryption algorithm.

      -d directory

      Specify the database directory into which to import to or export from certificates and keys.

      pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix dbm: is not used, then the tool assumes that the given databases are in the SQLite format.

      -h tokenname

      Specify the name of the token to import into or export from.

      -k slotPasswordFile

      Specify the text file containing the slot's password.

      -K slotPassword

      Specify the slot's password.

      -m | --key-len keyLength

      Specify the desired length of the symmetric key to be used to encrypt the private key.

      -M hashAlg

      Specify the hash algorithm used in the pkcs #12 mac. This algorithm also specifies the HMAC used in the prf when using pkcs #5 v2.

      --cert-key-len certKeyLength

      Specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data.

      -n certname

      Specify the nickname of the cert and private key to export.

      The nickname can also be a PKCS #11 URI. For example, if you have a certificate named "my-server-cert" on the internal certificate store, it can be unambiguously specified as "pkcs11:token=NSS%20Certificate%20DB;object=my-server-cert". For details about the format, see RFC 7512.

      -P prefix

      Specify the prefix used on the certificate and key databases. This option is provided as a special case. Changing the names of the certificate and key databases is not recommended.

      -r

      Dumps all of the data in raw (binary) form. This must be saved as a DER file. The default is to return information in a pretty-print ASCII format, which displays the information about the certificates and public keys in the p12 file.

      -v

      Enable debug logging when importing.

      -w p12filePasswordFile

      Specify the text file containing the pkcs #12 file password.

      -W p12filePassword

      Specify the pkcs #12 file password.

      Return Codes

      • 0 - No error

      • 1 - User Cancelled

      • 2 - Usage error

      • 6 - NLS init error

      • 8 - Certificate DB open error

      • 9 - Key DB open error

      • 10 - File initialization error

      • 11 - Unicode conversion error

      • 12 - Temporary file creation error

      • 13 - PKCS11 get slot error

      • 14 - PKCS12 decoder start error

      • 15 - error read from import file

      • 16 - pkcs12 decode error

      • 17 - pkcs12 decoder verify error

      • 18 - pkcs12 decoder validate bags error

      • 19 - pkcs12 decoder import bags error

      • 20 - key db conversion version 3 to version 2 error

      • 21 - cert db conversion version 7 to version 5 error

      • 22 - cert and key dbs patch error

      • 23 - get default cert db error

      • 24 - find cert by nickname error

      • 25 - create export context error

      • 26 - PKCS12 add password itegrity error

      • 27 - cert and key Safes creation error

      • 28 - PKCS12 add cert and key error

      • 29 - PKCS12 encode error

      Examples

      Importing Keys and Certificates

      The most basic usage of pk12util for importing a certificate or key is the PKCS #12 input file (-i) and some way to specify the security database being accessed (either -d for a directory or -h for a token).

      - pk12util -i p12File [-h tokenname] [-v] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] -

      For example:

      # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb
      +    pk12util -i p12File [-h tokenname] [-v] [-d directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]
      +    

      For example:

      # pk12util -i /tmp/cert-files/users.p12 -d /home/my/sharednssdb
       
       Enter a password which will be used to encrypt your keys.
       The password should be at least 8 characters long,
       and should contain at least one non-alphabetic character.
       
       Enter new password: 
       Re-enter password: 
       Enter password for PKCS12 file: 
       pk12util: PKCS12 IMPORT SUCCESSFUL

      Exporting Keys and Certificates

      Using the pk12util command to export certificates and keys requires both the name of the certificate to extract from the database (-n) and the PKCS #12-formatted output file to write to. There are optional parameters that can be used to encrypt the file to protect the certificate material. -

      pk12util -o p12File -n certname [-c keyCipher] [-C certCipher] [-m|--key_len keyLen] [-n|--cert_key_len certKeyLen] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]

      For example:

      # pk12util -o certs.p12 -n Server-Cert -d sql:/home/my/sharednssdb
      +    

      pk12util -o p12File -n certname [-c keyCipher] [-C certCipher] [-m|--key_len keyLen] [-n|--cert_key_len certKeyLen] [-d directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]

      For example:

      # pk12util -o certs.p12 -n Server-Cert -d /home/my/sharednssdb
       Enter password for PKCS12 file: 
       Re-enter password: 

      Listing Keys and Certificates

      The information in a .p12 file are not human-readable. The certificates and keys in the file can be printed (listed) in a human-readable pretty-print format that shows information for every certificate and any public keys in the .p12 file. -

      pk12util -l p12File [-h tokenname] [-r] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]

      For example, this prints the default ASCII output:

      # pk12util -l certs.p12
      +    

      pk12util -l p12File [-h tokenname] [-r] [-d directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]

      For example, this prints the default ASCII output:

      # pk12util -l certs.p12
       
       Enter password for PKCS12 file: 
       Key(shrouded):
           Friendly Name: Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID
       
           Encryption algorithm: PKCS #12 V2 PBE With SHA-1 And 3KEY Triple DES-CBC
               Parameters:
                   Salt:
      @@ -59,18 +59,18 @@ The last versions of these 
      • cert9.db for certificates

      • key4.db for keys

      • pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory -

      Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

      By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example:

      # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb

      To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql:

      export NSS_DEFAULT_DB_TYPE="sql"

      This line can be set added to the ~/.bashrc file to make the change permanent.

      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:

      • +

      Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

      By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example:

      # pk12util -i /tmp/cert-files/users.p12 -d dbm:/home/my/sharednssdb

      To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm:

      export NSS_DEFAULT_DB_TYPE="dbm"

      This line can be set added to the ~/.bashrc file to make the change permanent.

      • https://wiki.mozilla.org/NSS_Shared_DB_Howto

      For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:

      • https://wiki.mozilla.org/NSS_Shared_DB

      Compatibility Notes

      The exporting behavior of pk12util has changed over time, while importing files exported with older versions of NSS is still supported.

      Until the 3.30 release, pk12util used the UTF-16 encoding for the PKCS #5 password-based encryption schemes, while the recommendation is to encode passwords in UTF-8 if the used encryption scheme is defined outside of the PKCS #12 standard.

      Until the 3.31 release, even when "AES-128-CBC" or "AES-192-CBC" is given from the command line, pk12util always used 256-bit AES as the underlying encryption scheme.

      For historical reasons, pk12util accepts password-based encryption schemes not listed in this document. However, those schemes are not officially supported and may have issues in interoperability with other tools.

      See Also

      certutil (1)

      modutil (1)

      The NSS wiki has information on the new database design and how to configure applications to use it.

      • https://wiki.mozilla.org/NSS_Shared_DB_Howto

      • https://wiki.mozilla.org/NSS_Shared_DB

      Additional Resources

      For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at http://www.mozilla.org/projects/security/pki/nss/. The NSS site relates directly to NSS code changes and releases.

      Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto

      IRC: Freenode at #dogtag-pki

      Authors

      The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.

      Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>.

      LICENSE

      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/. diff --git a/doc/html/pp.html b/doc/html/pp.html --- a/doc/html/pp.html +++ b/doc/html/pp.html @@ -1,7 +1,7 @@ -PP

      Name

      pp — Prints certificates, keys, crls, and pkcs7 files

      Synopsis

      pp -t type [-a] [-i input] [-o output] [-u] [-w]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 -

      Description

      pp pretty-prints private and public key, certificate, certificate-request, - pkcs7 or crl files -

      Options

      -t type

      specify the input, one of {private-key | public-key | certificate | certificate-request | pkcs7 | crl}

      -a
      Input is in ascii encoded form (RFC1113)
      -i inputfile
      Define an input file to use (default is stdin)
      -o outputfile
      Define an output file to use (default is stdout)
      -u
      Use UTF-8 (default is to show non-ascii as .)
      -w
      Don't wrap long output lines

      Additional Resources

      NSS is maintained in conjunction with PKI and security-related projects through Mozilla and Fedora. The most closely-related project is Dogtag PKI, with a project wiki at PKI Wiki.

      For information specifically about NSS, the NSS project wiki is located at Mozilla NSS site. The NSS site relates directly to NSS code changes and releases.

      Mailing lists: pki-devel@redhat.com and pki-users@redhat.com

      IRC: Freenode at #dogtag-pki

      Authors

      The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.

      +PP

      Name

      pp — Prints certificates, keys, crls, and pkcs7 files

      Synopsis

      pp -t type [-a] [-i input] [-o output] [-u] [-w]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 +

      Description

      pp pretty-prints private and public key, certificate, certificate-request, + pkcs7, pkcs12 or crl files +

      Options

      -t type

      specify the input, one of {private-key | public-key | certificate | certificate-request | pkcs7 | pkcs12 | crl | name}

      -a
      Input is in ascii encoded form (RFC1113)
      -i inputfile
      Define an input file to use (default is stdin)
      -o outputfile
      Define an output file to use (default is stdout)
      -u
      Use UTF-8 (default is to show non-ascii as .)
      -w
      Don't wrap long output lines

      Additional Resources

      NSS is maintained in conjunction with PKI and security-related projects through Mozilla and Fedora. The most closely-related project is Dogtag PKI, with a project wiki at PKI Wiki.

      For information specifically about NSS, the NSS project wiki is located at Mozilla NSS site. The NSS site relates directly to NSS code changes and releases.

      Mailing lists: pki-devel@redhat.com and pki-users@redhat.com

      IRC: Freenode at #dogtag-pki

      Authors

      The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.

      Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>.

      LICENSE

      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/.

      diff --git a/doc/html/signver.html b/doc/html/signver.html --- a/doc/html/signver.html +++ b/doc/html/signver.html @@ -1,12 +1,12 @@ -SIGNVER

      Name

      signver — Verify a detached PKCS#7 signature for a file.

      Synopsis

      signtool -A | -V -d directory [-a] [-i input_file] [-o output_file] [-s signature_file] [-v]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 -

      Description

      The Signature Verification Tool, signver, is a simple command-line utility that unpacks a base-64-encoded PKCS#7 signed object and verifies the digital signature using standard cryptographic techniques. The Signature Verification Tool can also display the contents of the signed object.

      Options

      -A

      Displays all of the information in the PKCS#7 signature.

      -V

      Verifies the digital signature.

      -d [sql:]directory

      Specify the database directory which contains the certificates and keys.

      signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql: is not used, then the tool assumes that the given databases are in the old format.

      -a

      Sets that the given signature file is in ASCII format.

      -i input_file

      Gives the input file for the object with signed data.

      -o output_file

      Gives the output file to which to write the results.

      -s signature_file

      Gives the input file for the digital signature.

      -v

      Enables verbose output.

      Extended Examples

      Verifying a Signature

      The -V option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file).

      signver -V -s signature_file -i signed_file -d sql:/home/my/sharednssdb
      +SIGNVER

      Name

      signver — Verify a detached PKCS#7 signature for a file.

      Synopsis

      signtool -A | -V -d directory [-a] [-i input_file] [-o output_file] [-s signature_file] [-v]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 +

      Description

      The Signature Verification Tool, signver, is a simple command-line utility that unpacks a base-64-encoded PKCS#7 signed object and verifies the digital signature using standard cryptographic techniques. The Signature Verification Tool can also display the contents of the signed object.

      Options

      -A

      Displays all of the information in the PKCS#7 signature.

      -V

      Verifies the digital signature.

      -d directory

      Specify the database directory which contains the certificates and keys.

      signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix dbm: is not used, then the tool assumes that the given databases are in the SQLite format.

      -a

      Sets that the given signature file is in ASCII format.

      -i input_file

      Gives the input file for the object with signed data.

      -o output_file

      Gives the output file to which to write the results.

      -s signature_file

      Gives the input file for the digital signature.

      -v

      Enables verbose output.

      Extended Examples

      Verifying a Signature

      The -V option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file).

      signver -V -s signature_file -i signed_file -d /home/my/sharednssdb
       
      -signatureValid=yes

      Printing Signature Data

      +signatureValid=yes

      Printing Signature Data

      The -A option prints all of the information contained in a signature file. Using the -o option prints the signature file information to the given output file rather than stdout.

      signver -A -s signature_file -o output_file

      NSS Database Types

      NSS originally used BerkeleyDB databases to store security information. The last versions of these legacy databases are:

      • cert8.db for certificates

      • key3.db for keys

      • secmod.db for PKCS #11 module information @@ -14,18 +14,18 @@ The last versions of these

        • cert9.db for certificates

        • key4.db for keys

        • pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory -

      Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

      By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example:

      # signver -A -s signature -d sql:/home/my/sharednssdb

      To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql:

      export NSS_DEFAULT_DB_TYPE="sql"

      This line can be added to the ~/.bashrc file to make the change permanent for the user.

      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:

      • +

      Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility.

      By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example:

      # signver -A -s signature -d dbm:/home/my/sharednssdb

      To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm:

      export NSS_DEFAULT_DB_TYPE="dbm"

      This line can be added to the ~/.bashrc file to make the change permanent for the user.

      • https://wiki.mozilla.org/NSS_Shared_DB_Howto

      For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:

      • https://wiki.mozilla.org/NSS_Shared_DB

      See Also

      signtool (1)

      The NSS wiki has information on the new database design and how to configure applications to use it.

      • Setting up the shared NSS database

        https://wiki.mozilla.org/NSS_Shared_DB_Howto

      • Engineering and technical information about the shared NSS database

        https://wiki.mozilla.org/NSS_Shared_DB

      Additional Resources

      For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at http://www.mozilla.org/projects/security/pki/nss/. The NSS site relates directly to NSS code changes and releases.

      Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto

      IRC: Freenode at #dogtag-pki

      Authors

      The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.

      Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. diff --git a/doc/html/ssltap.html b/doc/html/ssltap.html --- a/doc/html/ssltap.html +++ b/doc/html/ssltap.html @@ -1,9 +1,9 @@ -SSLTAP

      Name

      ssltap — Tap into SSL connections and display the data going by

      Synopsis

      ssltap [-fhlsvx] [-p port] [hostname:port]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477 +SSLTAP

      Name

      ssltap — Tap into SSL connections and display the data going by

      Synopsis

      ssltap [-fhlsvx] [-p port] [hostname:port]

      STATUS

      This documentation is still work in progress. Please contribute to the initial review in Mozilla NSS bug 836477

      Description

      The SSL Debugging Tool ssltap is an SSL-aware command-line proxy. It watches TCP connections and displays the data going by. If a connection is SSL, the data display includes interpreted SSL records and handshaking

      Options

      -f

      Turn on fancy printing. Output is printed in colored HTML. Data sent from the client to the server is in blue; the server's reply is in red. When used with looping mode, the different connections are separated with horizontal lines. You can use this option to upload the output into a browser.

      -h

      Turn on hex/ASCII printing. Instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ASCII characters. The two parts are separated by a vertical bar. Nonprinting characters are replaced by dots.

      -l prefix

      Turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete.

      -p port

      Change the default rendezvous port (1924) to another port.

      The following are well-known port numbers:

      * HTTP 80 diff --git a/doc/modutil.xml b/doc/modutil.xml --- a/doc/modutil.xml +++ b/doc/modutil.xml @@ -144,24 +144,24 @@ -ciphers cipher-enable-list Enable specific ciphers in a module that is being added to the database. The cipher-enable-list is a colon-delimited list of cipher names. Enclose this list in quotation marks if it contains spaces. - -dbdir [sql:]directory + -dbdir directory Specify the database directory in which to access or create security module database files. - modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql: is not used, then the tool assumes that the given databases are in the old format. + modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix dbm: is not used, then the tool assumes that the given databases are in SQLite format. --dbprefix prefix - Specify the prefix used on the database files, such as my_ for my_cert8.db. This option is provided as a special case. Changing the names of the certificate and key databases is not recommended. + Specify the prefix used on the database files, such as my_ for my_cert9.db. This option is provided as a special case. Changing the names of the certificate and key databases is not recommended. -installdir root-installation-directory Specify the root installation directory relative to which files will be installed by the option. This directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. @@ -224,23 +224,23 @@ Usage and Examples Creating Database Files Before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. The only required argument is the database that where the databases will be located. -modutil -create -dbdir [sql:]directory +modutil -create -dbdir directory Adding a Cryptographic Module Adding a PKCS #11 module means submitting a supporting library file, enabling its ciphers, and setting default provider status for various security mechanisms. This can be done by supplying all of the information through modutil directly or by running a JAR file and install script. For the most basic case, simply upload the library: modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] For example: -modutil -dbdir sql:/home/my/sharednssdb -add "Example PKCS #11 Module" -libfile "/tmp/crypto.so" -mechanisms RSA:DSA:RC2:RANDOM +modutil -dbdir /home/my/sharednssdb -add "Example PKCS #11 Module" -libfile "/tmp/crypto.so" -mechanisms RSA:DSA:RC2:RANDOM Using database directory ... Module "Example PKCS #11 Module" added to database. Installing a Cryptographic Module from a JAR File PKCS #11 modules can also be loaded using a JAR file, which contains all of the required libraries and an installation script that describes how to install the module. The JAR install script is described in more detail in . @@ -262,17 +262,17 @@ Module "Example PKCS #11 Module" added t } } Linux:6.0.0:x86 { EquivalentPlatform { Linux:5.4.08:x86 } } } Both the install script and the required libraries must be bundled in a JAR file, which is specified with the argument. -modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/home/my/sharednssdb +modutil -dbdir /home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir /home/my/sharednssdb This installation JAR file was signed by: ---------------------------------------------- **SUBJECT NAME** C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital ID Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS @@ -299,42 +299,42 @@ Installation completed successfully Adding Module Spec Each module has information stored in the security database about its configuration and parameters. These can be added or edited using the command. For the current settings or to see the format of the module spec in the database, use the option. modutil -rawadd modulespec Deleting a Module A specific PKCS #11 module can be deleted from the secmod.db database: -modutil -delete modulename -dbdir [sql:]directory +modutil -delete modulename -dbdir directory Displaying Module Information The secmod.db database contains information about the PKCS #11 modules that are available to an application or server to use. The list of all modules, information about specific modules, and database configuration specs for modules can all be viewed. To simply get a list of modules in the database, use the command. -modutil -list [modulename] -dbdir [sql:]directory +modutil -list [modulename] -dbdir directory Listing the modules shows the module name, their status, and other associated security databases for certificates and keys. For example: -modutil -list -dbdir sql:/home/my/sharednssdb +modutil -list -dbdir /home/my/sharednssdb Listing of PKCS #11 Modules ----------------------------------------------------------- 1. NSS Internal PKCS #11 Module slots: 2 slots attached status: loaded slot: NSS Internal Cryptographic Services token: NSS Generic Crypto Services uri: pkcs11:token=NSS%20Generic%20Crypto%20Services;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203 slot: NSS User Private Key and Certificate Services token: NSS Certificate DB uri: pkcs11:token=NSS%20Certificate%20DB;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203 ----------------------------------------------------------- Passing a specific module name with the returns details information about the module itself, like supported cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on. For example: - modutil -list "NSS Internal PKCS #11 Module" -dbdir sql:/home/my/sharednssdb + modutil -list "NSS Internal PKCS #11 Module" -dbdir /home/my/sharednssdb ----------------------------------------------------------- Name: NSS Internal PKCS #11 Module Library file: **Internal ONLY module** Manufacturer: Mozilla Foundation Description: NSS Internal Crypto Services PKCS #11 Version 2.20 Library Version: 3.11 @@ -370,17 +370,17 @@ Default Mechanism Flags: RSA:RC2:RC4:DES Token Model: NSS 3 Token Serial Number: 0000000000000000 Token Version: 8.3 Token Firmware Version: 0.0 Access: NOT Write Protected Login Type: Login required User Pin: Initialized A related command, returns information about the database configuration for the modules. (This information can be edited by loading new specs using the command.) - modutil -rawlist -dbdir sql:/home/my/sharednssdb + modutil -rawlist -dbdir /home/my/sharednssdb name="NSS Internal PKCS #11 Module" parameters="configdir=. certPrefix= keyPrefix= secmod=secmod.db flags=readOnly " NSS="trustOrder=75 cipherOrder=100 slotParams={0x00000001=[slotFlags=RSA,RC4,RC2,DES,DH,SHA1,MD5,MD2,SSL,TLS,AES,RANDOM askpw=any timeout=30 ] } Flags=internal,critical" Setting a Default Provider for Security Mechanisms Multiple security modules may provide support for the same security mechanisms. It is possible to set a specific security module as the default provider for a specific security mechanism (or, conversely, to prohibit a provider from supplying those mechanisms). modutil -default modulename -mechanisms mechanism-list To set a module as the default provider for mechanisms, use the command with a colon-separated list of mechanisms. The available mechanisms depend on the module; NSS supplies almost all common mechanisms. For example: modutil -default "NSS Internal PKCS #11 Module" -dbdir -mechanisms RSA:DSA:RC2 @@ -398,29 +398,29 @@ Successfully changed defaults.For example: modutil -enable "NSS Internal PKCS #11 Module" -slot "NSS Internal Cryptographic Services " -dbdir . Slot "NSS Internal Cryptographic Services " enabled. Be sure that the appropriate amount of trailing whitespace is after the slot name. Some slot names have a significant amount of whitespace that must be included, or the operation will fail. Enabling and Verifying FIPS Compliance The NSS modules can have FIPS 140-2 compliance enabled or disabled using modutil with the option. For example: -modutil -fips true -dbdir sql:/home/my/sharednssdb/ +modutil -fips true -dbdir /home/my/sharednssdb/ FIPS mode enabled. To verify that status of FIPS mode, run the command with either a true or false flag (it doesn't matter which). The tool returns the current FIPS setting. -modutil -chkfips false -dbdir sql:/home/my/sharednssdb/ +modutil -chkfips false -dbdir /home/my/sharednssdb/ FIPS mode enabled. Changing the Password on a Token Initializing or changing a token's password: modutil -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] -modutil -dbdir sql:/home/my/sharednssdb -changepw "NSS Certificate DB" +modutil -dbdir /home/my/sharednssdb -changepw "NSS Certificate DB" Enter old password: Incorrect password, try again... Enter old password: Enter new password: Re-enter new password: Token "Communicator Certificate DB" password changed successfully. @@ -684,27 +684,26 @@ BerkleyDB. These new databases provide m pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility. -By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example: +By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type. +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example: -modutil -create -dbdir sql:/home/my/sharednssdb +modutil -create -dbdir dbm:/home/my/sharednssdb -To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql: -export NSS_DEFAULT_DB_TYPE="sql" +To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm: +export NSS_DEFAULT_DB_TYPE="dbm" This line can be added to the ~/.bashrc file to make the change permanent for the user. -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: https://wiki.mozilla.org/NSS_Shared_DB_Howto For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: diff --git a/doc/nroff/certutil.1 b/doc/nroff/certutil.1 --- a/doc/nroff/certutil.1 +++ b/doc/nroff/certutil.1 @@ -1,18 +1,18 @@ '\" t .\" Title: CERTUTIL .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 5 October 2017 +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "CERTUTIL" "1" "5 October 2017" "nss-tools" "NSS Security Tools" +.TH "CERTUTIL" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq @@ -182,16 +182,21 @@ key4\&.db)\&. .PP Arguments modify a command option and are usually lower case, numbers, or symbols\&. .PP \-a .RS 4 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\&. .RE .PP +\-\-simple\-self\-signed +.RS 4 +When printing the certificate chain, don\*(Aqt search for a chain if issuer name equals to subject name\&. +.RE +.PP \-b validity\-time .RS 4 Specify a time at which a certificate is required to be valid\&. Use when checking certificate validity with the \fB\-V\fR option\&. The format of the \fIvalidity\-time\fR argument is \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, @@ -242,17 +247,17 @@ requests the newer database .sp -1 .IP \(bu 2.3 .\} \fBdbm:\fR requests the legacy database .RE .sp If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE\&. If NSS_DEFAULT_DB_TYPE is not set then -\fBdbm:\fR +\fBsql:\fR is the default\&. .RE .PP \-\-dump\-ext\-val OID .RS 4 For single cert, print binary DER encoding of extension OID\&. .RE .PP @@ -569,16 +574,28 @@ The contexts are the following: .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBJ\fR (as an object signer) .RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBI\fR +(as an IPSEC user) +.RE .RE .PP \-v valid\-months .RS 4 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 \fB\-w\fR option\&. If this argument is not used, the default validity period is three months\&. .RE @@ -1041,16 +1058,93 @@ msTrustListSign .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} critical .RE .sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +x509Any +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ipsecIKE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ipsecIKEEnd +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ipsecIKEIntermediate +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ipsecEnd +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ipsecTunnel +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ipsecUser +.RE +.sp X\&.509 certificate extensions are described in RFC 5280\&. .RE .PP \-7 emailAddrs .RS 4 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\&. .RE .PP @@ -1194,31 +1288,31 @@ secmod\&.db or pkcs11\&.txt .RE .PP These databases must be created before certificates or keys can be generated\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-N \-d [sql:]directory +certutil \-N \-d directory .fi .if n \{\ .RE .\} .PP \fBCreating a Certificate Request\fR .PP 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\&. .sp .if n \{\ .RS 4 .\} .nf -$ 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] +$ certutil \-R \-k key\-type\-or\-id [\-q pqgfile|curve\-name] \-g key\-size \-s subject [\-h tokenname] \-d directory [\-p phone] [\-o output\-file] [\-a] .fi .if n \{\ .RE .\} .PP The \fB\-R\fR command options requires four arguments: @@ -1274,17 +1368,17 @@ to give the security database directory The new certificate request can be output in ASCII format (\fB\-a\fR) or can be written to a specified file (\fB\-o\fR)\&. .PP For example: .sp .if n \{\ .RS 4 .\} .nf -$ 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 +$ certutil \-R \-k rsa \-g 1024 \-s "CN=John Smith,O=Example Corp,L=Mountain View,ST=California,C=US" \-d $HOME/nssdb \-p 650\-555\-0123 \-a \-o cert\&.cer Generating key\&. This may take a few moments\&.\&.\&. .fi .if n \{\ .RE .\} .PP @@ -1295,17 +1389,17 @@ A valid certificate must be issued by a argument with the \fB\-S\fR command option\&. .sp .if n \{\ .RS 4 .\} .nf -$ 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] +$ certutil \-S \-k rsa|dsa|ec \-n certname \-s subject [\-c issuer |\-x] \-t trustargs \-d 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] .fi .if n \{\ .RE .\} .PP The series of numbers and \fB\-\-ext*\fR options set certificate extensions that can be added to the certificate when it is generated by the CA\&. Interactive prompts will result\&. @@ -1343,45 +1437,45 @@ When a certificate request is created, a specified in the \fB\-c\fR argument)\&. The issuing certificate must be in the certificate database in the specified directory\&. .sp .if n \{\ .RS 4 .\} .nf -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] +certutil \-C \-c issuer \-i cert\-request\-file \-o output\-file [\-m serial\-number] [\-v valid\-months] [\-w offset\-months] \-d directory [\-1] [\-2] [\-3] [\-4] [\-5 keyword] [\-6 keyword] [\-7 emailAddress] [\-8 dns\-names] .fi .if n \{\ .RE .\} .PP For example: .sp .if n \{\ .RS 4 .\} .nf -$ 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 +$ certutil \-C \-c "my\-ca\-cert" \-i /home/certs/cert\&.req \-o cert\&.cer \-m 010 \-v 12 \-w 1 \-d $HOME/nssdb \-1 nonRepudiation,dataEncipherment \-5 sslClient \-6 clientAuth \-7 jsmith@example\&.com .fi .if n \{\ .RE .\} .PP \fBListing Certificates\fR .PP The \fB\-L\fR command option lists all of the certificates listed in the certificate database\&. The path to the directory (\fB\-d\fR) is required\&. .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-L \-d sql:/home/my/sharednssdb +$ certutil \-L \-d /home/my/sharednssdb Certificate Nickname Trust Attributes SSL,S/MIME,JAR/XPI CA Administrator of Instance pki\-ca1\*(Aqs Example Domain ID u,u,u TPS Administrator\*(Aqs Example Domain ID u,u,u Google Internet Authority ,, Certificate Authority \- Example Domain CT,C,C @@ -1397,17 +1491,17 @@ can return and print the information for argument passes the certificate name, while the \fB\-a\fR argument prints the certificate in ASCII format: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-L \-d sql:$HOME/nssdb \-a \-n my\-ca\-cert +$ certutil \-L \-d $HOME/nssdb \-a \-n my\-ca\-cert \-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\- MIIB1DCCAT2gAwIBAgICDkIwDQYJKoZIhvcNAQEFBQAwFTETMBEGA1UEAxMKRXhh bXBsZSBDQTAeFw0xMzAzMTMxOTEwMjlaFw0xMzA2MTMxOTEwMjlaMBUxEzARBgNV BAMTCkV4YW1wbGUgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJ4Kzqvz JyBVgFqDXRYSyTBNw1DrxUU/3GvWA/ngjAwHEv0Cul/6sO/gsCvnABHiH6unns6x XRzPORlC2WY3gkk7vmlsLvYpyecNazAi/NAwVnU/66HOsaoVFWE+gBQo99UrN2yk 0BiK/GMFlLm5dXQROgA9ZKKyFdI0LIXtf6SbAgMBAAGjMzAxMBEGCWCGSAGG+EIB AQQEAwIHADAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQEAwICBDANBgkqhkiG9w0B @@ -1421,17 +1515,17 @@ ob2rb8XRVVJkzXdXxlk4uo3UtNvw8sAz7sWD71qx .\} .PP For a human\-readable display .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-L \-d sql:$HOME/nssdb \-n my\-ca\-cert +$ certutil \-L \-d $HOME/nssdb \-n my\-ca\-cert Certificate: Data: Version: 3 (0x2) Serial Number: 3650 (0xe42) Signature Algorithm: PKCS #1 SHA\-1 With RSA Encryption Issuer: "CN=Example CA" Validity: Not Before: Wed Mar 13 19:10:29 2013 @@ -1504,17 +1598,17 @@ To list all keys in the database, use th command option and the (required) \fB\-d\fR argument to give the path to the directory\&. .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-K \-d sql:$HOME/nssdb +$ certutil \-K \-d $HOME/nssdb certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services " < 0> rsa 455a6673bde9375c2887ec8bf8016b3f9f35861d Thawte Freemail Member\*(Aqs Thawte Consulting (Pty) Ltd\&. ID < 1> rsa 40defeeb522ade11090eacebaaf1196a172127df Example Domain Administrator Cert < 2> rsa 1d0b06f44f6c03842f7d4f4a1dc78b3bcd1b85a5 John Smith user cert .fi .if n \{\ .RE .\} @@ -1570,17 +1664,17 @@ The devices that can be used to store ce command option lists all of the security modules listed in the secmod\&.db database\&. The path to the directory (\fB\-d\fR) is required\&. .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-U \-d sql:/home/my/sharednssdb +$ certutil \-U \-d /home/my/sharednssdb slot: NSS User Private Key and Certificate Services token: NSS Certificate DB uri: pkcs11:token=NSS%20Certificate%20DB;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203 slot: NSS Internal Cryptographic Services token: NSS Generic Crypto Services uri: pkcs11:token=NSS%20Generic%20Crypto%20Services;manufacturer=Mozilla%20Foundation;serial=0000000000000000;model=NSS%203 @@ -1594,29 +1688,29 @@ database\&. The path to the directory (\ Existing certificates or certificate requests can be added manually to the certificate database, even if they were generated elsewhere\&. This uses the \fB\-A\fR command option\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-A \-n certname \-t trustargs \-d [sql:]directory [\-a] [\-i input\-file] +certutil \-A \-n certname \-t trustargs \-d directory [\-a] [\-i input\-file] .fi .if n \{\ .RE .\} .PP For example: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-A \-n "CN=My SSL Certificate" \-t ",," \-d sql:/home/my/sharednssdb \-i /home/example\-certs/cert\&.cer +$ certutil \-A \-n "CN=My SSL Certificate" \-t ",," \-d /home/my/sharednssdb \-i /home/example\-certs/cert\&.cer .fi .if n \{\ .RE .\} .PP A related command option, \fB\-E\fR, is used specifically to add email certificates to the certificate database\&. The \fB\-E\fR @@ -1624,99 +1718,99 @@ command has the same arguments as the \fB\-A\fR command\&. The trust arguments for certificates have the format \fISSL,S/MIME,Code\-signing\fR, so the middle trust settings relate most to email certificates (though the others can be set)\&. For example: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-E \-n "CN=John Smith Email Cert" \-t ",P," \-d sql:/home/my/sharednssdb \-i /home/example\-certs/email\&.cer +$ certutil \-E \-n "CN=John Smith Email Cert" \-t ",P," \-d /home/my/sharednssdb \-i /home/example\-certs/email\&.cer .fi .if n \{\ .RE .\} .PP \fBDeleting Certificates to the Database\fR .PP Certificates can be deleted from a database using the \fB\-D\fR option\&. The only required options are to give the security database directory and to identify the certificate nickname\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-D \-d [sql:]directory \-n "nickname" +certutil \-D \-d directory \-n "nickname" .fi .if n \{\ .RE .\} .PP For example: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-D \-d sql:/home/my/sharednssdb \-n "my\-ssl\-cert" +$ certutil \-D \-d /home/my/sharednssdb \-n "my\-ssl\-cert" .fi .if n \{\ .RE .\} .PP \fBValidating Certificates\fR .PP 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 \fB\-V\fR command option\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-V \-n certificate\-name [\-b time] [\-e] [\-u cert\-usage] \-d [sql:]directory +certutil \-V \-n certificate\-name [\-b time] [\-e] [\-u cert\-usage] \-d directory .fi .if n \{\ .RE .\} .PP For example, to validate an email certificate: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-V \-n "John Smith\*(Aqs Email Cert" \-e \-u S,R \-d sql:/home/my/sharednssdb +$ certutil \-V \-n "John Smith\*(Aqs Email Cert" \-e \-u S,R \-d /home/my/sharednssdb .fi .if n \{\ .RE .\} .PP \fBModifying Certificate Trust Settings\fR .PP 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\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-M \-n certificate\-name \-t trust\-args \-d [sql:]directory +certutil \-M \-n certificate\-name \-t trust\-args \-d directory .fi .if n \{\ .RE .\} .PP For example: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-M \-n "My CA Certificate" \-d sql:/home/my/sharednssdb \-t "CT,CT,CT" +$ certutil \-M \-n "My CA Certificate" \-d /home/my/sharednssdb \-t "CT,CT,CT" .fi .if n \{\ .RE .\} .PP \fBPrinting the Certificate Chain\fR .PP Certificates can be issued in @@ -1724,17 +1818,17 @@ Certificates can be issued in because every certificate authority itself has a certificate; when a CA issues a certificate, it essentially stamps that certificate with its own fingerprint\&. The \fB\-O\fR 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: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-d sql:/home/my/sharednssdb \-O \-n "jsmith@example\&.com" +$ certutil \-d /home/my/sharednssdb \-O \-n "jsmith@example\&.com" "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] "Thawte Personal Freemail Issuing CA \- Thawte Consulting" [CN=Thawte Personal Freemail Issuing CA,O=Thawte Consulting (Pty) Ltd\&.,C=ZA] "(null)" [E=jsmith@example\&.com,CN=Thawte Freemail Member] .fi .if n \{\ .RE @@ -1743,29 +1837,29 @@ prints the full chain of a certificate, \fBResetting a Token\fR .PP 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\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-T \-d [sql:]directory \-h token\-name \-0 security\-officer\-password +certutil \-T \-d directory \-h token\-name \-0 security\-officer\-password .fi .if n \{\ .RE .\} .PP 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: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-T \-d sql:/home/my/sharednssdb \-h nethsm \-0 secret +$ certutil \-T \-d /home/my/sharednssdb \-h nethsm \-0 secret .fi .if n \{\ .RE .\} .PP \fBUpgrading or Merging the Security Databases\fR .PP 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 @@ -1780,55 +1874,55 @@ The \fB\-\-upgrade\-merge\fR command must give information about the original database and then use the standard arguments (like \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\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-\-upgrade\-merge \-d [sql:]directory [\-P dbprefix] \-\-source\-dir directory \-\-source\-prefix dbprefix \-\-upgrade\-id id \-\-upgrade\-token\-name name [\-@ password\-file] +certutil \-\-upgrade\-merge \-d directory [\-P dbprefix] \-\-source\-dir directory \-\-source\-prefix dbprefix \-\-upgrade\-id id \-\-upgrade\-token\-name name [\-@ password\-file] .fi .if n \{\ .RE .\} .PP For example: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-\-upgrade\-merge \-d sql:/home/my/sharednssdb \-\-source\-dir /opt/my\-app/alias/ \-\-source\-prefix serverapp\- \-\-upgrade\-id 1 \-\-upgrade\-token\-name internal +$ certutil \-\-upgrade\-merge \-d /home/my/sharednssdb \-\-source\-dir /opt/my\-app/alias/ \-\-source\-prefix serverapp\- \-\-upgrade\-id 1 \-\-upgrade\-token\-name internal .fi .if n \{\ .RE .\} .PP The \fB\-\-merge\fR 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\&. .sp .if n \{\ .RS 4 .\} .nf -certutil \-\-merge \-d [sql:]directory [\-P dbprefix] \-\-source\-dir directory \-\-source\-prefix dbprefix [\-@ password\-file] +certutil \-\-merge \-d directory [\-P dbprefix] \-\-source\-dir directory \-\-source\-prefix dbprefix [\-@ password\-file] .fi .if n \{\ .RE .\} .PP For example: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-\-merge \-d sql:/home/my/sharednssdb \-\-source\-dir /opt/my\-app/alias/ \-\-source\-prefix serverapp\- +$ certutil \-\-merge \-d /home/my/sharednssdb \-\-source\-dir /opt/my\-app/alias/ \-\-source\-prefix serverapp\- .fi .if n \{\ .RE .\} .PP \fBRunning certutil Commands from a Batch File\fR .PP A series of commands can be run sequentially from a text file with the @@ -1921,50 +2015,48 @@ pkcs11\&.txt, a listing of all of the PK .RE .PP Because the SQLite databases are designed to be shared, these are the \fIshared\fR database type\&. The shared database type is preferred; the legacy format is included for backward compatibility\&. .PP By default, the tools (\fBcertutil\fR, \fBpk12util\fR, -\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 -\fBsql:\fR +\fBmodutil\fR) assume that the given security databases use the SQLite type\&. Using the legacy databases must be manually specified by using the +\fBdbm:\fR prefix with the given security directory\&. For example: .sp .if n \{\ .RS 4 .\} .nf -$ certutil \-L \-d sql:/home/my/sharednssdb +$ certutil \-L \-d dbm:/home/my/sharednssdb .fi .if n \{\ .RE .\} .PP -To set the shared database type as the default type for the tools, set the +To set the legacy database type as the default type for the tools, set the \fBNSS_DEFAULT_DB_TYPE\fR environment variable to -\fBsql\fR: +\fBdbm\fR: .sp .if n \{\ .RS 4 .\} .nf -export NSS_DEFAULT_DB_TYPE="sql" +export NSS_DEFAULT_DB_TYPE="dbm" .fi .if n \{\ .RE .\} .PP This line can be set added to the ~/\&.bashrc file to make the change permanent\&. -.PP -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: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 diff --git a/doc/nroff/crlutil.1 b/doc/nroff/crlutil.1 --- a/doc/nroff/crlutil.1 +++ b/doc/nroff/crlutil.1 @@ -1,18 +1,18 @@ '\" t .\" Title: CRLUTIL .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 5 June 2014 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "CRLUTIL" "1" "5 June 2014" "nss-tools" "NSS Security Tools" +.TH "CRLUTIL" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq diff --git a/doc/nroff/derdump.1 b/doc/nroff/derdump.1 --- a/doc/nroff/derdump.1 +++ b/doc/nroff/derdump.1 @@ -1,18 +1,18 @@ '\" t .\" Title: DERDUMP .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.77.1 -.\" Date: 15 February 2013 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "DERDUMP" "1" "15 February 2013" "nss-tools" "NSS Security Tools" +.TH "DERDUMP" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq @@ -63,22 +63,22 @@ NSS is maintained in conjunction with PK For information specifically about NSS, the NSS project wiki is located at \m[blue]\fBMozilla NSS site\fR\m[]\&\s-2\u[3]\d\s+2\&. The NSS site relates directly to NSS code changes and releases\&. .PP Mailing lists: pki\-devel@redhat\&.com and pki\-users@redhat\&.com .PP IRC: Freenode at #dogtag\-pki .SH "AUTHORS" .PP -The NSS tools were written and maintained by developers with Netscape and now with Red Hat\&. +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. .PP Authors: Gerhardus Geldenhuis \&. Elio Maldonado , Deon Lackey .SH "LICENSE" .PP -Licensed under the Mozilla Public License, version 1\&.1, and/or the GNU General Public License, version 2 or later, and/or the GNU Lesser General Public License, version 2\&.1 or later\&. +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/\&. .SH "NOTES" .IP " 1." 4 Mozilla NSS bug 836477 .RS 4 \%https://bugzilla.mozilla.org/show_bug.cgi?id=836477 .RE .IP " 2." 4 PKI Wiki diff --git a/doc/nroff/modutil.1 b/doc/nroff/modutil.1 --- a/doc/nroff/modutil.1 +++ b/doc/nroff/modutil.1 @@ -1,18 +1,18 @@ '\" t .\" Title: MODUTIL .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 5 October 2017 +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "MODUTIL" "1" "5 October 2017" "nss-tools" "NSS Security Tools" +.TH "MODUTIL" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq @@ -183,36 +183,36 @@ Give the security module spec to load in .PP \-ciphers cipher\-enable\-list .RS 4 Enable specific ciphers in a module that is being added to the database\&. The \fIcipher\-enable\-list\fR is a colon\-delimited list of cipher names\&. Enclose this list in quotation marks if it contains spaces\&. .RE .PP -\-dbdir [sql:]directory +\-dbdir directory .RS 4 Specify the database directory in which to access or create security module database files\&. .sp \fBmodutil\fR supports two types of databases: the legacy security databases (cert8\&.db, key3\&.db, and -secmod\&.db) and new SQLite databases (cert9\&.db, +secmod\&.db) and SQLite databases (cert9\&.db, key4\&.db, and pkcs11\&.txt)\&. If the prefix -\fBsql:\fR -is not used, then the tool assumes that the given databases are in the old format\&. +\fBdbm:\fR +is not used, then the tool assumes that the given databases are in SQLite format\&. .RE .PP \-\-dbprefix prefix .RS 4 Specify the prefix used on the database files, such as my_ for -my_cert8\&.db\&. This option is provided as a special case\&. Changing the names of the certificate and key databases is not recommended\&. +my_cert9\&.db\&. This option is provided as a special case\&. Changing the names of the certificate and key databases is not recommended\&. .RE .PP \-installdir root\-installation\-directory .RS 4 Specify the root installation directory relative to which files will be installed by the \fB\-jar\fR option\&. This directory should be one below which it is appropriate to store dynamic library files, such as a server\*(Aqs root directory\&. .RE @@ -325,17 +325,17 @@ option\&. If no temporary directory is s Before any operations can be performed, there must be a set of security databases available\&. \fBmodutil\fR can be used to create these files\&. The only required argument is the database that where the databases will be located\&. .sp .if n \{\ .RS 4 .\} .nf -modutil \-create \-dbdir [sql:]directory +modutil \-create \-dbdir directory .fi .if n \{\ .RE .\} .PP \fBAdding a Cryptographic Module\fR .PP Adding a PKCS #11 module means submitting a supporting library file, enabling its ciphers, and setting default provider status for various security mechanisms\&. This can be done by supplying all of the information through @@ -353,17 +353,17 @@ modutil \-add modulename \-libfile libra .\} .PP For example: .sp .if n \{\ .RS 4 .\} .nf -modutil \-dbdir sql:/home/my/sharednssdb \-add "Example PKCS #11 Module" \-libfile "/tmp/crypto\&.so" \-mechanisms RSA:DSA:RC2:RANDOM +modutil \-dbdir /home/my/sharednssdb \-add "Example PKCS #11 Module" \-libfile "/tmp/crypto\&.so" \-mechanisms RSA:DSA:RC2:RANDOM Using database directory \&.\&.\&. Module "Example PKCS #11 Module" added to database\&. .fi .if n \{\ .RE .\} .PP @@ -406,17 +406,17 @@ Platforms { Both the install script and the required libraries must be bundled in a JAR file, which is specified with the \fB\-jar\fR argument\&. .sp .if n \{\ .RS 4 .\} .nf -modutil \-dbdir sql:/home/mt"jar\-install\-filey/sharednssdb \-jar install\&.jar \-installdir sql:/home/my/sharednssdb +modutil \-dbdir /home/mt"jar\-install\-filey/sharednssdb \-jar install\&.jar \-installdir /home/my/sharednssdb This installation JAR file was signed by: \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- **SUBJECT NAME** C=US, ST=California, L=Mountain View, CN=Cryptorific Inc\&., OU=Digital ID Class 3 \- Netscape Object Signing, OU="www\&.verisign\&.com/repository/CPS @@ -468,17 +468,17 @@ modutil \-rawadd modulespec A specific PKCS #11 module can be deleted from the secmod\&.db database: .sp .if n \{\ .RS 4 .\} .nf -modutil \-delete modulename \-dbdir [sql:]directory +modutil \-delete modulename \-dbdir directory .fi .if n \{\ .RE .\} .PP \fBDisplaying Module Information\fR .PP The @@ -488,29 +488,29 @@ database contains information about the To simply get a list of modules in the database, use the \fB\-list\fR command\&. .sp .if n \{\ .RS 4 .\} .nf -modutil \-list [modulename] \-dbdir [sql:]directory +modutil \-list [modulename] \-dbdir directory .fi .if n \{\ .RE .\} .PP Listing the modules shows the module name, their status, and other associated security databases for certificates and keys\&. For example: .sp .if n \{\ .RS 4 .\} .nf -modutil \-list \-dbdir sql:/home/my/sharednssdb +modutil \-list \-dbdir /home/my/sharednssdb Listing of PKCS #11 Modules \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 1\&. NSS Internal PKCS #11 Module slots: 2 slots attached status: loaded slot: NSS Internal Cryptographic Services @@ -529,17 +529,17 @@ Listing of PKCS #11 Modules Passing a specific module name with the \fB\-list\fR returns details information about the module itself, like supported cipher mechanisms, version numbers, serial numbers, and other information about the module and the token it is loaded on\&. For example: .sp .if n \{\ .RS 4 .\} .nf - modutil \-list "NSS Internal PKCS #11 Module" \-dbdir sql:/home/my/sharednssdb + modutil \-list "NSS Internal PKCS #11 Module" \-dbdir /home/my/sharednssdb \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Name: NSS Internal PKCS #11 Module Library file: **Internal ONLY module** Manufacturer: Mozilla Foundation Description: NSS Internal Crypto Services PKCS #11 Version 2\&.20 Library Version: 3\&.11 @@ -589,17 +589,17 @@ A related command, returns information about the database configuration for the modules\&. (This information can be edited by loading new specs using the \fB\-rawadd\fR command\&.) .sp .if n \{\ .RS 4 .\} .nf - modutil \-rawlist \-dbdir sql:/home/my/sharednssdb + modutil \-rawlist \-dbdir /home/my/sharednssdb name="NSS Internal PKCS #11 Module" parameters="configdir=\&. certPrefix= keyPrefix= secmod=secmod\&.db flags=readOnly " NSS="trustOrder=75 cipherOrder=100 slotParams={0x00000001=[slotFlags=RSA,RC4,RC2,DES,DH,SHA1,MD5,MD2,SSL,TLS,AES,RANDOM askpw=any timeout=30 ] } Flags=internal,critical" .fi .if n \{\ .RE .\} .PP \fBSetting a Default Provider for Security Mechanisms\fR .PP @@ -683,33 +683,33 @@ The NSS modules can have FIPS 140\-2 com with the \fB\-fips\fR option\&. For example: .sp .if n \{\ .RS 4 .\} .nf -modutil \-fips true \-dbdir sql:/home/my/sharednssdb/ +modutil \-fips true \-dbdir /home/my/sharednssdb/ FIPS mode enabled\&. .fi .if n \{\ .RE .\} .PP To verify that status of FIPS mode, run the \fB\-chkfips\fR command with either a true or false flag (it doesn\*(Aqt matter which)\&. The tool returns the current FIPS setting\&. .sp .if n \{\ .RS 4 .\} .nf -modutil \-chkfips false \-dbdir sql:/home/my/sharednssdb/ +modutil \-chkfips false \-dbdir /home/my/sharednssdb/ FIPS mode enabled\&. .fi .if n \{\ .RE .\} .PP \fBChanging the Password on a Token\fR @@ -725,17 +725,17 @@ modutil \-changepw tokenname [\-pwfile o .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf -modutil \-dbdir sql:/home/my/sharednssdb \-changepw "NSS Certificate DB" +modutil \-dbdir /home/my/sharednssdb \-changepw "NSS Certificate DB" Enter old password: Incorrect password, try again\&.\&.\&. Enter old password: Enter new password: Re\-enter new password: Token "Communicator Certificate DB" password changed successfully\&. .fi @@ -1336,50 +1336,48 @@ pkcs11\&.txt, which is listing of all of .RE .PP Because the SQLite databases are designed to be shared, these are the \fIshared\fR database type\&. The shared database type is preferred; the legacy format is included for backward compatibility\&. .PP By default, the tools (\fBcertutil\fR, \fBpk12util\fR, -\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 -\fBsql:\fR +\fBmodutil\fR) assume that the given security databases use the SQLite type\&. Using the legacy databases must be manually specified by using the +\fBdbm:\fR prefix with the given security directory\&. For example: .sp .if n \{\ .RS 4 .\} .nf -modutil \-create \-dbdir sql:/home/my/sharednssdb +modutil \-create \-dbdir dbm:/home/my/sharednssdb .fi .if n \{\ .RE .\} .PP -To set the shared database type as the default type for the tools, set the +To set the legacy database type as the default type for the tools, set the \fBNSS_DEFAULT_DB_TYPE\fR environment variable to -\fBsql\fR: +\fBdbm\fR: .sp .if n \{\ .RS 4 .\} .nf -export NSS_DEFAULT_DB_TYPE="sql" +export NSS_DEFAULT_DB_TYPE="dbm" .fi .if n \{\ .RE .\} .PP This line can be added to the ~/\&.bashrc file to make the change permanent for the user\&. -.PP -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: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 diff --git a/doc/nroff/pk12util.1 b/doc/nroff/pk12util.1 --- a/doc/nroff/pk12util.1 +++ b/doc/nroff/pk12util.1 @@ -1,18 +1,18 @@ '\" t .\" Title: PK12UTIL .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 5 October 2017 +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "PK12UTIL" "1" "5 October 2017" "nss-tools" "NSS Security Tools" +.TH "PK12UTIL" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq @@ -26,17 +26,17 @@ .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pk12util \- Export and import keys and certificate to or from a PKCS #12 file and the NSS database .SH "SYNOPSIS" .HP \w'\fBpk12util\fR\ 'u -\fBpk12util\fR [\-i\ p12File|\-l\ p12File|\-o\ p12File] [\-d\ [sql:]directory] [\-h\ tokenname] [\-P\ dbprefix] [\-r] [\-v] [\-k\ slotPasswordFile|\-K\ slotPassword] [\-w\ p12filePasswordFile|\-W\ p12filePassword] +\fBpk12util\fR [\-i\ p12File|\-l\ p12File|\-o\ p12File] [\-c\ keyCipher] [\-C\ certCipher] [\-d\ directory] [\-h\ tokenname] [\-m\ |\ \-\-key\-len\ keyLength] [\-M\ hashAlg] [\-n\ certname] [\-P\ dbprefix] [\-r] [\-v] [\-\-cert\-key\-len\ certKeyLength] [\-k\ slotPasswordFile|\-K\ slotPassword] [\-w\ p12filePasswordFile|\-W\ p12filePassword] .SH "STATUS" .PP This documentation is still work in progress\&. Please contribute to the initial review in \m[blue]\fBMozilla NSS bug 836477\fR\m[]\&\s-2\u[1]\d\s+2 .SH "DESCRIPTION" .PP The PKCS #12 utility, \fBpk12util\fR, enables sharing certificates among any server that supports PKCS #12\&. The tool can import certificates and keys from PKCS #12 files into security databases, export certificates, and list certificates and keys\&. @@ -66,28 +66,28 @@ Export keys and certificates from the se Specify the key encryption algorithm\&. .RE .PP \-C certCipher .RS 4 Specify the certiticate encryption algorithm\&. .RE .PP -\-d [sql:]directory +\-d directory .RS 4 Specify the database directory into which to import to or export from certificates and keys\&. .sp \fBpk12util\fR supports two types of databases: the legacy security databases (cert8\&.db, key3\&.db, and secmod\&.db) and new SQLite databases (cert9\&.db, key4\&.db, and pkcs11\&.txt)\&. If the prefix -\fBsql:\fR -is not used, then the tool assumes that the given databases are in the old format\&. +\fBdbm:\fR +is not used, then the tool assumes that the given databases are in the SQLite format\&. .RE .PP \-h tokenname .RS 4 Specify the name of the token to import into or export from\&. .RE .PP \-k slotPasswordFile @@ -100,17 +100,22 @@ Specify the text file containing the slo Specify the slot\*(Aqs password\&. .RE .PP \-m | \-\-key\-len keyLength .RS 4 Specify the desired length of the symmetric key to be used to encrypt the private key\&. .RE .PP -\-n | \-\-cert\-key\-len certKeyLength +\-M hashAlg +.RS 4 +Specify the hash algorithm used in the pkcs #12 mac\&. This algorithm also specifies the HMAC used in the prf when using pkcs #5 v2\&. +.RE +.PP +\-\-cert\-key\-len certKeyLength .RS 4 Specify the desired length of the symmetric key to be used to encrypt the certificates and other meta\-data\&. .RE .PP \-n certname .RS 4 Specify the nickname of the cert and private key to export\&. .sp @@ -435,27 +440,27 @@ 29 \- PKCS12 encode error The most basic usage of \fBpk12util\fR for importing a certificate or key is the PKCS #12 input file (\fB\-i\fR) and some way to specify the security database being accessed (either \fB\-d\fR for a directory or \fB\-h\fR for a token)\&. .PP -pk12util \-i p12File [\-h tokenname] [\-v] [\-d [sql:]directory] [\-P dbprefix] [\-k slotPasswordFile|\-K slotPassword] [\-w p12filePasswordFile|\-W p12filePassword] +pk12util \-i p12File [\-h tokenname] [\-v] [\-d directory] [\-P dbprefix] [\-k slotPasswordFile|\-K slotPassword] [\-w p12filePasswordFile|\-W p12filePassword] .PP For example: .PP .sp .if n \{\ .RS 4 .\} .nf -# pk12util \-i /tmp/cert\-files/users\&.p12 \-d sql:/home/my/sharednssdb +# pk12util \-i /tmp/cert\-files/users\&.p12 \-d /home/my/sharednssdb Enter a password which will be used to encrypt your keys\&. The password should be at least 8 characters long, and should contain at least one non\-alphabetic character\&. Enter new password: Re\-enter password: Enter password for PKCS12 file: @@ -466,41 +471,41 @@ pk12util: PKCS12 IMPORT SUCCESSFUL .\} .PP \fBExporting Keys and Certificates\fR .PP Using the \fBpk12util\fR command to export certificates and keys requires both the name of the certificate to extract from the database (\fB\-n\fR) and the PKCS #12\-formatted output file to write to\&. There are optional parameters that can be used to encrypt the file to protect the certificate material\&. .PP -pk12util \-o p12File \-n certname [\-c keyCipher] [\-C certCipher] [\-m|\-\-key_len keyLen] [\-n|\-\-cert_key_len certKeyLen] [\-d [sql:]directory] [\-P dbprefix] [\-k slotPasswordFile|\-K slotPassword] [\-w p12filePasswordFile|\-W p12filePassword] +pk12util \-o p12File \-n certname [\-c keyCipher] [\-C certCipher] [\-m|\-\-key_len keyLen] [\-n|\-\-cert_key_len certKeyLen] [\-d directory] [\-P dbprefix] [\-k slotPasswordFile|\-K slotPassword] [\-w p12filePasswordFile|\-W p12filePassword] .PP For example: .sp .if n \{\ .RS 4 .\} .nf -# pk12util \-o certs\&.p12 \-n Server\-Cert \-d sql:/home/my/sharednssdb +# pk12util \-o certs\&.p12 \-n Server\-Cert \-d /home/my/sharednssdb Enter password for PKCS12 file: Re\-enter password: .fi .if n \{\ .RE .\} .PP \fBListing Keys and Certificates\fR .PP The information in a \&.p12 file are not human\-readable\&. The certificates and keys in the file can be printed (listed) in a human\-readable pretty\-print format that shows information for every certificate and any public keys in the \&.p12 file\&. .PP -pk12util \-l p12File [\-h tokenname] [\-r] [\-d [sql:]directory] [\-P dbprefix] [\-k slotPasswordFile|\-K slotPassword] [\-w p12filePasswordFile|\-W p12filePassword] +pk12util \-l p12File [\-h tokenname] [\-r] [\-d directory] [\-P dbprefix] [\-k slotPasswordFile|\-K slotPassword] [\-w p12filePasswordFile|\-W p12filePassword] .PP For example, this prints the default ASCII output: .sp .if n \{\ .RS 4 .\} .nf # pk12util \-l certs\&.p12 @@ -732,50 +737,48 @@ pkcs11\&.txt, which is listing of all of .RE .PP Because the SQLite databases are designed to be shared, these are the \fIshared\fR database type\&. The shared database type is preferred; the legacy format is included for backward compatibility\&. .PP By default, the tools (\fBcertutil\fR, \fBpk12util\fR, -\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 -\fBsql:\fR +\fBmodutil\fR) assume that the given security databases use the SQLite type Using the legacy databases must be manually specified by using the +\fBdbm:\fR prefix with the given security directory\&. For example: .sp .if n \{\ .RS 4 .\} .nf -# pk12util \-i /tmp/cert\-files/users\&.p12 \-d sql:/home/my/sharednssdb +# pk12util \-i /tmp/cert\-files/users\&.p12 \-d dbm:/home/my/sharednssdb .fi .if n \{\ .RE .\} .PP -To set the shared database type as the default type for the tools, set the +To set the legacy database type as the default type for the tools, set the \fBNSS_DEFAULT_DB_TYPE\fR environment variable to -\fBsql\fR: +\fBdbm\fR: .sp .if n \{\ .RS 4 .\} .nf -export NSS_DEFAULT_DB_TYPE="sql" +export NSS_DEFAULT_DB_TYPE="dbm" .fi .if n \{\ .RE .\} .PP This line can be set added to the ~/\&.bashrc file to make the change permanent\&. -.PP -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: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 diff --git a/doc/nroff/pp.1 b/doc/nroff/pp.1 --- a/doc/nroff/pp.1 +++ b/doc/nroff/pp.1 @@ -1,18 +1,18 @@ '\" t .\" Title: PP .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 29 July 2014 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "PP" "1" "29 July 2014" "nss-tools" "NSS Security Tools" +.TH "PP" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq @@ -33,22 +33,22 @@ pp \- Prints certificates, keys, crls, a .HP \w'\fBpp\ \-t\ type\ [\-a]\ [\-i\ input]\ [\-o\ output]\ [\-u]\ [\-w]\fR\ 'u \fBpp \-t type [\-a] [\-i input] [\-o output] [\-u] [\-w]\fR .SH "STATUS" .PP This documentation is still work in progress\&. Please contribute to the initial review in \m[blue]\fBMozilla NSS bug 836477\fR\m[]\&\s-2\u[1]\d\s+2 .SH "DESCRIPTION" .PP -\fBpp \fRpretty\-prints private and public key, certificate, certificate\-request, pkcs7 or crl files +\fBpp \fRpretty\-prints private and public key, certificate, certificate\-request, pkcs7, pkcs12 or crl files .SH "OPTIONS" .PP \fB\-t \fR \fItype\fR .RS 4 -specify the input, one of {private\-key | public\-key | certificate | certificate\-request | pkcs7 | crl} +specify the input, one of {private\-key | public\-key | certificate | certificate\-request | pkcs7 | pkcs12 | crl | name} .sp .RE .PP \fB\-a \fR .RS 4 Input is in ascii encoded form (RFC1113) .RE .PP diff --git a/doc/nroff/signtool.1 b/doc/nroff/signtool.1 --- a/doc/nroff/signtool.1 +++ b/doc/nroff/signtool.1 @@ -1,18 +1,18 @@ '\" t .\" Title: signtool .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 5 June 2014 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "SIGNTOOL" "1" "5 June 2014" "nss-tools" "NSS Security Tools" +.TH "SIGNTOOL" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq diff --git a/doc/nroff/signver.1 b/doc/nroff/signver.1 --- a/doc/nroff/signver.1 +++ b/doc/nroff/signver.1 @@ -1,18 +1,18 @@ '\" t .\" Title: SIGNVER .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 5 June 2014 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "SIGNVER" "1" "5 June 2014" "nss-tools" "NSS Security Tools" +.TH "SIGNVER" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq @@ -47,28 +47,28 @@ The Signature Verification Tool, Displays all of the information in the PKCS#7 signature\&. .RE .PP \-V .RS 4 Verifies the digital signature\&. .RE .PP -\-d [sql:]\fIdirectory\fR +\-d \fIdirectory\fR .RS 4 Specify the database directory which contains the certificates and keys\&. .sp \fBsignver\fR supports two types of databases: the legacy security databases (cert8\&.db, key3\&.db, and secmod\&.db) and new SQLite databases (cert9\&.db, key4\&.db, and pkcs11\&.txt)\&. If the prefix -\fBsql:\fR -is not used, then the tool assumes that the given databases are in the old format\&. +\fBdbm:\fR +is not used, then the tool assumes that the given databases are in the SQLite format\&. .RE .PP \-a .RS 4 Sets that the given signature file is in ASCII format\&. .RE .PP \-i \fIinput_file\fR @@ -96,17 +96,17 @@ Enables verbose output\&. The \fB\-V\fR option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file)\&. .sp .if n \{\ .RS 4 .\} .nf -signver \-V \-s \fIsignature_file\fR \-i \fIsigned_file\fR \-d sql:/home/my/sharednssdb +signver \-V \-s \fIsignature_file\fR \-i \fIsigned_file\fR \-d /home/my/sharednssdb signatureValid=yes .fi .if n \{\ .RE .\} .SS "Printing Signature Data" .PP @@ -202,50 +202,48 @@ pkcs11\&.txt, which is listing of all of .RE .PP Because the SQLite databases are designed to be shared, these are the \fIshared\fR database type\&. The shared database type is preferred; the legacy format is included for backward compatibility\&. .PP By default, the tools (\fBcertutil\fR, \fBpk12util\fR, -\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 -\fBsql:\fR +\fBmodutil\fR) assume that the given security databases use the SQLite type Using the legacy databases must be manually specified by using the +\fBdbm:\fR prefix with the given security directory\&. For example: .sp .if n \{\ .RS 4 .\} .nf -# signver \-A \-s \fIsignature\fR \-d sql:/home/my/sharednssdb +# signver \-A \-s \fIsignature\fR \-d dbm:/home/my/sharednssdb .fi .if n \{\ .RE .\} .PP -To set the shared database type as the default type for the tools, set the +To set the legacy database type as the default type for the tools, set the \fBNSS_DEFAULT_DB_TYPE\fR environment variable to -\fBsql\fR: +\fBdbm\fR: .sp .if n \{\ .RS 4 .\} .nf -export NSS_DEFAULT_DB_TYPE="sql" +export NSS_DEFAULT_DB_TYPE="dbm" .fi .if n \{\ .RE .\} .PP This line can be added to the ~/\&.bashrc file to make the change permanent for the user\&. -.PP -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: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 diff --git a/doc/nroff/ssltap.1 b/doc/nroff/ssltap.1 --- a/doc/nroff/ssltap.1 +++ b/doc/nroff/ssltap.1 @@ -1,18 +1,18 @@ '\" t .\" Title: SSLTAP .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 5 June 2014 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "SSLTAP" "1" "5 June 2014" "nss-tools" "NSS Security Tools" +.TH "SSLTAP" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq diff --git a/doc/nroff/vfychain.1 b/doc/nroff/vfychain.1 --- a/doc/nroff/vfychain.1 +++ b/doc/nroff/vfychain.1 @@ -1,18 +1,18 @@ '\" t .\" Title: VFYCHAIN .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 5 June 2014 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "VFYCHAIN" "1" "5 June 2014" "nss-tools" "NSS Security Tools" +.TH "VFYCHAIN" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq diff --git a/doc/nroff/vfyserv.1 b/doc/nroff/vfyserv.1 --- a/doc/nroff/vfyserv.1 +++ b/doc/nroff/vfyserv.1 @@ -1,18 +1,18 @@ '\" t .\" Title: VFYSERV .\" Author: [see the "Authors" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 5 June 2014 +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 19 May 2021 .\" Manual: NSS Security Tools .\" Source: nss-tools .\" Language: English .\" -.TH "VFYSERV" "1" "5 June 2014" "nss-tools" "NSS Security Tools" +.TH "VFYSERV" "1" "19 May 2021" "nss-tools" "NSS Security Tools" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq diff --git a/doc/pk12util.xml b/doc/pk12util.xml --- a/doc/pk12util.xml +++ b/doc/pk12util.xml @@ -25,17 +25,17 @@ pk12util -i p12File|-l p12File|-o p12File -c keyCipher -C certCipher - -d [sql:]directory + -d directory -h tokenname -m | --key-len keyLength -M hashAlg -n certname -P dbprefix -r -v --cert-key-len certKeyLength @@ -83,19 +83,19 @@ -C certCipher Specify the certiticate encryption algorithm. - -d [sql:]directory + -d directory Specify the database directory into which to import to or export from certificates and keys. - pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql: is not used, then the tool assumes that the given databases are in the old format. + pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix dbm: is not used, then the tool assumes that the given databases are in the SQLite format. -h tokenname Specify the name of the token to import into or export from. @@ -244,44 +244,44 @@ Examples Importing Keys and Certificates The most basic usage of pk12util for importing a certificate or key is the PKCS #12 input file () and some way to specify the security database being accessed (either for a directory or for a token). - pk12util -i p12File [-h tokenname] [-v] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] + pk12util -i p12File [-h tokenname] [-v] [-d directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] For example: - # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb + # pk12util -i /tmp/cert-files/users.p12 -d /home/my/sharednssdb Enter a password which will be used to encrypt your keys. The password should be at least 8 characters long, and should contain at least one non-alphabetic character. Enter new password: Re-enter password: Enter password for PKCS12 file: pk12util: PKCS12 IMPORT SUCCESSFUL Exporting Keys and Certificates Using the pk12util command to export certificates and keys requires both the name of the certificate to extract from the database () and the PKCS #12-formatted output file to write to. There are optional parameters that can be used to encrypt the file to protect the certificate material. - pk12util -o p12File -n certname [-c keyCipher] [-C certCipher] [-m|--key_len keyLen] [-n|--cert_key_len certKeyLen] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] + pk12util -o p12File -n certname [-c keyCipher] [-C certCipher] [-m|--key_len keyLen] [-n|--cert_key_len certKeyLen] [-d directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] For example: - # pk12util -o certs.p12 -n Server-Cert -d sql:/home/my/sharednssdb + # pk12util -o certs.p12 -n Server-Cert -d /home/my/sharednssdb Enter password for PKCS12 file: Re-enter password: Listing Keys and Certificates The information in a .p12 file are not human-readable. The certificates and keys in the file can be printed (listed) in a human-readable pretty-print format that shows information for every certificate and any public keys in the .p12 file. - pk12util -l p12File [-h tokenname] [-r] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] + pk12util -l p12File [-h tokenname] [-r] [-d directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] For example, this prints the default ASCII output: # pk12util -l certs.p12 Enter password for PKCS12 file: Key(shrouded): Friendly Name: Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID Encryption algorithm: PKCS #12 V2 PBE With SHA-1 And 3KEY Triple DES-CBC @@ -389,27 +389,26 @@ BerkleyDB. These new databases provide m pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility. -By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example: +By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example: -# pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb +# pk12util -i /tmp/cert-files/users.p12 -d dbm:/home/my/sharednssdb -To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql: -export NSS_DEFAULT_DB_TYPE="sql" +To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm: +export NSS_DEFAULT_DB_TYPE="dbm" This line can be set added to the ~/.bashrc file to make the change permanent. -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: https://wiki.mozilla.org/NSS_Shared_DB_Howto For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: diff --git a/doc/signver.xml b/doc/signver.xml --- a/doc/signver.xml +++ b/doc/signver.xml @@ -59,19 +59,19 @@ -A Displays all of the information in the PKCS#7 signature. -V Verifies the digital signature. - -d [sql:]directory + -d directory Specify the database directory which contains the certificates and keys. - signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix sql: is not used, then the tool assumes that the given databases are in the old format. + signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt). If the prefix dbm: is not used, then the tool assumes that the given databases are in the SQLite format. -a Sets that the given signature file is in ASCII format. -i input_file Gives the input file for the object with signed data. @@ -90,17 +90,17 @@ Extended Examples Verifying a Signature The option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file). -signver -V -s signature_file -i signed_file -d sql:/home/my/sharednssdb +signver -V -s signature_file -i signed_file -d /home/my/sharednssdb signatureValid=yes Printing Signature Data The option prints all of the information contained in a signature file. Using the option prints the signature file information to the given output file rather than stdout. @@ -150,27 +150,26 @@ BerkleyDB. These new databases provide m pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory Because the SQLite databases are designed to be shared, these are the shared database type. The shared database type is preferred; the legacy format is included for backward compatibility. -By default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. -Using the SQLite databases must be manually specified by using the sql: prefix with the given security directory. For example: +By default, the tools (certutil, pk12util, modutil) assume that the given security databases use the SQLite type +Using the legacy databases must be manually specified by using the dbm: prefix with the given security directory. For example: -# signver -A -s signature -d sql:/home/my/sharednssdb +# signver -A -s signature -d dbm:/home/my/sharednssdb -To set the shared database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to sql: -export NSS_DEFAULT_DB_TYPE="sql" +To set the legacy database type as the default type for the tools, set the NSS_DEFAULT_DB_TYPE environment variable to dbm: +export NSS_DEFAULT_DB_TYPE="dbm" This line can be added to the ~/.bashrc file to make the change permanent for the user. -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: https://wiki.mozilla.org/NSS_Shared_DB_Howto For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: