diff options
Diffstat (limited to 'security/nss/doc')
38 files changed, 14350 insertions, 0 deletions
diff --git a/security/nss/doc/Makefile b/security/nss/doc/Makefile new file mode 100644 index 000000000..444a81a30 --- /dev/null +++ b/security/nss/doc/Makefile @@ -0,0 +1,69 @@ +#! gmake +# +# Creates man pages for the NSS security tools +# +# pk12util, certutil, modutil, ssltap, +# signtool, signver, cmsutil, crlutil, +# derdump, pp, vfychain, vfyserv +# + +.SUFFIXES: .html .txt .1 .xml + +COMPILE.1 = xmlto -o nroff man +COMPILE.html = xmlto -o html html + +# the name of the tar ball +name = nss-man +date = `date +"%Y%m%d"` + +all: prepare all-man all-html + +prepare: date-and-version + mkdir -p html + mkdir -p nroff + +clean: + rm -f date.xml version.xml *.tar.bz2 + rm -f html/*.proc + rm -fr $(name) ascii + +date-and-version: date.xml version.xml + +date.xml: + date +"%e %B %Y" | tr -d '\n' > $@ + +version.xml: + echo -n ${VERSION} > $@ + +.PHONY : $(MANPAGES) +.PHONY : $(HTMLPAGES) +.PHONY : $(TXTPAGES) + +#-------------------------------------------------------- +# manpages +#-------------------------------------------------------- + +nroff/%.1 : %.xml + $(COMPILE.1) $< + +MANPAGES = \ +nroff/certutil.1 nroff/cmsutil.1 nroff/crlutil.1 nroff/pk12util.1 \ +nroff/modutil.1 nroff/ssltap.1 nroff/derdump.1 nroff/signtool.1 nroff/signver.1 \ +nroff/pp.1 nroff/vfychain.1 nroff/vfyserv.1 + +all-man: prepare $(MANPAGES) + +#-------------------------------------------------------- +# html pages +#-------------------------------------------------------- + +html/%.html : %.xml + $(COMPILE.html) $< + mv html/index.html $@ + +HTMLPAGES = \ +html/certutil.html html/cmsutil.html html/crlutil.html html/pk12util.html html/modutil.html \ +html/ssltap.html html/derdump.html html/signtool.html html/signver.html html/pp.html \ +html/vfychain.html html/vfyserv.html + +all-html: prepare $(HTMLPAGES) diff --git a/security/nss/doc/README b/security/nss/doc/README new file mode 100644 index 000000000..a579a2fbd --- /dev/null +++ b/security/nss/doc/README @@ -0,0 +1,7 @@ +A convenient tool to edit these files is + https://sourceforge.net/projects/xml-copy-editor/ + +Assuming the documentation text will remain plain US-ASCII, +please disable the option + "Save UTF-8 byte order mark". + diff --git a/security/nss/doc/certutil.xml b/security/nss/doc/certutil.xml new file mode 100644 index 000000000..461b21389 --- /dev/null +++ b/security/nss/doc/certutil.xml @@ -0,0 +1,1243 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="certutil"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>CERTUTIL</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>certutil</refname> + <refpurpose>Manage keys and certificate in both NSS databases and other NSS tokens</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>certutil</command> + <arg><replaceable>options</replaceable></arg> + <arg>[<replaceable>arguments</replaceable>]</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + +<refsection id="description"> + <title>Description</title> + + <para>The Certificate Database Tool, <command>certutil</command>, 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.</para> + <para>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 <command>modutil</command> manpage.</para> + + </refsection> + + <refsection id="options"> + <title>Command Options and Arguments</title> + <para>Running <command>certutil</command> 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 <option>-H</option> will list all the command options and their relevant arguments.</para> + <para><command>Command Options</command></para> + <variablelist> + + <varlistentry> + <term>-A </term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-B</term> + <listitem><para>Run a series of commands from the specified batch file. This requires the <option>-i</option> argument.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-C </term> + <listitem><para>Create a new binary certificate file from a binary certificate request file. Use the <option>-i</option> argument to specify the certificate request file. If this argument is not used, <command>certutil</command> prompts for a filename. </para></listitem> + </varlistentry> + + <varlistentry> + <term>-D </term> + <listitem><para>Delete a certificate from the certificate database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--rename </term> + <listitem><para>Change the database nickname of a certificate.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-E </term> + <listitem><para>Add an email certificate to the certificate database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-F</term> + <listitem><para>Delete a private key from a key database. Specify the key to delete with the -n argument. Specify the database from which to delete the key with the +<option>-d</option> argument. Use the <option>-k</option> argument to specify explicitly whether to delete a DSA, RSA, or ECC key. If you don't use the <option>-k</option> argument, the option looks for an RSA key matching the specified nickname. +</para> +<para> +When you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using -D. Some smart cards do not let you remove a public key you have generated. In such a case, only the private key is deleted from the key pair. You can display the public key with the command certutil -K -h tokenname. </para></listitem> + </varlistentry> + + <varlistentry> + <term>-G </term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-H </term> + <listitem><para>Display a list of the command options and arguments.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-K </term> + <listitem><para>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).</para></listitem> + </varlistentry> + + <varlistentry> + <term>-L </term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-M </term> + <listitem><para>Modify a certificate's trust attributes using the values of the -t argument.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-N</term> + <listitem><para>Create new certificate and key databases.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-O </term> + <listitem><para>Print the certificate chain.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-R</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-S </term> + <listitem><para>Create an individual certificate and add it to a certificate database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-T </term> + <listitem><para>Reset the key database or token.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-U </term> + <listitem><para>List all available modules or print a single named module.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-V </term> + <listitem><para>Check the validity of a certificate and its attributes.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-W </term> + <listitem><para>Change the password to a key database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--merge</term> + <listitem><para>Merge two databases into one.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--upgrade-merge</term> + <listitem><para>Upgrade an old database and merge it into a new database. This is used to migrate legacy NSS databases (<filename>cert8.db</filename> and <filename>key3.db</filename>) into the newer SQLite databases (<filename>cert9.db</filename> and <filename>key4.db</filename>).</para></listitem> + </varlistentry> + </variablelist> + + <para><command>Arguments</command></para> + <para>Arguments modify a command option and are usually lower case, numbers, or symbols.</para> + <variablelist> + <varlistentry> + <term>-a</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-b validity-time</term> + <listitem><para>Specify a time at which a certificate is required to be valid. Use when checking certificate validity with the <option>-V</option> option. The format of the <emphasis>validity-time</emphasis> argument is <emphasis>YYMMDDHHMMSS[+HHMM|-HHMM|Z]</emphasis>, which allows offsets to be set relative to the validity end time. Specifying seconds (<emphasis>SS</emphasis>) is optional. When specifying an explicit time, use a Z at the end of the term, <emphasis>YYMMDDHHMMSSZ</emphasis>, to close it. When specifying an offset time, use <emphasis>YYMMDDHHMMSS+HHMM</emphasis> or <emphasis>YYMMDDHHMMSS-HHMM</emphasis> for adding or subtracting time, respectively. +</para> +<para> +If this option is not used, the validity check defaults to the current system time.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-c issuer</term> + <listitem><para>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. </para></listitem> + </varlistentry> + + <varlistentry> + <term>-d [prefix]directory</term> + <listitem> + <para>Specify the database directory containing the certificate and key database files.</para> + <para><command>certutil</command> supports two types of databases: the legacy security databases (<filename>cert8.db</filename>, <filename>key3.db</filename>, and <filename>secmod.db</filename>) and new SQLite databases (<filename>cert9.db</filename>, <filename>key4.db</filename>, and <filename>pkcs11.txt</filename>). </para> + <para>NSS recognizes the following prefixes:</para> + <itemizedlist> + <listitem><para><command>sql:</command> requests the newer database</para></listitem> + <listitem><para><command>dbm:</command> requests the legacy database</para></listitem> + </itemizedlist> + <para>If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE. If NSS_DEFAULT_DB_TYPE is not set then <command>dbm:</command> is the default.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>--dump-ext-val OID </term> + <listitem><para>For single cert, print binary DER encoding of extension OID.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-e </term> + <listitem><para>Check a certificate's signature during the process of validating a certificate.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--email email-address</term> + <listitem><para>Specify the email address of a certificate to list. Used with the -L command option.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extGeneric OID:critical-flag:filename[,OID:critical-flag:filename]... </term> + <listitem> + <para> +Add one or multiple extensions that certutil cannot encode yet, by loading their encodings from external files. + </para> + <itemizedlist> + <listitem> +<para>OID (example): 1.2.3.4</para> + </listitem> + <listitem> +<para>critical-flag: critical or not-critical</para> + </listitem> + <listitem> +<para>filename: full path to a file containing an encoded extension</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + + <varlistentry> + <term>-f password-file</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-g keysize</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + + <varlistentry> + <term>-h tokenname</term> + <listitem><para>Specify the name of a token to use or act on. If not specified the default token is the internal database slot.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-i input_file</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-k key-type-or-id</term> + <listitem> + <para>Specify the type or specific ID of a key.</para> + <para> + The valid key type options are rsa, dsa, ec, or all. The default + value is rsa. Specifying the type of key can avoid mistakes caused by + duplicate nicknames. Giving a key type generates a new key pair; + giving the ID of an existing key reuses that key pair (which is + required to renew certificates). + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-l </term> + <listitem><para>Display detailed information when validating a certificate with the -V option.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-m serial-number</term> + <listitem><para>Assign a unique serial number to a certificate being created. This operation should be performed by a CA. If no serial number is provided a default serial number is made from the current time. Serial numbers are limited to integers </para></listitem> + </varlistentry> + + <varlistentry> + <term>-n nickname</term> + <listitem><para>Specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. Bracket the nickname string with quotation marks if it contains spaces.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-o output-file</term> + <listitem><para>Specify the output file name for new certificates or binary certificate requests. Bracket the output-file string with quotation marks if it contains spaces. If this argument is not used the output destination defaults to standard output.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-P dbPrefix</term> + <listitem><para>Specify the prefix used on the certificate and key database file. This argument is provided to support legacy servers. Most applications do not use a database prefix.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-p phone</term> + <listitem><para>Specify a contact telephone number to include in new certificates or certificate requests. Bracket this string with quotation marks if it contains spaces.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-q pqgfile or curve-name</term> + <listitem> + <para>Read an alternate PQG value from the specified file when generating DSA key pairs. If this argument is not used, <command>certutil</command> generates its own PQG value. PQG files are created with a separate DSA utility.</para> + <para>Elliptic curve name is one of the ones from nistp256, nistp384, nistp521, curve25519.</para> + <para> + If a token is available that supports more curves, the foolowing curves are supported as well: + sect163k1, nistk163, sect163r1, sect163r2, + nistb163, sect193r1, sect193r2, sect233k1, nistk233, + sect233r1, nistb233, sect239k1, sect283k1, nistk283, + sect283r1, nistb283, sect409k1, nistk409, sect409r1, + nistb409, sect571k1, nistk571, sect571r1, nistb571, + secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, + nistp192, secp224k1, secp224r1, nistp224, secp256k1, + secp256r1, secp384r1, secp521r1, + prime192v1, prime192v2, prime192v3, + prime239v1, prime239v2, prime239v3, c2pnb163v1, + c2pnb163v2, c2pnb163v3, c2pnb176v1, c2tnb191v1, + c2tnb191v2, c2tnb191v3, + c2pnb208w1, c2tnb239v1, c2tnb239v2, c2tnb239v3, + c2pnb272w1, c2pnb304w1, + c2tnb359w1, c2pnb368w1, c2tnb431r1, secp112r1, + secp112r2, secp128r1, secp128r2, sect113r1, sect113r2, + sect131r1, sect131r2 + </para> + </listitem> + + </varlistentry> + + <varlistentry> + <term>-r </term> + <listitem><para>Display a certificate's binary DER encoding when listing information about that certificate with the -L option.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-s subject</term> + <listitem><para>Identify a particular certificate owner for new certificates or certificate requests. Bracket this string with quotation marks if it contains spaces. The subject identification format follows RFC #1485.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-t trustargs</term> + <listitem><para>Specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database. There are three available trust categories for each certificate, expressed in the order <emphasis>SSL, email, object signing</emphasis> for each trust setting. In each category position, use none, any, or all +of the attribute codes: + </para> + <itemizedlist> + <listitem> + <para> + <command>p</command> - Valid peer + </para> + </listitem> + <listitem> + <para> + <command>P</command> - Trusted peer (implies p) + </para> + </listitem> + <listitem> + <para> + <command>c</command> - Valid CA + </para> + </listitem> + <listitem> + <para> + <command>C</command> - Trusted CA (implies c) + </para> + </listitem> + <listitem> + <para> + <command>T</command> - trusted CA for client authentication (ssl server only) + </para> + </listitem> + </itemizedlist> + <para> + The attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks. For example: + </para> +<para><command>-t "TC,C,T"</command></para> + <para> + Use the -L option to see a list of the current certificates and trust attributes in a certificate database. </para> + <para> + 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. </para></listitem> + </varlistentry> + + <varlistentry> + <term>-u certusage</term> + <listitem><para>Specify a usage context to apply when validating a certificate with the -V option.</para><para>The contexts are the following:</para> + <itemizedlist> + <listitem> +<para><command>C</command> (as an SSL client)</para> + </listitem> + <listitem> +<para><command>V</command> (as an SSL server)</para> + </listitem> + <listitem> +<para><command>L</command> (as an SSL CA)</para> + </listitem> + <listitem> +<para><command>A</command> (as Any CA)</para> + </listitem> + <listitem> +<para><command>Y</command> (Verify CA)</para> + </listitem> + <listitem> +<para><command>S</command> (as an email signer)</para> + </listitem> + <listitem> +<para><command>R</command> (as an email recipient)</para> + </listitem> + <listitem> +<para><command>O</command> (as an OCSP status responder)</para> + </listitem> + <listitem> +<para><command>J</command> (as an object signer)</para> + </listitem> + </itemizedlist></listitem> + </varlistentry> + + <varlistentry> + <term>-v valid-months</term> + <listitem><para>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 <option>-w</option> option. If this argument is not used, the default validity period is three months. </para></listitem> + </varlistentry> + + <varlistentry> + <term>-w offset-months</term> + <listitem><para>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. </para></listitem> + </varlistentry> + + <varlistentry> + <term>-X </term> + <listitem><para>Force the key and certificate database to open in read-write mode. This is used with the <option>-U</option> and <option>-L</option> command options.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-x </term> + <listitem><para>Use <command>certutil</command> to generate the signature for a certificate being created or added to a database, rather than obtaining a signature from a separate CA.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-y exp</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-z noise-file</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-Z hashAlg</term> + <listitem> + <para>Specify the hash algorithm to use with the -C, -S or -R command options. Possible keywords:</para> + <itemizedlist> + <listitem><para>MD2</para></listitem> + <listitem><para>MD4</para></listitem> + <listitem><para>MD5</para></listitem> + <listitem><para>SHA1</para></listitem> + <listitem><para>SHA224</para></listitem> + <listitem><para>SHA256</para></listitem> + <listitem><para>SHA384</para></listitem> + <listitem><para>SHA512</para></listitem> + </itemizedlist> + </listitem> + </varlistentry> + + <varlistentry> + <term>-0 SSO_password</term> + <listitem><para>Set a site security officer password on a token.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-1 | --keyUsage keyword,keyword</term> + <listitem><para>Set an X.509 V3 Certificate Type Extension in the certificate. There are several available keywords:</para> + <itemizedlist> + <listitem> + <para> + digitalSignature + </para> + </listitem> + <listitem> + <para> + nonRepudiation + </para> + </listitem> + <listitem> + <para> + keyEncipherment + </para> + </listitem> + <listitem> + <para> + dataEncipherment + </para> + </listitem> + <listitem> + <para> + keyAgreement + </para> + </listitem> + <listitem> + <para> + certSigning + </para> + </listitem> + <listitem> + <para> + crlSigning + </para> + </listitem> + <listitem> + <para> + critical + </para> + </listitem> + </itemizedlist> +</listitem> + </varlistentry> + + <varlistentry> + <term>-2 </term> + <listitem><para>Add a basic constraint extension to a certificate that is being created or added to a database. This extension supports the certificate chain verification process. <command>certutil</command> prompts for the certificate constraint extension to select.</para> +<para>X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-3 </term> + <listitem><para>Add an authority key ID extension to a certificate that is being created or added to a database. This extension supports the identification of a particular certificate, from among multiple certificates associated with one subject name, as the correct issuer of a certificate. The Certificate Database Tool will prompt you to select the authority key ID extension.</para> +<para>X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-4 </term> + <listitem><para>Add a CRL distribution point extension to a certificate that is being created or added to a database. This extension identifies the URL of a certificate's associated certificate revocation list (CRL). <command>certutil</command> prompts for the URL.</para> +<para>X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-5 | --nsCertType keyword,keyword</term> + <listitem><para>Add an X.509 V3 certificate type extension to a certificate that is being created or added to the database. There are several available keywords:</para> + <itemizedlist> + <listitem> + <para> + sslClient + </para> + </listitem> + <listitem> + <para> + sslServer + </para> + </listitem> + <listitem> + <para> + smime + </para> + </listitem> + <listitem> + <para> + objectSigning + </para> + </listitem> + <listitem> + <para> + sslCA + </para> + </listitem> + <listitem> + <para> + smimeCA + </para> + </listitem> + <listitem> + <para> + objectSigningCA + </para> + </listitem> + <listitem> + <para> + critical + </para> + </listitem> + </itemizedlist> + +<para>X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-6 | --extKeyUsage keyword,keyword</term> + <listitem><para>Add an extended key usage extension to a certificate that is being created or added to the database. Several keywords are available:</para> + <itemizedlist> + <listitem> + <para> + serverAuth + </para> + </listitem> + <listitem> + <para> + clientAuth + </para> + </listitem> + <listitem> + <para> + codeSigning + </para> + </listitem> + <listitem> + <para> + emailProtection + </para> + </listitem> + <listitem> + <para> + timeStamp + </para> + </listitem> + <listitem> + <para> + ocspResponder + </para> + </listitem> + <listitem> + <para> + stepUp + </para> + </listitem> + <listitem> + <para> + msTrustListSign + </para> + </listitem> + <listitem> + <para> + critical + </para> + </listitem> + </itemizedlist> +<para>X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-7 emailAddrs</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-8 dns-names</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extAIA</term> + <listitem><para>Add the Authority Information Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extSIA</term> + <listitem><para>Add the Subject Information Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extCP</term> + <listitem><para>Add the Certificate Policies extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extPM</term> + <listitem><para>Add the Policy Mappings extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extPC</term> + <listitem><para>Add the Policy Constraints extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extIA</term> + <listitem><para>Add the Inhibit Any Policy Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extSKID</term> + <listitem><para>Add the Subject Key ID extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extNC</term> + <listitem><para>Add a Name Constraint extension to the certificate. X.509 certificate extensions are described in RFC 5280.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--extSAN type:name[,type:name]...</term> + <listitem><para> +Create a Subject Alt Name extension with one or multiple names. + </para> + <para> +-type: directory, dn, dns, edi, ediparty, email, ip, ipaddr, other, registerid, rfc822, uri, x400, x400addr + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>--empty-password</term> + <listitem><para>Use empty password when creating new certificate database with -N.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--keyAttrFlags attrflags</term> + <listitem><para> +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}</para></listitem> + </varlistentry> + + <varlistentry> + <term>--keyOpFlagsOn opflags</term> + <term>--keyOpFlagsOff opflags</term> + <listitem><para> +PKCS #11 key Operation Flags. +Comma separated list of one or more of the following: +{token | session} {public | private} {sensitive | insensitive} {modifiable | unmodifiable} {extractable | unextractable} + </para></listitem> + </varlistentry> + + <varlistentry> + <term>--new-n nickname</term> + <listitem><para>A new nickname, used when renaming a certificate.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--source-dir certdir</term> + <listitem><para>Identify the certificate database directory to upgrade.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--source-prefix certdir</term> + <listitem><para>Give the prefix of the certificate and key databases to upgrade.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--upgrade-id uniqueID</term> + <listitem><para>Give the unique ID of the database to upgrade.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--upgrade-token-name name</term> + <listitem><para>Set the name of the token to use while it is being upgraded.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-@ pwfile</term> + <listitem><para>Give the name of a password file to use for the database being upgraded.</para></listitem> + </varlistentry> + + </variablelist> + </refsection> + + <refsection id="basic-usage"> + <title>Usage and Examples</title> + <para> + Most of the command options in the examples listed here have more arguments available. The arguments included in these examples are the most common ones or are used to illustrate a specific scenario. Use the <option>-H</option> option to show the complete list of arguments for each command option. + </para> + <para><command>Creating New Security Databases</command></para> + <para> + Certificates, keys, and security modules related to managing certificates are stored in three related databases: + </para> + <itemizedlist> + <listitem> + <para> + cert8.db or cert9.db + </para> + </listitem> + <listitem> + <para> + key3.db or key4.db + </para> + </listitem> + <listitem> + <para> + secmod.db or pkcs11.txt + </para> + </listitem> + </itemizedlist> + <para> + These databases must be created before certificates or keys can be generated. + </para> +<programlisting>certutil -N -d [sql:]directory</programlisting> + + <para><command>Creating a Certificate Request</command></para> + <para> + 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. + </para> +<programlisting>$ 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]</programlisting> + <para> + The <option>-R</option> command options requires four arguments: + </para> + <itemizedlist> + <listitem> + <para> + <option>-k</option> to specify either the key type to generate or, when renewing a certificate, the existing key pair to use + </para> + </listitem> + <listitem> + <para> + <option>-g</option> to set the keysize of the key to generate + </para> + </listitem> + <listitem> + <para> + <option>-s</option> to set the subject name of the certificate + </para> + </listitem> + <listitem> + <para> + <option>-d</option> to give the security database directory + </para> + </listitem> + </itemizedlist> + <para> + The new certificate request can be output in ASCII format (<option>-a</option>) or can be written to a specified file (<option>-o</option>). + </para> + <para> + For example: + </para> +<programlisting>$ 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 + +Generating key. This may take a few moments... + +</programlisting> + + <para><command>Creating a Certificate</command></para> + <para> + A valid certificate must be issued by a trusted CA. This can be done by specifying a CA certificate (<option>-c</option>) that is stored in the certificate database. If a CA key pair is not available, you can create a self-signed certificate using the <option>-x</option> argument with the <option>-S</option> command option. + </para> +<programlisting>$ 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]</programlisting> + <para> + The series of numbers and <option>--ext*</option> options set certificate extensions that can be added to the certificate when it is generated by the CA. Interactive prompts will result. + </para> + <para> + For example, this creates a self-signed certificate: + </para> +<programlisting>$ certutil -S -s "CN=Example CA" -n my-ca-cert -x -t "C,C,C" -1 -2 -5 -m 3650</programlisting> + <para> +The interative prompts for key usage and whether any extensions are critical and responses have been ommitted for brevity. + </para> + <para> + From there, new certificates can reference the self-signed certificate: + </para> +<programlisting>$ certutil -S -s "CN=My Server Cert" -n my-server-cert -c "my-ca-cert" -t ",," -1 -5 -6 -8 -m 730</programlisting> + + <para><command>Generating a Certificate from a Certificate Request</command></para> + <para> + When a certificate request is created, a certificate can be generated by using the request and then referencing a certificate authority signing certificate (the <emphasis>issuer</emphasis> specified in the <option>-c</option> argument). The issuing certificate must be in the certificate database in the specified directory. + </para> +<programlisting>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]</programlisting> + <para> + For example: + </para> +<programlisting>$ 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</programlisting> + + <para><command>Listing Certificates</command></para> + <para> + The <option>-L</option> command option lists all of the certificates listed in the certificate database. The path to the directory (<option>-d</option>) is required. + </para> +<programlisting>$ certutil -L -d sql:/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</programlisting> + <para> + Using additional arguments with <option>-L</option> can return and print the information for a single, specific certificate. For example, the <option>-n</option> argument passes the certificate name, while the <option>-a</option> argument prints the certificate in ASCII format: + </para> +<programlisting> +$ certutil -L -d sql:$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----- +</programlisting> +<para>For a human-readable display</para> +<programlisting>$ certutil -L -d sql:$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 + Not After : Thu Jun 13 19:10:29 2013 + Subject: "CN=Example CA" + Subject Public Key Info: + Public Key Algorithm: PKCS #1 RSA Encryption + RSA Public Key: + Modulus: + 9e:0a:ce:ab:f3:27:20:55:80:5a:83:5d:16:12:c9:30: + 4d:c3:50:eb:c5:45:3f:dc:6b:d6:03:f9:e0:8c:0c:07: + 12:fd:02:ba:5f:fa:b0:ef:e0:b0:2b:e7:00:11:e2:1f: + ab:a7:9e:ce:b1:5d:1c:cf:39:19:42:d9:66:37:82:49: + 3b:be:69:6c:2e:f6:29:c9:e7:0d:6b:30:22:fc:d0:30: + 56:75:3f:eb:a1:ce:b1:aa:15:15:61:3e:80:14:28:f7: + d5:2b:37:6c:a4:d0:18:8a:fc:63:05:94:b9:b9:75:74: + 11:3a:00:3d:64:a2:b2:15:d2:34:2c:85:ed:7f:a4:9b + Exponent: 65537 (0x10001) + Signed Extensions: + Name: Certificate Type + Data: none + + Name: Certificate Basic Constraints + Data: Is a CA with no maximum path length. + + Name: Certificate Key Usage + Critical: True + Usages: Certificate Signing + + Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption + Signature: + 3a:72:19:33:90:00:8d:db:cd:5d:d6:32:8c:ad:cf:91: + 1c:6d:94:31:a4:32:c6:2b:5e:68:b5:59:3b:e4:68:d6: + 79:d1:52:fb:1e:0d:fd:3d:5c:a6:05:c0:f3:09:8d:60: + a2:85:59:2e:e9:bc:3f:8a:16:5f:b8:c1:e1:c4:ad:b6: + 36:e7:ba:8a:73:50:e9:e0:ee:ed:69:ab:a8:bf:33:de: + 25:2b:43:0c:6c:f9:68:85:a1:bd:ab:6f:c5:d1:55:52: + 64:cd:77:57:c6:59:38:ba:8d:d4:b4:db:f0:f2:c0:33: + ee:c5:83:ef:5a:b1:29:a2:07:53:9a:b8:f7:38:a3:7e + Fingerprint (MD5): + 86:D8:A5:8B:8A:26:BE:9E:17:A8:7B:66:10:6B:27:80 + Fingerprint (SHA1): + 48:78:09:EF:C5:D4:0C:BD:D2:64:45:59:EB:03:13:15:F7:A9:D6:F7 + + Certificate Trust Flags: + SSL Flags: + Valid CA + Trusted CA + User + Email Flags: + Valid CA + Trusted CA + User + Object Signing Flags: + Valid CA + Trusted CA + User + +</programlisting> + + <para><command>Listing Keys</command></para> + <para> + Keys are the original material used to encrypt certificate data. The keys generated for certificates are stored separately, in the key database. + </para> + <para> + To list all keys in the database, use the <option>-K</option> command option and the (required) <option>-d</option> argument to give the path to the directory. + </para> +<programlisting>$ certutil -K -d sql:$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</programlisting> + <para> + There are ways to narrow the keys listed in the search results: + </para> + <itemizedlist> + <listitem> + <para> + To return a specific key, use the <option>-n</option> <emphasis>name</emphasis> argument with the name of the key. + </para> + </listitem> + <listitem> + <para> + If there are multiple security devices loaded, then the <option>-h</option> <emphasis>tokenname</emphasis> argument can search a specific token or all tokens. + </para> + </listitem> + <listitem> + <para> + If there are multiple key types available, then the <option>-k</option> <emphasis>key-type</emphasis> argument can search a specific type of key, like RSA, DSA, or ECC. + </para> + </listitem> + </itemizedlist> + + <para><command>Listing Security Modules</command></para> + <para> + 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 <option>-U</option> command option lists all of the security modules listed in the <filename>secmod.db</filename> database. The path to the directory (<option>-d</option>) is required. + </para> +<programlisting>$ certutil -U -d sql:/home/my/sharednssdb + + slot: NSS User Private Key and Certificate Services + token: NSS Certificate DB + + slot: NSS Internal Cryptographic Services + token: NSS Generic Crypto Services</programlisting> + + <para><command>Adding Certificates to the Database</command></para> + <para> + Existing certificates or certificate requests can be added manually to the certificate database, even if they were generated elsewhere. This uses the <option>-A</option> command option. + </para> +<programlisting>certutil -A -n certname -t trustargs -d [sql:]directory [-a] [-i input-file]</programlisting> + <para> + For example: + </para> +<programlisting>$ certutil -A -n "CN=My SSL Certificate" -t ",," -d sql:/home/my/sharednssdb -i /home/example-certs/cert.cer</programlisting> + <para> + A related command option, <option>-E</option>, is used specifically to add email certificates to the certificate database. The <option>-E</option> command has the same arguments as the <option>-A</option> command. The trust arguments for certificates have the format <emphasis>SSL,S/MIME,Code-signing</emphasis>, so the middle trust settings relate most to email certificates (though the others can be set). For example: + </para> +<programlisting>$ certutil -E -n "CN=John Smith Email Cert" -t ",P," -d sql:/home/my/sharednssdb -i /home/example-certs/email.cer</programlisting> + + <para><command>Deleting Certificates to the Database</command></para> + <para> + Certificates can be deleted from a database using the <option>-D</option> option. The only required options are to give the security database directory and to identify the certificate nickname. + </para> +<programlisting>certutil -D -d [sql:]directory -n "nickname"</programlisting> + <para> + For example: + </para> +<programlisting>$ certutil -D -d sql:/home/my/sharednssdb -n "my-ssl-cert"</programlisting> + + <para><command>Validating Certificates</command></para> + <para> + 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 <option>-V</option> command option. + </para> +<programlisting>certutil -V -n certificate-name [-b time] [-e] [-u cert-usage] -d [sql:]directory</programlisting> + <para> + For example, to validate an email certificate: + </para> +<programlisting>$ certutil -V -n "John Smith's Email Cert" -e -u S,R -d sql:/home/my/sharednssdb</programlisting> + + <para><command>Modifying Certificate Trust Settings</command></para> + <para> + 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. + </para> +<programlisting>certutil -M -n certificate-name -t trust-args -d [sql:]directory</programlisting> + <para> + For example: + </para> +<programlisting>$ certutil -M -n "My CA Certificate" -d sql:/home/my/sharednssdb -t "CT,CT,CT"</programlisting> + + <para><command>Printing the Certificate Chain</command></para> + <para> + Certificates can be issued in <emphasis>chains</emphasis> because every certificate authority itself has a certificate; when a CA issues a certificate, it essentially stamps that certificate with its own fingerprint. The <option>-O</option> 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: + </para> +<programlisting>$ certutil -d sql:/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]</programlisting> + + <para><command>Resetting a Token</command></para> + <para> + 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 (<option>-h</option>) as well as any directory path. If there is no external token used, the default value is internal. + </para> +<programlisting>certutil -T -d [sql:]directory -h token-name -0 security-officer-password</programlisting> + <para> + 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: + </para> +<programlisting>$ certutil -T -d sql:/home/my/sharednssdb -h nethsm -0 secret</programlisting> + + <para><command>Upgrading or Merging the Security Databases</command></para> + <para> + Many networks or applications may be using older BerkeleyDB versions of the certificate database (<filename>cert8.db</filename>). Databases can be upgraded to the new SQLite version of the database (<filename>cert9.db</filename>) using the <option>--upgrade-merge</option> command option or existing databases can be merged with the new <filename>cert9.db</filename> databases using the <option>---merge</option> command. + </para> + <para> + The <option>--upgrade-merge</option> command must give information about the original database and then use the standard arguments (like <option>-d</option>) 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. + </para> +<programlisting>certutil --upgrade-merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix --upgrade-id id --upgrade-token-name name [-@ password-file]</programlisting> + <para> + For example: + </para> +<programlisting>$ certutil --upgrade-merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- --upgrade-id 1 --upgrade-token-name internal</programlisting> + <para> + The <option>--merge</option> 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. + </para> +<programlisting>certutil --merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix [-@ password-file]</programlisting> + <para> + For example: + </para> +<programlisting>$ certutil --merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp-</programlisting> + + <para><command>Running certutil Commands from a Batch File</command></para> + <para> + A series of commands can be run sequentially from a text file with the <option>-B</option> command option. The only argument for this specifies the input file. + </para> +<programlisting>$ certutil -B -i /path/to/batch-file</programlisting> + </refsection> + +<refsection id="databases"><title>NSS Database Types</title> +<para>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <emphasis>legacy</emphasis> databases are:</para> +<itemizedlist> + <listitem> + <para> + cert8.db for certificates + </para> + </listitem> + <listitem> + <para> + key3.db for keys + </para> + </listitem> + <listitem> + <para> + secmod.db for PKCS #11 module information + </para> + </listitem> +</itemizedlist> + +<para>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</para> + +<para>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkeleyDB. These new databases provide more accessibility and performance:</para> +<itemizedlist> + <listitem> + <para> + cert9.db for certificates + </para> + </listitem> + <listitem> + <para> + key4.db for keys + </para> + </listitem> + <listitem> + <para> + pkcs11.txt, a listing of all of the PKCS #11 modules, contained in a new subdirectory in the security databases directory + </para> + </listitem> +</itemizedlist> + +<para>Because the SQLite databases are designed to be shared, these are the <emphasis>shared</emphasis> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</para> + +<para>By default, the tools (<command>certutil</command>, <command>pk12util</command>, <command>modutil</command>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <command>sql:</command> prefix with the given security directory. For example:</para> + +<programlisting>$ certutil -L -d sql:/home/my/sharednssdb</programlisting> + +<para>To set the shared database type as the default type for the tools, set the <envar>NSS_DEFAULT_DB_TYPE</envar> environment variable to <envar>sql</envar>:</para> +<programlisting>export NSS_DEFAULT_DB_TYPE="sql"</programlisting> + +<para>This line can be set added to the <filename>~/.bashrc</filename> file to make the change permanent.</para> + +<para>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:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> +</itemizedlist> +<para>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> +</itemizedlist> +</refsection> + + + <refsection id="seealso"> + <title>See Also</title> + <para>pk12util (1)</para> + <para>modutil (1)</para> + <para><command>certutil</command> has arguments or operations that use features defined in several IETF RFCs.</para> + <itemizedlist> + <listitem> + <para> + http://tools.ietf.org/html/rfc5280 + </para> + </listitem> + <listitem> + <para> + http://tools.ietf.org/html/rfc1113 + </para> + </listitem> + <listitem> + <para> + http://tools.ietf.org/html/rfc1485 + </para> + </listitem> + </itemizedlist> + + <para>The NSS wiki has information on the new database design and how to configure applications to use it.</para> + <itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> + </itemizedlist> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/cmsutil.xml b/security/nss/doc/cmsutil.xml new file mode 100644 index 000000000..c7d2408d3 --- /dev/null +++ b/security/nss/doc/cmsutil.xml @@ -0,0 +1,299 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="cmsutil"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>CMSUTIL</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>cmsutil</refname> + <refpurpose>Performs basic cryptograpic operations, such as encryption and decryption, on Cryptographic Message Syntax (CMS) messages.</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>cmsutil</command> + <arg><replaceable>options</replaceable></arg> + <arg>[<replaceable>arguments</replaceable>]</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + + <para>The <command>cmsutil</command> command-line uses the S/MIME Toolkit to perform basic operations, such as encryption and decryption, on Cryptographic Message Syntax (CMS) messages. + </para> + <para> +To run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. +Each command takes one option. Each option may take zero or more arguments. +To see a usage string, issue the command without options. + </para> + + </refsection> + + <refsection id="options"> + <title>Options and Arguments</title> + <para> + </para> + <para><command>Options</command></para> + <para> +Options specify an action. Option arguments modify an action. +The options and arguments for the cmsutil command are defined as follows: + </para> + <variablelist> + <varlistentry> + <term>-C</term> + <listitem><para>Encrypt a message.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-D </term> + <listitem><para>Decode a message.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-E </term> + <listitem><para>Envelope a message.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-O </term> + <listitem><para>Create a certificates-only message.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-S </term> + <listitem><para>Sign a message.</para></listitem> + </varlistentry> + + </variablelist> + + <para><command>Arguments</command></para> + <para>Option arguments modify an action.</para> + <variablelist> + <varlistentry> + <term>-b </term> + <listitem> + <para>Decode a batch of files named in infile.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-c content </term> + <listitem> + <para>Use this detached content (decode only).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-d dbdir</term> + <listitem> + <para>Specify the key/certificate database directory (default is ".")</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-e envfile</term> + <listitem> + <para>Specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message. If this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-f pwfile</term> + <listitem> + <para>Use password file to set password on all PKCS#11 tokens.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-G</term> + <listitem> + <para>Include a signing time attribute (sign only).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-H hash</term> + <listitem> + <para>Use specified hash algorithm (default:SHA1).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-h num</term> + <listitem> + <para>Generate email headers with info about CMS message (decode only).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-i infile</term> + <listitem> + <para>Use infile as a source of data (default is stdin).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-k</term> + <listitem> + <para>Keep decoded encryption certs in permanent cert db.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-N nickname</term> + <listitem> + <para>Specify nickname of certificate to sign with (sign only).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-n </term> + <listitem> + <para>Suppress output of contents (decode only).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-o outfile</term> + <listitem> + <para>Use outfile as a destination of data (default is stdout).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-P</term> + <listitem> + <para>Include an S/MIME capabilities attribute.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-p password</term> + <listitem> + <para>Use password as key database password.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-r recipient1,recipient2, ...</term> + <listitem> + <para> +Specify list of recipients (email addresses) for an encrypted or enveloped message. +For certificates-only message, list of certificates to send. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-T</term> + <listitem> + <para>Suppress content in CMS message (sign only).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-u certusage</term> + <listitem> + <para>Set type of cert usage (default is certUsageEmailSigner).</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-v</term> + <listitem> + <para>Print debugging information.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-Y ekprefnick</term> + <listitem> + <para>Specify an encryption key preference by nickname.</para> + </listitem> + </varlistentry> + + </variablelist> + + </refsection> + + <refsection id="usage"> + <title>Usage</title> + <para>Encrypt Example</para> + <programlisting> +cmsutil -C [-i infile] [-o outfile] [-d dbdir] [-p password] -r "recipient1,recipient2, . . ." -e envfile + </programlisting> + + <para>Decode Example</para> + <programlisting> +cmsutil -D [-i infile] [-o outfile] [-d dbdir] [-p password] [-c content] [-n] [-h num] + </programlisting> + + <para>Envelope Example</para> + <programlisting> +cmsutil -E [-i infile] [-o outfile] [-d dbdir] [-p password] -r "recipient1,recipient2, ..." + </programlisting> + + <para>Certificate-only Example</para> + <programlisting> +cmsutil -O [-i infile] [-o outfile] [-d dbdir] [-p password] -r "cert1,cert2, . . ." + </programlisting> + + <para>Sign Message Example</para> + <programlisting> +cmsutil -S [-i infile] [-o outfile] [-d dbdir] [-p password] -N nickname[-TGP] [-Y ekprefnick] + </programlisting> + + </refsection> + + <refsection id="seealso"> + <title>See also</title> + <para>certutil(1)</para> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/crlutil.xml b/security/nss/doc/crlutil.xml new file mode 100644 index 000000000..e77570e2d --- /dev/null +++ b/security/nss/doc/crlutil.xml @@ -0,0 +1,525 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="crlutil"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>CRLUTIL</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>crlutil</refname> + <refpurpose> +List, generate, modify, or delete CRLs within the NSS security database file(s) and list, create, modify or delete certificates entries in a particular CRL. + </refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>crlutil</command> + <arg><replaceable>options</replaceable></arg> + <arg>[<replaceable>arguments</replaceable>]</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + + <para>The Certificate Revocation List (CRL) Management Tool, <command>crlutil</command>, is a command-line utility that can list, generate, modify, or delete CRLs within the NSS security database file(s) and list, create, modify or delete certificates entries in a particular CRL. + </para> + <para> +The key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. + </para> + <para> +This document discusses certificate revocation list management. For information on security module database management, see Using the Security Module Database Tool. For information on certificate and key database management, see Using the Certificate Database Tool. + </para> + + <para> +To run the Certificate Revocation List Management Tool, type the command + </para> + <para> +crlutil option [arguments] + </para> + <para> +where options and arguments are combinations of the options and arguments listed in the following section. Each command takes one option. Each option may take zero or more arguments. To see a usage string, issue the command without options, or with the -H option. + </para> + + </refsection> + + <refsection id="options"> + <title>Options and Arguments</title> + <para> + </para> + <para><command>Options</command></para> + <para> +Options specify an action. Option arguments modify an action. +The options and arguments for the crlutil command are defined as follows: + </para> + + <variablelist> + <varlistentry> + <term>-D </term> + <listitem> + <para> +Delete Certificate Revocation List from cert database. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-E </term> + <listitem> + <para> +Erase all CRLs of specified type from the cert database + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-G </term> + <listitem> + <para> +Create new Certificate Revocation List (CRL). + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-I </term> + <listitem> + <para> +Import a CRL to the cert database + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-L </term> + <listitem> + <para> +List existing CRL located in cert database file. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-M </term> + <listitem> + <para> +Modify existing CRL which can be located in cert db or in arbitrary file. If located in file it should be encoded in ASN.1 encode format. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-S </term> + <listitem> + <para> +Show contents of a CRL file which isn't stored in the database. + </para> + </listitem> + </varlistentry> + </variablelist> + + <para><command>Arguments</command></para> + <para>Option arguments modify an action.</para> + + <variablelist> + + <varlistentry> + <term>-a </term> + <listitem> + <para> +Use ASCII format or allow the use of ASCII format for input and output. This formatting follows RFC #1113. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-B </term> + <listitem> + <para> +Bypass CA signature checks. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-c crl-gen-file </term> + <listitem> + <para> +Specify script file that will be used to control crl generation/modification. See crl-cript-file format below. If options -M|-G is used and -c crl-script-file is not specified, crlutil will read script data from standard input. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-d directory </term> + <listitem> + <para> +Specify the database directory containing the certificate and key database files. On Unix the Certificate Database Tool defaults to $HOME/.netscape (that is, ~/.netscape). On Windows NT the default is the current directory. + </para> + <para> +The NSS database files must reside in the same directory. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-f password-file </term> + <listitem> + <para> +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. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-i crl-file </term> + <listitem> + <para> +Specify the file which contains the CRL to import or show. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-l algorithm-name </term> + <listitem> + <para> +Specify a specific signature algorithm. List of possible algorithms: MD2 | MD4 | MD5 | SHA1 | SHA256 | SHA384 | SHA512 + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-n nickname </term> + <listitem> + <para> +Specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. Bracket the nickname string with quotation marks if it contains spaces. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-o output-file </term> + <listitem> + <para> +Specify the output file name for new CRL. Bracket the output-file string with quotation marks if it contains spaces. If this argument is not used the output destination defaults to standard output. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-P dbprefix </term> + <listitem> + <para> +Specify the prefix used on the NSS security database files (for example, my_cert8.db and my_key3.db). This option is provided as a special case. Changing the names of the certificate and key databases is not recommended. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-t crl-type </term> + <listitem> + <para> +Specify type of CRL. possible types are: 0 - SEC_KRL_TYPE, 1 - SEC_CRL_TYPE. This option is obsolete + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-u url </term> + <listitem> + <para> +Specify the url. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-w pwd-string</term> + <listitem> + <para>Provide db password in command line.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>-Z algorithm</term> + <listitem> + <para>Specify the hash algorithm to use for signing the CRL.</para> + </listitem> + </varlistentry> + + </variablelist> + </refsection> + + <refsection id="syntax"> + <title>CRL Generation script syntax</title> + <para>CRL generation script file has the following syntax:</para> + <para> + * Line with comments should have # as a first symbol of a line</para> + <para> + * Set "this update" or "next update" CRL fields: + </para> + <para> + update=YYYYMMDDhhmmssZ + nextupdate=YYYYMMDDhhmmssZ + </para> + <para> + Field "next update" is optional. Time should be in GeneralizedTime format (YYYYMMDDhhmmssZ). + For example: 20050204153000Z + </para> + + <para>* Add an extension to a CRL or a crl certificate entry:</para> + <para>addext extension-name critical/non-critical [arg1[arg2 ...]]</para> + <para>Where:</para> + <para> + extension-name: string value of a name of known extensions. + critical/non-critical: is 1 when extension is critical and 0 otherwise. + arg1, arg2: specific to extension type extension parameters + </para> + <para> + addext uses the range that was set earlier by addcert and will install an extension to every cert entries within the range. + </para> + <para> + * Add certificate entries(s) to CRL: + </para> + <para> + addcert range date + </para> + <para> + range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. Only one cert will be added if there is no delimiter. + date: revocation date of a cert. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ). + </para> + <para> + * Remove certificate entry(s) from CRL + </para> + <para> + rmcert range + </para> + <para> + Where: + </para> + <para> + range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. Only one cert will be added if there is no delimiter. + </para> + <para> + * Change range of certificate entry(s) in CRL + </para> + <para> + range new-range + </para> + <para> + Where: + </para> + <para> + new-range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. Only one cert will be added if there is no delimiter. + </para> + <para> +Implemented Extensions + </para> + <para> + The extensions defined for CRL provide methods for associating additional attributes with CRLs of theirs entries. For more information see RFC #3280 + </para> + <para> + * Add The Authority Key Identifier extension: + </para> + <para> +The authority key identifier extension provides a means of identifying the public key corresponding to the private key used to sign a CRL. + </para> + <para> + authKeyId critical [key-id | dn cert-serial] + </para> + <para> + Where: + </para> + <para> + authKeyIdent: identifies the name of an extension + critical: value of 1 of 0. Should be set to 1 if this extension is critical or 0 otherwise. + key-id: key identifier represented in octet string. dn:: is a CA distinguished name cert-serial: authority certificate serial number. + </para> + <para> + * Add Issuer Alternative Name extension: + </para> + <para> + The issuer alternative names extension allows additional identities to be associated with the issuer of the CRL. Defined options include an rfc822 name (electronic mail address), a DNS name, an IP address, and a URI. + </para> + <para> + issuerAltNames non-critical name-list + </para> + <para> + Where: + </para> + <para> + subjAltNames: identifies the name of an extension + should be set to 0 since this is non-critical extension + name-list: comma separated list of names + </para> + <para> + * Add CRL Number extension: + </para> + <para> + The CRL number is a non-critical CRL extension which conveys a monotonically increasing sequence number for a given CRL scope and CRL issuer. This extension allows users to easily determine when a particular CRL supersedes another CRL + </para> + <para> + crlNumber non-critical number + </para> + <para> + Where: + </para> + <para> + crlNumber: identifies the name of an extension + critical: should be set to 0 since this is non-critical extension + number: value of long which identifies the sequential number of a CRL. + </para> + <para> + * Add Revocation Reason Code extension: + </para> + <para> + The reasonCode is a non-critical CRL entry extension that identifies the reason for the certificate revocation. + </para> + <para> + reasonCode non-critical code + </para> + <para> + Where: + </para> + <para> + reasonCode: identifies the name of an extension + non-critical: should be set to 0 since this is non-critical extension + code: the following codes are available: + </para> + <para> + unspecified (0), + keyCompromise (1), + cACompromise (2), + affiliationChanged (3), + superseded (4), + cessationOfOperation (5), + certificateHold (6), + removeFromCRL (8), + privilegeWithdrawn (9), + aACompromise (10) + </para> + <para> + * Add Invalidity Date extension: + </para> + <para> + The invalidity date is a non-critical CRL entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. + </para> + <para> + invalidityDate non-critical date + </para> + <para> + Where: + </para> + <para> + crlNumber: identifies the name of an extension + non-critical: should be set to 0 since this is non-critical extension date: invalidity date of a cert. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ). + </para> + </refsection> + + <refsection id="usage"> + <title>Usage</title> + <para> +The Certificate Revocation List Management Tool's capabilities are grouped as follows, using these combinations of options and arguments. Options and arguments in square brackets are optional, those without square brackets are required. + </para> + <para>See "Implemented extensions" for more information regarding extensions and their parameters.</para> + <para> + * Creating or modifying a CRL: + </para> + <programlisting> +crlutil -G|-M -c crl-gen-file -n nickname [-i crl] [-u url] [-d keydir] [-P dbprefix] [-l alg] [-a] [-B] + </programlisting> + <para> + * Listing all CRls or a named CRL: + </para> + <programlisting> + crlutil -L [-n crl-name] [-d krydir] + </programlisting> + + <para> + * Deleting CRL from db: + </para> + <programlisting> + crlutil -D -n nickname [-d keydir] [-P dbprefix] + </programlisting> + + <para> + * Erasing CRLs from db: + </para> + <programlisting> + crlutil -E [-d keydir] [-P dbprefix] + </programlisting> + + <para> + * Deleting CRL from db: + </para> + <programlisting> + crlutil -D -n nickname [-d keydir] [-P dbprefix] + </programlisting> + + <para> + * Erasing CRLs from db: + </para> + <programlisting> + crlutil -E [-d keydir] [-P dbprefix] + </programlisting> + + <para> + * Import CRL from file: + </para> + <programlisting> + crlutil -I -i crl [-t crlType] [-u url] [-d keydir] [-P dbprefix] [-B] + </programlisting> + </refsection> + + <refsection id="seealso"> + <title>See Also</title> + <para>certutil(1)</para> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/derdump.xml b/security/nss/doc/derdump.xml new file mode 100644 index 000000000..4e4a62a50 --- /dev/null +++ b/security/nss/doc/derdump.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+<!ENTITY date SYSTEM "date.xml">
+<!ENTITY version SYSTEM "version.xml">
+]>
+
+<refentry id="derdump">
+
+ <refentryinfo>
+ <date>&date;</date>
+ <title>NSS Security Tools</title>
+ <productname>nss-tools</productname>
+ <productnumber>&version;</productnumber>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>DERDUMP</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>derdump </refname>
+ <refpurpose>Dumps C-sequence strings from a DER encoded certificate file</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>derdump</command>
+ <arg><option>-r</option></arg>
+ <arg><option>-i <replaceable>input-file</replaceable></option></arg>
+ <arg><option>-o <replaceable>output-file</replaceable></option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection>
+ <title>Description</title>
+
+ <para><command>derdump </command>dumps C-sequence strings from a DER encode certificate file </para>
+
+ </refsection>
+
+<refsection>
+ <title>Options</title>
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-r </option></term>
+ <listitem><simpara>For formatted items, dump raw bytes as well</simpara></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-i </option> <replaceable>DER encoded file</replaceable></term>
+ <listitem><simpara>Define an input file to use (default is stdin)</simpara></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-o </option> <replaceable>output file</replaceable></term>
+ <listitem><simpara>Define an output file to use (default is stdout).</simpara></listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsection>
+
+ <refsection id="resources">
+ <title>Additional Resources</title>
+ <para>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 <ulink url="http://pki.fedoraproject.org/wiki/">PKI Wiki</ulink>. </para>
+ <para>For information specifically about NSS, the NSS project wiki is located at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">Mozilla NSS site</ulink>. The NSS site relates directly to NSS code changes and releases.</para>
+ <para>Mailing lists: pki-devel@redhat.com and pki-users@redhat.com</para>
+ <para>IRC: Freenode at #dogtag-pki</para>
+ </refsection>
+
+<!-- fill in your name first; keep the other names for reference -->
+ <refsection id="authors">
+ <title>Authors</title>
+ <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para>
+ Authors: Gerhardus Geldenhuis <gerhardus.geldenhuis@gmail.com>. Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>
+ </para>
+ </refsection>
+
+<!-- don't change -->
+ <refsection id="license">
+ <title>LICENSE</title>
+ <para>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/. + </para>
+ </refsection>
+
+</refentry>
diff --git a/security/nss/doc/html/certutil.html b/security/nss/doc/html/certutil.html new file mode 100644 index 000000000..eb2e94322 --- /dev/null +++ b/security/nss/doc/html/certutil.html @@ -0,0 +1,354 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>CERTUTIL</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="CERTUTIL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CERTUTIL</th></tr></table><hr></div><div class="refentry"><a name="certutil"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>certutil — Manage keys and certificate in both NSS databases and other NSS tokens</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">certutil</code> [<em class="replaceable"><code>options</code></em>] [[<em class="replaceable"><code>arguments</code></em>]]</p></div></div><div class="refsection"><a name="idm139774553663312"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The Certificate Database Tool, <span class="command"><strong>certutil</strong></span>, 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.</p><p>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 <span class="command"><strong>modutil</strong></span> manpage.</p></div><div class="refsection"><a name="options"></a><h2>Command Options and Arguments</h2><p>Running <span class="command"><strong>certutil</strong></span> 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 <code class="option">-H</code> will list all the command options and their relevant arguments.</p><p><span class="command"><strong>Command Options</strong></span></p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-A </span></dt><dd><p>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.</p></dd><dt><span class="term">-B</span></dt><dd><p>Run a series of commands from the specified batch file. This requires the <code class="option">-i</code> argument.</p></dd><dt><span class="term">-C </span></dt><dd><p>Create a new binary certificate file from a binary certificate request file. Use the <code class="option">-i</code> argument to specify the certificate request file. If this argument is not used, <span class="command"><strong>certutil</strong></span> prompts for a filename. </p></dd><dt><span class="term">-D </span></dt><dd><p>Delete a certificate from the certificate database.</p></dd><dt><span class="term">--rename </span></dt><dd><p>Change the database nickname of a certificate.</p></dd><dt><span class="term">-E </span></dt><dd><p>Add an email certificate to the certificate database.</p></dd><dt><span class="term">-F</span></dt><dd><p>Delete a private key from a key database. Specify the key to delete with the -n argument. Specify the database from which to delete the key with the +<code class="option">-d</code> argument. Use the <code class="option">-k</code> argument to specify explicitly whether to delete a DSA, RSA, or ECC key. If you don't use the <code class="option">-k</code> argument, the option looks for an RSA key matching the specified nickname. +</p><p> +When you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using -D. Some smart cards do not let you remove a public key you have generated. In such a case, only the private key is deleted from the key pair. You can display the public key with the command certutil -K -h tokenname. </p></dd><dt><span class="term">-G </span></dt><dd><p>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.</p></dd><dt><span class="term">-H </span></dt><dd><p>Display a list of the command options and arguments.</p></dd><dt><span class="term">-K </span></dt><dd><p>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).</p></dd><dt><span class="term">-L </span></dt><dd><p>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.</p></dd><dt><span class="term">-M </span></dt><dd><p>Modify a certificate's trust attributes using the values of the -t argument.</p></dd><dt><span class="term">-N</span></dt><dd><p>Create new certificate and key databases.</p></dd><dt><span class="term">-O </span></dt><dd><p>Print the certificate chain.</p></dd><dt><span class="term">-R</span></dt><dd><p>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.</p></dd><dt><span class="term">-S </span></dt><dd><p>Create an individual certificate and add it to a certificate database.</p></dd><dt><span class="term">-T </span></dt><dd><p>Reset the key database or token.</p></dd><dt><span class="term">-U </span></dt><dd><p>List all available modules or print a single named module.</p></dd><dt><span class="term">-V </span></dt><dd><p>Check the validity of a certificate and its attributes.</p></dd><dt><span class="term">-W </span></dt><dd><p>Change the password to a key database.</p></dd><dt><span class="term">--merge</span></dt><dd><p>Merge two databases into one.</p></dd><dt><span class="term">--upgrade-merge</span></dt><dd><p>Upgrade an old database and merge it into a new database. This is used to migrate legacy NSS databases (<code class="filename">cert8.db</code> and <code class="filename">key3.db</code>) into the newer SQLite databases (<code class="filename">cert9.db</code> and <code class="filename">key4.db</code>).</p></dd></dl></div><p><span class="command"><strong>Arguments</strong></span></p><p>Arguments modify a command option and are usually lower case, numbers, or symbols.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-a</span></dt><dd><p>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.</p></dd><dt><span class="term">-b validity-time</span></dt><dd><p>Specify a time at which a certificate is required to be valid. Use when checking certificate validity with the <code class="option">-V</code> option. The format of the <span class="emphasis"><em>validity-time</em></span> argument is <span class="emphasis"><em>YYMMDDHHMMSS[+HHMM|-HHMM|Z]</em></span>, which allows offsets to be set relative to the validity end time. Specifying seconds (<span class="emphasis"><em>SS</em></span>) is optional. When specifying an explicit time, use a Z at the end of the term, <span class="emphasis"><em>YYMMDDHHMMSSZ</em></span>, to close it. When specifying an offset time, use <span class="emphasis"><em>YYMMDDHHMMSS+HHMM</em></span> or <span class="emphasis"><em>YYMMDDHHMMSS-HHMM</em></span> for adding or subtracting time, respectively. +</p><p> +If this option is not used, the validity check defaults to the current system time.</p></dd><dt><span class="term">-c issuer</span></dt><dd><p>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. </p></dd><dt><span class="term">-d [prefix]directory</span></dt><dd><p>Specify the database directory containing the certificate and key database files.</p><p><span class="command"><strong>certutil</strong></span> supports two types of databases: the legacy security databases (<code class="filename">cert8.db</code>, <code class="filename">key3.db</code>, and <code class="filename">secmod.db</code>) and new SQLite databases (<code class="filename">cert9.db</code>, <code class="filename">key4.db</code>, and <code class="filename">pkcs11.txt</code>). </p><p>NSS recognizes the following prefixes:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><span class="command"><strong>sql:</strong></span> requests the newer database</p></li><li class="listitem"><p><span class="command"><strong>dbm:</strong></span> requests the legacy database</p></li></ul></div><p>If no prefix is specified the default type is retrieved from NSS_DEFAULT_DB_TYPE. If NSS_DEFAULT_DB_TYPE is not set then <span class="command"><strong>dbm:</strong></span> is the default.</p></dd><dt><span class="term">--dump-ext-val OID </span></dt><dd><p>For single cert, print binary DER encoding of extension OID.</p></dd><dt><span class="term">-e </span></dt><dd><p>Check a certificate's signature during the process of validating a certificate.</p></dd><dt><span class="term">--email email-address</span></dt><dd><p>Specify the email address of a certificate to list. Used with the -L command option.</p></dd><dt><span class="term">--extGeneric OID:critical-flag:filename[,OID:critical-flag:filename]... </span></dt><dd><p> +Add one or multiple extensions that certutil cannot encode yet, by loading their encodings from external files. + </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>OID (example): 1.2.3.4</p></li><li class="listitem"><p>critical-flag: critical or not-critical</p></li><li class="listitem"><p>filename: full path to a file containing an encoded extension</p></li></ul></div></dd><dt><span class="term">-f password-file</span></dt><dd><p>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.</p></dd><dt><span class="term">-g keysize</span></dt><dd><p>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.</p></dd><dt><span class="term">-h tokenname</span></dt><dd><p>Specify the name of a token to use or act on. If not specified the default token is the internal database slot.</p></dd><dt><span class="term">-i input_file</span></dt><dd><p>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.</p></dd><dt><span class="term">-k key-type-or-id</span></dt><dd><p>Specify the type or specific ID of a key.</p><p> + The valid key type options are rsa, dsa, ec, or all. The default + value is rsa. Specifying the type of key can avoid mistakes caused by + duplicate nicknames. Giving a key type generates a new key pair; + giving the ID of an existing key reuses that key pair (which is + required to renew certificates). + </p></dd><dt><span class="term">-l </span></dt><dd><p>Display detailed information when validating a certificate with the -V option.</p></dd><dt><span class="term">-m serial-number</span></dt><dd><p>Assign a unique serial number to a certificate being created. This operation should be performed by a CA. If no serial number is provided a default serial number is made from the current time. Serial numbers are limited to integers </p></dd><dt><span class="term">-n nickname</span></dt><dd><p>Specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. Bracket the nickname string with quotation marks if it contains spaces.</p></dd><dt><span class="term">-o output-file</span></dt><dd><p>Specify the output file name for new certificates or binary certificate requests. Bracket the output-file string with quotation marks if it contains spaces. If this argument is not used the output destination defaults to standard output.</p></dd><dt><span class="term">-P dbPrefix</span></dt><dd><p>Specify the prefix used on the certificate and key database file. This argument is provided to support legacy servers. Most applications do not use a database prefix.</p></dd><dt><span class="term">-p phone</span></dt><dd><p>Specify a contact telephone number to include in new certificates or certificate requests. Bracket this string with quotation marks if it contains spaces.</p></dd><dt><span class="term">-q pqgfile or curve-name</span></dt><dd><p>Read an alternate PQG value from the specified file when generating DSA key pairs. If this argument is not used, <span class="command"><strong>certutil</strong></span> generates its own PQG value. PQG files are created with a separate DSA utility.</p><p>Elliptic curve name is one of the ones from nistp256, nistp384, nistp521, curve25519.</p><p>If a token is available that supports more curves, the foolowing curves are supported as well: + sect163k1, nistk163, sect163r1, sect163r2, + nistb163, sect193r1, sect193r2, sect233k1, nistk233, + sect233r1, nistb233, sect239k1, sect283k1, nistk283, + sect283r1, nistb283, sect409k1, nistk409, sect409r1, + nistb409, sect571k1, nistk571, sect571r1, nistb571, + secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, + nistp192, secp224k1, secp224r1, nistp224, secp256k1, + secp256r1, secp384r1, secp521r1, + prime192v1, prime192v2, prime192v3, + prime239v1, prime239v2, prime239v3, c2pnb163v1, + c2pnb163v2, c2pnb163v3, c2pnb176v1, c2tnb191v1, + c2tnb191v2, c2tnb191v3, + c2pnb208w1, c2tnb239v1, c2tnb239v2, c2tnb239v3, + c2pnb272w1, c2pnb304w1, + c2tnb359w1, c2pnb368w1, c2tnb431r1, secp112r1, + secp112r2, secp128r1, secp128r2, sect113r1, sect113r2, + sect131r1, sect131r2</p> + </dd><dt><span class="term">-r </span></dt><dd><p>Display a certificate's binary DER encoding when listing information about that certificate with the -L option.</p></dd><dt><span class="term">-s subject</span></dt><dd><p>Identify a particular certificate owner for new certificates or certificate requests. Bracket this string with quotation marks if it contains spaces. The subject identification format follows RFC #1485.</p></dd><dt><span class="term">-t trustargs</span></dt><dd><p>Specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database. There are three available trust categories for each certificate, expressed in the order <span class="emphasis"><em>SSL, email, object signing</em></span> for each trust setting. In each category position, use none, any, or all +of the attribute codes: + </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + <span class="command"><strong>p</strong></span> - Valid peer + </p></li><li class="listitem"><p> + <span class="command"><strong>P</strong></span> - Trusted peer (implies p) + </p></li><li class="listitem"><p> + <span class="command"><strong>c</strong></span> - Valid CA + </p></li><li class="listitem"><p> + <span class="command"><strong>C</strong></span> - Trusted CA (implies c) + </p></li><li class="listitem"><p> + <span class="command"><strong>T</strong></span> - trusted CA for client authentication (ssl server only) + </p></li></ul></div><p> + The attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks. For example: + </p><p><span class="command"><strong>-t "TC,C,T"</strong></span></p><p> + Use the -L option to see a list of the current certificates and trust attributes in a certificate database. </p><p> + 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. </p></dd><dt><span class="term">-u certusage</span></dt><dd><p>Specify a usage context to apply when validating a certificate with the -V option.</p><p>The contexts are the following:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><span class="command"><strong>C</strong></span> (as an SSL client)</p></li><li class="listitem"><p><span class="command"><strong>V</strong></span> (as an SSL server)</p></li><li class="listitem"><p><span class="command"><strong>L</strong></span> (as an SSL CA)</p></li><li class="listitem"><p><span class="command"><strong>A</strong></span> (as Any CA)</p></li><li class="listitem"><p><span class="command"><strong>Y</strong></span> (Verify CA)</p></li><li class="listitem"><p><span class="command"><strong>S</strong></span> (as an email signer)</p></li><li class="listitem"><p><span class="command"><strong>R</strong></span> (as an email recipient)</p></li><li class="listitem"><p><span class="command"><strong>O</strong></span> (as an OCSP status responder)</p></li><li class="listitem"><p><span class="command"><strong>J</strong></span> (as an object signer)</p></li></ul></div></dd><dt><span class="term">-v valid-months</span></dt><dd><p>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 <code class="option">-w</code> option. If this argument is not used, the default validity period is three months. </p></dd><dt><span class="term">-w offset-months</span></dt><dd><p>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. </p></dd><dt><span class="term">-X </span></dt><dd><p>Force the key and certificate database to open in read-write mode. This is used with the <code class="option">-U</code> and <code class="option">-L</code> command options.</p></dd><dt><span class="term">-x </span></dt><dd><p>Use <span class="command"><strong>certutil</strong></span> to generate the signature for a certificate being created or added to a database, rather than obtaining a signature from a separate CA.</p></dd><dt><span class="term">-y exp</span></dt><dd><p>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.</p></dd><dt><span class="term">-z noise-file</span></dt><dd><p>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.</p></dd><dt><span class="term">-Z hashAlg</span></dt><dd><p>Specify the hash algorithm to use with the -C, -S or -R command options. Possible keywords:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>MD2</p></li><li class="listitem"><p>MD4</p></li><li class="listitem"><p>MD5</p></li><li class="listitem"><p>SHA1</p></li><li class="listitem"><p>SHA224</p></li><li class="listitem"><p>SHA256</p></li><li class="listitem"><p>SHA384</p></li><li class="listitem"><p>SHA512</p></li></ul></div></dd><dt><span class="term">-0 SSO_password</span></dt><dd><p>Set a site security officer password on a token.</p></dd><dt><span class="term">-1 | --keyUsage keyword,keyword</span></dt><dd><p>Set an X.509 V3 Certificate Type Extension in the certificate. There are several available keywords:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + digitalSignature + </p></li><li class="listitem"><p> + nonRepudiation + </p></li><li class="listitem"><p> + keyEncipherment + </p></li><li class="listitem"><p> + dataEncipherment + </p></li><li class="listitem"><p> + keyAgreement + </p></li><li class="listitem"><p> + certSigning + </p></li><li class="listitem"><p> + crlSigning + </p></li><li class="listitem"><p> + critical + </p></li></ul></div></dd><dt><span class="term">-2 </span></dt><dd><p>Add a basic constraint extension to a certificate that is being created or added to a database. This extension supports the certificate chain verification process. <span class="command"><strong>certutil</strong></span> prompts for the certificate constraint extension to select.</p><p>X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">-3 </span></dt><dd><p>Add an authority key ID extension to a certificate that is being created or added to a database. This extension supports the identification of a particular certificate, from among multiple certificates associated with one subject name, as the correct issuer of a certificate. The Certificate Database Tool will prompt you to select the authority key ID extension.</p><p>X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">-4 </span></dt><dd><p>Add a CRL distribution point extension to a certificate that is being created or added to a database. This extension identifies the URL of a certificate's associated certificate revocation list (CRL). <span class="command"><strong>certutil</strong></span> prompts for the URL.</p><p>X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">-5 | --nsCertType keyword,keyword</span></dt><dd><p>Add an X.509 V3 certificate type extension to a certificate that is being created or added to the database. There are several available keywords:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + sslClient + </p></li><li class="listitem"><p> + sslServer + </p></li><li class="listitem"><p> + smime + </p></li><li class="listitem"><p> + objectSigning + </p></li><li class="listitem"><p> + sslCA + </p></li><li class="listitem"><p> + smimeCA + </p></li><li class="listitem"><p> + objectSigningCA + </p></li><li class="listitem"><p> + critical + </p></li></ul></div><p>X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">-6 | --extKeyUsage keyword,keyword</span></dt><dd><p>Add an extended key usage extension to a certificate that is being created or added to the database. Several keywords are available:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + serverAuth + </p></li><li class="listitem"><p> + clientAuth + </p></li><li class="listitem"><p> + codeSigning + </p></li><li class="listitem"><p> + emailProtection + </p></li><li class="listitem"><p> + timeStamp + </p></li><li class="listitem"><p> + ocspResponder + </p></li><li class="listitem"><p> + stepUp + </p></li><li class="listitem"><p> + msTrustListSign + </p></li><li class="listitem"><p> + critical + </p></li></ul></div><p>X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">-7 emailAddrs</span></dt><dd><p>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.</p></dd><dt><span class="term">-8 dns-names</span></dt><dd><p>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.</p></dd><dt><span class="term">--extAIA</span></dt><dd><p>Add the Authority Information Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extSIA</span></dt><dd><p>Add the Subject Information Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extCP</span></dt><dd><p>Add the Certificate Policies extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extPM</span></dt><dd><p>Add the Policy Mappings extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extPC</span></dt><dd><p>Add the Policy Constraints extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extIA</span></dt><dd><p>Add the Inhibit Any Policy Access extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extSKID</span></dt><dd><p>Add the Subject Key ID extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extNC</span></dt><dd><p>Add a Name Constraint extension to the certificate. X.509 certificate extensions are described in RFC 5280.</p></dd><dt><span class="term">--extSAN type:name[,type:name]...</span></dt><dd><p> +Create a Subject Alt Name extension with one or multiple names. + </p><p> +-type: directory, dn, dns, edi, ediparty, email, ip, ipaddr, other, registerid, rfc822, uri, x400, x400addr + </p></dd><dt><span class="term">--empty-password</span></dt><dd><p>Use empty password when creating new certificate database with -N.</p></dd><dt><span class="term">--keyAttrFlags attrflags</span></dt><dd><p> +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}</p></dd><dt><span class="term">--keyOpFlagsOn opflags, </span><span class="term">--keyOpFlagsOff opflags</span></dt><dd><p> +PKCS #11 key Operation Flags. +Comma separated list of one or more of the following: +{token | session} {public | private} {sensitive | insensitive} {modifiable | unmodifiable} {extractable | unextractable} + </p></dd><dt><span class="term">--new-n nickname</span></dt><dd><p>A new nickname, used when renaming a certificate.</p></dd><dt><span class="term">--source-dir certdir</span></dt><dd><p>Identify the certificate database directory to upgrade.</p></dd><dt><span class="term">--source-prefix certdir</span></dt><dd><p>Give the prefix of the certificate and key databases to upgrade.</p></dd><dt><span class="term">--upgrade-id uniqueID</span></dt><dd><p>Give the unique ID of the database to upgrade.</p></dd><dt><span class="term">--upgrade-token-name name</span></dt><dd><p>Set the name of the token to use while it is being upgraded.</p></dd><dt><span class="term">-@ pwfile</span></dt><dd><p>Give the name of a password file to use for the database being upgraded.</p></dd></dl></div></div><div class="refsection"><a name="basic-usage"></a><h2>Usage and Examples</h2><p> + Most of the command options in the examples listed here have more arguments available. The arguments included in these examples are the most common ones or are used to illustrate a specific scenario. Use the <code class="option">-H</code> option to show the complete list of arguments for each command option. + </p><p><span class="command"><strong>Creating New Security Databases</strong></span></p><p> + Certificates, keys, and security modules related to managing certificates are stored in three related databases: + </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert8.db or cert9.db + </p></li><li class="listitem"><p> + key3.db or key4.db + </p></li><li class="listitem"><p> + secmod.db or pkcs11.txt + </p></li></ul></div><p> + These databases must be created before certificates or keys can be generated. + </p><pre class="programlisting">certutil -N -d [sql:]directory</pre><p><span class="command"><strong>Creating a Certificate Request</strong></span></p><p> + 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. + </p><pre class="programlisting">$ 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]</pre><p> + The <code class="option">-R</code> command options requires four arguments: + </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + <code class="option">-k</code> to specify either the key type to generate or, when renewing a certificate, the existing key pair to use + </p></li><li class="listitem"><p> + <code class="option">-g</code> to set the keysize of the key to generate + </p></li><li class="listitem"><p> + <code class="option">-s</code> to set the subject name of the certificate + </p></li><li class="listitem"><p> + <code class="option">-d</code> to give the security database directory + </p></li></ul></div><p> + The new certificate request can be output in ASCII format (<code class="option">-a</code>) or can be written to a specified file (<code class="option">-o</code>). + </p><p> + For example: + </p><pre class="programlisting">$ 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 + +Generating key. This may take a few moments... + +</pre><p><span class="command"><strong>Creating a Certificate</strong></span></p><p> + A valid certificate must be issued by a trusted CA. This can be done by specifying a CA certificate (<code class="option">-c</code>) that is stored in the certificate database. If a CA key pair is not available, you can create a self-signed certificate using the <code class="option">-x</code> argument with the <code class="option">-S</code> command option. + </p><pre class="programlisting">$ 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]</pre><p> + The series of numbers and <code class="option">--ext*</code> options set certificate extensions that can be added to the certificate when it is generated by the CA. Interactive prompts will result. + </p><p> + For example, this creates a self-signed certificate: + </p><pre class="programlisting">$ certutil -S -s "CN=Example CA" -n my-ca-cert -x -t "C,C,C" -1 -2 -5 -m 3650</pre><p> +The interative prompts for key usage and whether any extensions are critical and responses have been ommitted for brevity. + </p><p> + From there, new certificates can reference the self-signed certificate: + </p><pre class="programlisting">$ certutil -S -s "CN=My Server Cert" -n my-server-cert -c "my-ca-cert" -t ",," -1 -5 -6 -8 -m 730</pre><p><span class="command"><strong>Generating a Certificate from a Certificate Request</strong></span></p><p> + When a certificate request is created, a certificate can be generated by using the request and then referencing a certificate authority signing certificate (the <span class="emphasis"><em>issuer</em></span> specified in the <code class="option">-c</code> argument). The issuing certificate must be in the certificate database in the specified directory. + </p><pre class="programlisting">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]</pre><p> + For example: + </p><pre class="programlisting">$ 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</pre><p><span class="command"><strong>Listing Certificates</strong></span></p><p> + The <code class="option">-L</code> command option lists all of the certificates listed in the certificate database. The path to the directory (<code class="option">-d</code>) is required. + </p><pre class="programlisting">$ certutil -L -d sql:/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</pre><p> + Using additional arguments with <code class="option">-L</code> can return and print the information for a single, specific certificate. For example, the <code class="option">-n</code> argument passes the certificate name, while the <code class="option">-a</code> argument prints the certificate in ASCII format: + </p><pre class="programlisting"> +$ certutil -L -d sql:$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----- +</pre><p>For a human-readable display</p><pre class="programlisting">$ certutil -L -d sql:$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 + Not After : Thu Jun 13 19:10:29 2013 + Subject: "CN=Example CA" + Subject Public Key Info: + Public Key Algorithm: PKCS #1 RSA Encryption + RSA Public Key: + Modulus: + 9e:0a:ce:ab:f3:27:20:55:80:5a:83:5d:16:12:c9:30: + 4d:c3:50:eb:c5:45:3f:dc:6b:d6:03:f9:e0:8c:0c:07: + 12:fd:02:ba:5f:fa:b0:ef:e0:b0:2b:e7:00:11:e2:1f: + ab:a7:9e:ce:b1:5d:1c:cf:39:19:42:d9:66:37:82:49: + 3b:be:69:6c:2e:f6:29:c9:e7:0d:6b:30:22:fc:d0:30: + 56:75:3f:eb:a1:ce:b1:aa:15:15:61:3e:80:14:28:f7: + d5:2b:37:6c:a4:d0:18:8a:fc:63:05:94:b9:b9:75:74: + 11:3a:00:3d:64:a2:b2:15:d2:34:2c:85:ed:7f:a4:9b + Exponent: 65537 (0x10001) + Signed Extensions: + Name: Certificate Type + Data: none + + Name: Certificate Basic Constraints + Data: Is a CA with no maximum path length. + + Name: Certificate Key Usage + Critical: True + Usages: Certificate Signing + + Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption + Signature: + 3a:72:19:33:90:00:8d:db:cd:5d:d6:32:8c:ad:cf:91: + 1c:6d:94:31:a4:32:c6:2b:5e:68:b5:59:3b:e4:68:d6: + 79:d1:52:fb:1e:0d:fd:3d:5c:a6:05:c0:f3:09:8d:60: + a2:85:59:2e:e9:bc:3f:8a:16:5f:b8:c1:e1:c4:ad:b6: + 36:e7:ba:8a:73:50:e9:e0:ee:ed:69:ab:a8:bf:33:de: + 25:2b:43:0c:6c:f9:68:85:a1:bd:ab:6f:c5:d1:55:52: + 64:cd:77:57:c6:59:38:ba:8d:d4:b4:db:f0:f2:c0:33: + ee:c5:83:ef:5a:b1:29:a2:07:53:9a:b8:f7:38:a3:7e + Fingerprint (MD5): + 86:D8:A5:8B:8A:26:BE:9E:17:A8:7B:66:10:6B:27:80 + Fingerprint (SHA1): + 48:78:09:EF:C5:D4:0C:BD:D2:64:45:59:EB:03:13:15:F7:A9:D6:F7 + + Certificate Trust Flags: + SSL Flags: + Valid CA + Trusted CA + User + Email Flags: + Valid CA + Trusted CA + User + Object Signing Flags: + Valid CA + Trusted CA + User + +</pre><p><span class="command"><strong>Listing Keys</strong></span></p><p> + Keys are the original material used to encrypt certificate data. The keys generated for certificates are stored separately, in the key database. + </p><p> + To list all keys in the database, use the <code class="option">-K</code> command option and the (required) <code class="option">-d</code> argument to give the path to the directory. + </p><pre class="programlisting">$ certutil -K -d sql:$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</pre><p> + There are ways to narrow the keys listed in the search results: + </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + To return a specific key, use the <code class="option">-n</code> <span class="emphasis"><em>name</em></span> argument with the name of the key. + </p></li><li class="listitem"><p> + If there are multiple security devices loaded, then the <code class="option">-h</code> <span class="emphasis"><em>tokenname</em></span> argument can search a specific token or all tokens. + </p></li><li class="listitem"><p> + If there are multiple key types available, then the <code class="option">-k</code> <span class="emphasis"><em>key-type</em></span> argument can search a specific type of key, like RSA, DSA, or ECC. + </p></li></ul></div><p><span class="command"><strong>Listing Security Modules</strong></span></p><p> + 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 <code class="option">-U</code> command option lists all of the security modules listed in the <code class="filename">secmod.db</code> database. The path to the directory (<code class="option">-d</code>) is required. + </p><pre class="programlisting">$ certutil -U -d sql:/home/my/sharednssdb + + slot: NSS User Private Key and Certificate Services + token: NSS Certificate DB + + slot: NSS Internal Cryptographic Services + token: NSS Generic Crypto Services</pre><p><span class="command"><strong>Adding Certificates to the Database</strong></span></p><p> + Existing certificates or certificate requests can be added manually to the certificate database, even if they were generated elsewhere. This uses the <code class="option">-A</code> command option. + </p><pre class="programlisting">certutil -A -n certname -t trustargs -d [sql:]directory [-a] [-i input-file]</pre><p> + For example: + </p><pre class="programlisting">$ certutil -A -n "CN=My SSL Certificate" -t ",," -d sql:/home/my/sharednssdb -i /home/example-certs/cert.cer</pre><p> + A related command option, <code class="option">-E</code>, is used specifically to add email certificates to the certificate database. The <code class="option">-E</code> command has the same arguments as the <code class="option">-A</code> command. The trust arguments for certificates have the format <span class="emphasis"><em>SSL,S/MIME,Code-signing</em></span>, so the middle trust settings relate most to email certificates (though the others can be set). For example: + </p><pre class="programlisting">$ certutil -E -n "CN=John Smith Email Cert" -t ",P," -d sql:/home/my/sharednssdb -i /home/example-certs/email.cer</pre><p><span class="command"><strong>Deleting Certificates to the Database</strong></span></p><p> + Certificates can be deleted from a database using the <code class="option">-D</code> option. The only required options are to give the security database directory and to identify the certificate nickname. + </p><pre class="programlisting">certutil -D -d [sql:]directory -n "nickname"</pre><p> + For example: + </p><pre class="programlisting">$ certutil -D -d sql:/home/my/sharednssdb -n "my-ssl-cert"</pre><p><span class="command"><strong>Validating Certificates</strong></span></p><p> + 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 <code class="option">-V</code> command option. + </p><pre class="programlisting">certutil -V -n certificate-name [-b time] [-e] [-u cert-usage] -d [sql:]directory</pre><p> + For example, to validate an email certificate: + </p><pre class="programlisting">$ certutil -V -n "John Smith's Email Cert" -e -u S,R -d sql:/home/my/sharednssdb</pre><p><span class="command"><strong>Modifying Certificate Trust Settings</strong></span></p><p> + 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. + </p><pre class="programlisting">certutil -M -n certificate-name -t trust-args -d [sql:]directory</pre><p> + For example: + </p><pre class="programlisting">$ certutil -M -n "My CA Certificate" -d sql:/home/my/sharednssdb -t "CT,CT,CT"</pre><p><span class="command"><strong>Printing the Certificate Chain</strong></span></p><p> + Certificates can be issued in <span class="emphasis"><em>chains</em></span> because every certificate authority itself has a certificate; when a CA issues a certificate, it essentially stamps that certificate with its own fingerprint. The <code class="option">-O</code> 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: + </p><pre class="programlisting">$ certutil -d sql:/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]</pre><p><span class="command"><strong>Resetting a Token</strong></span></p><p> + 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 (<code class="option">-h</code>) as well as any directory path. If there is no external token used, the default value is internal. + </p><pre class="programlisting">certutil -T -d [sql:]directory -h token-name -0 security-officer-password</pre><p> + 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: + </p><pre class="programlisting">$ certutil -T -d sql:/home/my/sharednssdb -h nethsm -0 secret</pre><p><span class="command"><strong>Upgrading or Merging the Security Databases</strong></span></p><p> + Many networks or applications may be using older BerkeleyDB versions of the certificate database (<code class="filename">cert8.db</code>). Databases can be upgraded to the new SQLite version of the database (<code class="filename">cert9.db</code>) using the <code class="option">--upgrade-merge</code> command option or existing databases can be merged with the new <code class="filename">cert9.db</code> databases using the <code class="option">---merge</code> command. + </p><p> + The <code class="option">--upgrade-merge</code> command must give information about the original database and then use the standard arguments (like <code class="option">-d</code>) 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. + </p><pre class="programlisting">certutil --upgrade-merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix --upgrade-id id --upgrade-token-name name [-@ password-file]</pre><p> + For example: + </p><pre class="programlisting">$ certutil --upgrade-merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp- --upgrade-id 1 --upgrade-token-name internal</pre><p> + The <code class="option">--merge</code> 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. + </p><pre class="programlisting">certutil --merge -d [sql:]directory [-P dbprefix] --source-dir directory --source-prefix dbprefix [-@ password-file]</pre><p> + For example: + </p><pre class="programlisting">$ certutil --merge -d sql:/home/my/sharednssdb --source-dir /opt/my-app/alias/ --source-prefix serverapp-</pre><p><span class="command"><strong>Running certutil Commands from a Batch File</strong></span></p><p> + A series of commands can be run sequentially from a text file with the <code class="option">-B</code> command option. The only argument for this specifies the input file. + </p><pre class="programlisting">$ certutil -B -i /path/to/batch-file</pre></div><div class="refsection"><a name="databases"></a><h2>NSS Database Types</h2><p>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <span class="emphasis"><em>legacy</em></span> databases are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert8.db for certificates + </p></li><li class="listitem"><p> + key3.db for keys + </p></li><li class="listitem"><p> + secmod.db for PKCS #11 module information + </p></li></ul></div><p>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</p><p>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkeleyDB. These new databases provide more accessibility and performance:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert9.db for certificates + </p></li><li class="listitem"><p> + key4.db for keys + </p></li><li class="listitem"><p> + pkcs11.txt, a listing of all of the PKCS #11 modules, contained in a new subdirectory in the security databases directory + </p></li></ul></div><p>Because the SQLite databases are designed to be shared, these are the <span class="emphasis"><em>shared</em></span> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</p><p>By default, the tools (<span class="command"><strong>certutil</strong></span>, <span class="command"><strong>pk12util</strong></span>, <span class="command"><strong>modutil</strong></span>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <span class="command"><strong>sql:</strong></span> prefix with the given security directory. For example:</p><pre class="programlisting">$ certutil -L -d sql:/home/my/sharednssdb</pre><p>To set the shared database type as the default type for the tools, set the <code class="envar">NSS_DEFAULT_DB_TYPE</code> environment variable to <code class="envar">sql</code>:</p><pre class="programlisting">export NSS_DEFAULT_DB_TYPE="sql"</pre><p>This line can be set added to the <code class="filename">~/.bashrc</code> file to make the change permanent.</p><p>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:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li></ul></div><p>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="seealso"></a><h2>See Also</h2><p>pk12util (1)</p><p>modutil (1)</p><p><span class="command"><strong>certutil</strong></span> has arguments or operations that use features defined in several IETF RFCs.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + http://tools.ietf.org/html/rfc5280 + </p></li><li class="listitem"><p> + http://tools.ietf.org/html/rfc1113 + </p></li><li class="listitem"><p> + http://tools.ietf.org/html/rfc1485 + </p></li></ul></div><p>The NSS wiki has information on the new database design and how to configure applications to use it.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/cmsutil.html b/security/nss/doc/html/cmsutil.html new file mode 100644 index 000000000..1bed3fe6f --- /dev/null +++ b/security/nss/doc/html/cmsutil.html @@ -0,0 +1,27 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>CMSUTIL</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="CMSUTIL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CMSUTIL</th></tr></table><hr></div><div class="refentry"><a name="cmsutil"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>cmsutil — Performs basic cryptograpic operations, such as encryption and decryption, on Cryptographic Message Syntax (CMS) messages.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">cmsutil</code> [<em class="replaceable"><code>options</code></em>] [[<em class="replaceable"><code>arguments</code></em>]]</p></div></div><div class="refsection"><a name="idm233266717696"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The <span class="command"><strong>cmsutil</strong></span> command-line uses the S/MIME Toolkit to perform basic operations, such as encryption and decryption, on Cryptographic Message Syntax (CMS) messages. + </p><p> +To run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. +Each command takes one option. Each option may take zero or more arguments. +To see a usage string, issue the command without options. + </p></div><div class="refsection"><a name="options"></a><h2>Options and Arguments</h2><p> + </p><p><span class="command"><strong>Options</strong></span></p><p> +Options specify an action. Option arguments modify an action. +The options and arguments for the cmsutil command are defined as follows: + </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-C</span></dt><dd><p>Encrypt a message.</p></dd><dt><span class="term">-D </span></dt><dd><p>Decode a message.</p></dd><dt><span class="term">-E </span></dt><dd><p>Envelope a message.</p></dd><dt><span class="term">-O </span></dt><dd><p>Create a certificates-only message.</p></dd><dt><span class="term">-S </span></dt><dd><p>Sign a message.</p></dd></dl></div><p><span class="command"><strong>Arguments</strong></span></p><p>Option arguments modify an action.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-b </span></dt><dd><p>Decode a batch of files named in infile.</p></dd><dt><span class="term">-c content </span></dt><dd><p>Use this detached content (decode only).</p></dd><dt><span class="term">-d dbdir</span></dt><dd><p>Specify the key/certificate database directory (default is ".")</p></dd><dt><span class="term">-e envfile</span></dt><dd><p>Specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message. If this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only).</p></dd><dt><span class="term">-f pwfile</span></dt><dd><p>Use password file to set password on all PKCS#11 tokens.</p></dd><dt><span class="term">-G</span></dt><dd><p>Include a signing time attribute (sign only).</p></dd><dt><span class="term">-H hash</span></dt><dd><p>Use specified hash algorithm (default:SHA1).</p></dd><dt><span class="term">-h num</span></dt><dd><p>Generate email headers with info about CMS message (decode only).</p></dd><dt><span class="term">-i infile</span></dt><dd><p>Use infile as a source of data (default is stdin).</p></dd><dt><span class="term">-k</span></dt><dd><p>Keep decoded encryption certs in permanent cert db.</p></dd><dt><span class="term">-N nickname</span></dt><dd><p>Specify nickname of certificate to sign with (sign only).</p></dd><dt><span class="term">-n </span></dt><dd><p>Suppress output of contents (decode only).</p></dd><dt><span class="term">-o outfile</span></dt><dd><p>Use outfile as a destination of data (default is stdout).</p></dd><dt><span class="term">-P</span></dt><dd><p>Include an S/MIME capabilities attribute.</p></dd><dt><span class="term">-p password</span></dt><dd><p>Use password as key database password.</p></dd><dt><span class="term">-r recipient1,recipient2, ...</span></dt><dd><p> +Specify list of recipients (email addresses) for an encrypted or enveloped message. +For certificates-only message, list of certificates to send. + </p></dd><dt><span class="term">-T</span></dt><dd><p>Suppress content in CMS message (sign only).</p></dd><dt><span class="term">-u certusage</span></dt><dd><p>Set type of cert usage (default is certUsageEmailSigner).</p></dd><dt><span class="term">-v</span></dt><dd><p>Print debugging information.</p></dd><dt><span class="term">-Y ekprefnick</span></dt><dd><p>Specify an encryption key preference by nickname.</p></dd></dl></div></div><div class="refsection"><a name="usage"></a><h2>Usage</h2><p>Encrypt Example</p><pre class="programlisting"> +cmsutil -C [-i infile] [-o outfile] [-d dbdir] [-p password] -r "recipient1,recipient2, . . ." -e envfile + </pre><p>Decode Example</p><pre class="programlisting"> +cmsutil -D [-i infile] [-o outfile] [-d dbdir] [-p password] [-c content] [-n] [-h num] + </pre><p>Envelope Example</p><pre class="programlisting"> +cmsutil -E [-i infile] [-o outfile] [-d dbdir] [-p password] -r "recipient1,recipient2, ..." + </pre><p>Certificate-only Example</p><pre class="programlisting"> +cmsutil -O [-i infile] [-o outfile] [-d dbdir] [-p password] -r "cert1,cert2, . . ." + </pre><p>Sign Message Example</p><pre class="programlisting"> +cmsutil -S [-i infile] [-o outfile] [-d dbdir] [-p password] -N nickname[-TGP] [-Y ekprefnick] + </pre></div><div class="refsection"><a name="seealso"></a><h2>See also</h2><p>certutil(1)</p></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/crlutil.html b/security/nss/doc/html/crlutil.html new file mode 100644 index 000000000..c27a06e78 --- /dev/null +++ b/security/nss/doc/html/crlutil.html @@ -0,0 +1,204 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>CRLUTIL</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="CRLUTIL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CRLUTIL</th></tr></table><hr></div><div class="refentry"><a name="crlutil"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>crlutil — +List, generate, modify, or delete CRLs within the NSS security database file(s) and list, create, modify or delete certificates entries in a particular CRL. + </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">crlutil</code> [<em class="replaceable"><code>options</code></em>] [[<em class="replaceable"><code>arguments</code></em>]]</p></div></div><div class="refsection"><a name="idm233261315520"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The Certificate Revocation List (CRL) Management Tool, <span class="command"><strong>crlutil</strong></span>, is a command-line utility that can list, generate, modify, or delete CRLs within the NSS security database file(s) and list, create, modify or delete certificates entries in a particular CRL. + </p><p> +The key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. + </p><p> +This document discusses certificate revocation list management. For information on security module database management, see Using the Security Module Database Tool. For information on certificate and key database management, see Using the Certificate Database Tool. + </p><p> +To run the Certificate Revocation List Management Tool, type the command + </p><p> +crlutil option [arguments] + </p><p> +where options and arguments are combinations of the options and arguments listed in the following section. Each command takes one option. Each option may take zero or more arguments. To see a usage string, issue the command without options, or with the -H option. + </p></div><div class="refsection"><a name="options"></a><h2>Options and Arguments</h2><p> + </p><p><span class="command"><strong>Options</strong></span></p><p> +Options specify an action. Option arguments modify an action. +The options and arguments for the crlutil command are defined as follows: + </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-D </span></dt><dd><p> +Delete Certificate Revocation List from cert database. + </p></dd><dt><span class="term">-E </span></dt><dd><p> +Erase all CRLs of specified type from the cert database + </p></dd><dt><span class="term">-G </span></dt><dd><p> +Create new Certificate Revocation List (CRL). + </p></dd><dt><span class="term">-I </span></dt><dd><p> +Import a CRL to the cert database + </p></dd><dt><span class="term">-L </span></dt><dd><p> +List existing CRL located in cert database file. + </p></dd><dt><span class="term">-M </span></dt><dd><p> +Modify existing CRL which can be located in cert db or in arbitrary file. If located in file it should be encoded in ASN.1 encode format. + </p></dd><dt><span class="term">-S </span></dt><dd><p> +Show contents of a CRL file which isn't stored in the database. + </p></dd></dl></div><p><span class="command"><strong>Arguments</strong></span></p><p>Option arguments modify an action.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-a </span></dt><dd><p> +Use ASCII format or allow the use of ASCII format for input and output. This formatting follows RFC #1113. + </p></dd><dt><span class="term">-B </span></dt><dd><p> +Bypass CA signature checks. + </p></dd><dt><span class="term">-c crl-gen-file </span></dt><dd><p> +Specify script file that will be used to control crl generation/modification. See crl-cript-file format below. If options -M|-G is used and -c crl-script-file is not specified, crlutil will read script data from standard input. + </p></dd><dt><span class="term">-d directory </span></dt><dd><p> +Specify the database directory containing the certificate and key database files. On Unix the Certificate Database Tool defaults to $HOME/.netscape (that is, ~/.netscape). On Windows NT the default is the current directory. + </p><p> +The NSS database files must reside in the same directory. + </p></dd><dt><span class="term">-f password-file </span></dt><dd><p> +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. + </p></dd><dt><span class="term">-i crl-file </span></dt><dd><p> +Specify the file which contains the CRL to import or show. + </p></dd><dt><span class="term">-l algorithm-name </span></dt><dd><p> +Specify a specific signature algorithm. List of possible algorithms: MD2 | MD4 | MD5 | SHA1 | SHA256 | SHA384 | SHA512 + </p></dd><dt><span class="term">-n nickname </span></dt><dd><p> +Specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. Bracket the nickname string with quotation marks if it contains spaces. + </p></dd><dt><span class="term">-o output-file </span></dt><dd><p> +Specify the output file name for new CRL. Bracket the output-file string with quotation marks if it contains spaces. If this argument is not used the output destination defaults to standard output. + </p></dd><dt><span class="term">-P dbprefix </span></dt><dd><p> +Specify the prefix used on the NSS security database files (for example, my_cert8.db and my_key3.db). This option is provided as a special case. Changing the names of the certificate and key databases is not recommended. + </p></dd><dt><span class="term">-t crl-type </span></dt><dd><p> +Specify type of CRL. possible types are: 0 - SEC_KRL_TYPE, 1 - SEC_CRL_TYPE. This option is obsolete + </p></dd><dt><span class="term">-u url </span></dt><dd><p> +Specify the url. + </p></dd><dt><span class="term">-w pwd-string</span></dt><dd><p>Provide db password in command line.</p></dd><dt><span class="term">-Z algorithm</span></dt><dd><p>Specify the hash algorithm to use for signing the CRL.</p></dd></dl></div></div><div class="refsection"><a name="syntax"></a><h2>CRL Generation script syntax</h2><p>CRL generation script file has the following syntax:</p><p> + * Line with comments should have # as a first symbol of a line</p><p> + * Set "this update" or "next update" CRL fields: + </p><p> + update=YYYYMMDDhhmmssZ + nextupdate=YYYYMMDDhhmmssZ + </p><p> + Field "next update" is optional. Time should be in GeneralizedTime format (YYYYMMDDhhmmssZ). + For example: 20050204153000Z + </p><p>* Add an extension to a CRL or a crl certificate entry:</p><p>addext extension-name critical/non-critical [arg1[arg2 ...]]</p><p>Where:</p><p> + extension-name: string value of a name of known extensions. + critical/non-critical: is 1 when extension is critical and 0 otherwise. + arg1, arg2: specific to extension type extension parameters + </p><p> + addext uses the range that was set earlier by addcert and will install an extension to every cert entries within the range. + </p><p> + * Add certificate entries(s) to CRL: + </p><p> + addcert range date + </p><p> + range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. Only one cert will be added if there is no delimiter. + date: revocation date of a cert. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ). + </p><p> + * Remove certificate entry(s) from CRL + </p><p> + rmcert range + </p><p> + Where: + </p><p> + range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. Only one cert will be added if there is no delimiter. + </p><p> + * Change range of certificate entry(s) in CRL + </p><p> + range new-range + </p><p> + Where: + </p><p> + new-range: two integer values separated by dash: range of certificates that will be added by this command. dash is used as a delimiter. Only one cert will be added if there is no delimiter. + </p><p> +Implemented Extensions + </p><p> + The extensions defined for CRL provide methods for associating additional attributes with CRLs of theirs entries. For more information see RFC #3280 + </p><p> + * Add The Authority Key Identifier extension: + </p><p> +The authority key identifier extension provides a means of identifying the public key corresponding to the private key used to sign a CRL. + </p><p> + authKeyId critical [key-id | dn cert-serial] + </p><p> + Where: + </p><p> + authKeyIdent: identifies the name of an extension + critical: value of 1 of 0. Should be set to 1 if this extension is critical or 0 otherwise. + key-id: key identifier represented in octet string. dn:: is a CA distinguished name cert-serial: authority certificate serial number. + </p><p> + * Add Issuer Alternative Name extension: + </p><p> + The issuer alternative names extension allows additional identities to be associated with the issuer of the CRL. Defined options include an rfc822 name (electronic mail address), a DNS name, an IP address, and a URI. + </p><p> + issuerAltNames non-critical name-list + </p><p> + Where: + </p><p> + subjAltNames: identifies the name of an extension + should be set to 0 since this is non-critical extension + name-list: comma separated list of names + </p><p> + * Add CRL Number extension: + </p><p> + The CRL number is a non-critical CRL extension which conveys a monotonically increasing sequence number for a given CRL scope and CRL issuer. This extension allows users to easily determine when a particular CRL supersedes another CRL + </p><p> + crlNumber non-critical number + </p><p> + Where: + </p><p> + crlNumber: identifies the name of an extension + critical: should be set to 0 since this is non-critical extension + number: value of long which identifies the sequential number of a CRL. + </p><p> + * Add Revocation Reason Code extension: + </p><p> + The reasonCode is a non-critical CRL entry extension that identifies the reason for the certificate revocation. + </p><p> + reasonCode non-critical code + </p><p> + Where: + </p><p> + reasonCode: identifies the name of an extension + non-critical: should be set to 0 since this is non-critical extension + code: the following codes are available: + </p><p> + unspecified (0), + keyCompromise (1), + cACompromise (2), + affiliationChanged (3), + superseded (4), + cessationOfOperation (5), + certificateHold (6), + removeFromCRL (8), + privilegeWithdrawn (9), + aACompromise (10) + </p><p> + * Add Invalidity Date extension: + </p><p> + The invalidity date is a non-critical CRL entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. + </p><p> + invalidityDate non-critical date + </p><p> + Where: + </p><p> + crlNumber: identifies the name of an extension + non-critical: should be set to 0 since this is non-critical extension date: invalidity date of a cert. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ). + </p></div><div class="refsection"><a name="usage"></a><h2>Usage</h2><p> +The Certificate Revocation List Management Tool's capabilities are grouped as follows, using these combinations of options and arguments. Options and arguments in square brackets are optional, those without square brackets are required. + </p><p>See "Implemented extensions" for more information regarding extensions and their parameters.</p><p> + * Creating or modifying a CRL: + </p><pre class="programlisting"> +crlutil -G|-M -c crl-gen-file -n nickname [-i crl] [-u url] [-d keydir] [-P dbprefix] [-l alg] [-a] [-B] + </pre><p> + * Listing all CRls or a named CRL: + </p><pre class="programlisting"> + crlutil -L [-n crl-name] [-d krydir] + </pre><p> + * Deleting CRL from db: + </p><pre class="programlisting"> + crlutil -D -n nickname [-d keydir] [-P dbprefix] + </pre><p> + * Erasing CRLs from db: + </p><pre class="programlisting"> + crlutil -E [-d keydir] [-P dbprefix] + </pre><p> + * Deleting CRL from db: + </p><pre class="programlisting"> + crlutil -D -n nickname [-d keydir] [-P dbprefix] + </pre><p> + * Erasing CRLs from db: + </p><pre class="programlisting"> + crlutil -E [-d keydir] [-P dbprefix] + </pre><p> + * Import CRL from file: + </p><pre class="programlisting"> + crlutil -I -i crl [-t crlType] [-u url] [-d keydir] [-P dbprefix] [-B] + </pre></div><div class="refsection"><a name="seealso"></a><h2>See Also</h2><p>certutil(1)</p></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/derdump.html b/security/nss/doc/html/derdump.html new file mode 100644 index 000000000..77e70be1f --- /dev/null +++ b/security/nss/doc/html/derdump.html @@ -0,0 +1,7 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>DERDUMP</title><meta name="generator" content="DocBook XSL Stylesheets V1.77.1"><link rel="home" href="index.html" title="DERDUMP"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">DERDUMP</th></tr></table><hr></div><div class="refentry"><a name="derdump"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>derdump — Dumps C-sequence strings from a DER encoded certificate file</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">derdump</code> [<code class="option">-r</code>] [<code class="option">-i <em class="replaceable"><code>input-file</code></em></code>] [<code class="option">-o <em class="replaceable"><code>output-file</code></em></code>]</p></div></div><div class="refsection"><a name="idp4817536"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="idp2658976"></a><h2>Description</h2><p><span class="command"><strong>derdump </strong></span>dumps C-sequence strings from a DER encode certificate file </p></div><div class="refsection"><a name="idp4859136"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-r </code></span></dt><dd>For formatted items, dump raw bytes as well</dd><dt><span class="term"><code class="option">-i </code> <em class="replaceable"><code>DER encoded file</code></em></span></dt><dd>Define an input file to use (default is stdin)</dd><dt><span class="term"><code class="option">-o </code> <em class="replaceable"><code>output file</code></em></span></dt><dd>Define an output file to use (default is stdout).</dd></dl></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>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 <a class="ulink" href="http://pki.fedoraproject.org/wiki/" target="_top">PKI Wiki</a>. </p><p>For information specifically about NSS, the NSS project wiki is located at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">Mozilla NSS site</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: pki-devel@redhat.com and pki-users@redhat.com</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape and now with Red Hat.</p><p> + Authors: Gerhardus Geldenhuis <gerhardus.geldenhuis@gmail.com>. Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com> + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/modutil.html b/security/nss/doc/html/modutil.html new file mode 100644 index 000000000..5c53b0a62 --- /dev/null +++ b/security/nss/doc/html/modutil.html @@ -0,0 +1,250 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>MODUTIL</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="MODUTIL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">MODUTIL</th></tr></table><hr></div><div class="refentry"><a name="modutil"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>modutil — Manage PKCS #11 module information within the security module database.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">modutil</code> [<em class="replaceable"><code>options</code></em>] [[<em class="replaceable"><code>arguments</code></em>]]</p></div></div><div class="refsection"><a name="idm233245929376"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The Security Module Database Tool, <span class="command"><strong>modutil</strong></span>, is a command-line utility for managing PKCS #11 module information both within <code class="filename">secmod.db</code> files and within hardware tokens. <span class="command"><strong>modutil</strong></span> 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.</p><p>The tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases.</p></div><div class="refsection"><a name="options"></a><h2>Options</h2><p> + Running <span class="command"><strong>modutil</strong></span> 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. + </p><p><span class="command"><strong>Options</strong></span></p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-add modulename</span></dt><dd><p>Add the named PKCS #11 module to the database. Use this option with the <code class="option">-libfile</code>, <code class="option">-ciphers</code>, and <code class="option">-mechanisms</code> arguments.</p></dd><dt><span class="term">-changepw tokenname</span></dt><dd><p>Change the password on the named token. If the token has not been initialized, this option initializes the password. Use this option with the <code class="option">-pwfile</code> and <code class="option">-newpwfile</code> arguments. A <span class="emphasis"><em>password</em></span> is equivalent to a personal identification number (PIN).</p></dd><dt><span class="term">-chkfips</span></dt><dd><p>Verify whether the module is in the given FIPS mode. <span class="command"><strong>true</strong></span> means to verify that the module is in FIPS mode, while <span class="command"><strong>false</strong></span> means to verify that the module is not in FIPS mode.</p></dd><dt><span class="term">-create</span></dt><dd><p>Create new certificate, key, and module databases. Use the <code class="option">-dbdir</code> directory argument to specify a directory. If any of these databases already exist in a specified directory, <span class="command"><strong>modutil</strong></span> returns an error message.</p></dd><dt><span class="term">-default modulename</span></dt><dd><p>Specify the security mechanisms for which the named module will be a default provider. The security mechanisms are specified with the <code class="option">-mechanisms</code> argument.</p></dd><dt><span class="term">-delete modulename</span></dt><dd><p>Delete the named module. The default NSS PKCS #11 module cannot be deleted.</p></dd><dt><span class="term">-disable modulename</span></dt><dd><p>Disable all slots on the named module. Use the <code class="option">-slot</code> argument to disable a specific slot.</p><p>The internal NSS PKCS #11 module cannot be disabled.</p></dd><dt><span class="term">-enable modulename</span></dt><dd><p>Enable all slots on the named module. Use the <code class="option">-slot</code> argument to enable a specific slot.</p></dd><dt><span class="term">-fips [true | false]</span></dt><dd><p>Enable (true) or disable (false) FIPS 140-2 compliance for the default NSS module.</p></dd><dt><span class="term">-force</span></dt><dd><p>Disable <span class="command"><strong>modutil</strong></span>'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.</p></dd><dt><span class="term">-jar JAR-file</span></dt><dd><p>Add a new PKCS #11 module to the database using the named JAR file. Use this command with the <code class="option">-installdir</code> and <code class="option">-tempdir</code> 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 <span class="command"><strong>modutil</strong></span>. </p></dd><dt><span class="term">-list [modulename]</span></dt><dd><p>Display basic information about the contents of the <code class="filename">secmod.db</code> file. Specifying a <span class="emphasis"><em>modulename</em></span> displays detailed information about a particular module and its slots and tokens.</p></dd><dt><span class="term">-rawadd</span></dt><dd><p>Add the module spec string to the <code class="filename">secmod.db</code> database.</p></dd><dt><span class="term">-rawlist</span></dt><dd><p>Display the module specs for a specified module or for all loadable modules.</p></dd><dt><span class="term">-undefault modulename</span></dt><dd><p>Specify the security mechanisms for which the named module will not be a default provider. The security mechanisms are specified with the <code class="option">-mechanisms</code> argument.</p></dd></dl></div><p><span class="command"><strong>Arguments</strong></span></p><div class="variablelist"><dl class="variablelist"><dt><span class="term">MODULE</span></dt><dd><p>Give the security module to access.</p></dd><dt><span class="term">MODULESPEC</span></dt><dd><p>Give the security module spec to load into the security database.</p></dd><dt><span class="term">-ciphers cipher-enable-list</span></dt><dd><p>Enable specific ciphers in a module that is being added to the database. The <span class="emphasis"><em>cipher-enable-list</em></span> is a colon-delimited list of cipher names. Enclose this list in quotation marks if it contains spaces.</p></dd><dt><span class="term">-dbdir [sql:]directory</span></dt><dd><p>Specify the database directory in which to access or create security module database files.</p><p><span class="command"><strong>modutil</strong></span> supports two types of databases: the legacy security databases (<code class="filename">cert8.db</code>, <code class="filename">key3.db</code>, and <code class="filename">secmod.db</code>) and new SQLite databases (<code class="filename">cert9.db</code>, <code class="filename">key4.db</code>, and <code class="filename">pkcs11.txt</code>). If the prefix <span class="command"><strong>sql:</strong></span> is not used, then the tool assumes that the given databases are in the old format.</p></dd><dt><span class="term">--dbprefix prefix</span></dt><dd><p>Specify the prefix used on the database files, such as <code class="filename">my_</code> for <code class="filename">my_cert8.db</code>. This option is provided as a special case. Changing the names of the certificate and key databases is not recommended.</p></dd><dt><span class="term">-installdir root-installation-directory</span></dt><dd><p>Specify the root installation directory relative to which files will be installed by the <code class="option">-jar</code> option. This directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory.</p></dd><dt><span class="term">-libfile library-file</span></dt><dd><p>Specify a path to a library file containing the implementation of the PKCS #11 interface module that is being added to the database.</p></dd><dt><span class="term">-mechanisms mechanism-list</span></dt><dd><p>Specify the security mechanisms for which a particular module will be flagged as a default provider. The <span class="emphasis"><em>mechanism-list</em></span> is a colon-delimited list of mechanism names. Enclose this list in quotation marks if it contains spaces.</p><p>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.</p><p><span class="command"><strong>modutil</strong></span> 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).</p></dd><dt><span class="term">-newpwfile new-password-file</span></dt><dd><p>Specify a text file containing a token's new or replacement password so that a password can be entered automatically with the <code class="option">-changepw</code> option.</p></dd><dt><span class="term">-nocertdb</span></dt><dd><p>Do not open the certificate or key databases. This has several effects:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>With the <code class="option">-create</code> command, only a module security file is created; certificate and key databases are not created.</p></li><li class="listitem"><p>With the <code class="option">-jar</code> command, signatures on the JAR file are not checked.</p></li><li class="listitem"><p>With the <code class="option">-changepw</code> command, the password on the NSS internal module cannot be set or changed, since this password is stored in the key database.</p></li></ul></div></dd><dt><span class="term">-pwfile old-password-file</span></dt><dd><p>Specify a text file containing a token's existing password so that a password can be entered automatically when the <code class="option">-changepw</code> option is used to change passwords.</p></dd><dt><span class="term">-secmod secmodname</span></dt><dd><p>Give the name of the security module database (like <code class="filename">secmod.db</code>) to load.</p></dd><dt><span class="term">-slot slotname</span></dt><dd><p>Specify a particular slot to be enabled or disabled with the <code class="option">-enable</code> or <code class="option">-disable</code> options.</p></dd><dt><span class="term">-string CONFIG_STRING</span></dt><dd><p>Pass a configuration string for the module being added to the database.</p></dd><dt><span class="term">-tempdir temporary-directory</span></dt><dd><p>Give a directory location where temporary files are created during the installation by the <code class="option">-jar</code> option. If no temporary directory is specified, the current directory is used.</p></dd></dl></div></div><div class="refsection"><a name="usage-and-examples"></a><h2>Usage and Examples</h2><p><span class="command"><strong>Creating Database Files</strong></span></p><p>Before any operations can be performed, there must be a set of security databases available. <span class="command"><strong>modutil</strong></span> can be used to create these files. The only required argument is the database that where the databases will be located.</p><pre class="programlisting">modutil -create -dbdir [sql:]directory</pre><p><span class="command"><strong>Adding a Cryptographic Module</strong></span></p><p>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 <span class="command"><strong>modutil</strong></span> directly or by running a JAR file and install script. For the most basic case, simply upload the library:</p><pre class="programlisting">modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] </pre><p>For example: +</p><pre class="programlisting">modutil -dbdir sql:/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.</pre><p> + </p><p><span class="command"><strong>Installing a Cryptographic Module from a JAR File</strong></span></p><p>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 <a class="xref" href="index.html#jar-install-file" title="JAR Installation File Format">the section called “JAR Installation File Format”</a>.</p><p>The JAR installation script defines the setup information for each platform that the module can be installed on. For example:</p><pre class="programlisting">Platforms { + Linux:5.4.08:x86 { + ModuleName { "Example PKCS #11 Module" } + ModuleFile { crypto.so } + DefaultMechanismFlags{0x0000} + CipherEnableFlags{0x0000} + Files { + crypto.so { + Path{ /tmp/crypto.so } + } + setup.sh { + Executable + Path{ /tmp/setup.sh } + } + } + } + Linux:6.0.0:x86 { + EquivalentPlatform { Linux:5.4.08:x86 } + } +} </pre><p>Both the install script and the required libraries must be bundled in a JAR file, which is specified with the <code class="option">-jar</code> argument.</p><pre class="programlisting">modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/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 +Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref +. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 +Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUER +NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 +VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, +OU="VeriSign, Inc.", O=VeriSign Trust Network +---------------------------------------------- + +Do you wish to continue this installation? (y/n) y +Using installer script "installer_script" +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 </pre><p><span class="command"><strong>Adding Module Spec</strong></span></p><p>Each module has information stored in the security database about its configuration and parameters. These can be added or edited using the <code class="option">-rawadd</code> command. For the current settings or to see the format of the module spec in the database, use the <code class="option">-rawlist</code> option.</p><pre class="programlisting">modutil -rawadd modulespec</pre><p><span class="command"><strong>Deleting a Module</strong></span></p><p>A specific PKCS #11 module can be deleted from the <code class="filename">secmod.db</code> database:</p><pre class="programlisting">modutil -delete modulename -dbdir [sql:]directory </pre><p><span class="command"><strong>Displaying Module Information</strong></span></p><p>The <code class="filename">secmod.db</code> 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. </p><p>To simply get a list of modules in the database, use the <code class="option">-list</code> command.</p><pre class="programlisting">modutil -list [modulename] -dbdir [sql:]directory </pre><p>Listing the modules shows the module name, their status, and other associated security databases for certificates and keys. For example:</p><pre class="programlisting">modutil -list -dbdir sql:/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 + + slot: NSS User Private Key and Certificate Services + token: NSS Certificate DB +-----------------------------------------------------------</pre><p>Passing a specific module name with the <code class="option">-list</code> 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:</p><pre class="programlisting"> modutil -list "NSS Internal PKCS #11 Module" -dbdir sql:/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 +Cipher Enable Flags: None +Default Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES + + Slot: NSS Internal Cryptographic Services + Slot Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES + Manufacturer: Mozilla Foundation + Type: Software + Version Number: 3.11 + Firmware Version: 0.0 + Status: Enabled + Token Name: NSS Generic Crypto Services + Token Manufacturer: Mozilla Foundation + Token Model: NSS 3 + Token Serial Number: 0000000000000000 + Token Version: 4.0 + Token Firmware Version: 0.0 + Access: Write Protected + Login Type: Public (no login required) + User Pin: NOT Initialized + + Slot: NSS User Private Key and Certificate Services + Slot Mechanism Flags: None + Manufacturer: Mozilla Foundation + Type: Software + Version Number: 3.11 + Firmware Version: 0.0 + Status: Enabled + 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</pre><p>A related command, <code class="option">-rawlist</code> returns information about the database configuration for the modules. (This information can be edited by loading new specs using the <code class="option">-rawadd</code> command.)</p><pre class="programlisting"> modutil -rawlist -dbdir sql:/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"</pre><p><span class="command"><strong>Setting a Default Provider for Security Mechanisms</strong></span></p><p>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).</p><pre class="programlisting">modutil -default modulename -mechanisms mechanism-list </pre><p>To set a module as the default provider for mechanisms, use the <code class="option">-default</code> command with a colon-separated list of mechanisms. The available mechanisms depend on the module; NSS supplies almost all common mechanisms. For example:</p><pre class="programlisting">modutil -default "NSS Internal PKCS #11 Module" -dbdir -mechanisms RSA:DSA:RC2 + +Using database directory c:\databases... + +Successfully changed defaults.</pre><p>Clearing the default provider has the same format:</p><pre class="programlisting">modutil -undefault "NSS Internal PKCS #11 Module" -dbdir -mechanisms MD2:MD5</pre><p><span class="command"><strong>Enabling and Disabling Modules and Slots</strong></span></p><p>Modules, and specific slots on modules, can be selectively enabled or disabled using <span class="command"><strong>modutil</strong></span>. Both commands have the same format:</p><pre class="programlisting">modutil -enable|-disable modulename [-slot slotname] </pre><p>For example:</p><pre class="programlisting">modutil -enable "NSS Internal PKCS #11 Module" -slot "NSS Internal Cryptographic Services " -dbdir . + +Slot "NSS Internal Cryptographic Services " enabled.</pre><p>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.</p><p><span class="command"><strong>Enabling and Verifying FIPS Compliance</strong></span></p><p>The NSS modules can have FIPS 140-2 compliance enabled or disabled using <span class="command"><strong>modutil</strong></span> with the <code class="option">-fips</code> option. For example:</p><pre class="programlisting">modutil -fips true -dbdir sql:/home/my/sharednssdb/ + +FIPS mode enabled.</pre><p>To verify that status of FIPS mode, run the <code class="option">-chkfips</code> command with either a true or false flag (it doesn't matter which). The tool returns the current FIPS setting.</p><pre class="programlisting">modutil -chkfips false -dbdir sql:/home/my/sharednssdb/ + +FIPS mode enabled.</pre><p><span class="command"><strong>Changing the Password on a Token</strong></span></p><p>Initializing or changing a token's password:</p><pre class="programlisting">modutil -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] </pre><pre class="programlisting">modutil -dbdir sql:/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.</pre></div><div class="refsection"><a name="jar-install-file"></a><h2>JAR Installation File Format</h2><p>When a JAR file is run by a server, by <span class="command"><strong>modutil</strong></span>, 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:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + It must be declared in the JAR archive's manifest file. + </p></li><li class="listitem"><p> + The script can have any name. + </p></li><li class="listitem"><p> + The metainfo tag for this is <span class="command"><strong>Pkcs11_install_script</strong></span>. To declare meta-information in the manifest file, put it in a file that is passed to <span class="command"><strong>signtool</strong></span>.</p></li></ul></div><p><span class="command"><strong>Sample Script</strong></span></p><p>For example, the PKCS #11 installer script could be in the file pk11install. If so, the metainfo file for <span class="command"><strong>signtool</strong></span> includes a line such as this:</p><pre class="programlisting">+ Pkcs11_install_script: pk11install</pre><p>The script must define the platform and version number, the module name and file, and any optional information like supported ciphers and mechanisms. Multiple platforms can be defined in a single install file.</p><pre class="programlisting">ForwardCompatible { IRIX:6.2:mips SUNOS:5.5.1:sparc } +Platforms { + WINNT::x86 { + ModuleName { "Example Module" } + ModuleFile { win32/fort32.dll } + DefaultMechanismFlags{0x0001} + DefaultCipherFlags{0x0001} + Files { + win32/setup.exe { + Executable + RelativePath { %temp%/setup.exe } + } + win32/setup.hlp { + RelativePath { %temp%/setup.hlp } + } + win32/setup.cab { + RelativePath { %temp%/setup.cab } + } + } + } + WIN95::x86 { + EquivalentPlatform {WINNT::x86} + } + SUNOS:5.5.1:sparc { + ModuleName { "Example UNIX Module" } + ModuleFile { unix/fort.so } + DefaultMechanismFlags{0x0001} + CipherEnableFlags{0x0001} + Files { + unix/fort.so { + RelativePath{%root%/lib/fort.so} + AbsolutePath{/usr/local/netscape/lib/fort.so} + FilePermissions{555} + } + xplat/instr.html { + RelativePath{%root%/docs/inst.html} + AbsolutePath{/usr/local/netscape/docs/inst.html} + FilePermissions{555} + } + } + } + IRIX:6.2:mips { + EquivalentPlatform { SUNOS:5.5.1:sparc } + } +}</pre><p><span class="command"><strong>Script Grammar</strong></span></p><p>The script is basic Java, allowing lists, key-value pairs, strings, and combinations of all of them.</p><pre class="programlisting">--> valuelist + +valuelist --> value valuelist + <null> + +value ---> key_value_pair + string + +key_value_pair --> key { valuelist } + +key --> string + +string --> simple_string + "complex_string" + +simple_string --> [^ \t\n\""{""}"]+ + +complex_string --> ([^\"\\\r\n]|(\\\")|(\\\\))+ </pre><p>Quotes and backslashes must be escaped with a backslash. A complex string must not include newlines or carriage returns.Outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.</p><p><span class="command"><strong>Keys</strong></span></p><p>The Java install file uses keys to define the platform and module information.</p><p><span class="command"><strong>ForwardCompatible</strong></span> gives a list of platforms that are forward compatible. If the current platform cannot be found in the list of supported platforms, then the <span class="command"><strong>ForwardCompatible</strong></span> list is checked for any platforms that have the same OS and architecture in an earlier version. If one is found, its attributes are used for the current platform. </p><p><span class="command"><strong>Platforms</strong></span> (required) Gives a list of platforms. Each entry in the list is itself a key-value pair: the key is the name of the platform and the value list contains various attributes of the platform. The platform string is in the format <span class="emphasis"><em>system name:OS release:architecture</em></span>. The installer obtains these values from NSPR. OS release is an empty string on non-Unix operating systems. NSPR supports these platforms:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>AIX (rs6000)</p></li><li class="listitem"><p>BSDI (x86)</p></li><li class="listitem"><p>FREEBSD (x86)</p></li><li class="listitem"><p>HPUX (hppa1.1)</p></li><li class="listitem"><p>IRIX (mips)</p></li><li class="listitem"><p>LINUX (ppc, alpha, x86)</p></li><li class="listitem"><p>MacOS (PowerPC)</p></li><li class="listitem"><p>NCR (x86)</p></li><li class="listitem"><p>NEC (mips)</p></li><li class="listitem"><p>OS2 (x86)</p></li><li class="listitem"><p>OSF (alpha)</p></li><li class="listitem"><p>ReliantUNIX (mips)</p></li><li class="listitem"><p>SCO (x86)</p></li><li class="listitem"><p>SOLARIS (sparc)</p></li><li class="listitem"><p>SONY (mips)</p></li><li class="listitem"><p>SUNOS (sparc)</p></li><li class="listitem"><p>UnixWare (x86)</p></li><li class="listitem"><p>WIN16 (x86)</p></li><li class="listitem"><p>WIN95 (x86)</p></li><li class="listitem"><p>WINNT (x86)</p></li></ul></div><p>For example:</p><pre class="programlisting">IRIX:6.2:mips +SUNOS:5.5.1:sparc +Linux:2.0.32:x86 +WIN95::x86</pre><p>The module information is defined independently for each platform in the <span class="command"><strong>ModuleName</strong></span>, <span class="command"><strong>ModuleFile</strong></span>, and <span class="command"><strong>Files</strong></span> attributes. These attributes must be given unless an <span class="command"><strong>EquivalentPlatform</strong></span> attribute is specified. </p><p><span class="command"><strong>Per-Platform Keys</strong></span></p><p>Per-platform keys have meaning only within the value list of an entry in the <span class="command"><strong>Platforms</strong></span> list.</p><p><span class="command"><strong>ModuleName</strong></span> (required) gives the common name for the module. This name is used to reference the module by servers and by the <span class="command"><strong>modutil</strong></span> tool. </p><p><span class="command"><strong>ModuleFile</strong></span> (required) names the PKCS #11 module file for this platform. The name is given as the relative path of the file within the JAR archive. </p><p><span class="command"><strong>Files</strong></span> (required) lists the files that need to be installed for this module. Each entry in the file list is a key-value pair. The key is the path of the file in the JAR archive, and the value list contains attributes of the file. At least <span class="command"><strong>RelativePath</strong></span> or <span class="command"><strong>AbsolutePath</strong></span> must be specified for each file.</p><p><span class="command"><strong>DefaultMechanismFlags</strong></span> specifies mechanisms for which this module is the default provider; this is equivalent to the <code class="option">-mechanism</code> option with the <code class="option">-add</code> command. This key-value pair is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR. If the DefaultMechanismFlags entry is omitted, the value defaults to 0x0.</p><pre class="programlisting">RSA: 0x00000001 +DSA: 0x00000002 +RC2: 0x00000004 +RC4: 0x00000008 +DES: 0x00000010 +DH: 0x00000020 +FORTEZZA: 0x00000040 +RC5: 0x00000080 +SHA1: 0x00000100 +MD5: 0x00000200 +MD2: 0x00000400 +RANDOM: 0x08000000 +FRIENDLY: 0x10000000 +OWN_PW_DEFAULTS: 0x20000000 +DISABLE: 0x40000000</pre><p><span class="command"><strong>CipherEnableFlags</strong></span> specifies ciphers that this module provides that NSS does not provide (so that the module enables those ciphers for NSS). This is equivalent to the <code class="option">-cipher</code> argument with the <code class="option">-add</code> command. This key is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR. If the <span class="command"><strong>CipherEnableFlags</strong></span> entry is omitted, the value defaults to 0x0.</p><p><span class="command"><strong>EquivalentPlatform</strong></span> specifies that the attributes of the named platform should also be used for the current platform. This makes it easier when more than one platform uses the same settings.</p><p><span class="command"><strong>Per-File Keys</strong></span></p><p>Some keys have meaning only within the value list of an entry in a <span class="command"><strong>Files</strong></span> list.</p><p>Each file requires a path key the identifies where the file is. Either <span class="command"><strong>RelativePath</strong></span> or <span class="command"><strong>AbsolutePath</strong></span> must be specified. If both are specified, the relative path is tried first, and the absolute path is used only if no relative root directory is provided by the installer program.</p><p><span class="command"><strong>RelativePath</strong></span> specifies the destination directory of the file, relative to some directory decided at install time. Two variables can be used in the relative path: <span class="command"><strong>%root%</strong></span> and <span class="command"><strong>%temp%</strong></span>. <span class="command"><strong>%root%</strong></span> is replaced at run time with the directory relative to which files should be installed; for example, it may be the server's root directory. The <span class="command"><strong>%temp%</strong></span> directory is created at the beginning of the installation and destroyed at the end. The purpose of <span class="command"><strong>%temp%</strong></span> is to hold executable files (such as setup programs) or files that are used by these programs. Files destined for the temporary directory are guaranteed to be in place before any executable file is run; they are not deleted until all executable files have finished.</p><p><span class="command"><strong>AbsolutePath</strong></span> specifies the destination directory of the file as an absolute path. </p><p><span class="command"><strong>Executable</strong></span> specifies that the file is to be executed during the course of the installation. Typically, this string is used for a setup program provided by a module vendor, such as a self-extracting setup executable. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file.</p><p><span class="command"><strong>FilePermissions</strong></span> sets permissions on any referenced files in a string of octal digits, according to the standard Unix format. This string is a bitwise OR.</p><pre class="programlisting"> +user read: 0400 +user write: 0200 +user execute: 0100 +group read: 0040 +group write: 0020 +group execute: 0010 +other read: 0004 +other write: 0002 +other execute: 0001 +</pre><p>Some platforms may not understand these permissions. They are applied only insofar as they make sense for the current platform. If this attribute is omitted, a default of 777 is assumed.</p></div><div class="refsection"><a name="databases"></a><h2>NSS Database Types</h2><p>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <span class="emphasis"><em>legacy</em></span> databases are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert8.db for certificates + </p></li><li class="listitem"><p> + key3.db for keys + </p></li><li class="listitem"><p> + secmod.db for PKCS #11 module information + </p></li></ul></div><p>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</p><p>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkleyDB. These new databases provide more accessibility and performance:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert9.db for certificates + </p></li><li class="listitem"><p> + key4.db for keys + </p></li><li class="listitem"><p> + pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory + </p></li></ul></div><p>Because the SQLite databases are designed to be shared, these are the <span class="emphasis"><em>shared</em></span> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</p><p>By default, the tools (<span class="command"><strong>certutil</strong></span>, <span class="command"><strong>pk12util</strong></span>, <span class="command"><strong>modutil</strong></span>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <span class="command"><strong>sql:</strong></span> prefix with the given security directory. For example:</p><pre class="programlisting">modutil -create -dbdir sql:/home/my/sharednssdb</pre><p>To set the shared database type as the default type for the tools, set the <code class="envar">NSS_DEFAULT_DB_TYPE</code> environment variable to <code class="envar">sql</code>:</p><pre class="programlisting">export NSS_DEFAULT_DB_TYPE="sql"</pre><p>This line can be added to the <code class="filename">~/.bashrc</code> file to make the change permanent for the user.</p><p>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:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li></ul></div><p>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="seealso"></a><h2>See Also</h2><p>certutil (1)</p><p>pk12util (1)</p><p>signtool (1)</p><p>The NSS wiki has information on the new database design and how to configure applications to use it.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/pk12util.html b/security/nss/doc/html/pk12util.html new file mode 100644 index 000000000..fe516dd83 --- /dev/null +++ b/security/nss/doc/html/pk12util.html @@ -0,0 +1,77 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>PK12UTIL</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="PK12UTIL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">PK12UTIL</th></tr></table><hr></div><div class="refentry"><a name="pk12util"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>pk12util — Export and import keys and certificate to or from a PKCS #12 file and the NSS database</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">pk12util</code> [-i p12File|-l p12File|-o p12File] [-d [sql:]directory] [-h tokenname] [-P dbprefix] [-r] [-v] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]</p></div></div><div class="refsection"><a name="idm233250345408"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The PKCS #12 utility, <span class="command"><strong>pk12util</strong></span>, 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.</p></div><div class="refsection"><a name="options"></a><h2>Options and Arguments</h2><p><span class="command"><strong>Options</strong></span></p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-i p12file</span></dt><dd><p>Import keys and certificates from a PKCS#12 file into a security database.</p></dd><dt><span class="term">-l p12file</span></dt><dd><p>List the keys and certificates in PKCS#12 file.</p></dd><dt><span class="term">-o p12file</span></dt><dd><p>Export keys and certificates from the security database to a PKCS#12 file.</p></dd></dl></div><p><span class="command"><strong>Arguments</strong></span></p><div class="variablelist"><dl class="variablelist"><dt><span class="term">-c keyCipher</span></dt><dd><p>Specify the key encryption algorithm.</p></dd><dt><span class="term">-C certCipher</span></dt><dd><p>Specify the key cert (overall package) encryption algorithm.</p></dd><dt><span class="term">-d [sql:]directory</span></dt><dd><p>Specify the database directory into which to import to or export from certificates and keys.</p><p><span class="command"><strong>pk12util</strong></span> supports two types of databases: the legacy security databases (<code class="filename">cert8.db</code>, <code class="filename">key3.db</code>, and <code class="filename">secmod.db</code>) and new SQLite databases (<code class="filename">cert9.db</code>, <code class="filename">key4.db</code>, and <code class="filename">pkcs11.txt</code>). If the prefix <span class="command"><strong>sql:</strong></span> is not used, then the tool assumes that the given databases are in the old format.</p></dd><dt><span class="term">-h tokenname</span></dt><dd><p>Specify the name of the token to import into or export from.</p></dd><dt><span class="term">-k slotPasswordFile</span></dt><dd><p>Specify the text file containing the slot's password.</p></dd><dt><span class="term">-K slotPassword</span></dt><dd><p>Specify the slot's password.</p></dd><dt><span class="term">-m | --key-len keyLength</span></dt><dd><p>Specify the desired length of the symmetric key to be used to encrypt the private key.</p></dd><dt><span class="term">-n | --cert-key-len certKeyLength</span></dt><dd><p>Specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data.</p></dd><dt><span class="term">-n certname</span></dt><dd><p>Specify the nickname of the cert and private key to export.</p></dd><dt><span class="term">-P prefix</span></dt><dd><p>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.</p></dd><dt><span class="term">-r</span></dt><dd><p>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.</p></dd><dt><span class="term">-v </span></dt><dd><p>Enable debug logging when importing.</p></dd><dt><span class="term">-w p12filePasswordFile</span></dt><dd><p>Specify the text file containing the pkcs #12 file password.</p></dd><dt><span class="term">-W p12filePassword</span></dt><dd><p>Specify the pkcs #12 file password.</p></dd></dl></div></div><div class="refsection"><a name="return-codes"></a><h2>Return Codes</h2><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> 0 - No error</p></li><li class="listitem"><p> 1 - User Cancelled</p></li><li class="listitem"><p> 2 - Usage error</p></li><li class="listitem"><p> 6 - NLS init error</p></li><li class="listitem"><p> 8 - Certificate DB open error</p></li><li class="listitem"><p> 9 - Key DB open error</p></li><li class="listitem"><p> 10 - File initialization error</p></li><li class="listitem"><p> 11 - Unicode conversion error</p></li><li class="listitem"><p> 12 - Temporary file creation error</p></li><li class="listitem"><p> 13 - PKCS11 get slot error</p></li><li class="listitem"><p> 14 - PKCS12 decoder start error</p></li><li class="listitem"><p> 15 - error read from import file</p></li><li class="listitem"><p> 16 - pkcs12 decode error</p></li><li class="listitem"><p> 17 - pkcs12 decoder verify error</p></li><li class="listitem"><p> 18 - pkcs12 decoder validate bags error</p></li><li class="listitem"><p> 19 - pkcs12 decoder import bags error</p></li><li class="listitem"><p> 20 - key db conversion version 3 to version 2 error</p></li><li class="listitem"><p> 21 - cert db conversion version 7 to version 5 error</p></li><li class="listitem"><p> 22 - cert and key dbs patch error</p></li><li class="listitem"><p> 23 - get default cert db error</p></li><li class="listitem"><p> 24 - find cert by nickname error</p></li><li class="listitem"><p> 25 - create export context error</p></li><li class="listitem"><p> 26 - PKCS12 add password itegrity error</p></li><li class="listitem"><p> 27 - cert and key Safes creation error</p></li><li class="listitem"><p> 28 - PKCS12 add cert and key error</p></li><li class="listitem"><p> 29 - PKCS12 encode error</p></li></ul></div></div><div class="refsection"><a name="examples"></a><h2>Examples</h2><p><span class="command"><strong>Importing Keys and Certificates</strong></span></p><p>The most basic usage of <span class="command"><strong>pk12util</strong></span> for importing a certificate or key is the PKCS#12 input file (<code class="option">-i</code>) and some way to specify the security database being accessed (either <code class="option">-d</code> for a directory or <code class="option">-h</code> for a token). + </p><p> + pk12util -i p12File [-h tokenname] [-v] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] + </p><p>For example:</p><p> </p><pre class="programlisting"># pk12util -i /tmp/cert-files/users.p12 -d sql:/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</pre><p><span class="command"><strong>Exporting Keys and Certificates</strong></span></p><p>Using the <span class="command"><strong>pk12util</strong></span> command to export certificates and keys requires both the name of the certificate to extract from the database (<code class="option">-n</code>) 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. + </p><p>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]</p><p>For example:</p><pre class="programlisting"># pk12util -o certs.p12 -n Server-Cert -d sql:/home/my/sharednssdb +Enter password for PKCS12 file: +Re-enter password: </pre><p><span class="command"><strong>Listing Keys and Certificates</strong></span></p><p>The information in a <code class="filename">.p12</code> 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 <code class="filename">.p12</code> file. + </p><p>pk12util -l p12File [-h tokenname] [-r] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]</p><p>For example, this prints the default ASCII output:</p><pre class="programlisting"># 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: + 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f + Iteration Count: 1 (0x1) +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 13 (0xd) + Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption + Issuer: "E=personal-freemail@thawte.com,CN=Thawte Personal Freemail C + A,OU=Certification Services Division,O=Thawte Consulting,L=Cape T + own,ST=Western Cape,C=ZA" + </pre><p>Alternatively, the <code class="option">-r</code> prints the certificates and then exports them into separate DER binary files. This allows the certificates to be fed to another application that supports <code class="filename">.p12</code> files. Each certificate is written to a sequentially-number file, beginning with <code class="filename">file0001.der</code> and continuing through <code class="filename">file000N.der</code>, incrementing the number for every certificate:</p><pre class="programlisting">pk12util -l test.p12 -r +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: + 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f + Iteration Count: 1 (0x1) +Certificate Friendly Name: Thawte Personal Freemail Issuing CA - Thawte Consulting + +Certificate Friendly Name: Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID + </pre></div><div class="refsection"><a name="encryption"></a><h2>Password Encryption</h2><p>PKCS#12 provides for not only the protection of the private keys but also the certificate and meta-data associated with the keys. Password-based encryption is used to protect private keys on export to a PKCS#12 file and, optionally, the entire package. If no algorithm is specified, the tool defaults to using <span class="command"><strong>PKCS12 V2 PBE with SHA1 and 3KEY Triple DES-cbc</strong></span> for private key encryption. <span class="command"><strong>PKCS12 V2 PBE with SHA1 and 40 Bit RC4</strong></span> is the default for the overall package encryption when not in FIPS mode. When in FIPS mode, there is no package encryption.</p><p>The private key is always protected with strong encryption by default.</p><p>Several types of ciphers are supported.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Symmetric CBC ciphers for PKCS#5 V2</span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>DES-CBC</p></li><li class="listitem"><p>RC2-CBC</p></li><li class="listitem"><p>RC5-CBCPad</p></li><li class="listitem"><p>DES-EDE3-CBC (the default for key encryption)</p></li><li class="listitem"><p>AES-128-CBC</p></li><li class="listitem"><p>AES-192-CBC</p></li><li class="listitem"><p>AES-256-CBC</p></li><li class="listitem"><p>CAMELLIA-128-CBC</p></li><li class="listitem"><p>CAMELLIA-192-CBC</p></li><li class="listitem"><p>CAMELLIA-256-CBC</p></li></ul></div></dd><dt><span class="term">PKCS#12 PBE ciphers</span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>PKCS #12 PBE with Sha1 and 128 Bit RC4</p></li><li class="listitem"><p>PKCS #12 PBE with Sha1 and 40 Bit RC4</p></li><li class="listitem"><p>PKCS #12 PBE with Sha1 and Triple DES CBC</p></li><li class="listitem"><p>PKCS #12 PBE with Sha1 and 128 Bit RC2 CBC</p></li><li class="listitem"><p>PKCS #12 PBE with Sha1 and 40 Bit RC2 CBC</p></li><li class="listitem"><p>PKCS12 V2 PBE with SHA1 and 128 Bit RC4</p></li><li class="listitem"><p>PKCS12 V2 PBE with SHA1 and 40 Bit RC4 (the default for non-FIPS mode)</p></li><li class="listitem"><p>PKCS12 V2 PBE with SHA1 and 3KEY Triple DES-cbc</p></li><li class="listitem"><p>PKCS12 V2 PBE with SHA1 and 2KEY Triple DES-cbc</p></li><li class="listitem"><p>PKCS12 V2 PBE with SHA1 and 128 Bit RC2 CBC</p></li><li class="listitem"><p>PKCS12 V2 PBE with SHA1 and 40 Bit RC2 CBC</p></li></ul></div></dd><dt><span class="term">PKCS#5 PBE ciphers</span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>PKCS #5 Password Based Encryption with MD2 and DES CBC</p></li><li class="listitem"><p>PKCS #5 Password Based Encryption with MD5 and DES CBC</p></li><li class="listitem"><p>PKCS #5 Password Based Encryption with SHA1 and DES CBC</p></li></ul></div></dd></dl></div><p>With PKCS#12, the crypto provider may be the soft token module or an external hardware module. If the cryptographic module does not support the requested algorithm, then the next best fit will be selected (usually the default). If no suitable replacement for the desired algorithm can be found, the tool returns the error <span class="emphasis"><em>no security module can perform the requested operation</em></span>.</p></div><div class="refsection"><a name="databases"></a><h2>NSS Database Types</h2><p>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <span class="emphasis"><em>legacy</em></span> databases are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert8.db for certificates + </p></li><li class="listitem"><p> + key3.db for keys + </p></li><li class="listitem"><p> + secmod.db for PKCS #11 module information + </p></li></ul></div><p>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</p><p>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkleyDB. These new databases provide more accessibility and performance:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert9.db for certificates + </p></li><li class="listitem"><p> + key4.db for keys + </p></li><li class="listitem"><p> + pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory + </p></li></ul></div><p>Because the SQLite databases are designed to be shared, these are the <span class="emphasis"><em>shared</em></span> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</p><p>By default, the tools (<span class="command"><strong>certutil</strong></span>, <span class="command"><strong>pk12util</strong></span>, <span class="command"><strong>modutil</strong></span>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <span class="command"><strong>sql:</strong></span> prefix with the given security directory. For example:</p><pre class="programlisting"># pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb</pre><p>To set the shared database type as the default type for the tools, set the <code class="envar">NSS_DEFAULT_DB_TYPE</code> environment variable to <code class="envar">sql</code>:</p><pre class="programlisting">export NSS_DEFAULT_DB_TYPE="sql"</pre><p>This line can be set added to the <code class="filename">~/.bashrc</code> file to make the change permanent.</p><p>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:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li></ul></div><p>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="seealso"></a><h2>See Also</h2><p>certutil (1)</p><p>modutil (1)</p><p>The NSS wiki has information on the new database design and how to configure applications to use it.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/pp.html b/security/nss/doc/html/pp.html new file mode 100644 index 000000000..b9b8ed6e4 --- /dev/null +++ b/security/nss/doc/html/pp.html @@ -0,0 +1,7 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>PP</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="PP"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">PP</th></tr></table><hr></div><div class="refentry"><a name="pp"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>pp — Prints certificates, keys, crls, and pkcs7 files</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">pp -t type [-a] [-i input] [-o output] [-u] [-w]</code> </p></div></div><div class="refsection"><a name="idm226689875920"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="idm226686118544"></a><h2>Description</h2><p><span class="command"><strong>pp </strong></span>pretty-prints private and public key, certificate, certificate-request, + pkcs7 or crl files + </p></div><div class="refsection"><a name="idm226686116608"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-t </code> <em class="replaceable"><code>type</code></em></span></dt><dd><p class="simpara">specify the input, one of {private-key | public-key | certificate | certificate-request | pkcs7 | crl}</p><p class="simpara"></p></dd><dt><span class="term"><code class="option">-a </code></span></dt><dd>Input is in ascii encoded form (RFC1113)</dd><dt><span class="term"><code class="option">-i </code> <em class="replaceable"><code>inputfile</code></em></span></dt><dd>Define an input file to use (default is stdin)</dd><dt><span class="term"><code class="option">-o </code> <em class="replaceable"><code>outputfile</code></em></span></dt><dd>Define an output file to use (default is stdout)</dd><dt><span class="term"><code class="option">-u </code> </span></dt><dd>Use UTF-8 (default is to show non-ascii as .)</dd><dt><span class="term"><code class="option">-w </code> </span></dt><dd>Don't wrap long output lines</dd></dl></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>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 <a class="ulink" href="http://pki.fedoraproject.org/wiki/" target="_top">PKI Wiki</a>. </p><p>For information specifically about NSS, the NSS project wiki is located at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">Mozilla NSS site</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: pki-devel@redhat.com and pki-users@redhat.com</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/signtool.html b/security/nss/doc/html/signtool.html new file mode 100644 index 000000000..84568e17c --- /dev/null +++ b/security/nss/doc/html/signtool.html @@ -0,0 +1,284 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>signtool</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="signtool"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">signtool</th></tr></table><hr></div><div class="refentry"><a name="signtool"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>signtool — Digitally sign objects and files.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">signtool</code> [[-b basename]] [[-c Compression Level] ] [[-d cert-dir] ] [[-e extension] ] [[-f filename] ] [[-i installer script] ] [[-h]] [[-H]] [[-v]] [[-w]] [[-G nickname]] [[-J]] [[-j directory] ] [-k keyName] [[--keysize | -s size]] [[-l]] [[-L]] [[-M]] [[-m metafile] ] [[--norecurse] ] [[-O] ] [[-o] ] [[--outfile] ] [[-p password] ] [[-t|--token tokenname] ] [[-z] ] [[-X] ] [[-x name] ] [[--verbose value] ] [[--leavearc] ] [[-Z jarfile] ] [directory-tree] [archive]</p></div></div><div class="refsection"><a name="idm233257546416"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The Signing Tool, <span class="command"><strong>signtool</strong></span>, creates digital signatures and uses a Java Archive (JAR) file to associate the signatures with files in a directory. Electronic software distribution over any network involves potential security problems. To help address some of these problems, you can associate digital signatures with the files in a JAR archive. Digital signatures allow SSL-enabled clients to perform two important operations:</p><p>* Confirm the identity of the individual, company, or other entity whose digital signature is associated with the files</p><p>* Check whether the files have been tampered with since being signed</p><p>If you have a signing certificate, you can use Netscape Signing Tool to digitally sign files and package them as a JAR file. An object-signing certificate is a special kind of certificate that allows you to associate your digital signature with one or more files.</p><p>An individual file can potentially be signed with multiple digital signatures. For example, a commercial software developer might sign the files that constitute a software product to prove that the files are indeed from a particular company. A network administrator manager might sign the same files with an additional digital signature based on a company-generated certificate to indicate that the product is approved for use within the company.</p><p>The significance of a digital signature is comparable to the significance of a handwritten signature. Once you have signed a file, it is difficult to claim later that you didn't sign it. In some situations, a digital signature may be considered as legally binding as a handwritten signature. Therefore, you should take great care to ensure that you can stand behind any file you sign and distribute.</p><p>For example, if you are a software developer, you should test your code to make sure it is virus-free before signing it. Similarly, if you are a network administrator, you should make sure, before signing any code, that it comes from a reliable source and will run correctly with the software installed on the machines to which you are distributing it.</p><p>Before you can use Netscape Signing Tool to sign files, you must have an object-signing certificate, which is a special certificate whose associated private key is used to create digital signatures. For testing purposes only, you can create an object-signing certificate with Netscape Signing Tool 1.3. When testing is finished and you are ready to disitribute your software, you should obtain an object-signing certificate from one of two kinds of sources:</p><p>* An independent certificate authority (CA) that authenticates your identity and charges you a fee. You typically get a certificate from an independent CA if you want to sign software that will be distributed over the Internet.</p><p>* CA server software running on your corporate intranet or extranet. Netscape Certificate Management System provides a complete management solution for creating, deploying, and managing certificates, including CAs that issue object-signing certificates.</p><p>You must also have a certificate for the CA that issues your signing certificate before you can sign files. If the certificate authority's certificate isn't already installed in your copy of Communicator, you typically install it by clicking the appropriate link on the certificate authority's web site, for example on the page from which you initiated enrollment for your signing certificate. This is the case for some test certificates, as well as certificates issued by Netscape Certificate Management System: you must download the the CA certificate in addition to obtaining your own signing certificate. CA certificates for several certificate authorities are preinstalled in the Communicator certificate database.</p><p>When you receive an object-signing certificate for your own use, it is automatically installed in your copy of the Communicator client software. Communicator supports the public-key cryptography standard known as PKCS #12, which governs key portability. You can, for example, move an object-signing certificate and its associated private key from one computer to another on a credit-card-sized device called a smart card.</p></div><div class="refsection"><a name="options"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-b basename</span></dt><dd><p>Specifies the base filename for the .rsa and .sf files in the META-INF directory to conform with the JAR format. For example, <span class="emphasis"><em>-b signatures</em></span> causes the files to be named signatures.rsa and signatures.sf. The default is signtool.</p></dd><dt><span class="term">-c#</span></dt><dd><p> + Specifies the compression level for the -J or -Z option. The symbol # represents a number from 0 to 9, where 0 means no compression and 9 means maximum compression. The higher the level of compression, the smaller the output but the longer the operation takes. + +If the -c# option is not used with either the -J or the -Z option, the default compression value used by both the -J and -Z options is 6. +</p></dd><dt><span class="term">-d certdir</span></dt><dd><p> + Specifies your certificate database directory; that is, the directory in which you placed your key3.db and cert7.db files. To specify the current directory, use "-d." (including the period). + +The Unix version of signtool assumes ~/.netscape unless told otherwise. The NT version of signtool always requires the use of the -d option to specify where the database files are located. +</p></dd><dt><span class="term">-e extension</span></dt><dd><p> + Tells signtool to sign only files with the given extension; for example, use -e".class" to sign only Java class files. Note that with Netscape Signing Tool version 1.1 and later this option can appear multiple times on one command line, making it possible to specify multiple file types or classes to include. +</p></dd><dt><span class="term">-f commandfile</span></dt><dd><p> + Specifies a text file containing Netscape Signing Tool options and arguments in keyword=value format. All options and arguments can be expressed through this file. For more information about the syntax used with this file, see "Tips and Techniques". +</p></dd><dt><span class="term">-G nickname</span></dt><dd><p> + Generates a new private-public key pair and corresponding object-signing certificate with the given nickname. + +The newly generated keys and certificate are installed into the key and certificate databases in the directory specified by the -d option. With the NT version of Netscape Signing Tool, you must use the -d option with the -G option. With the Unix version of Netscape Signing Tool, omitting the -d option causes the tool to install the keys and certificate in the Communicator key and certificate databases. If you are installing the keys and certificate in the Communicator databases, you must exit Communicator before using this option; otherwise, you risk corrupting the databases. In all cases, the certificate is also output to a file named x509.cacert, which has the MIME-type application/x-x509-ca-cert. + +Unlike certificates normally used to sign finished code to be distributed over a network, a test certificate created with -G is not signed by a recognized certificate authority. Instead, it is self-signed. In addition, a single test signing certificate functions as both an object-signing certificate and a CA. When you are using it to sign objects, it behaves like an object-signing certificate. When it is imported into browser software such as Communicator, it behaves like an object-signing CA and cannot be used to sign objects. + +The -G option is available in Netscape Signing Tool 1.0 and later versions only. By default, it produces only RSA certificates with 1024-byte keys in the internal token. However, you can use the -s option specify the required key size and the -t option to specify the token. + </p></dd><dt><span class="term">-i scriptname</span></dt><dd><p> +Specifies the name of an installer script for SmartUpdate. This script installs files from the JAR archive in the local system after SmartUpdate has validated the digital signature. For more details, see the description of -m that follows. The -i option provides a straightforward way to provide this information if you don't need to specify any metadata other than an installer script. + </p></dd><dt><span class="term">-J</span></dt><dd><p> +Signs a directory of HTML files containing JavaScript and creates as many archive files as are specified in the HTML tags. Even if signtool creates more than one archive file, you need to supply the key database password only once. + +The -J option is available only in Netscape Signing Tool 1.0 and later versions. The -J option cannot be used at the same time as the -Z option. + +If the -c# option is not used with the -J option, the default compression value is 6. + +Note that versions 1.1 and later of Netscape Signing Tool correctly recognizes the CODEBASE attribute, allows paths to be expressed for the CLASS and SRC attributes instead of filenames only, processes LINK tags and parses HTML correctly, and offers clearer error messages. + </p></dd><dt><span class="term">-j directory</span></dt><dd><p> + Specifies a special JavaScript directory. This option causes the specified directory to be signed and tags its entries as inline JavaScript. This special type of entry does not have to appear in the JAR file itself. Instead, it is located in the HTML page containing the inline scripts. When you use signtool -v, these entries are displayed with the string NOT PRESENT. +</p></dd><dt><span class="term">-k key ... directory</span></dt><dd><p> + Specifies the nickname (key) of the certificate you want to sign with and signs the files in the specified directory. The directory to sign is always specified as the last command-line argument. Thus, it is possible to write + +signtool -k MyCert -d . signdir + +You may have trouble if the nickname contains a single quotation mark. To avoid problems, escape the quotation mark using the escape conventions for your platform. + +It's also possible to use the -k option without signing any files or specifying a directory. For example, you can use it with the -l option to get detailed information about a particular signing certificate. +</p></dd><dt><span class="term">-l</span></dt><dd><p> + Lists signing certificates, including issuing CAs. If any of your certificates are expired or invalid, the list will so specify. This option can be used with the -k option to list detailed information about a particular signing certificate. + +The -l option is available in Netscape Signing Tool 1.0 and later versions only. +</p></dd><dt><span class="term">-L</span></dt><dd><p> + Lists the certificates in your database. An asterisk appears to the left of the nickname for any certificate that can be used to sign objects with signtool. +</p></dd><dt><span class="term">--leavearc</span></dt><dd><p> + Retains the temporary .arc (archive) directories that the -J option creates. These directories are automatically erased by default. Retaining the temporary directories can be an aid to debugging. +</p></dd><dt><span class="term">-m metafile</span></dt><dd><p> + Specifies the name of a metadata control file. Metadata is signed information attached either to the JAR archive itself or to files within the archive. This metadata can be any ASCII string, but is used mainly for specifying an installer script. + +The metadata file contains one entry per line, each with three fields: + +field #1: file specification, or + if you want to specify global metadata (that is, metadata about the JAR archive itself or all entries in the archive) +field #2: the name of the data you are specifying; for example: Install-Script +field #3: data corresponding to the name in field #2 + +For example, the -i option uses the equivalent of this line: + ++ Install-Script: script.js + + +This example associates a MIME type with a file: + +movie.qt MIME-Type: video/quicktime + +For information about the way installer script information appears in the manifest file for a JAR archive, see The JAR Format on Netscape DevEdge. +</p></dd><dt><span class="term">-M</span></dt><dd><p> + Lists the PKCS #11 modules available to signtool, including smart cards. + +The -M option is available in Netscape Signing Tool 1.0 and later versions only. + +For information on using Netscape Signing Tool with smart cards, see "Using Netscape Signing Tool with Smart Cards". + +For information on using the -M option to verify FIPS-140-1 validated mode, see "Netscape Signing Tool and FIPS-140-1". +</p></dd><dt><span class="term">--norecurse</span></dt><dd><p> + Blocks recursion into subdirectories when signing a directory's contents or when parsing HTML. +</p></dd><dt><span class="term">-o</span></dt><dd><p> + Optimizes the archive for size. Use this only if you are signing very large archives containing hundreds of files. This option makes the manifest files (required by the JAR format) considerably smaller, but they contain slightly less information. +</p></dd><dt><span class="term">--outfile outputfile</span></dt><dd><p> + Specifies a file to receive redirected output from Netscape Signing Tool. +</p></dd><dt><span class="term">-p password</span></dt><dd><p> + Specifies a password for the private-key database. Note that the password entered on the command line is displayed as plain text. +</p></dd><dt><span class="term">-s keysize</span></dt><dd><p> + Specifies the size of the key for generated certificate. Use the -M option to find out what tokens are available. + +The -s option can be used with the -G option only. +</p></dd><dt><span class="term">-t token</span></dt><dd><p> + Specifies which available token should generate the key and receive the certificate. Use the -M option to find out what tokens are available. + +The -t option can be used with the -G option only. +</p></dd><dt><span class="term">-v archive</span></dt><dd><p> + Displays the contents of an archive and verifies the cryptographic integrity of the digital signatures it contains and the files with which they are associated. This includes checking that the certificate for the issuer of the object-signing certificate is listed in the certificate database, that the CA's digital signature on the object-signing certificate is valid, that the relevant certificates have not expired, and so on. +</p></dd><dt><span class="term">--verbosity value</span></dt><dd><p> + Sets the quantity of information Netscape Signing Tool generates in operation. A value of 0 (zero) is the default and gives full information. A value of -1 suppresses most messages, but not error messages. +</p></dd><dt><span class="term">-w archive</span></dt><dd><p> + Displays the names of signers of any files in the archive. +</p></dd><dt><span class="term">-x directory</span></dt><dd><p> + Excludes the specified directory from signing. Note that with Netscape Signing Tool version 1.1 and later this option can appear multiple times on one command line, making it possible to specify several particular directories to exclude. +</p></dd><dt><span class="term">-z</span></dt><dd><p> + Tells signtool not to store the signing time in the digital signature. This option is useful if you want the expiration date of the signature checked against the current date and time rather than the time the files were signed. +</p></dd><dt><span class="term">-Z jarfile</span></dt><dd><p> + Creates a JAR file with the specified name. You must specify this option if you want signtool to create the JAR file; it does not do so automatically. If you don't specify -Z, you must use an external ZIP tool to create the JAR file. + +The -Z option cannot be used at the same time as the -J option. + +If the -c# option is not used with the -Z option, the default compression value is 6.</p></dd></dl></div></div><div class="refsection"><a name="command-file"></a><h2>The Command File Format</h2><p>Entries in a Netscape Signing Tool command file have this general format: +keyword=value + +Everything before the = sign on a single line is a keyword, and everything from the = sign to the end of line is a value. The value may include = signs; only the first = sign on a line is interpreted. Blank lines are ignored, but white space on a line with keywords and values is assumed to be part of the keyword (if it comes before the equal sign) or part of the value (if it comes after the first equal sign). Keywords are case insensitive, values are generally case sensitive. Since the = sign and newline delimit the value, it should not be quoted. </p><p><span class="command"><strong>Subsection</strong></span></p><div class="variablelist"><dl class="variablelist"><dt><span class="term">basename</span></dt><dd><p>Same as -b option.</p></dd><dt><span class="term">compression</span></dt><dd><p> + Same as -c option. +</p></dd><dt><span class="term">certdir</span></dt><dd><p> + Same as -d option. +</p></dd><dt><span class="term">extension</span></dt><dd><p> + Same as -e option. +</p></dd><dt><span class="term">generate</span></dt><dd><p> + Same as -G option. +</p></dd><dt><span class="term">installscript</span></dt><dd><p> + Same as -i option. +</p></dd><dt><span class="term">javascriptdir</span></dt><dd><p> + Same as -j option. +</p></dd><dt><span class="term">htmldir</span></dt><dd><p> + Same as -J option. +</p></dd><dt><span class="term">certname</span></dt><dd><p> + Nickname of certificate, as with -k and -l -k options. +</p></dd><dt><span class="term">signdir</span></dt><dd><p> + The directory to be signed, as with -k option. +</p></dd><dt><span class="term">list</span></dt><dd><p> + Same as -l option. Value is ignored, but = sign must be present. +</p></dd><dt><span class="term">listall</span></dt><dd><p> + Same as -L option. Value is ignored, but = sign must be present. +</p></dd><dt><span class="term">metafile</span></dt><dd><p> + Same as -m option. +</p></dd><dt><span class="term">modules</span></dt><dd><p> + Same as -M option. Value is ignored, but = sign must be present. +</p></dd><dt><span class="term">optimize</span></dt><dd><p> + Same as -o option. Value is ignored, but = sign must be present. +</p></dd><dt><span class="term">password</span></dt><dd><p> + Same as -p option. +</p></dd><dt><span class="term">keysize</span></dt><dd><p> + Same as -s option. +</p></dd><dt><span class="term">token</span></dt><dd><p> + Same as -t option. +</p></dd><dt><span class="term">verify</span></dt><dd><p> + Same as -v option. +</p></dd><dt><span class="term">who</span></dt><dd><p> + Same as -w option. +</p></dd><dt><span class="term">exclude</span></dt><dd><p> + Same as -x option. +</p></dd><dt><span class="term">notime</span></dt><dd><p> + Same as -z option. value is ignored, but = sign must be present. +</p></dd><dt><span class="term">jarfile</span></dt><dd><p> + Same as -Z option. +</p></dd><dt><span class="term">outfile</span></dt><dd><p> + Name of a file to which output and error messages will be redirected. This option has no command-line equivalent. + </p></dd></dl></div></div><div class="refsection"><a name="examples"></a><h2>Extended Examples</h2><p>The following example will do this and that + </p><p><span class="command"><strong>Listing Available Signing Certificates</strong></span></p><p>You use the -L option to list the nicknames for all available certificates and check which ones are signing certificates.</p><pre class="programlisting">signtool -L + +using certificate directory: /u/jsmith/.netscape +S Certificates +- ------------ + BBN Certificate Services CA Root 1 + IBM World Registry CA + VeriSign Class 1 CA - Individual Subscriber - VeriSign, Inc. + GTE CyberTrust Root CA + Uptime Group Plc. Class 4 CA +* Verisign Object Signing Cert + Integrion CA + GTE CyberTrust Secure Server CA + AT&T Directory Services +* test object signing cert + Uptime Group Plc. Class 1 CA + VeriSign Class 1 Primary CA +- ------------ + +Certificates that can be used to sign objects have *'s to their left. </pre><p>Two signing certificates are displayed: Verisign Object Signing Cert and test object signing cert.</p><p>You use the -l option to get a list of signing certificates only, including the signing CA for each.</p><pre class="programlisting">signtool -l + +using certificate directory: /u/jsmith/.netscape +Object signing certificates +--------------------------------------- + +Verisign Object Signing Cert + Issued by: VeriSign, Inc. - Verisign, Inc. + Expires: Tue May 19, 1998 +test object signing cert + Issued by: test object signing cert (Signtool 1.0 Testing +Certificate (960187691)) + Expires: Sun May 17, 1998 +---------------------------------------</pre><p>For a list including CAs, use the <code class="option">-L</code> option.</p><p><span class="command"><strong>Signing a File</strong></span></p><p>1. Create an empty directory.</p><pre class="programlisting">mkdir signdir</pre><p>2. Put some file into it.</p><pre class="programlisting">echo boo > signdir/test.f</pre><p>3. Specify the name of your object-signing certificate and sign the directory.</p><pre class="programlisting">signtool -k MySignCert -Z testjar.jar signdir + +using key "MySignCert" +using certificate directory: /u/jsmith/.netscape +Generating signdir/META-INF/manifest.mf file.. +--> test.f +adding signdir/test.f to testjar.jar +Generating signtool.sf file.. +Enter Password or Pin for "Communicator Certificate DB": + +adding signdir/META-INF/manifest.mf to testjar.jar +adding signdir/META-INF/signtool.sf to testjar.jar +adding signdir/META-INF/signtool.rsa to testjar.jar + +tree "signdir" signed successfully</pre><p>4. Test the archive you just created.</p><pre class="programlisting">signtool -v testjar.jar + +using certificate directory: /u/jsmith/.netscape +archive "testjar.jar" has passed crypto verification. + status path + ------------ ------------------- + verified test.f</pre><p><span class="command"><strong>Using Netscape Signing Tool with a ZIP Utility</strong></span></p><p>To use Netscape Signing Tool with a ZIP utility, you must have the utility in your path environment variable. You should use the zip.exe utility rather than pkzip.exe, which cannot handle long filenames. You can use a ZIP utility instead of the -Z option to package a signed archive into a JAR file after you have signed it:</p><pre class="programlisting">cd signdir + + zip -r ../myjar.jar * + adding: META-INF/ (stored 0%) + adding: META-INF/manifest.mf (deflated 15%) + adding: META-INF/signtool.sf (deflated 28%) + adding: META-INF/signtool.rsa (stored 0%) + adding: text.txt (stored 0%)</pre><p><span class="command"><strong>Generating the Keys and Certificate</strong></span></p><p>The signtool option -G generates a new public-private key pair and certificate. It takes the nickname of the new certificate as an argument. The newly generated keys and certificate are installed into the key and certificate databases in the directory specified by the -d option. With the NT version of Netscape Signing Tool, you must use the -d option with the -G option. With the Unix version of Netscape Signing Tool, omitting the -d option causes the tool to install the keys and certificate in the Communicator key and certificate databases. In all cases, the certificate is also output to a file named x509.cacert, which has the MIME-type application/x-x509-ca-cert.</p><p>Certificates contain standard information about the entity they identify, such as the common name and organization name. Netscape Signing Tool prompts you for this information when you run the command with the -G option. However, all of the requested fields are optional for test certificates. If you do not enter a common name, the tool provides a default name. In the following example, the user input is in boldface:</p><pre class="programlisting">signtool -G MyTestCert + +using certificate directory: /u/someuser/.netscape +Enter certificate information. All fields are optional. Acceptable +characters are numbers, letters, spaces, and apostrophes. +certificate common name: Test Object Signing Certificate +organization: Netscape Communications Corp. +organization unit: Server Products Division +state or province: California +country (must be exactly 2 characters): US +username: someuser +email address: someuser@netscape.com +Enter Password or Pin for "Communicator Certificate DB": [Password will not echo] +generated public/private key pair +certificate request generated +certificate has been signed +certificate "MyTestCert" added to database +Exported certificate to x509.raw and x509.cacert.</pre><p>The certificate information is read from standard input. Therefore, the information can be read from a file using the redirection operator (<) in some operating systems. To create a file for this purpose, enter each of the seven input fields, in order, on a separate line. Make sure there is a newline character at the end of the last line. Then run signtool with standard input redirected from your file as follows:</p><pre class="programlisting">signtool -G MyTestCert inputfile</pre><p>The prompts show up on the screen, but the responses will be automatically read from the file. The password will still be read from the console unless you use the -p option to give the password on the command line.</p><p><span class="command"><strong>Using the -M Option to List Smart Cards</strong></span></p><p>You can use the -M option to list the PKCS #11 modules, including smart cards, that are available to signtool:</p><pre class="programlisting">signtool -d "c:\netscape\users\jsmith" -M + +using certificate directory: c:\netscape\users\username +Listing of PKCS11 modules +----------------------------------------------- + 1. Netscape Internal PKCS #11 Module + (this module is internally loaded) + slots: 2 slots attached + status: loaded + slot: Communicator Internal Cryptographic Services Version 4.0 + token: Communicator Generic Crypto Svcs + slot: Communicator User Private Key and Certificate Services + token: Communicator Certificate DB + 2. CryptOS + (this is an external module) + DLL name: core32 + slots: 1 slots attached + status: loaded + slot: Litronic 210 + token: + ----------------------------------------------- </pre><p><span class="command"><strong>Using Netscape Signing Tool and a Smart Card to Sign Files</strong></span></p><p>The signtool command normally takes an argument of the -k option to specify a signing certificate. To sign with a smart card, you supply only the fully qualified name of the certificate.</p><p>To see fully qualified certificate names when you run Communicator, click the Security button in Navigator, then click Yours under Certificates in the left frame. Fully qualified names are of the format smart card:certificate, for example "MyCard:My Signing Cert". You use this name with the -k argument as follows:</p><pre class="programlisting">signtool -k "MyCard:My Signing Cert" directory</pre><p><span class="command"><strong>Verifying FIPS Mode</strong></span></p><p>Use the -M option to verify that you are using the FIPS-140-1 module.</p><pre class="programlisting">signtool -d "c:\netscape\users\jsmith" -M + +using certificate directory: c:\netscape\users\jsmith +Listing of PKCS11 modules +----------------------------------------------- + 1. Netscape Internal PKCS #11 Module + (this module is internally loaded) + slots: 2 slots attached + status: loaded + slot: Communicator Internal Cryptographic Services Version 4.0 + token: Communicator Generic Crypto Svcs + slot: Communicator User Private Key and Certificate Services + token: Communicator Certificate DB +-----------------------------------------------</pre><p>This Unix example shows that Netscape Signing Tool is using a FIPS-140-1 module:</p><pre class="programlisting">signtool -d "c:\netscape\users\jsmith" -M +using certificate directory: c:\netscape\users\jsmith +Enter Password or Pin for "Communicator Certificate DB": [password will not echo] +Listing of PKCS11 modules +----------------------------------------------- +1. Netscape Internal FIPS PKCS #11 Module +(this module is internally loaded) +slots: 1 slots attached +status: loaded +slot: Netscape Internal FIPS-140-1 Cryptographic Services +token: Communicator Certificate DB +-----------------------------------------------</pre></div><div class="refsection"><a name="seealso"></a><h2>See Also</h2><p>signver (1)</p><p>The NSS wiki has information on the new database design and how to configure applications to use it.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/signver.html b/security/nss/doc/html/signver.html new file mode 100644 index 000000000..ade57de6f --- /dev/null +++ b/security/nss/doc/html/signver.html @@ -0,0 +1,33 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>SIGNVER</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="SIGNVER"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SIGNVER</th></tr></table><hr></div><div class="refentry"><a name="signver"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>signver — Verify a detached PKCS#7 signature for a file.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">signtool</code> -A | -V -d <em class="replaceable"><code>directory</code></em> [-a] [-i <em class="replaceable"><code>input_file</code></em>] [-o <em class="replaceable"><code>output_file</code></em>] [-s <em class="replaceable"><code>signature_file</code></em>] [-v]</p></div></div><div class="refsection"><a name="idm233257229808"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The Signature Verification Tool, <span class="command"><strong>signver</strong></span>, 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.</p></div><div class="refsection"><a name="options"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-A</span></dt><dd><p>Displays all of the information in the PKCS#7 signature.</p></dd><dt><span class="term">-V</span></dt><dd><p>Verifies the digital signature.</p></dd><dt><span class="term">-d [sql:]<span class="emphasis"><em>directory</em></span></span></dt><dd><p>Specify the database directory which contains the certificates and keys.</p><p><span class="command"><strong>signver</strong></span> supports two types of databases: the legacy security databases (<code class="filename">cert8.db</code>, <code class="filename">key3.db</code>, and <code class="filename">secmod.db</code>) and new SQLite databases (<code class="filename">cert9.db</code>, <code class="filename">key4.db</code>, and <code class="filename">pkcs11.txt</code>). If the prefix <span class="command"><strong>sql:</strong></span> is not used, then the tool assumes that the given databases are in the old format.</p></dd><dt><span class="term">-a</span></dt><dd><p>Sets that the given signature file is in ASCII format.</p></dd><dt><span class="term">-i <span class="emphasis"><em>input_file</em></span></span></dt><dd><p>Gives the input file for the object with signed data.</p></dd><dt><span class="term">-o <span class="emphasis"><em>output_file</em></span></span></dt><dd><p>Gives the output file to which to write the results.</p></dd><dt><span class="term">-s <span class="emphasis"><em>signature_file</em></span></span></dt><dd><p>Gives the input file for the digital signature.</p></dd><dt><span class="term">-v</span></dt><dd><p>Enables verbose output.</p></dd></dl></div></div><div class="refsection"><a name="examples"></a><h2>Extended Examples</h2><div class="refsection"><a name="idm233261091008"></a><h3>Verifying a Signature</h3><p>The <code class="option">-V</code> option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file).</p><pre class="programlisting">signver -V -s <em class="replaceable"><code>signature_file</code></em> -i <em class="replaceable"><code>signed_file</code></em> -d sql:/home/my/sharednssdb + +signatureValid=yes</pre></div><div class="refsection"><a name="idm233261087840"></a><h3>Printing Signature Data</h3><p> + The <code class="option">-A</code> option prints all of the information contained in a signature file. Using the <code class="option">-o</code> option prints the signature file information to the given output file rather than stdout. + </p><pre class="programlisting">signver -A -s <em class="replaceable"><code>signature_file</code></em> -o <em class="replaceable"><code>output_file</code></em></pre></div></div><div class="refsection"><a name="databases"></a><h2>NSS Database Types</h2><p>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <span class="emphasis"><em>legacy</em></span> databases are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert8.db for certificates + </p></li><li class="listitem"><p> + key3.db for keys + </p></li><li class="listitem"><p> + secmod.db for PKCS #11 module information + </p></li></ul></div><p>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</p><p>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkleyDB. These new databases provide more accessibility and performance:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + cert9.db for certificates + </p></li><li class="listitem"><p> + key4.db for keys + </p></li><li class="listitem"><p> + pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory + </p></li></ul></div><p>Because the SQLite databases are designed to be shared, these are the <span class="emphasis"><em>shared</em></span> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</p><p>By default, the tools (<span class="command"><strong>certutil</strong></span>, <span class="command"><strong>pk12util</strong></span>, <span class="command"><strong>modutil</strong></span>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <span class="command"><strong>sql:</strong></span> prefix with the given security directory. For example:</p><pre class="programlisting"># signver -A -s <em class="replaceable"><code>signature</code></em> -d sql:/home/my/sharednssdb</pre><p>To set the shared database type as the default type for the tools, set the <code class="envar">NSS_DEFAULT_DB_TYPE</code> environment variable to <code class="envar">sql</code>:</p><pre class="programlisting">export NSS_DEFAULT_DB_TYPE="sql"</pre><p>This line can be added to the <code class="filename">~/.bashrc</code> file to make the change permanent for the user.</p><p>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:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li></ul></div><p>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="seealso"></a><h2>See Also</h2><p>signtool (1)</p><p>The NSS wiki has information on the new database design and how to configure applications to use it.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Setting up the shared NSS database</p><p>https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li><li class="listitem"><p> + Engineering and technical information about the shared NSS database + </p><p> + https://wiki.mozilla.org/NSS_Shared_DB + </p></li></ul></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/ssltap.html b/security/nss/doc/html/ssltap.html new file mode 100644 index 000000000..e69b3758e --- /dev/null +++ b/security/nss/doc/html/ssltap.html @@ -0,0 +1,417 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>SSLTAP</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="SSLTAP"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SSLTAP</th></tr></table><hr></div><div class="refentry"><a name="ssltap"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ssltap — Tap into SSL connections and display the data going by </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">ssltap</code> [-fhlsvx] [-p port] [hostname:port]</p></div></div><div class="refsection"><a name="idm233258230400"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The SSL Debugging Tool <span class="command"><strong>ssltap</strong></span> 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</p></div><div class="refsection"><a name="options"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-f </span></dt><dd><p> +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. + </p></dd><dt><span class="term">-h </span></dt><dd><p> +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. + </p></dd><dt><span class="term">-l prefix</span></dt><dd><p> +Turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. + </p></dd><dt><span class="term">-p port</span></dt><dd><p>Change the default rendezvous port (1924) to another port.</p><p>The following are well-known port numbers:</p><p> + * HTTP 80 + </p><p> + * HTTPS 443 + </p><p> + * SMTP 25 + </p><p> + * FTP 21 + </p><p> + * IMAP 143 + </p><p> + * IMAPS 993 (IMAP over SSL) + </p><p> + * NNTP 119 + </p><p> + * NNTPS 563 (NNTP over SSL) + </p></dd><dt><span class="term">-s </span></dt><dd><p> +Turn on SSL parsing and decoding. The tool does not automatically detect SSL sessions. If you are intercepting an SSL connection, use this option so that the tool can detect and decode SSL structures. + </p><p> +If the tool detects a certificate chain, it saves the DER-encoded certificates into files in the current directory. The files are named cert.0x, where x is the sequence number of the certificate. + </p><p> +If the -s option is used with -h, two separate parts are printed for each record: the plain hex/ASCII output, and the parsed SSL output. + </p></dd><dt><span class="term">-v </span></dt><dd><p>Print a version string for the tool.</p></dd><dt><span class="term">-x </span></dt><dd><p>Turn on extra SSL hex dumps.</p></dd></dl></div></div><div class="refsection"><a name="basic-usage"></a><h2>Usage and Examples</h2><p> +You can use the SSL Debugging Tool to intercept any connection information. Although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful. For example, assume your development machine is called intercept. The simplest way to use the debugging tool is to execute the following command from a command shell: + </p><pre class="programlisting">$ ssltap www.netscape.com</pre><p> +The program waits for an incoming connection on the default port 1924. In your browser window, enter the URL http://intercept:1924. The browser retrieves the requested page from the server at www.netscape.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept. On its way to the browser, the data is printed to the command shell from which you issued the command. Data sent from the client to the server is surrounded by the following symbols: --> [ data ] Data sent from the server to the client is surrounded by the following symbols: +"left arrow"-- [ data ] The raw data stream is sent to standard output and is not interpreted in any way. This can result in peculiar effects, such as sounds, flashes, and even crashes of the command shell window. To output a basic, printable interpretation of the data, use the -h option, or, if you are looking at an SSL connection, the -s option. You will notice that the page you retrieved looks incomplete in the browser. This is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images. To make the tool +continue to accept connections, switch on looping mode with the -l option. The following examples show the output from commonly used combinations of options. + </p><p>Example 1 </p><pre class="programlisting">$ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt</pre><p>Output </p><pre class="programlisting"> +Connected to interzone.mcom.com:443 +-->; [ +alloclen = 66 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher-specs-length = 39 (0x27) + sid-length = 0 (0x00) + challenge-length = 16 (0x10) + cipher-suites = { + + (0x010080) SSL2/RSA/RC4-128/MD5 + (0x020080) SSL2/RSA/RC4-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x040080) SSL2/RSA/RC2CBC40/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE-CBC/MD5 + (0x000004) SSL3/RSA/RC4-128/MD5 + (0x00ffe0) SSL3/RSA-FIPS/3DES192EDE-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE-CBC/SHA + (0x00ffe1) SSL3/RSA-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4-40/MD5 + (0x000006) SSL3/RSA/RC2CBC40/MD5 + } + session-id = { } + challenge = { 0xec5d 0x8edb 0x37c9 0xb5c9 0x7b70 0x8fe9 0xd1d3 + +0x2592 } +} +] +<-- [ +SSLRecord { + 0: 16 03 00 03 e5 |..... + type = 22 (handshake) + version = { 3,0 } + length = 997 (0x3e5) + handshake { + 0: 02 00 00 46 |...F + type = 2 (server_hello) + length = 70 (0x000046) + ServerHello { + server_version = {3, 0} + random = {...} + 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | +wn&l.ì..XOG.-.E + 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | + +\.uC§L.Ç.d<PAHO. + session ID = { + length = 32 + + contents = {..} + 0: 14 11 07 a8 2a 31 91 29 11 94 40 37 57 10 a7 32 | ...¨*1.)..@7W.§2 + 10: 56 6f 52 62 fe 3d b3 65 b1 e4 13 0f 52 a3 c8 f6 | VoRbþ=³e±...R£È. + } + cipher_suite = (0x0003) SSL3/RSA/RC4-40/MD5 + } + 0: 0b 00 02 c5 |...Å + type = 11 (certificate) + length = 709 (0x0002c5) + CertificateChain { + chainlength = 706 (0x02c2) + Certificate { + size = 703 (0x02bf) + data = { saved in file 'cert.001' } + } + } + 0: 0c 00 00 ca |.... + type = 12 (server_key_exchange) + length = 202 (0x0000ca) + 0: 0e 00 00 00 |.... + type = 14 (server_hello_done) + length = 0 (0x000000) + } +} +] +--> [ +SSLRecord { + 0: 16 03 00 00 44 |....D + type = 22 (handshake) + version = { 3,0 } + length = 68 (0x44) + handshake { + 0: 10 00 00 40 |...@ + type = 16 (client_key_exchange) + length = 64 (0x000040) + ClientKeyExchange { + message = {...} + } + } +} +] +--> [ +SSLRecord { + 0: 14 03 00 00 01 |..... + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) + 0: 01 |. +} +SSLRecord { + 0: 16 03 00 00 38 |....8 + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + < encrypted > + +} +] +<-- [ +SSLRecord { + 0: 14 03 00 00 01 |..... + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) + 0: 01 |. +} +] +<-- [ +SSLRecord { + 0: 16 03 00 00 38 |....8 + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + < encrypted > + +} +] +--> [ +SSLRecord { + 0: 17 03 00 01 1f |..... + type = 23 (application_data) + version = { 3,0 } + length = 287 (0x11f) + < encrypted > +} +] +<-- [ +SSLRecord { + 0: 17 03 00 00 a0 |.... + type = 23 (application_data) + version = { 3,0 } + length = 160 (0xa0) + < encrypted > + +} +] +<-- [ +SSLRecord { +0: 17 03 00 00 df |....ß + type = 23 (application_data) + version = { 3,0 } + length = 223 (0xdf) + < encrypted > + +} +SSLRecord { + 0: 15 03 00 00 12 |..... + type = 21 (alert) + version = { 3,0 } + length = 18 (0x12) + < encrypted > +} +] +Server socket closed. +</pre><p>Example 2</p><p> +The -s option turns on SSL parsing. Because the -x option is not used in this example, undecoded values are output as raw data. The output is routed to a text file. + </p><pre class="programlisting">$ ssltap -s -p 444 interzone.mcom.com:443 > s.txt</pre><p>Output </p><pre class="programlisting"> +Connected to interzone.mcom.com:443 +--> [ +alloclen = 63 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher-specs-length = 36 (0x24) + sid-length = 0 (0x00) + challenge-length = 16 (0x10) + cipher-suites = { + (0x010080) SSL2/RSA/RC4-128/MD5 + (0x020080) SSL2/RSA/RC4-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE-CBC/MD5 + (0x000004) SSL3/RSA/RC4-128/MD5 + (0x00ffe0) SSL3/RSA-FIPS/3DES192EDE-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE-CBC/SHA + (0x00ffe1) SSL3/RSA-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4-40/MD5 + } + session-id = { } + challenge = { 0x713c 0x9338 0x30e1 0xf8d6 0xb934 0x7351 0x200c +0x3fd0 } +] +>-- [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 997 (0x3e5) + handshake { + type = 2 (server_hello) + length = 70 (0x000046) + ServerHello { + server_version = {3, 0} + random = {...} + session ID = { + length = 32 + contents = {..} + } + cipher_suite = (0x0003) SSL3/RSA/RC4-40/MD5 + } + type = 11 (certificate) + length = 709 (0x0002c5) + CertificateChain { + chainlength = 706 (0x02c2) + Certificate { + size = 703 (0x02bf) + data = { saved in file 'cert.001' } + } + } + type = 12 (server_key_exchange) + length = 202 (0x0000ca) + type = 14 (server_hello_done) + length = 0 (0x000000) + } +} +] +--> [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 68 (0x44) + handshake { + type = 16 (client_key_exchange) + length = 64 (0x000040) + ClientKeyExchange { + message = {...} + } + } +} +] +--> [ +SSLRecord { + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) +} +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + > encrypted > +} +] +>-- [ +SSLRecord { + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) +} +] +>-- [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + > encrypted > +} +] +--> [ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 287 (0x11f) + > encrypted > +} +] +[ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 160 (0xa0) + > encrypted > +} +] +>-- [ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 223 (0xdf) + > encrypted > +} +SSLRecord { + type = 21 (alert) + version = { 3,0 } + length = 18 (0x12) + > encrypted > +} +] +Server socket closed. +</pre><p>Example 3</p><p> +In this example, the -h option turns hex/ASCII format. There is no SSL parsing or decoding. The output is routed to a text file. + </p><pre class="programlisting">$ ssltap -h -p 444 interzone.mcom.com:443 > h.txt</pre><p>Output </p><pre class="programlisting"> +Connected to interzone.mcom.com:443 +--> [ + 0: 80 40 01 03 00 00 27 00 00 00 10 01 00 80 02 00 | .@....'......... + 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | .........@...... + 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 00 | ........á....... + 30: 00 06 9b fe 5b 56 96 49 1f 9f ca dd d5 ba b9 52 | ..þ[V.I.\xd9 ...º¹R + 40: 6f 2d |o- +] +<-- [ + 0: 16 03 00 03 e5 02 00 00 46 03 00 7f e5 0d 1b 1d | ........F....... + 10: 68 7f 3a 79 60 d5 17 3c 1d 9c 96 b3 88 d2 69 3b | h.:y`..<..³.Òi; + 20: 78 e2 4b 8b a6 52 12 4b 46 e8 c2 20 14 11 89 05 | x.K.¦R.KFè. ... + 30: 4d 52 91 fd 93 e0 51 48 91 90 08 96 c1 b6 76 77 | MR.ý..QH.....¶vw + 40: 2a f4 00 08 a1 06 61 a2 64 1f 2e 9b 00 03 00 0b | *ô..¡.a¢d...... + 50: 00 02 c5 00 02 c2 00 02 bf 30 82 02 bb 30 82 02 | ..Å......0...0.. + 60: 24 a0 03 02 01 02 02 02 01 36 30 0d 06 09 2a 86 | $ .......60...*. + 70: 48 86 f7 0d 01 01 04 05 00 30 77 31 0b 30 09 06 | H.÷......0w1.0.. + 80: 03 55 04 06 13 02 55 53 31 2c 30 2a 06 03 55 04 | .U....US1,0*..U. + 90: 0a 13 23 4e 65 74 73 63 61 70 65 20 43 6f 6d 6d | ..#Netscape Comm + a0: 75 6e 69 63 61 74 69 6f 6e 73 20 43 6f 72 70 6f | unications Corpo + b0: 72 61 74 69 6f 6e 31 11 30 0f 06 03 55 04 0b 13 | ration1.0...U... + c0: 08 48 61 72 64 63 6f 72 65 31 27 30 25 06 03 55 | .Hardcore1'0%..U + d0: 04 03 13 1e 48 61 72 64 63 6f 72 65 20 43 65 72 | ....Hardcore Cer + e0: 74 69 66 69 63 61 74 65 20 53 65 72 76 65 72 20 | tificate Server + f0: 49 49 30 1e 17 0d 39 38 30 35 31 36 30 31 30 33 | II0...9805160103 +<additional data lines> +] +<additional records in same format> +Server socket closed. +</pre><p>Example 4</p><p> +In this example, the -s option turns on SSL parsing, and the -h option turns on hex/ASCII format. +Both formats are shown for each record. The output is routed to a text file. + </p><pre class="programlisting">$ ssltap -hs -p 444 interzone.mcom.com:443 > hs.txt</pre><p>Output </p><pre class="programlisting"> +Connected to interzone.mcom.com:443 +--> [ + 0: 80 3d 01 03 00 00 24 00 00 00 10 01 00 80 02 00 | .=....$......... + 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | .........@...... + 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 03 | ........á....... + 30: 55 e6 e4 99 79 c7 d7 2c 86 78 96 5d b5 cf e9 |U..yÇ\xb0 ,.x.]µÏé +alloclen = 63 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher-specs-length = 36 (0x24) + sid-length = 0 (0x00) + challenge-length = 16 (0x10) + cipher-suites = { + (0x010080) SSL2/RSA/RC4-128/MD5 + (0x020080) SSL2/RSA/RC4-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x040080) SSL2/RSA/RC2CBC40/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE-CBC/MD5 + (0x000004) SSL3/RSA/RC4-128/MD5 + (0x00ffe0) SSL3/RSA-FIPS/3DES192EDE-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE-CBC/SHA + (0x00ffe1) SSL3/RSA-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4-40/MD5 + } + session-id = { } + challenge = { 0x0355 0xe6e4 0x9979 0xc7d7 0x2c86 0x7896 0x5db + +0xcfe9 } +} +] +<additional records in same formats> +Server socket closed. +</pre></div><div class="refsection"><a name="usage-tips"></a><h2>Usage Tips</h2><p> +When SSL restarts a previous session, it makes use of cached information to do a partial handshake. +If you wish to capture a full SSL handshake, restart the browser to clear the session id cache. + </p><p> +If you run the tool on a machine other than the SSL server to which you are trying to connect, +the browser will complain that the host name you are trying to connect to is different from the certificate. +If you are using the default BadCert callback, you can still connect through a dialog. If you are not using +the default BadCert callback, the one you supply must allow for this possibility. + </p></div><div class="refsection"><a name="seealso"></a><h2>See Also</h2><p>The NSS Security Tools are also documented at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/tools" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>.</p></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/vfychain.html b/security/nss/doc/html/vfychain.html new file mode 100644 index 000000000..a360836f5 --- /dev/null +++ b/security/nss/doc/html/vfychain.html @@ -0,0 +1,26 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>VFYCHAIN</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="VFYCHAIN"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">VFYCHAIN</th></tr></table><hr></div><div class="refentry"><a name="vfychain"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>vfychain — vfychain [options] [revocation options] certfile [[options] certfile] ...</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">vfychain</code> </p></div></div><div class="refsection"><a name="idm233261246224"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The verification Tool, <span class="command"><strong>vfychain</strong></span>, verifies certificate chains. <span class="command"><strong>modutil</strong></span> 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.</p><p>The tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases.</p></div><div class="refsection"><a name="options"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-a</code></span></dt><dd>the following certfile is base64 encoded</dd><dt><span class="term"><code class="option">-b </code> <em class="replaceable"><code>YYMMDDHHMMZ</code></em></span></dt><dd>Validate date (default: now)</dd><dt><span class="term"><code class="option">-d </code> <em class="replaceable"><code>directory</code></em></span></dt><dd>database directory</dd><dt><span class="term"><code class="option">-f </code> </span></dt><dd>Enable cert fetching from AIA URL</dd><dt><span class="term"><code class="option">-o </code> <em class="replaceable"><code>oid</code></em></span></dt><dd>Set policy OID for cert validation(Format OID.1.2.3)</dd><dt><span class="term"><code class="option">-p </code></span></dt><dd><p class="simpara">Use PKIX Library to validate certificate by calling:</p><p class="simpara"> * CERT_VerifyCertificate if specified once,</p><p class="simpara"> * CERT_PKIXVerifyCert if specified twice and more.</p></dd><dt><span class="term"><code class="option">-r </code></span></dt><dd>Following certfile is raw binary DER (default)</dd><dt><span class="term"><code class="option">-t</code></span></dt><dd>Following cert is explicitly trusted (overrides db trust)</dd><dt><span class="term"><code class="option">-u </code> <em class="replaceable"><code>usage</code></em></span></dt><dd><p> + 0=SSL client, 1=SSL server, 2=SSL StepUp, 3=SSL CA, + 4=Email signer, 5=Email recipient, 6=Object signer, + 9=ProtectedObjectSigner, 10=OCSP responder, 11=Any CA + </p></dd><dt><span class="term"><code class="option">-T </code></span></dt><dd>Trust both explicit trust anchors (-t) and the database. (Without this option, the default is to only trust certificates marked -t, if there are any, or to trust the database if there are certificates marked -t.) + </dd><dt><span class="term"><code class="option">-v </code></span></dt><dd>Verbose mode. Prints root cert subject(double the + argument for whole root cert info) + </dd><dt><span class="term"><code class="option">-w </code> <em class="replaceable"><code>password</code></em></span></dt><dd>Database password</dd><dt><span class="term"><code class="option">-W </code> <em class="replaceable"><code>pwfile</code></em></span></dt><dd>Password file</dd><dt><span class="term"><code class="option"></code></span></dt><dd><p class="simpara">Revocation options for PKIX API (invoked with -pp options) is a + collection of the following flags: + [-g type [-h flags] [-m type [-s flags]] ...] ...</p><p class="simpara">Where: </p></dd><dt><span class="term"><code class="option">-g </code> <em class="replaceable"><code>test-type</code></em></span></dt><dd>Sets status checking test type. Possible values + are "leaf" or "chain" + </dd><dt><span class="term"><code class="option">-g </code> <em class="replaceable"><code>test type</code></em></span></dt><dd>Sets status checking test type. Possible values + are "leaf" or "chain". + </dd><dt><span class="term"><code class="option">-h </code> <em class="replaceable"><code>test flags</code></em></span></dt><dd>Sets revocation flags for the test type it + follows. Possible flags: "testLocalInfoFirst" and + "requireFreshInfo". + </dd><dt><span class="term"><code class="option">-m </code> <em class="replaceable"><code>method type</code></em></span></dt><dd>Sets method type for the test type it follows. + Possible types are "crl" and "ocsp". + </dd><dt><span class="term"><code class="option">-s </code> <em class="replaceable"><code>method flags</code></em></span></dt><dd>Sets revocation flags for the method it follows. + Possible types are "doNotUse", "forbidFetching", + "ignoreDefaultSrc", "requireInfo" and "failIfNoInfo". + </dd></dl></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/html/vfyserv.html b/security/nss/doc/html/vfyserv.html new file mode 100644 index 000000000..dec6dcb3a --- /dev/null +++ b/security/nss/doc/html/vfyserv.html @@ -0,0 +1,5 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>VFYSERV</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="VFYSERV"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">VFYSERV</th></tr></table><hr></div><div class="refentry"><a name="vfyserv"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>vfyserv — TBD</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">vfyserv</code> </p></div></div><div class="refsection"><a name="idm233266435200"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477" target="_top">Mozilla NSS bug 836477</a> + </p></div><div class="refsection"><a name="description"></a><h2>Description</h2><p>The <span class="command"><strong>vfyserv </strong></span> tool verifies a certificate chain</p></div><div class="refsection"><a name="options"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option"></code> <em class="replaceable"><code></code></em></span></dt><dd><p class="simpara"></p><p class="simpara"></p></dd></dl></div></div><div class="refsection"><a name="resources"></a><h2>Additional Resources</h2><p>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <a class="ulink" href="http://www.mozilla.org/projects/security/pki/nss/" target="_top">http://www.mozilla.org/projects/security/pki/nss/</a>. The NSS site relates directly to NSS code changes and releases.</p><p>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</p><p>IRC: Freenode at #dogtag-pki</p></div><div class="refsection"><a name="authors"></a><h2>Authors</h2><p>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</p><p> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </p></div><div class="refsection"><a name="license"></a><h2>LICENSE</h2><p>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/. + </p></div></div><div class="navfooter"><hr></div></body></html> diff --git a/security/nss/doc/modutil.xml b/security/nss/doc/modutil.xml new file mode 100644 index 000000000..142aa69da --- /dev/null +++ b/security/nss/doc/modutil.xml @@ -0,0 +1,761 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="modutil"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>MODUTIL</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>modutil</refname> + <refpurpose>Manage PKCS #11 module information within the security module database.</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>modutil</command> + <arg><replaceable>options</replaceable></arg> + <arg>[<replaceable>arguments</replaceable>]</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + <para>The Security Module Database Tool, <command>modutil</command>, is a command-line utility for managing PKCS #11 module information both within <filename>secmod.db</filename> files and within hardware tokens. <command>modutil</command> 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.</para> + + <para>The tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases.</para> + </refsection> + + <refsection id="options"> + <title>Options</title> + <para> + Running <command>modutil</command> 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. + </para> + <para><command>Options</command></para> + + <variablelist> + + <varlistentry> + <term>-add modulename</term> + <listitem><para>Add the named PKCS #11 module to the database. Use this option with the <option>-libfile</option>, <option>-ciphers</option>, and <option>-mechanisms</option> arguments.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-changepw tokenname</term> + <listitem><para>Change the password on the named token. If the token has not been initialized, this option initializes the password. Use this option with the <option>-pwfile</option> and <option>-newpwfile</option> arguments. A <emphasis>password</emphasis> is equivalent to a personal identification number (PIN).</para></listitem> + </varlistentry> + + <varlistentry> + <term>-chkfips</term> + <listitem><para>Verify whether the module is in the given FIPS mode. <command>true</command> means to verify that the module is in FIPS mode, while <command>false</command> means to verify that the module is not in FIPS mode.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-create</term> + <listitem><para>Create new certificate, key, and module databases. Use the <option>-dbdir</option> directory argument to specify a directory. If any of these databases already exist in a specified directory, <command>modutil</command> returns an error message.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-default modulename</term> + <listitem><para>Specify the security mechanisms for which the named module will be a default provider. The security mechanisms are specified with the <option>-mechanisms</option> argument.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-delete modulename</term> + <listitem><para>Delete the named module. The default NSS PKCS #11 module cannot be deleted.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-disable modulename</term> + <listitem><para>Disable all slots on the named module. Use the <option>-slot</option> argument to disable a specific slot.</para><para>The internal NSS PKCS #11 module cannot be disabled.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-enable modulename</term> + <listitem><para>Enable all slots on the named module. Use the <option>-slot</option> argument to enable a specific slot.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-fips [true | false]</term> + <listitem><para>Enable (true) or disable (false) FIPS 140-2 compliance for the default NSS module.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-force</term> + <listitem><para>Disable <command>modutil</command>'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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-jar JAR-file</term> + <listitem><para>Add a new PKCS #11 module to the database using the named JAR file. Use this command with the <option>-installdir</option> and <option>-tempdir</option> 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 <command>modutil</command>. </para></listitem> + </varlistentry> + + <varlistentry> + <term>-list [modulename]</term> + <listitem><para>Display basic information about the contents of the <filename>secmod.db</filename> file. Specifying a <emphasis>modulename</emphasis> displays detailed information about a particular module and its slots and tokens.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-rawadd</term> + <listitem><para>Add the module spec string to the <filename>secmod.db</filename> database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-rawlist</term> + <listitem><para>Display the module specs for a specified module or for all loadable modules.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-undefault modulename</term> + <listitem><para>Specify the security mechanisms for which the named module will not be a default provider. The security mechanisms are specified with the <option>-mechanisms</option> argument.</para></listitem> + </varlistentry> + </variablelist> + + <para><command>Arguments</command></para> + <variablelist> + + <varlistentry> + <term>MODULE</term> + <listitem><para>Give the security module to access.</para></listitem> + </varlistentry> + + <varlistentry> + <term>MODULESPEC</term> + <listitem><para>Give the security module spec to load into the security database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-ciphers cipher-enable-list</term> + <listitem><para>Enable specific ciphers in a module that is being added to the database. The <emphasis>cipher-enable-list</emphasis> is a colon-delimited list of cipher names. Enclose this list in quotation marks if it contains spaces.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-dbdir [sql:]directory</term> + <listitem><para>Specify the database directory in which to access or create security module database files.</para> + <para><command>modutil</command> supports two types of databases: the legacy security databases (<filename>cert8.db</filename>, <filename>key3.db</filename>, and <filename>secmod.db</filename>) and new SQLite databases (<filename>cert9.db</filename>, <filename>key4.db</filename>, and <filename>pkcs11.txt</filename>). If the prefix <command>sql:</command> is not used, then the tool assumes that the given databases are in the old format.</para></listitem> + </varlistentry> + + <varlistentry> + <term>--dbprefix prefix</term> + <listitem><para>Specify the prefix used on the database files, such as <filename>my_</filename> for <filename>my_cert8.db</filename>. This option is provided as a special case. Changing the names of the certificate and key databases is not recommended.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-installdir root-installation-directory</term> + <listitem><para>Specify the root installation directory relative to which files will be installed by the <option>-jar</option> option. This directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-libfile library-file</term> + <listitem><para>Specify a path to a library file containing the implementation of the PKCS #11 interface module that is being added to the database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-mechanisms mechanism-list</term> + <listitem><para>Specify the security mechanisms for which a particular module will be flagged as a default provider. The <emphasis>mechanism-list</emphasis> is a colon-delimited list of mechanism names. Enclose this list in quotation marks if it contains spaces.</para> + <para>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.</para> + <para><command>modutil</command> 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).</para></listitem> + </varlistentry> + + <varlistentry> + <term>-newpwfile new-password-file</term> + <listitem><para>Specify a text file containing a token's new or replacement password so that a password can be entered automatically with the <option>-changepw</option> option.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-nocertdb</term> + <listitem><para>Do not open the certificate or key databases. This has several effects:</para> + <itemizedlist> + <listitem> + <para>With the <option>-create</option> command, only a module security file is created; certificate and key databases are not created.</para> + </listitem> + <listitem> + <para>With the <option>-jar</option> command, signatures on the JAR file are not checked.</para> + </listitem> + <listitem> + <para>With the <option>-changepw</option> command, the password on the NSS internal module cannot be set or changed, since this password is stored in the key database.</para></listitem> + </itemizedlist> + </listitem> + </varlistentry> + + <varlistentry> + <term>-pwfile old-password-file</term> + <listitem><para>Specify a text file containing a token's existing password so that a password can be entered automatically when the <option>-changepw</option> option is used to change passwords.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-secmod secmodname</term> + <listitem><para>Give the name of the security module database (like <filename>secmod.db</filename>) to load.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-slot slotname</term> + <listitem><para>Specify a particular slot to be enabled or disabled with the <option>-enable</option> or <option>-disable</option> options.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-string CONFIG_STRING</term> + <listitem><para>Pass a configuration string for the module being added to the database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-tempdir temporary-directory</term> + <listitem><para>Give a directory location where temporary files are created during the installation by the <option>-jar</option> option. If no temporary directory is specified, the current directory is used.</para></listitem> + </varlistentry> + </variablelist> + </refsection> + + <refsection id="usage-and-examples"> + <title>Usage and Examples</title> + + <para><command>Creating Database Files</command></para> + <para>Before any operations can be performed, there must be a set of security databases available. <command>modutil</command> can be used to create these files. The only required argument is the database that where the databases will be located.</para> +<programlisting>modutil -create -dbdir [sql:]directory</programlisting> + + <para><command>Adding a Cryptographic Module</command></para> + <para>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 <command>modutil</command> directly or by running a JAR file and install script. For the most basic case, simply upload the library:</para> +<programlisting>modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] </programlisting> + <para>For example: +<programlisting>modutil -dbdir sql:/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.</programlisting> + </para> + + + <para><command>Installing a Cryptographic Module from a JAR File</command></para> + <para>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 <xref linkend="jar-install-file" />.</para> + <para>The JAR installation script defines the setup information for each platform that the module can be installed on. For example:</para> +<programlisting>Platforms { + Linux:5.4.08:x86 { + ModuleName { "Example PKCS #11 Module" } + ModuleFile { crypto.so } + DefaultMechanismFlags{0x0000} + CipherEnableFlags{0x0000} + Files { + crypto.so { + Path{ /tmp/crypto.so } + } + setup.sh { + Executable + Path{ /tmp/setup.sh } + } + } + } + Linux:6.0.0:x86 { + EquivalentPlatform { Linux:5.4.08:x86 } + } +} </programlisting> + <para>Both the install script and the required libraries must be bundled in a JAR file, which is specified with the <option>-jar</option> argument.</para> + +<programlisting>modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/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 +Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref +. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 +Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUER +NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 +VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, +OU="VeriSign, Inc.", O=VeriSign Trust Network +---------------------------------------------- + +Do you wish to continue this installation? (y/n) y +Using installer script "installer_script" +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 </programlisting> + + <para><command>Adding Module Spec</command></para> + <para>Each module has information stored in the security database about its configuration and parameters. These can be added or edited using the <option>-rawadd</option> command. For the current settings or to see the format of the module spec in the database, use the <option>-rawlist</option> option.</para> +<programlisting>modutil -rawadd modulespec</programlisting> + + + <para><command>Deleting a Module</command></para> + <para>A specific PKCS #11 module can be deleted from the <filename>secmod.db</filename> database:</para> +<programlisting>modutil -delete modulename -dbdir [sql:]directory </programlisting> + + <para><command>Displaying Module Information</command></para> + <para>The <filename>secmod.db</filename> 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. </para> + <para>To simply get a list of modules in the database, use the <option>-list</option> command.</para> +<programlisting>modutil -list [modulename] -dbdir [sql:]directory </programlisting> + <para>Listing the modules shows the module name, their status, and other associated security databases for certificates and keys. For example:</para> + +<programlisting>modutil -list -dbdir sql:/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 + + slot: NSS User Private Key and Certificate Services + token: NSS Certificate DB +-----------------------------------------------------------</programlisting> + <para>Passing a specific module name with the <option>-list</option> 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:</para> +<programlisting> modutil -list "NSS Internal PKCS #11 Module" -dbdir sql:/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 +Cipher Enable Flags: None +Default Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES + + Slot: NSS Internal Cryptographic Services + Slot Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES + Manufacturer: Mozilla Foundation + Type: Software + Version Number: 3.11 + Firmware Version: 0.0 + Status: Enabled + Token Name: NSS Generic Crypto Services + Token Manufacturer: Mozilla Foundation + Token Model: NSS 3 + Token Serial Number: 0000000000000000 + Token Version: 4.0 + Token Firmware Version: 0.0 + Access: Write Protected + Login Type: Public (no login required) + User Pin: NOT Initialized + + Slot: NSS User Private Key and Certificate Services + Slot Mechanism Flags: None + Manufacturer: Mozilla Foundation + Type: Software + Version Number: 3.11 + Firmware Version: 0.0 + Status: Enabled + 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</programlisting> + <para>A related command, <option>-rawlist</option> returns information about the database configuration for the modules. (This information can be edited by loading new specs using the <option>-rawadd</option> command.)</para> +<programlisting> modutil -rawlist -dbdir sql:/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"</programlisting> + + <para><command>Setting a Default Provider for Security Mechanisms</command></para> + <para>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).</para> +<programlisting>modutil -default modulename -mechanisms mechanism-list </programlisting> + <para>To set a module as the default provider for mechanisms, use the <option>-default</option> command with a colon-separated list of mechanisms. The available mechanisms depend on the module; NSS supplies almost all common mechanisms. For example:</para> +<programlisting>modutil -default "NSS Internal PKCS #11 Module" -dbdir -mechanisms RSA:DSA:RC2 + +Using database directory c:\databases... + +Successfully changed defaults.</programlisting> + + <para>Clearing the default provider has the same format:</para> +<programlisting>modutil -undefault "NSS Internal PKCS #11 Module" -dbdir -mechanisms MD2:MD5</programlisting> + + <para><command>Enabling and Disabling Modules and Slots</command></para> + <para>Modules, and specific slots on modules, can be selectively enabled or disabled using <command>modutil</command>. Both commands have the same format:</para> +<programlisting>modutil -enable|-disable modulename [-slot slotname] </programlisting> + + <para>For example:</para> +<programlisting>modutil -enable "NSS Internal PKCS #11 Module" -slot "NSS Internal Cryptographic Services " -dbdir . + +Slot "NSS Internal Cryptographic Services " enabled.</programlisting> + <para>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.</para> + + <para><command>Enabling and Verifying FIPS Compliance</command></para> + <para>The NSS modules can have FIPS 140-2 compliance enabled or disabled using <command>modutil</command> with the <option>-fips</option> option. For example:</para> +<programlisting>modutil -fips true -dbdir sql:/home/my/sharednssdb/ + +FIPS mode enabled.</programlisting> + <para>To verify that status of FIPS mode, run the <option>-chkfips</option> command with either a true or false flag (it doesn't matter which). The tool returns the current FIPS setting.</para> +<programlisting>modutil -chkfips false -dbdir sql:/home/my/sharednssdb/ + +FIPS mode enabled.</programlisting> + + <para><command>Changing the Password on a Token</command></para> + + <para>Initializing or changing a token's password:</para> +<programlisting>modutil -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] </programlisting> +<programlisting>modutil -dbdir sql:/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.</programlisting> + </refsection> + + <refsection id="jar-install-file"><title>JAR Installation File Format</title> + <para>When a JAR file is run by a server, by <command>modutil</command>, 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:</para> + <itemizedlist> + <listitem> + <para> + It must be declared in the JAR archive's manifest file. + </para> + </listitem> + <listitem> + <para> + The script can have any name. + </para> + </listitem> + <listitem> + <para> + The metainfo tag for this is <command>Pkcs11_install_script</command>. To declare meta-information in the manifest file, put it in a file that is passed to <command>signtool</command>.</para> + </listitem> + </itemizedlist> + + <para><command>Sample Script</command></para> + <para>For example, the PKCS #11 installer script could be in the file pk11install. If so, the metainfo file for <command>signtool</command> includes a line such as this:</para> +<programlisting>+ Pkcs11_install_script: pk11install</programlisting> + + <para>The script must define the platform and version number, the module name and file, and any optional information like supported ciphers and mechanisms. Multiple platforms can be defined in a single install file.</para> +<programlisting>ForwardCompatible { IRIX:6.2:mips SUNOS:5.5.1:sparc } +Platforms { + WINNT::x86 { + ModuleName { "Example Module" } + ModuleFile { win32/fort32.dll } + DefaultMechanismFlags{0x0001} + DefaultCipherFlags{0x0001} + Files { + win32/setup.exe { + Executable + RelativePath { %temp%/setup.exe } + } + win32/setup.hlp { + RelativePath { %temp%/setup.hlp } + } + win32/setup.cab { + RelativePath { %temp%/setup.cab } + } + } + } + WIN95::x86 { + EquivalentPlatform {WINNT::x86} + } + SUNOS:5.5.1:sparc { + ModuleName { "Example UNIX Module" } + ModuleFile { unix/fort.so } + DefaultMechanismFlags{0x0001} + CipherEnableFlags{0x0001} + Files { + unix/fort.so { + RelativePath{%root%/lib/fort.so} + AbsolutePath{/usr/local/netscape/lib/fort.so} + FilePermissions{555} + } + xplat/instr.html { + RelativePath{%root%/docs/inst.html} + AbsolutePath{/usr/local/netscape/docs/inst.html} + FilePermissions{555} + } + } + } + IRIX:6.2:mips { + EquivalentPlatform { SUNOS:5.5.1:sparc } + } +}</programlisting> + + <para><command>Script Grammar</command></para> + <para>The script is basic Java, allowing lists, key-value pairs, strings, and combinations of all of them.</para> +<programlisting>--> valuelist + +valuelist --> value valuelist + <null> + +value ---> key_value_pair + string + +key_value_pair --> key { valuelist } + +key --> string + +string --> simple_string + "complex_string" + +simple_string --> [^ \t\n\""{""}"]+ + +complex_string --> ([^\"\\\r\n]|(\\\")|(\\\\))+ </programlisting> + + <para>Quotes and backslashes must be escaped with a backslash. A complex string must not include newlines or carriage returns.Outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.</para> + + <para><command>Keys</command></para> + <para>The Java install file uses keys to define the platform and module information.</para> + <para><command>ForwardCompatible</command> gives a list of platforms that are forward compatible. If the current platform cannot be found in the list of supported platforms, then the <command>ForwardCompatible</command> list is checked for any platforms that have the same OS and architecture in an earlier version. If one is found, its attributes are used for the current platform. </para> + <para><command>Platforms</command> (required) Gives a list of platforms. Each entry in the list is itself a key-value pair: the key is the name of the platform and the value list contains various attributes of the platform. The platform string is in the format <emphasis>system name:OS release:architecture</emphasis>. The installer obtains these values from NSPR. OS release is an empty string on non-Unix operating systems. NSPR supports these platforms:</para> + <itemizedlist> + <listitem> + <para>AIX (rs6000)</para> + </listitem> + <listitem> + <para>BSDI (x86)</para> + </listitem> + <listitem> + <para>FREEBSD (x86)</para> + </listitem> + <listitem> + <para>HPUX (hppa1.1)</para> + </listitem> + <listitem> + <para>IRIX (mips)</para> + </listitem> + <listitem> + <para>LINUX (ppc, alpha, x86)</para> + </listitem> + <listitem> + <para>MacOS (PowerPC)</para> + </listitem> + <listitem> + <para>NCR (x86)</para> + </listitem> + <listitem> + <para>NEC (mips)</para> + </listitem> + <listitem> + <para>OS2 (x86)</para> + </listitem> + <listitem> + <para>OSF (alpha)</para> + </listitem> + <listitem> + <para>ReliantUNIX (mips)</para> + </listitem> + <listitem> + <para>SCO (x86)</para> + </listitem> + <listitem> + <para>SOLARIS (sparc)</para> + </listitem> + <listitem> + <para>SONY (mips)</para> + </listitem> + <listitem> + <para>SUNOS (sparc)</para> + </listitem> + <listitem> + <para>UnixWare (x86)</para> + </listitem> + <listitem> + <para>WIN16 (x86)</para> + </listitem> + <listitem> + <para>WIN95 (x86)</para> + </listitem> + <listitem> + <para>WINNT (x86)</para> + </listitem> + </itemizedlist> + + <para>For example:</para> +<programlisting>IRIX:6.2:mips +SUNOS:5.5.1:sparc +Linux:2.0.32:x86 +WIN95::x86</programlisting> + <para>The module information is defined independently for each platform in the <command>ModuleName</command>, <command>ModuleFile</command>, and <command>Files</command> attributes. These attributes must be given unless an <command>EquivalentPlatform</command> attribute is specified. </para> + + <para><command>Per-Platform Keys</command></para> + <para>Per-platform keys have meaning only within the value list of an entry in the <command>Platforms</command> list.</para> + <para><command>ModuleName</command> (required) gives the common name for the module. This name is used to reference the module by servers and by the <command>modutil</command> tool. </para> + <para><command>ModuleFile</command> (required) names the PKCS #11 module file for this platform. The name is given as the relative path of the file within the JAR archive. </para> + <para><command>Files</command> (required) lists the files that need to be installed for this module. Each entry in the file list is a key-value pair. The key is the path of the file in the JAR archive, and the value list contains attributes of the file. At least <command>RelativePath</command> or <command>AbsolutePath</command> must be specified for each file.</para> + <para><command>DefaultMechanismFlags</command> specifies mechanisms for which this module is the default provider; this is equivalent to the <option>-mechanism</option> option with the <option>-add</option> command. This key-value pair is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR. If the DefaultMechanismFlags entry is omitted, the value defaults to 0x0.</para> + +<programlisting>RSA: 0x00000001 +DSA: 0x00000002 +RC2: 0x00000004 +RC4: 0x00000008 +DES: 0x00000010 +DH: 0x00000020 +FORTEZZA: 0x00000040 +RC5: 0x00000080 +SHA1: 0x00000100 +MD5: 0x00000200 +MD2: 0x00000400 +RANDOM: 0x08000000 +FRIENDLY: 0x10000000 +OWN_PW_DEFAULTS: 0x20000000 +DISABLE: 0x40000000</programlisting> + + <para><command>CipherEnableFlags</command> specifies ciphers that this module provides that NSS does not provide (so that the module enables those ciphers for NSS). This is equivalent to the <option>-cipher</option> argument with the <option>-add</option> command. This key is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR. If the <command>CipherEnableFlags</command> entry is omitted, the value defaults to 0x0.</para> + + <para><command>EquivalentPlatform</command> specifies that the attributes of the named platform should also be used for the current platform. This makes it easier when more than one platform uses the same settings.</para> + + <para><command>Per-File Keys</command></para> + <para>Some keys have meaning only within the value list of an entry in a <command>Files</command> list.</para> + <para>Each file requires a path key the identifies where the file is. Either <command>RelativePath</command> or <command>AbsolutePath</command> must be specified. If both are specified, the relative path is tried first, and the absolute path is used only if no relative root directory is provided by the installer program.</para> + <para><command>RelativePath</command> specifies the destination directory of the file, relative to some directory decided at install time. Two variables can be used in the relative path: <command>%root%</command> and <command>%temp%</command>. <command>%root%</command> is replaced at run time with the directory relative to which files should be installed; for example, it may be the server's root directory. The <command>%temp%</command> directory is created at the beginning of the installation and destroyed at the end. The purpose of <command>%temp%</command> is to hold executable files (such as setup programs) or files that are used by these programs. Files destined for the temporary directory are guaranteed to be in place before any executable file is run; they are not deleted until all executable files have finished.</para> + <para><command>AbsolutePath</command> specifies the destination directory of the file as an absolute path. </para> + <para><command>Executable</command> specifies that the file is to be executed during the course of the installation. Typically, this string is used for a setup program provided by a module vendor, such as a self-extracting setup executable. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file.</para> + <para><command>FilePermissions</command> sets permissions on any referenced files in a string of octal digits, according to the standard Unix format. This string is a bitwise OR.</para> + +<programlisting> +user read: 0400 +user write: 0200 +user execute: 0100 +group read: 0040 +group write: 0020 +group execute: 0010 +other read: 0004 +other write: 0002 +other execute: 0001 +</programlisting> + +<para>Some platforms may not understand these permissions. They are applied only insofar as they make sense for the current platform. If this attribute is omitted, a default of 777 is assumed.</para> + </refsection> + +<refsection id="databases"><title>NSS Database Types</title> +<para>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <emphasis>legacy</emphasis> databases are:</para> +<itemizedlist> + <listitem> + <para> + cert8.db for certificates + </para> + </listitem> + <listitem> + <para> + key3.db for keys + </para> + </listitem> + <listitem> + <para> + secmod.db for PKCS #11 module information + </para> + </listitem> +</itemizedlist> + +<para>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</para> + +<para>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkleyDB. These new databases provide more accessibility and performance:</para> +<itemizedlist> + <listitem> + <para> + cert9.db for certificates + </para> + </listitem> + <listitem> + <para> + key4.db for keys + </para> + </listitem> + <listitem> + <para> + pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory + </para> + </listitem> +</itemizedlist> + +<para>Because the SQLite databases are designed to be shared, these are the <emphasis>shared</emphasis> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</para> + +<para>By default, the tools (<command>certutil</command>, <command>pk12util</command>, <command>modutil</command>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <command>sql:</command> prefix with the given security directory. For example:</para> + +<programlisting>modutil -create -dbdir sql:/home/my/sharednssdb</programlisting> + +<para>To set the shared database type as the default type for the tools, set the <envar>NSS_DEFAULT_DB_TYPE</envar> environment variable to <envar>sql</envar>:</para> +<programlisting>export NSS_DEFAULT_DB_TYPE="sql"</programlisting> + +<para>This line can be added to the <filename>~/.bashrc</filename> file to make the change permanent for the user.</para> + +<para>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:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> +</itemizedlist> +<para>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> +</itemizedlist> +</refsection> + + <refsection id="seealso"> + <title>See Also</title> + <para>certutil (1)</para> + <para>pk12util (1)</para> + <para>signtool (1)</para> + + <para>The NSS wiki has information on the new database design and how to configure applications to use it.</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> +</itemizedlist> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/nroff/certutil.1 b/security/nss/doc/nroff/certutil.1 new file mode 100644 index 000000000..b2a8bd2bb --- /dev/null +++ b/security/nss/doc/nroff/certutil.1 @@ -0,0 +1,2050 @@ +'\" t +.\" Title: CERTUTIL +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 8 September 2016 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "CERTUTIL" "1" "8 September 2016" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +certutil \- Manage keys and certificate in both NSS databases and other NSS tokens +.SH "SYNOPSIS" +.HP \w'\fBcertutil\fR\ 'u +\fBcertutil\fR [\fIoptions\fR] [[\fIarguments\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 +The Certificate Database Tool, +\fBcertutil\fR, is a command\-line utility that can create and modify certificate and key databases\&. It can specifically list, generate, modify, or delete certificates, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database\&. +.PP +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 +\fBmodutil\fR +manpage\&. +.SH "COMMAND OPTIONS AND ARGUMENTS" +.PP +Running +\fBcertutil\fR +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 +\fB\-H\fR +will list all the command options and their relevant arguments\&. +.PP +\fBCommand Options\fR +.PP +\-A +.RS 4 +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\&. +.RE +.PP +\-B +.RS 4 +Run a series of commands from the specified batch file\&. This requires the +\fB\-i\fR +argument\&. +.RE +.PP +\-C +.RS 4 +Create a new binary certificate file from a binary certificate request file\&. Use the +\fB\-i\fR +argument to specify the certificate request file\&. If this argument is not used, +\fBcertutil\fR +prompts for a filename\&. +.RE +.PP +\-D +.RS 4 +Delete a certificate from the certificate database\&. +.RE +.PP +\-\-rename +.RS 4 +Change the database nickname of a certificate\&. +.RE +.PP +\-E +.RS 4 +Add an email certificate to the certificate database\&. +.RE +.PP +\-F +.RS 4 +Delete a private key from a key database\&. Specify the key to delete with the \-n argument\&. Specify the database from which to delete the key with the +\fB\-d\fR +argument\&. Use the +\fB\-k\fR +argument to specify explicitly whether to delete a DSA, RSA, or ECC key\&. If you don\*(Aqt use the +\fB\-k\fR +argument, the option looks for an RSA key matching the specified nickname\&. +.sp +When you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using \-D\&. Some smart cards do not let you remove a public key you have generated\&. In such a case, only the private key is deleted from the key pair\&. You can display the public key with the command certutil \-K \-h tokenname\&. +.RE +.PP +\-G +.RS 4 +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\&. +.RE +.PP +\-H +.RS 4 +Display a list of the command options and arguments\&. +.RE +.PP +\-K +.RS 4 +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)\&. +.RE +.PP +\-L +.RS 4 +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\&. +.RE +.PP +\-M +.RS 4 +Modify a certificate\*(Aqs trust attributes using the values of the \-t argument\&. +.RE +.PP +\-N +.RS 4 +Create new certificate and key databases\&. +.RE +.PP +\-O +.RS 4 +Print the certificate chain\&. +.RE +.PP +\-R +.RS 4 +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\&. +.RE +.PP +\-S +.RS 4 +Create an individual certificate and add it to a certificate database\&. +.RE +.PP +\-T +.RS 4 +Reset the key database or token\&. +.RE +.PP +\-U +.RS 4 +List all available modules or print a single named module\&. +.RE +.PP +\-V +.RS 4 +Check the validity of a certificate and its attributes\&. +.RE +.PP +\-W +.RS 4 +Change the password to a key database\&. +.RE +.PP +\-\-merge +.RS 4 +Merge two databases into one\&. +.RE +.PP +\-\-upgrade\-merge +.RS 4 +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)\&. +.RE +.PP +\fBArguments\fR +.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 +\-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, +\fIYYMMDDHHMMSSZ\fR, to close it\&. When specifying an offset time, use +\fIYYMMDDHHMMSS+HHMM\fR +or +\fIYYMMDDHHMMSS\-HHMM\fR +for adding or subtracting time, respectively\&. +.sp +If this option is not used, the validity check defaults to the current system time\&. +.RE +.PP +\-c issuer +.RS 4 +Identify the certificate of the CA from which a new certificate will derive its authenticity\&. Use the exact nickname or alias of the CA certificate, or use the CA\*(Aqs email address\&. Bracket the issuer string with quotation marks if it contains spaces\&. +.RE +.PP +\-d [prefix]directory +.RS 4 +Specify the database directory containing the certificate and key database files\&. +.sp +\fBcertutil\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)\&. +.sp +NSS recognizes the following prefixes: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBsql:\fR +requests the newer database +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.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 +is the default\&. +.RE +.PP +\-\-dump\-ext\-val OID +.RS 4 +For single cert, print binary DER encoding of extension OID\&. +.RE +.PP +\-e +.RS 4 +Check a certificate\*(Aqs signature during the process of validating a certificate\&. +.RE +.PP +\-\-email email\-address +.RS 4 +Specify the email address of a certificate to list\&. Used with the \-L command option\&. +.RE +.PP +\-\-extGeneric OID:critical\-flag:filename[,OID:critical\-flag:filename]\&.\&.\&. +.RS 4 +Add one or multiple extensions that certutil cannot encode yet, by loading their encodings from external files\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +OID (example): 1\&.2\&.3\&.4 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +critical\-flag: critical or not\-critical +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +filename: full path to a file containing an encoded extension +.RE +.RE +.PP +\-f password\-file +.RS 4 +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\&. +.RE +.PP +\-g keysize +.RS 4 +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\&. +.RE +.PP +\-h tokenname +.RS 4 +Specify the name of a token to use or act on\&. If not specified the default token is the internal database slot\&. +.RE +.PP +\-i input_file +.RS 4 +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\&. +.RE +.PP +\-k key\-type\-or\-id +.RS 4 +Specify the type or specific ID of a key\&. +.sp +The valid key type options are rsa, dsa, ec, or all\&. The default value is rsa\&. Specifying the type of key can avoid mistakes caused by duplicate nicknames\&. Giving a key type generates a new key pair; giving the ID of an existing key reuses that key pair (which is required to renew certificates)\&. +.RE +.PP +\-l +.RS 4 +Display detailed information when validating a certificate with the \-V option\&. +.RE +.PP +\-m serial\-number +.RS 4 +Assign a unique serial number to a certificate being created\&. This operation should be performed by a CA\&. If no serial number is provided a default serial number is made from the current time\&. Serial numbers are limited to integers +.RE +.PP +\-n nickname +.RS 4 +Specify the nickname of a certificate or key to list, create, add to a database, modify, or validate\&. Bracket the nickname string with quotation marks if it contains spaces\&. +.RE +.PP +\-o output\-file +.RS 4 +Specify the output file name for new certificates or binary certificate requests\&. Bracket the output\-file string with quotation marks if it contains spaces\&. If this argument is not used the output destination defaults to standard output\&. +.RE +.PP +\-P dbPrefix +.RS 4 +Specify the prefix used on the certificate and key database file\&. This argument is provided to support legacy servers\&. Most applications do not use a database prefix\&. +.RE +.PP +\-p phone +.RS 4 +Specify a contact telephone number to include in new certificates or certificate requests\&. Bracket this string with quotation marks if it contains spaces\&. +.RE +.PP +\-q pqgfile or curve\-name +.RS 4 +Read an alternate PQG value from the specified file when generating DSA key pairs\&. If this argument is not used, +\fBcertutil\fR +generates its own PQG value\&. PQG files are created with a separate DSA utility\&. +.sp +Elliptic curve name is one of the ones from nistp256, nistp384, nistp521, curve25519. +.sp +If a token is available that supports more curves, the foolowing curves are supported as well: sect163k1, nistk163, sect163r1, sect163r2, nistb163, sect193r1, sect193r2, sect233k1, nistk233, sect233r1, nistb233, sect239k1, sect283k1, nistk283, sect283r1, nistb283, sect409k1, nistk409, sect409r1, nistb409, sect571k1, nistk571, sect571r1, nistb571, secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, nistp192, secp224k1, secp224r1, nistp224, secp256k1, secp256r1, secp384r1, secp521r1, prime192v1, prime192v2, prime192v3, prime239v1, prime239v2, prime239v3, c2pnb163v1, c2pnb163v2, c2pnb163v3, c2pnb176v1, c2tnb191v1, c2tnb191v2, c2tnb191v3, c2pnb208w1, c2tnb239v1, c2tnb239v2, c2tnb239v3, c2pnb272w1, c2pnb304w1, c2tnb359w1, c2pnb368w1, c2tnb431r1, secp112r1, secp112r2, secp128r1, secp128r2, sect113r1, sect113r2, sect131r1, sect131r2 +.RE +.PP +\-r +.RS 4 +Display a certificate\*(Aqs binary DER encoding when listing information about that certificate with the \-L option\&. +.RE +.PP +\-s subject +.RS 4 +Identify a particular certificate owner for new certificates or certificate requests\&. Bracket this string with quotation marks if it contains spaces\&. The subject identification format follows RFC #1485\&. +.RE +.PP +\-t trustargs +.RS 4 +Specify the trust attributes to modify in an existing certificate or to apply to a certificate when creating it or adding it to a database\&. There are three available trust categories for each certificate, expressed in the order +\fISSL, email, object signing\fR +for each trust setting\&. In each category position, use none, any, or all of the attribute codes: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBp\fR +\- Valid peer +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBP\fR +\- Trusted peer (implies p) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBc\fR +\- Valid CA +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBC\fR +\- Trusted CA (implies c) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBT\fR +\- trusted CA for client authentication (ssl server only) +.RE +.sp +The attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks\&. For example: +.sp +\fB\-t "TC,C,T"\fR +.sp +Use the \-L option to see a list of the current certificates and trust attributes in a certificate database\&. +.sp +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\&. +.RE +.PP +\-u certusage +.RS 4 +Specify a usage context to apply when validating a certificate with the \-V option\&. +.sp +The contexts are the following: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBC\fR +(as an SSL client) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBV\fR +(as an SSL server) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBL\fR +(as an SSL CA) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBA\fR +(as Any CA) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBY\fR +(Verify CA) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBS\fR +(as an email signer) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBR\fR +(as an email recipient) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBO\fR +(as an OCSP status responder) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBJ\fR +(as an object signer) +.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 +.PP +\-w offset\-months +.RS 4 +Set an offset from the current system time, in months, for the beginning of a certificate\*(Aqs validity period\&. Use when creating the certificate or adding it to a database\&. Express the offset in integers, using a minus sign (\-) to indicate a negative offset\&. If this argument is not used, the validity period begins at the current system time\&. The length of the validity period is set with the \-v argument\&. +.RE +.PP +\-X +.RS 4 +Force the key and certificate database to open in read\-write mode\&. This is used with the +\fB\-U\fR +and +\fB\-L\fR +command options\&. +.RE +.PP +\-x +.RS 4 +Use +\fBcertutil\fR +to generate the signature for a certificate being created or added to a database, rather than obtaining a signature from a separate CA\&. +.RE +.PP +\-y exp +.RS 4 +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\&. +.RE +.PP +\-z noise\-file +.RS 4 +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\&. +.RE +.PP +\-Z hashAlg +.RS 4 +Specify the hash algorithm to use with the \-C, \-S or \-R command options\&. Possible keywords: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +MD2 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +MD4 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +MD5 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SHA1 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SHA224 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SHA256 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SHA384 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SHA512 +.RE +.RE +.PP +\-0 SSO_password +.RS 4 +Set a site security officer password on a token\&. +.RE +.PP +\-1 | \-\-keyUsage keyword,keyword +.RS 4 +Set an X\&.509 V3 Certificate Type Extension in the certificate\&. There are several available keywords: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +digitalSignature +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +nonRepudiation +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +keyEncipherment +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +dataEncipherment +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +keyAgreement +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +certSigning +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +crlSigning +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +critical +.RE +.RE +.PP +\-2 +.RS 4 +Add a basic constraint extension to a certificate that is being created or added to a database\&. This extension supports the certificate chain verification process\&. +\fBcertutil\fR +prompts for the certificate constraint extension to select\&. +.sp +X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-3 +.RS 4 +Add an authority key ID extension to a certificate that is being created or added to a database\&. This extension supports the identification of a particular certificate, from among multiple certificates associated with one subject name, as the correct issuer of a certificate\&. The Certificate Database Tool will prompt you to select the authority key ID extension\&. +.sp +X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-4 +.RS 4 +Add a CRL distribution point extension to a certificate that is being created or added to a database\&. This extension identifies the URL of a certificate\*(Aqs associated certificate revocation list (CRL)\&. +\fBcertutil\fR +prompts for the URL\&. +.sp +X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-5 | \-\-nsCertType keyword,keyword +.RS 4 +Add an X\&.509 V3 certificate type extension to a certificate that is being created or added to the database\&. There are several available keywords: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +sslClient +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +sslServer +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +smime +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +objectSigning +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +sslCA +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +smimeCA +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +objectSigningCA +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +critical +.RE +.sp +X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-6 | \-\-extKeyUsage keyword,keyword +.RS 4 +Add an extended key usage extension to a certificate that is being created or added to the database\&. Several keywords are available: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +serverAuth +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +clientAuth +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +codeSigning +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +emailProtection +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +timeStamp +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ocspResponder +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +stepUp +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +msTrustListSign +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +critical +.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 +\-8 dns\-names +.RS 4 +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\&. +.RE +.PP +\-\-extAIA +.RS 4 +Add the Authority Information Access extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extSIA +.RS 4 +Add the Subject Information Access extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extCP +.RS 4 +Add the Certificate Policies extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extPM +.RS 4 +Add the Policy Mappings extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extPC +.RS 4 +Add the Policy Constraints extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extIA +.RS 4 +Add the Inhibit Any Policy Access extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extSKID +.RS 4 +Add the Subject Key ID extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extNC +.RS 4 +Add a Name Constraint extension to the certificate\&. X\&.509 certificate extensions are described in RFC 5280\&. +.RE +.PP +\-\-extSAN type:name[,type:name]\&.\&.\&. +.RS 4 +Create a Subject Alt Name extension with one or multiple names\&. +.sp +\-type: directory, dn, dns, edi, ediparty, email, ip, ipaddr, other, registerid, rfc822, uri, x400, x400addr +.RE +.PP +\-\-empty\-password +.RS 4 +Use empty password when creating new certificate database with \-N\&. +.RE +.PP +\-\-keyAttrFlags attrflags +.RS 4 +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} +.RE +.PP +\-\-keyOpFlagsOn opflags, \-\-keyOpFlagsOff opflags +.RS 4 +PKCS #11 key Operation Flags\&. Comma separated list of one or more of the following: {token | session} {public | private} {sensitive | insensitive} {modifiable | unmodifiable} {extractable | unextractable} +.RE +.PP +\-\-new\-n nickname +.RS 4 +A new nickname, used when renaming a certificate\&. +.RE +.PP +\-\-source\-dir certdir +.RS 4 +Identify the certificate database directory to upgrade\&. +.RE +.PP +\-\-source\-prefix certdir +.RS 4 +Give the prefix of the certificate and key databases to upgrade\&. +.RE +.PP +\-\-upgrade\-id uniqueID +.RS 4 +Give the unique ID of the database to upgrade\&. +.RE +.PP +\-\-upgrade\-token\-name name +.RS 4 +Set the name of the token to use while it is being upgraded\&. +.RE +.PP +\-@ pwfile +.RS 4 +Give the name of a password file to use for the database being upgraded\&. +.RE +.SH "USAGE AND EXAMPLES" +.PP +Most of the command options in the examples listed here have more arguments available\&. The arguments included in these examples are the most common ones or are used to illustrate a specific scenario\&. Use the +\fB\-H\fR +option to show the complete list of arguments for each command option\&. +.PP +\fBCreating New Security Databases\fR +.PP +Certificates, keys, and security modules related to managing certificates are stored in three related databases: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert8\&.db or cert9\&.db +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key3\&.db or key4\&.db +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +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 +.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] +.fi +.if n \{\ +.RE +.\} +.PP +The +\fB\-R\fR +command options requires four arguments: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-k\fR +to specify either the key type to generate or, when renewing a certificate, the existing key pair to use +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-g\fR +to set the keysize of the key to generate +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-s\fR +to set the subject name of the certificate +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-d\fR +to give the security database directory +.RE +.PP +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 + +Generating key\&. This may take a few moments\&.\&.\&. + +.fi +.if n \{\ +.RE +.\} +.PP +\fBCreating a Certificate\fR +.PP +A valid certificate must be issued by a trusted CA\&. This can be done by specifying a CA certificate (\fB\-c\fR) that is stored in the certificate database\&. If a CA key pair is not available, you can create a self\-signed certificate using the +\fB\-x\fR +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] +.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\&. +.PP +For example, this creates a self\-signed certificate: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ certutil \-S \-s "CN=Example CA" \-n my\-ca\-cert \-x \-t "C,C,C" \-1 \-2 \-5 \-m 3650 +.fi +.if n \{\ +.RE +.\} +.PP +The interative prompts for key usage and whether any extensions are critical and responses have been ommitted for brevity\&. +.PP +From there, new certificates can reference the self\-signed certificate: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ certutil \-S \-s "CN=My Server Cert" \-n my\-server\-cert \-c "my\-ca\-cert" \-t ",," \-1 \-5 \-6 \-8 \-m 730 +.fi +.if n \{\ +.RE +.\} +.PP +\fBGenerating a Certificate from a Certificate Request\fR +.PP +When a certificate request is created, a certificate can be generated by using the request and then referencing a certificate authority signing certificate (the +\fIissuer\fR +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] +.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 +.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 + +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 +.fi +.if n \{\ +.RE +.\} +.PP +Using additional arguments with +\fB\-L\fR +can return and print the information for a single, specific certificate\&. For example, the +\fB\-n\fR +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 +\-\-\-\-\-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\-\-\-\-\- +.fi +.if n \{\ +.RE +.\} +.PP +For a human\-readable display +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ certutil \-L \-d sql:$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 + Not After : Thu Jun 13 19:10:29 2013 + Subject: "CN=Example CA" + Subject Public Key Info: + Public Key Algorithm: PKCS #1 RSA Encryption + RSA Public Key: + Modulus: + 9e:0a:ce:ab:f3:27:20:55:80:5a:83:5d:16:12:c9:30: + 4d:c3:50:eb:c5:45:3f:dc:6b:d6:03:f9:e0:8c:0c:07: + 12:fd:02:ba:5f:fa:b0:ef:e0:b0:2b:e7:00:11:e2:1f: + ab:a7:9e:ce:b1:5d:1c:cf:39:19:42:d9:66:37:82:49: + 3b:be:69:6c:2e:f6:29:c9:e7:0d:6b:30:22:fc:d0:30: + 56:75:3f:eb:a1:ce:b1:aa:15:15:61:3e:80:14:28:f7: + d5:2b:37:6c:a4:d0:18:8a:fc:63:05:94:b9:b9:75:74: + 11:3a:00:3d:64:a2:b2:15:d2:34:2c:85:ed:7f:a4:9b + Exponent: 65537 (0x10001) + Signed Extensions: + Name: Certificate Type + Data: none + + Name: Certificate Basic Constraints + Data: Is a CA with no maximum path length\&. + + Name: Certificate Key Usage + Critical: True + Usages: Certificate Signing + + Signature Algorithm: PKCS #1 SHA\-1 With RSA Encryption + Signature: + 3a:72:19:33:90:00:8d:db:cd:5d:d6:32:8c:ad:cf:91: + 1c:6d:94:31:a4:32:c6:2b:5e:68:b5:59:3b:e4:68:d6: + 79:d1:52:fb:1e:0d:fd:3d:5c:a6:05:c0:f3:09:8d:60: + a2:85:59:2e:e9:bc:3f:8a:16:5f:b8:c1:e1:c4:ad:b6: + 36:e7:ba:8a:73:50:e9:e0:ee:ed:69:ab:a8:bf:33:de: + 25:2b:43:0c:6c:f9:68:85:a1:bd:ab:6f:c5:d1:55:52: + 64:cd:77:57:c6:59:38:ba:8d:d4:b4:db:f0:f2:c0:33: + ee:c5:83:ef:5a:b1:29:a2:07:53:9a:b8:f7:38:a3:7e + Fingerprint (MD5): + 86:D8:A5:8B:8A:26:BE:9E:17:A8:7B:66:10:6B:27:80 + Fingerprint (SHA1): + 48:78:09:EF:C5:D4:0C:BD:D2:64:45:59:EB:03:13:15:F7:A9:D6:F7 + + Certificate Trust Flags: + SSL Flags: + Valid CA + Trusted CA + User + Email Flags: + Valid CA + Trusted CA + User + Object Signing Flags: + Valid CA + Trusted CA + User + +.fi +.if n \{\ +.RE +.\} +.PP +\fBListing Keys\fR +.PP +Keys are the original material used to encrypt certificate data\&. The keys generated for certificates are stored separately, in the key database\&. +.PP +To list all keys in the database, use the +\fB\-K\fR +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: 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 +.\} +.PP +There are ways to narrow the keys listed in the search results: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +To return a specific key, use the +\fB\-n\fR\fIname\fR +argument with the name of the key\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If there are multiple security devices loaded, then the +\fB\-h\fR\fItokenname\fR +argument can search a specific token or all tokens\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +If there are multiple key types available, then the +\fB\-k\fR\fIkey\-type\fR +argument can search a specific type of key, like RSA, DSA, or ECC\&. +.RE +.PP +\fBListing Security Modules\fR +.PP +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 +\fB\-U\fR +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 + + slot: NSS User Private Key and Certificate Services + token: NSS Certificate DB + + slot: NSS Internal Cryptographic Services + token: NSS Generic Crypto Services +.fi +.if n \{\ +.RE +.\} +.PP +\fBAdding Certificates to the Database\fR +.PP +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] +.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 +.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 +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 +.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" +.fi +.if n \{\ +.RE +.\} +.PP +For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ certutil \-D \-d sql:/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 +.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 +.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 +.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" +.fi +.if n \{\ +.RE +.\} +.PP +\fBPrinting the Certificate Chain\fR +.PP +Certificates can be issued in +\fIchains\fR +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" +"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 +.\} +.PP +\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 +.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 +.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 +\fB\-\-upgrade\-merge\fR +command option or existing databases can be merged with the new +cert9\&.db +databases using the +\fB\-\-\-merge\fR +command\&. +.PP +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] +.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 +.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] +.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\- +.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 +\fB\-B\fR +command option\&. The only argument for this specifies the input file\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ certutil \-B \-i /path/to/batch\-file +.fi +.if n \{\ +.RE +.\} +.SH "NSS DATABASE TYPES" +.PP +NSS originally used BerkeleyDB databases to store security information\&. The last versions of these +\fIlegacy\fR +databases are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert8\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key3\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +secmod\&.db for PKCS #11 module information +.RE +.PP +BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously\&. NSS has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues\&. Still, NSS requires more flexibility to provide a truly shared security database\&. +.PP +In 2009, NSS introduced a new set of databases that are SQLite databases rather than BerkeleyDB\&. These new databases provide more accessibility and performance: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert9\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key4\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +pkcs11\&.txt, a listing of all of the PKCS #11 modules, contained in a new subdirectory in the security databases directory +.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 +prefix with the given security directory\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ certutil \-L \-d sql:/home/my/sharednssdb +.fi +.if n \{\ +.RE +.\} +.PP +To set the shared database type as the default type for the tools, set the +\fBNSS_DEFAULT_DB_TYPE\fR +environment variable to +\fBsql\fR: +.sp +.if n \{\ +.RS 4 +.\} +.nf +export NSS_DEFAULT_DB_TYPE="sql" +.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 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.PP +For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "SEE ALSO" +.PP +pk12util (1) +.PP +modutil (1) +.PP +\fBcertutil\fR +has arguments or operations that use features defined in several IETF RFCs\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +http://tools\&.ietf\&.org/html/rfc5280 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +http://tools\&.ietf\&.org/html/rfc1113 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +http://tools\&.ietf\&.org/html/rfc1485 +.RE +.PP +The NSS wiki has information on the new database design and how to configure applications to use it\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/cmsutil.1 b/security/nss/doc/nroff/cmsutil.1 new file mode 100644 index 000000000..9c0bb48e9 --- /dev/null +++ b/security/nss/doc/nroff/cmsutil.1 @@ -0,0 +1,271 @@ +'\" t +.\" Title: CMSUTIL +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "CMSUTIL" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +cmsutil \- Performs basic cryptograpic operations, such as encryption and decryption, on Cryptographic Message Syntax (CMS) messages\&. +.SH "SYNOPSIS" +.HP \w'\fBcmsutil\fR\ 'u +\fBcmsutil\fR [\fIoptions\fR] [[\fIarguments\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 +The +\fBcmsutil\fR +command\-line uses the S/MIME Toolkit to perform basic operations, such as encryption and decryption, on Cryptographic Message Syntax (CMS) messages\&. +.PP +To run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section\&. Each command takes one option\&. Each option may take zero or more arguments\&. To see a usage string, issue the command without options\&. +.SH "OPTIONS AND ARGUMENTS" +.PP +.PP +\fBOptions\fR +.PP +Options specify an action\&. Option arguments modify an action\&. The options and arguments for the cmsutil command are defined as follows: +.PP +\-C +.RS 4 +Encrypt a message\&. +.RE +.PP +\-D +.RS 4 +Decode a message\&. +.RE +.PP +\-E +.RS 4 +Envelope a message\&. +.RE +.PP +\-O +.RS 4 +Create a certificates\-only message\&. +.RE +.PP +\-S +.RS 4 +Sign a message\&. +.RE +.PP +\fBArguments\fR +.PP +Option arguments modify an action\&. +.PP +\-b +.RS 4 +Decode a batch of files named in infile\&. +.RE +.PP +\-c content +.RS 4 +Use this detached content (decode only)\&. +.RE +.PP +\-d dbdir +.RS 4 +Specify the key/certificate database directory (default is "\&.") +.RE +.PP +\-e envfile +.RS 4 +Specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message\&. If this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only)\&. +.RE +.PP +\-f pwfile +.RS 4 +Use password file to set password on all PKCS#11 tokens\&. +.RE +.PP +\-G +.RS 4 +Include a signing time attribute (sign only)\&. +.RE +.PP +\-H hash +.RS 4 +Use specified hash algorithm (default:SHA1)\&. +.RE +.PP +\-h num +.RS 4 +Generate email headers with info about CMS message (decode only)\&. +.RE +.PP +\-i infile +.RS 4 +Use infile as a source of data (default is stdin)\&. +.RE +.PP +\-k +.RS 4 +Keep decoded encryption certs in permanent cert db\&. +.RE +.PP +\-N nickname +.RS 4 +Specify nickname of certificate to sign with (sign only)\&. +.RE +.PP +\-n +.RS 4 +Suppress output of contents (decode only)\&. +.RE +.PP +\-o outfile +.RS 4 +Use outfile as a destination of data (default is stdout)\&. +.RE +.PP +\-P +.RS 4 +Include an S/MIME capabilities attribute\&. +.RE +.PP +\-p password +.RS 4 +Use password as key database password\&. +.RE +.PP +\-r recipient1,recipient2, \&.\&.\&. +.RS 4 +Specify list of recipients (email addresses) for an encrypted or enveloped message\&. For certificates\-only message, list of certificates to send\&. +.RE +.PP +\-T +.RS 4 +Suppress content in CMS message (sign only)\&. +.RE +.PP +\-u certusage +.RS 4 +Set type of cert usage (default is certUsageEmailSigner)\&. +.RE +.PP +\-v +.RS 4 +Print debugging information\&. +.RE +.PP +\-Y ekprefnick +.RS 4 +Specify an encryption key preference by nickname\&. +.RE +.SH "USAGE" +.PP +Encrypt Example +.sp +.if n \{\ +.RS 4 +.\} +.nf +cmsutil \-C [\-i infile] [\-o outfile] [\-d dbdir] [\-p password] \-r "recipient1,recipient2, \&. \&. \&." \-e envfile + +.fi +.if n \{\ +.RE +.\} +.PP +Decode Example +.sp +.if n \{\ +.RS 4 +.\} +.nf +cmsutil \-D [\-i infile] [\-o outfile] [\-d dbdir] [\-p password] [\-c content] [\-n] [\-h num] + +.fi +.if n \{\ +.RE +.\} +.PP +Envelope Example +.sp +.if n \{\ +.RS 4 +.\} +.nf +cmsutil \-E [\-i infile] [\-o outfile] [\-d dbdir] [\-p password] \-r "recipient1,recipient2, \&.\&.\&." + +.fi +.if n \{\ +.RE +.\} +.PP +Certificate\-only Example +.sp +.if n \{\ +.RS 4 +.\} +.nf +cmsutil \-O [\-i infile] [\-o outfile] [\-d dbdir] [\-p password] \-r "cert1,cert2, \&. \&. \&." + +.fi +.if n \{\ +.RE +.\} +.PP +Sign Message Example +.sp +.if n \{\ +.RS 4 +.\} +.nf +cmsutil \-S [\-i infile] [\-o outfile] [\-d dbdir] [\-p password] \-N nickname[\-TGP] [\-Y ekprefnick] + +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.PP +certutil(1) +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/crlutil.1 b/security/nss/doc/nroff/crlutil.1 new file mode 100644 index 000000000..866bdedb0 --- /dev/null +++ b/security/nss/doc/nroff/crlutil.1 @@ -0,0 +1,389 @@ +'\" t +.\" Title: CRLUTIL +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "CRLUTIL" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +crlutil \- List, generate, modify, or delete CRLs within the NSS security database file(s) and list, create, modify or delete certificates entries in a particular CRL\&. +.SH "SYNOPSIS" +.HP \w'\fBcrlutil\fR\ 'u +\fBcrlutil\fR [\fIoptions\fR] [[\fIarguments\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 +The Certificate Revocation List (CRL) Management Tool, +\fBcrlutil\fR, is a command\-line utility that can list, generate, modify, or delete CRLs within the NSS security database file(s) and list, create, modify or delete certificates entries in a particular CRL\&. +.PP +The key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation\&. +.PP +This document discusses certificate revocation list management\&. For information on security module database management, see Using the Security Module Database Tool\&. For information on certificate and key database management, see Using the Certificate Database Tool\&. +.PP +To run the Certificate Revocation List Management Tool, type the command +.PP +crlutil option [arguments] +.PP +where options and arguments are combinations of the options and arguments listed in the following section\&. Each command takes one option\&. Each option may take zero or more arguments\&. To see a usage string, issue the command without options, or with the \-H option\&. +.SH "OPTIONS AND ARGUMENTS" +.PP +.PP +\fBOptions\fR +.PP +Options specify an action\&. Option arguments modify an action\&. The options and arguments for the crlutil command are defined as follows: +.PP +\-D +.RS 4 +Delete Certificate Revocation List from cert database\&. +.RE +.PP +\-E +.RS 4 +Erase all CRLs of specified type from the cert database +.RE +.PP +\-G +.RS 4 +Create new Certificate Revocation List (CRL)\&. +.RE +.PP +\-I +.RS 4 +Import a CRL to the cert database +.RE +.PP +\-L +.RS 4 +List existing CRL located in cert database file\&. +.RE +.PP +\-M +.RS 4 +Modify existing CRL which can be located in cert db or in arbitrary file\&. If located in file it should be encoded in ASN\&.1 encode format\&. +.RE +.PP +\-S +.RS 4 +Show contents of a CRL file which isn\*(Aqt stored in the database\&. +.RE +.PP +\fBArguments\fR +.PP +Option arguments modify an action\&. +.PP +\-a +.RS 4 +Use ASCII format or allow the use of ASCII format for input and output\&. This formatting follows RFC #1113\&. +.RE +.PP +\-B +.RS 4 +Bypass CA signature checks\&. +.RE +.PP +\-c crl\-gen\-file +.RS 4 +Specify script file that will be used to control crl generation/modification\&. See crl\-cript\-file format below\&. If options \-M|\-G is used and \-c crl\-script\-file is not specified, crlutil will read script data from standard input\&. +.RE +.PP +\-d directory +.RS 4 +Specify the database directory containing the certificate and key database files\&. On Unix the Certificate Database Tool defaults to $HOME/\&.netscape (that is, ~/\&.netscape)\&. On Windows NT the default is the current directory\&. +.sp +The NSS database files must reside in the same directory\&. +.RE +.PP +\-f password\-file +.RS 4 +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\&. +.RE +.PP +\-i crl\-file +.RS 4 +Specify the file which contains the CRL to import or show\&. +.RE +.PP +\-l algorithm\-name +.RS 4 +Specify a specific signature algorithm\&. List of possible algorithms: MD2 | MD4 | MD5 | SHA1 | SHA256 | SHA384 | SHA512 +.RE +.PP +\-n nickname +.RS 4 +Specify the nickname of a certificate or key to list, create, add to a database, modify, or validate\&. Bracket the nickname string with quotation marks if it contains spaces\&. +.RE +.PP +\-o output\-file +.RS 4 +Specify the output file name for new CRL\&. Bracket the output\-file string with quotation marks if it contains spaces\&. If this argument is not used the output destination defaults to standard output\&. +.RE +.PP +\-P dbprefix +.RS 4 +Specify the prefix used on the NSS security database files (for example, my_cert8\&.db and my_key3\&.db)\&. This option is provided as a special case\&. Changing the names of the certificate and key databases is not recommended\&. +.RE +.PP +\-t crl\-type +.RS 4 +Specify type of CRL\&. possible types are: 0 \- SEC_KRL_TYPE, 1 \- SEC_CRL_TYPE\&. This option is obsolete +.RE +.PP +\-u url +.RS 4 +Specify the url\&. +.RE +.PP +\-w pwd\-string +.RS 4 +Provide db password in command line\&. +.RE +.PP +\-Z algorithm +.RS 4 +Specify the hash algorithm to use for signing the CRL\&. +.RE +.SH "CRL GENERATION SCRIPT SYNTAX" +.PP +CRL generation script file has the following syntax: +.PP +* Line with comments should have # as a first symbol of a line +.PP +* Set "this update" or "next update" CRL fields: +.PP +update=YYYYMMDDhhmmssZ nextupdate=YYYYMMDDhhmmssZ +.PP +Field "next update" is optional\&. Time should be in GeneralizedTime format (YYYYMMDDhhmmssZ)\&. For example: 20050204153000Z +.PP +* Add an extension to a CRL or a crl certificate entry: +.PP +addext extension\-name critical/non\-critical [arg1[arg2 \&.\&.\&.]] +.PP +Where: +.PP +extension\-name: string value of a name of known extensions\&. critical/non\-critical: is 1 when extension is critical and 0 otherwise\&. arg1, arg2: specific to extension type extension parameters +.PP +addext uses the range that was set earlier by addcert and will install an extension to every cert entries within the range\&. +.PP +* Add certificate entries(s) to CRL: +.PP +addcert range date +.PP +range: two integer values separated by dash: range of certificates that will be added by this command\&. dash is used as a delimiter\&. Only one cert will be added if there is no delimiter\&. date: revocation date of a cert\&. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ)\&. +.PP +* Remove certificate entry(s) from CRL +.PP +rmcert range +.PP +Where: +.PP +range: two integer values separated by dash: range of certificates that will be added by this command\&. dash is used as a delimiter\&. Only one cert will be added if there is no delimiter\&. +.PP +* Change range of certificate entry(s) in CRL +.PP +range new\-range +.PP +Where: +.PP +new\-range: two integer values separated by dash: range of certificates that will be added by this command\&. dash is used as a delimiter\&. Only one cert will be added if there is no delimiter\&. +.PP +Implemented Extensions +.PP +The extensions defined for CRL provide methods for associating additional attributes with CRLs of theirs entries\&. For more information see RFC #3280 +.PP +* Add The Authority Key Identifier extension: +.PP +The authority key identifier extension provides a means of identifying the public key corresponding to the private key used to sign a CRL\&. +.PP +authKeyId critical [key\-id | dn cert\-serial] +.PP +Where: +.PP +authKeyIdent: identifies the name of an extension critical: value of 1 of 0\&. Should be set to 1 if this extension is critical or 0 otherwise\&. key\-id: key identifier represented in octet string\&. dn:: is a CA distinguished name cert\-serial: authority certificate serial number\&. +.PP +* Add Issuer Alternative Name extension: +.PP +The issuer alternative names extension allows additional identities to be associated with the issuer of the CRL\&. Defined options include an rfc822 name (electronic mail address), a DNS name, an IP address, and a URI\&. +.PP +issuerAltNames non\-critical name\-list +.PP +Where: +.PP +subjAltNames: identifies the name of an extension should be set to 0 since this is non\-critical extension name\-list: comma separated list of names +.PP +* Add CRL Number extension: +.PP +The CRL number is a non\-critical CRL extension which conveys a monotonically increasing sequence number for a given CRL scope and CRL issuer\&. This extension allows users to easily determine when a particular CRL supersedes another CRL +.PP +crlNumber non\-critical number +.PP +Where: +.PP +crlNumber: identifies the name of an extension critical: should be set to 0 since this is non\-critical extension number: value of long which identifies the sequential number of a CRL\&. +.PP +* Add Revocation Reason Code extension: +.PP +The reasonCode is a non\-critical CRL entry extension that identifies the reason for the certificate revocation\&. +.PP +reasonCode non\-critical code +.PP +Where: +.PP +reasonCode: identifies the name of an extension non\-critical: should be set to 0 since this is non\-critical extension code: the following codes are available: +.PP +unspecified (0), keyCompromise (1), cACompromise (2), affiliationChanged (3), superseded (4), cessationOfOperation (5), certificateHold (6), removeFromCRL (8), privilegeWithdrawn (9), aACompromise (10) +.PP +* Add Invalidity Date extension: +.PP +The invalidity date is a non\-critical CRL entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid\&. +.PP +invalidityDate non\-critical date +.PP +Where: +.PP +crlNumber: identifies the name of an extension non\-critical: should be set to 0 since this is non\-critical extension date: invalidity date of a cert\&. Date should be represented in GeneralizedTime format (YYYYMMDDhhmmssZ)\&. +.SH "USAGE" +.PP +The Certificate Revocation List Management Tool\*(Aqs capabilities are grouped as follows, using these combinations of options and arguments\&. Options and arguments in square brackets are optional, those without square brackets are required\&. +.PP +See "Implemented extensions" for more information regarding extensions and their parameters\&. +.PP +* Creating or modifying a CRL: +.sp +.if n \{\ +.RS 4 +.\} +.nf +crlutil \-G|\-M \-c crl\-gen\-file \-n nickname [\-i crl] [\-u url] [\-d keydir] [\-P dbprefix] [\-l alg] [\-a] [\-B] + +.fi +.if n \{\ +.RE +.\} +.PP +* Listing all CRls or a named CRL: +.sp +.if n \{\ +.RS 4 +.\} +.nf + crlutil \-L [\-n crl\-name] [\-d krydir] + +.fi +.if n \{\ +.RE +.\} +.PP +* Deleting CRL from db: +.sp +.if n \{\ +.RS 4 +.\} +.nf + crlutil \-D \-n nickname [\-d keydir] [\-P dbprefix] + +.fi +.if n \{\ +.RE +.\} +.PP +* Erasing CRLs from db: +.sp +.if n \{\ +.RS 4 +.\} +.nf + crlutil \-E [\-d keydir] [\-P dbprefix] + +.fi +.if n \{\ +.RE +.\} +.PP +* Deleting CRL from db: +.sp +.if n \{\ +.RS 4 +.\} +.nf + crlutil \-D \-n nickname [\-d keydir] [\-P dbprefix] + +.fi +.if n \{\ +.RE +.\} +.PP +* Erasing CRLs from db: +.sp +.if n \{\ +.RS 4 +.\} +.nf + crlutil \-E [\-d keydir] [\-P dbprefix] + +.fi +.if n \{\ +.RE +.\} +.PP +* Import CRL from file: +.sp +.if n \{\ +.RS 4 +.\} +.nf + crlutil \-I \-i crl [\-t crlType] [\-u url] [\-d keydir] [\-P dbprefix] [\-B] + +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.PP +certutil(1) +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/derdump.1 b/security/nss/doc/nroff/derdump.1 new file mode 100644 index 000000000..56b07cc21 --- /dev/null +++ b/security/nss/doc/nroff/derdump.1 @@ -0,0 +1,92 @@ +'\" t +.\" Title: DERDUMP +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/> +.\" Date: 15 February 2013 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "DERDUMP" "1" "15 February 2013" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +derdump_ \- Dumps C\-sequence strings from a DER encoded certificate file +.SH "SYNOPSIS" +.HP \w'\fBderdump\fR\ 'u +\fBderdump\fR [\fB\-r\fR] [\fB\-i\ \fR\fB\fIinput\-file\fR\fR] [\fB\-o\ \fR\fB\fIoutput\-file\fR\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 +\fBderdump \fRdumps C\-sequence strings from a DER encode certificate file +.SH "OPTIONS" +.PP +\fB\-r \fR +.RS 4 +For formatted items, dump raw bytes as well +.RE +.PP +\fB\-i \fR \fIDER encoded file\fR +.RS 4 +Define an input file to use (default is stdin) +.RE +.PP +\fB\-o \fR \fIoutput file\fR +.RS 4 +Define an output file to use (default is stdout)\&. +.RE +.SH "ADDITIONAL RESOURCES" +.PP +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 +\m[blue]\fBPKI Wiki\fR\m[]\&\s-2\u[2]\d\s+2\&. +.PP +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\&. +.PP +Authors: Gerhardus Geldenhuis <gerhardus\&.geldenhuis@gmail\&.com>\&. Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com> +.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\&. +.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 +.RS 4 +\%http://pki.fedoraproject.org/wiki/ +.RE +.IP " 3." 4 +Mozilla NSS site +.RS 4 +\%http://www.mozilla.org/projects/security/pki/nss/ +.RE diff --git a/security/nss/doc/nroff/modutil.1 b/security/nss/doc/nroff/modutil.1 new file mode 100644 index 000000000..1ce9ab2ce --- /dev/null +++ b/security/nss/doc/nroff/modutil.1 @@ -0,0 +1,1452 @@ +'\" t +.\" Title: MODUTIL +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "MODUTIL" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +modutil \- Manage PKCS #11 module information within the security module database\&. +.SH "SYNOPSIS" +.HP \w'\fBmodutil\fR\ 'u +\fBmodutil\fR [\fIoptions\fR] [[\fIarguments\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 +The Security Module Database Tool, +\fBmodutil\fR, is a command\-line utility for managing PKCS #11 module information both within +secmod\&.db +files and within hardware tokens\&. +\fBmodutil\fR +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\&. +.PP +The tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases\&. +.SH "OPTIONS" +.PP +Running +\fBmodutil\fR +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\&. +.PP +\fBOptions\fR +.PP +\-add modulename +.RS 4 +Add the named PKCS #11 module to the database\&. Use this option with the +\fB\-libfile\fR, +\fB\-ciphers\fR, and +\fB\-mechanisms\fR +arguments\&. +.RE +.PP +\-changepw tokenname +.RS 4 +Change the password on the named token\&. If the token has not been initialized, this option initializes the password\&. Use this option with the +\fB\-pwfile\fR +and +\fB\-newpwfile\fR +arguments\&. A +\fIpassword\fR +is equivalent to a personal identification number (PIN)\&. +.RE +.PP +\-chkfips +.RS 4 +Verify whether the module is in the given FIPS mode\&. +\fBtrue\fR +means to verify that the module is in FIPS mode, while +\fBfalse\fR +means to verify that the module is not in FIPS mode\&. +.RE +.PP +\-create +.RS 4 +Create new certificate, key, and module databases\&. Use the +\fB\-dbdir\fR +directory argument to specify a directory\&. If any of these databases already exist in a specified directory, +\fBmodutil\fR +returns an error message\&. +.RE +.PP +\-default modulename +.RS 4 +Specify the security mechanisms for which the named module will be a default provider\&. The security mechanisms are specified with the +\fB\-mechanisms\fR +argument\&. +.RE +.PP +\-delete modulename +.RS 4 +Delete the named module\&. The default NSS PKCS #11 module cannot be deleted\&. +.RE +.PP +\-disable modulename +.RS 4 +Disable all slots on the named module\&. Use the +\fB\-slot\fR +argument to disable a specific slot\&. +.sp +The internal NSS PKCS #11 module cannot be disabled\&. +.RE +.PP +\-enable modulename +.RS 4 +Enable all slots on the named module\&. Use the +\fB\-slot\fR +argument to enable a specific slot\&. +.RE +.PP +\-fips [true | false] +.RS 4 +Enable (true) or disable (false) FIPS 140\-2 compliance for the default NSS module\&. +.RE +.PP +\-force +.RS 4 +Disable +\fBmodutil\fR\*(Aqs 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\&. +.RE +.PP +\-jar JAR\-file +.RS 4 +Add a new PKCS #11 module to the database using the named JAR file\&. Use this command with the +\fB\-installdir\fR +and +\fB\-tempdir\fR +arguments\&. The JAR file uses the NSS PKCS #11 JAR format to identify all the files to be installed, the module\*(Aqs 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 +\fBmodutil\fR\&. +.RE +.PP +\-list [modulename] +.RS 4 +Display basic information about the contents of the +secmod\&.db +file\&. Specifying a +\fImodulename\fR +displays detailed information about a particular module and its slots and tokens\&. +.RE +.PP +\-rawadd +.RS 4 +Add the module spec string to the +secmod\&.db +database\&. +.RE +.PP +\-rawlist +.RS 4 +Display the module specs for a specified module or for all loadable modules\&. +.RE +.PP +\-undefault modulename +.RS 4 +Specify the security mechanisms for which the named module will not be a default provider\&. The security mechanisms are specified with the +\fB\-mechanisms\fR +argument\&. +.RE +.PP +\fBArguments\fR +.PP +MODULE +.RS 4 +Give the security module to access\&. +.RE +.PP +MODULESPEC +.RS 4 +Give the security module spec to load into the security database\&. +.RE +.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 +.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, +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\&. +.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\&. +.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 +.PP +\-libfile library\-file +.RS 4 +Specify a path to a library file containing the implementation of the PKCS #11 interface module that is being added to the database\&. +.RE +.PP +\-mechanisms mechanism\-list +.RS 4 +Specify the security mechanisms for which a particular module will be flagged as a default provider\&. The +\fImechanism\-list\fR +is a colon\-delimited list of mechanism names\&. Enclose this list in quotation marks if it contains spaces\&. +.sp +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\*(Aqs default provider, that mechanism\*(Aqs default provider is undefined\&. +.sp +\fBmodutil\fR +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)\&. +.RE +.PP +\-newpwfile new\-password\-file +.RS 4 +Specify a text file containing a token\*(Aqs new or replacement password so that a password can be entered automatically with the +\fB\-changepw\fR +option\&. +.RE +.PP +\-nocertdb +.RS 4 +Do not open the certificate or key databases\&. This has several effects: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +With the +\fB\-create\fR +command, only a module security file is created; certificate and key databases are not created\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +With the +\fB\-jar\fR +command, signatures on the JAR file are not checked\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +With the +\fB\-changepw\fR +command, the password on the NSS internal module cannot be set or changed, since this password is stored in the key database\&. +.RE +.RE +.PP +\-pwfile old\-password\-file +.RS 4 +Specify a text file containing a token\*(Aqs existing password so that a password can be entered automatically when the +\fB\-changepw\fR +option is used to change passwords\&. +.RE +.PP +\-secmod secmodname +.RS 4 +Give the name of the security module database (like +secmod\&.db) to load\&. +.RE +.PP +\-slot slotname +.RS 4 +Specify a particular slot to be enabled or disabled with the +\fB\-enable\fR +or +\fB\-disable\fR +options\&. +.RE +.PP +\-string CONFIG_STRING +.RS 4 +Pass a configuration string for the module being added to the database\&. +.RE +.PP +\-tempdir temporary\-directory +.RS 4 +Give a directory location where temporary files are created during the installation by the +\fB\-jar\fR +option\&. If no temporary directory is specified, the current directory is used\&. +.RE +.SH "USAGE AND EXAMPLES" +.PP +\fBCreating Database Files\fR +.PP +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 +.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 +\fBmodutil\fR +directly or by running a JAR file and install script\&. For the most basic case, simply upload the library: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-add modulename \-libfile library\-file [\-ciphers cipher\-enable\-list] [\-mechanisms mechanism\-list] +.fi +.if n \{\ +.RE +.\} +.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 + +Using database directory \&.\&.\&. +Module "Example PKCS #11 Module" added to database\&. +.fi +.if n \{\ +.RE +.\} +.PP +\fBInstalling a Cryptographic Module from a JAR File\fR +.PP +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 \(lqJAR INSTALLATION FILE FORMAT\(rq\&. +.PP +The JAR installation script defines the setup information for each platform that the module can be installed on\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +Platforms { + Linux:5\&.4\&.08:x86 { + ModuleName { "Example PKCS #11 Module" } + ModuleFile { crypto\&.so } + DefaultMechanismFlags{0x0000} + CipherEnableFlags{0x0000} + Files { + crypto\&.so { + Path{ /tmp/crypto\&.so } + } + setup\&.sh { + Executable + Path{ /tmp/setup\&.sh } + } + } + } + Linux:6\&.0\&.0:x86 { + EquivalentPlatform { Linux:5\&.4\&.08:x86 } + } +} +.fi +.if n \{\ +.RE +.\} +.PP +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 + +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 +Incorp\&. by Ref\&.,LIAB\&.LTD(c)9 6", OU=www\&.verisign\&.com/CPS Incorp\&.by Ref +\&. LIABILITY LTD\&.(c)97 VeriSign, OU=VeriSign Object Signing CA \- Class 3 +Organization, OU="VeriSign, Inc\&.", O=VeriSign Trust Network **ISSUER +NAME**, OU=www\&.verisign\&.com/CPS Incorp\&.by Ref\&. LIABILITY LTD\&.(c)97 +VeriSign, OU=VeriSign Object Signing CA \- Class 3 Organization, +OU="VeriSign, Inc\&.", O=VeriSign Trust Network +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + +Do you wish to continue this installation? (y/n) y +Using installer script "installer_script" +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 +.fi +.if n \{\ +.RE +.\} +.PP +\fBAdding Module Spec\fR +.PP +Each module has information stored in the security database about its configuration and parameters\&. These can be added or edited using the +\fB\-rawadd\fR +command\&. For the current settings or to see the format of the module spec in the database, use the +\fB\-rawlist\fR +option\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-rawadd modulespec +.fi +.if n \{\ +.RE +.\} +.PP +\fBDeleting a Module\fR +.PP +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 +.fi +.if n \{\ +.RE +.\} +.PP +\fBDisplaying Module Information\fR +.PP +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\&. +.PP +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 +.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 + +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 + + slot: NSS User Private Key and Certificate Services + token: NSS Certificate DB +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.fi +.if n \{\ +.RE +.\} +.PP +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 + +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +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 +Cipher Enable Flags: None +Default Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES + + Slot: NSS Internal Cryptographic Services + Slot Mechanism Flags: RSA:RC2:RC4:DES:DH:SHA1:MD5:MD2:SSL:TLS:AES + Manufacturer: Mozilla Foundation + Type: Software + Version Number: 3\&.11 + Firmware Version: 0\&.0 + Status: Enabled + Token Name: NSS Generic Crypto Services + Token Manufacturer: Mozilla Foundation + Token Model: NSS 3 + Token Serial Number: 0000000000000000 + Token Version: 4\&.0 + Token Firmware Version: 0\&.0 + Access: Write Protected + Login Type: Public (no login required) + User Pin: NOT Initialized + + Slot: NSS User Private Key and Certificate Services + Slot Mechanism Flags: None + Manufacturer: Mozilla Foundation + Type: Software + Version Number: 3\&.11 + Firmware Version: 0\&.0 + Status: Enabled + 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 +.fi +.if n \{\ +.RE +.\} +.PP +A related command, +\fB\-rawlist\fR +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 + 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 +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)\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-default modulename \-mechanisms mechanism\-list +.fi +.if n \{\ +.RE +.\} +.PP +To set a module as the default provider for mechanisms, use the +\fB\-default\fR +command with a colon\-separated list of mechanisms\&. The available mechanisms depend on the module; NSS supplies almost all common mechanisms\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-default "NSS Internal PKCS #11 Module" \-dbdir \-mechanisms RSA:DSA:RC2 + +Using database directory c:\edatabases\&.\&.\&. + +Successfully changed defaults\&. +.fi +.if n \{\ +.RE +.\} +.PP +Clearing the default provider has the same format: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-undefault "NSS Internal PKCS #11 Module" \-dbdir \-mechanisms MD2:MD5 +.fi +.if n \{\ +.RE +.\} +.PP +\fBEnabling and Disabling Modules and Slots\fR +.PP +Modules, and specific slots on modules, can be selectively enabled or disabled using +\fBmodutil\fR\&. Both commands have the same format: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-enable|\-disable modulename [\-slot slotname] +.fi +.if n \{\ +.RE +.\} +.PP +For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-enable "NSS Internal PKCS #11 Module" \-slot "NSS Internal Cryptographic Services " \-dbdir \&. + +Slot "NSS Internal Cryptographic Services " enabled\&. +.fi +.if n \{\ +.RE +.\} +.PP +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\&. +.PP +\fBEnabling and Verifying FIPS Compliance\fR +.PP +The NSS modules can have FIPS 140\-2 compliance enabled or disabled using +\fBmodutil\fR +with the +\fB\-fips\fR +option\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-fips true \-dbdir sql:/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/ + +FIPS mode enabled\&. +.fi +.if n \{\ +.RE +.\} +.PP +\fBChanging the Password on a Token\fR +.PP +Initializing or changing a token\*(Aqs password: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-changepw tokenname [\-pwfile old\-password\-file] [\-newpwfile new\-password\-file] +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-dbdir sql:/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 +.if n \{\ +.RE +.\} +.SH "JAR INSTALLATION FILE FORMAT" +.PP +When a JAR file is run by a server, by +\fBmodutil\fR, 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: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +It must be declared in the JAR archive\*(Aqs manifest file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The script can have any name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +The metainfo tag for this is +\fBPkcs11_install_script\fR\&. To declare meta\-information in the manifest file, put it in a file that is passed to +\fBsigntool\fR\&. +.RE +.PP +\fBSample Script\fR +.PP +For example, the PKCS #11 installer script could be in the file pk11install\&. If so, the metainfo file for +\fBsigntool\fR +includes a line such as this: +.sp +.if n \{\ +.RS 4 +.\} +.nf ++ Pkcs11_install_script: pk11install +.fi +.if n \{\ +.RE +.\} +.PP +The script must define the platform and version number, the module name and file, and any optional information like supported ciphers and mechanisms\&. Multiple platforms can be defined in a single install file\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +ForwardCompatible { IRIX:6\&.2:mips SUNOS:5\&.5\&.1:sparc } +Platforms { + WINNT::x86 { + ModuleName { "Example Module" } + ModuleFile { win32/fort32\&.dll } + DefaultMechanismFlags{0x0001} + DefaultCipherFlags{0x0001} + Files { + win32/setup\&.exe { + Executable + RelativePath { %temp%/setup\&.exe } + } + win32/setup\&.hlp { + RelativePath { %temp%/setup\&.hlp } + } + win32/setup\&.cab { + RelativePath { %temp%/setup\&.cab } + } + } + } + WIN95::x86 { + EquivalentPlatform {WINNT::x86} + } + SUNOS:5\&.5\&.1:sparc { + ModuleName { "Example UNIX Module" } + ModuleFile { unix/fort\&.so } + DefaultMechanismFlags{0x0001} + CipherEnableFlags{0x0001} + Files { + unix/fort\&.so { + RelativePath{%root%/lib/fort\&.so} + AbsolutePath{/usr/local/netscape/lib/fort\&.so} + FilePermissions{555} + } + xplat/instr\&.html { + RelativePath{%root%/docs/inst\&.html} + AbsolutePath{/usr/local/netscape/docs/inst\&.html} + FilePermissions{555} + } + } + } + IRIX:6\&.2:mips { + EquivalentPlatform { SUNOS:5\&.5\&.1:sparc } + } +} +.fi +.if n \{\ +.RE +.\} +.PP +\fBScript Grammar\fR +.PP +The script is basic Java, allowing lists, key\-value pairs, strings, and combinations of all of them\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +\-\-> valuelist + +valuelist \-\-> value valuelist + <null> + +value \-\-\-> key_value_pair + string + +key_value_pair \-\-> key { valuelist } + +key \-\-> string + +string \-\-> simple_string + "complex_string" + +simple_string \-\-> [^ \et\en\e""{""}"]+ + +complex_string \-\-> ([^\e"\e\e\er\en]|(\e\e\e")|(\e\e\e\e))+ +.fi +.if n \{\ +.RE +.\} +.PP +Quotes and backslashes must be escaped with a backslash\&. A complex string must not include newlines or carriage returns\&.Outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens\&. +.PP +\fBKeys\fR +.PP +The Java install file uses keys to define the platform and module information\&. +.PP +\fBForwardCompatible\fR +gives a list of platforms that are forward compatible\&. If the current platform cannot be found in the list of supported platforms, then the +\fBForwardCompatible\fR +list is checked for any platforms that have the same OS and architecture in an earlier version\&. If one is found, its attributes are used for the current platform\&. +.PP +\fBPlatforms\fR +(required) Gives a list of platforms\&. Each entry in the list is itself a key\-value pair: the key is the name of the platform and the value list contains various attributes of the platform\&. The platform string is in the format +\fIsystem name:OS release:architecture\fR\&. The installer obtains these values from NSPR\&. OS release is an empty string on non\-Unix operating systems\&. NSPR supports these platforms: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +AIX (rs6000) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +BSDI (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +FREEBSD (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +HPUX (hppa1\&.1) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +IRIX (mips) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +LINUX (ppc, alpha, x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +MacOS (PowerPC) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +NCR (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +NEC (mips) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +OS2 (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +OSF (alpha) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +ReliantUNIX (mips) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SCO (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SOLARIS (sparc) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SONY (mips) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +SUNOS (sparc) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +UnixWare (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +WIN16 (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +WIN95 (x86) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +WINNT (x86) +.RE +.PP +For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +IRIX:6\&.2:mips +SUNOS:5\&.5\&.1:sparc +Linux:2\&.0\&.32:x86 +WIN95::x86 +.fi +.if n \{\ +.RE +.\} +.PP +The module information is defined independently for each platform in the +\fBModuleName\fR, +\fBModuleFile\fR, and +\fBFiles\fR +attributes\&. These attributes must be given unless an +\fBEquivalentPlatform\fR +attribute is specified\&. +.PP +\fBPer\-Platform Keys\fR +.PP +Per\-platform keys have meaning only within the value list of an entry in the +\fBPlatforms\fR +list\&. +.PP +\fBModuleName\fR +(required) gives the common name for the module\&. This name is used to reference the module by servers and by the +\fBmodutil\fR +tool\&. +.PP +\fBModuleFile\fR +(required) names the PKCS #11 module file for this platform\&. The name is given as the relative path of the file within the JAR archive\&. +.PP +\fBFiles\fR +(required) lists the files that need to be installed for this module\&. Each entry in the file list is a key\-value pair\&. The key is the path of the file in the JAR archive, and the value list contains attributes of the file\&. At least +\fBRelativePath\fR +or +\fBAbsolutePath\fR +must be specified for each file\&. +.PP +\fBDefaultMechanismFlags\fR +specifies mechanisms for which this module is the default provider; this is equivalent to the +\fB\-mechanism\fR +option with the +\fB\-add\fR +command\&. This key\-value pair is a bitstring specified in hexadecimal (0x) format\&. It is constructed as a bitwise OR\&. If the DefaultMechanismFlags entry is omitted, the value defaults to 0x0\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +RSA: 0x00000001 +DSA: 0x00000002 +RC2: 0x00000004 +RC4: 0x00000008 +DES: 0x00000010 +DH: 0x00000020 +FORTEZZA: 0x00000040 +RC5: 0x00000080 +SHA1: 0x00000100 +MD5: 0x00000200 +MD2: 0x00000400 +RANDOM: 0x08000000 +FRIENDLY: 0x10000000 +OWN_PW_DEFAULTS: 0x20000000 +DISABLE: 0x40000000 +.fi +.if n \{\ +.RE +.\} +.PP +\fBCipherEnableFlags\fR +specifies ciphers that this module provides that NSS does not provide (so that the module enables those ciphers for NSS)\&. This is equivalent to the +\fB\-cipher\fR +argument with the +\fB\-add\fR +command\&. This key is a bitstring specified in hexadecimal (0x) format\&. It is constructed as a bitwise OR\&. If the +\fBCipherEnableFlags\fR +entry is omitted, the value defaults to 0x0\&. +.PP +\fBEquivalentPlatform\fR +specifies that the attributes of the named platform should also be used for the current platform\&. This makes it easier when more than one platform uses the same settings\&. +.PP +\fBPer\-File Keys\fR +.PP +Some keys have meaning only within the value list of an entry in a +\fBFiles\fR +list\&. +.PP +Each file requires a path key the identifies where the file is\&. Either +\fBRelativePath\fR +or +\fBAbsolutePath\fR +must be specified\&. If both are specified, the relative path is tried first, and the absolute path is used only if no relative root directory is provided by the installer program\&. +.PP +\fBRelativePath\fR +specifies the destination directory of the file, relative to some directory decided at install time\&. Two variables can be used in the relative path: +\fB%root%\fR +and +\fB%temp%\fR\&. +\fB%root%\fR +is replaced at run time with the directory relative to which files should be installed; for example, it may be the server\*(Aqs root directory\&. The +\fB%temp%\fR +directory is created at the beginning of the installation and destroyed at the end\&. The purpose of +\fB%temp%\fR +is to hold executable files (such as setup programs) or files that are used by these programs\&. Files destined for the temporary directory are guaranteed to be in place before any executable file is run; they are not deleted until all executable files have finished\&. +.PP +\fBAbsolutePath\fR +specifies the destination directory of the file as an absolute path\&. +.PP +\fBExecutable\fR +specifies that the file is to be executed during the course of the installation\&. Typically, this string is used for a setup program provided by a module vendor, such as a self\-extracting setup executable\&. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file\&. +.PP +\fBFilePermissions\fR +sets permissions on any referenced files in a string of octal digits, according to the standard Unix format\&. This string is a bitwise OR\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +user read: 0400 +user write: 0200 +user execute: 0100 +group read: 0040 +group write: 0020 +group execute: 0010 +other read: 0004 +other write: 0002 +other execute: 0001 +.fi +.if n \{\ +.RE +.\} +.PP +Some platforms may not understand these permissions\&. They are applied only insofar as they make sense for the current platform\&. If this attribute is omitted, a default of 777 is assumed\&. +.SH "NSS DATABASE TYPES" +.PP +NSS originally used BerkeleyDB databases to store security information\&. The last versions of these +\fIlegacy\fR +databases are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert8\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key3\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +secmod\&.db for PKCS #11 module information +.RE +.PP +BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously\&. NSS has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues\&. Still, NSS requires more flexibility to provide a truly shared security database\&. +.PP +In 2009, NSS introduced a new set of databases that are SQLite databases rather than BerkleyDB\&. These new databases provide more accessibility and performance: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert9\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key4\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +pkcs11\&.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory +.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 +prefix with the given security directory\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +modutil \-create \-dbdir sql:/home/my/sharednssdb +.fi +.if n \{\ +.RE +.\} +.PP +To set the shared database type as the default type for the tools, set the +\fBNSS_DEFAULT_DB_TYPE\fR +environment variable to +\fBsql\fR: +.sp +.if n \{\ +.RS 4 +.\} +.nf +export NSS_DEFAULT_DB_TYPE="sql" +.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 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.PP +For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "SEE ALSO" +.PP +certutil (1) +.PP +pk12util (1) +.PP +signtool (1) +.PP +The NSS wiki has information on the new database design and how to configure applications to use it\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/pk12util.1 b/security/nss/doc/nroff/pk12util.1 new file mode 100644 index 000000000..c4fa972c0 --- /dev/null +++ b/security/nss/doc/nroff/pk12util.1 @@ -0,0 +1,1040 @@ +'\" t +.\" Title: PK12UTIL +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "PK12UTIL" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.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] +.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\&. +.SH "OPTIONS AND ARGUMENTS" +.PP +\fBOptions\fR +.PP +\-i p12file +.RS 4 +Import keys and certificates from a PKCS#12 file into a security database\&. +.RE +.PP +\-l p12file +.RS 4 +List the keys and certificates in PKCS#12 file\&. +.RE +.PP +\-o p12file +.RS 4 +Export keys and certificates from the security database to a PKCS#12 file\&. +.RE +.PP +\fBArguments\fR +.PP +\-c keyCipher +.RS 4 +Specify the key encryption algorithm\&. +.RE +.PP +\-C certCipher +.RS 4 +Specify the key cert (overall package) encryption algorithm\&. +.RE +.PP +\-d [sql:]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\&. +.RE +.PP +\-h tokenname +.RS 4 +Specify the name of the token to import into or export from\&. +.RE +.PP +\-k slotPasswordFile +.RS 4 +Specify the text file containing the slot\*(Aqs password\&. +.RE +.PP +\-K slotPassword +.RS 4 +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 +.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\&. +.RE +.PP +\-P prefix +.RS 4 +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\&. +.RE +.PP +\-r +.RS 4 +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\&. +.RE +.PP +\-v +.RS 4 +Enable debug logging when importing\&. +.RE +.PP +\-w p12filePasswordFile +.RS 4 +Specify the text file containing the pkcs #12 file password\&. +.RE +.PP +\-W p12filePassword +.RS 4 +Specify the pkcs #12 file password\&. +.RE +.SH "RETURN CODES" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +0 \- No error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +1 \- User Cancelled +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +2 \- Usage error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +6 \- NLS init error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +8 \- Certificate DB open error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +9 \- Key DB open error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +10 \- File initialization error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +11 \- Unicode conversion error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +12 \- Temporary file creation error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +13 \- PKCS11 get slot error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +14 \- PKCS12 decoder start error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +15 \- error read from import file +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +16 \- pkcs12 decode error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +17 \- pkcs12 decoder verify error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +18 \- pkcs12 decoder validate bags error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +19 \- pkcs12 decoder import bags error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +20 \- key db conversion version 3 to version 2 error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +21 \- cert db conversion version 7 to version 5 error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +22 \- cert and key dbs patch error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +23 \- get default cert db error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +24 \- find cert by nickname error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +25 \- create export context error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +26 \- PKCS12 add password itegrity error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +27 \- cert and key Safes creation error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +28 \- PKCS12 add cert and key error +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +29 \- PKCS12 encode error +.RE +.SH "EXAMPLES" +.PP +\fBImporting Keys and Certificates\fR +.PP +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] +.PP +For example: +.PP + +.sp +.if n \{\ +.RS 4 +.\} +.nf +# pk12util \-i /tmp/cert\-files/users\&.p12 \-d sql:/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 +.fi +.if n \{\ +.RE +.\} +.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] +.PP +For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# pk12util \-o certs\&.p12 \-n Server\-Cert \-d sql:/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] +.PP +For example, this prints the default ASCII output: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# pk12util \-l certs\&.p12 + +Enter password for PKCS12 file: +Key(shrouded): + Friendly Name: Thawte Freemail Member\*(Aqs Thawte Consulting (Pty) Ltd\&. ID + + Encryption algorithm: PKCS #12 V2 PBE With SHA\-1 And 3KEY Triple DES\-CBC + Parameters: + Salt: + 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f + Iteration Count: 1 (0x1) +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 13 (0xd) + Signature Algorithm: PKCS #1 SHA\-1 With RSA Encryption + Issuer: "E=personal\-freemail@thawte\&.com,CN=Thawte Personal Freemail C + A,OU=Certification Services Division,O=Thawte Consulting,L=Cape T + own,ST=Western Cape,C=ZA" + +.fi +.if n \{\ +.RE +.\} +.PP +Alternatively, the +\fB\-r\fR +prints the certificates and then exports them into separate DER binary files\&. This allows the certificates to be fed to another application that supports +\&.p12 +files\&. Each certificate is written to a sequentially\-number file, beginning with +file0001\&.der +and continuing through +file000N\&.der, incrementing the number for every certificate: +.sp +.if n \{\ +.RS 4 +.\} +.nf +pk12util \-l test\&.p12 \-r +Enter password for PKCS12 file: +Key(shrouded): + Friendly Name: Thawte Freemail Member\*(Aqs Thawte Consulting (Pty) Ltd\&. ID + + Encryption algorithm: PKCS #12 V2 PBE With SHA\-1 And 3KEY Triple DES\-CBC + Parameters: + Salt: + 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f + Iteration Count: 1 (0x1) +Certificate Friendly Name: Thawte Personal Freemail Issuing CA \- Thawte Consulting + +Certificate Friendly Name: Thawte Freemail Member\*(Aqs Thawte Consulting (Pty) Ltd\&. ID + +.fi +.if n \{\ +.RE +.\} +.SH "PASSWORD ENCRYPTION" +.PP +PKCS#12 provides for not only the protection of the private keys but also the certificate and meta\-data associated with the keys\&. Password\-based encryption is used to protect private keys on export to a PKCS#12 file and, optionally, the entire package\&. If no algorithm is specified, the tool defaults to using +\fBPKCS12 V2 PBE with SHA1 and 3KEY Triple DES\-cbc\fR +for private key encryption\&. +\fBPKCS12 V2 PBE with SHA1 and 40 Bit RC4\fR +is the default for the overall package encryption when not in FIPS mode\&. When in FIPS mode, there is no package encryption\&. +.PP +The private key is always protected with strong encryption by default\&. +.PP +Several types of ciphers are supported\&. +.PP +Symmetric CBC ciphers for PKCS#5 V2 +.RS 4 +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +DES\-CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +RC2\-CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +RC5\-CBCPad +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +DES\-EDE3\-CBC (the default for key encryption) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +AES\-128\-CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +AES\-192\-CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +AES\-256\-CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +CAMELLIA\-128\-CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +CAMELLIA\-192\-CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +CAMELLIA\-256\-CBC +.RE +.RE +.PP +PKCS#12 PBE ciphers +.RS 4 +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #12 PBE with Sha1 and 128 Bit RC4 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #12 PBE with Sha1 and 40 Bit RC4 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #12 PBE with Sha1 and Triple DES CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #12 PBE with Sha1 and 128 Bit RC2 CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #12 PBE with Sha1 and 40 Bit RC2 CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS12 V2 PBE with SHA1 and 128 Bit RC4 +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS12 V2 PBE with SHA1 and 40 Bit RC4 (the default for non\-FIPS mode) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS12 V2 PBE with SHA1 and 3KEY Triple DES\-cbc +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS12 V2 PBE with SHA1 and 2KEY Triple DES\-cbc +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS12 V2 PBE with SHA1 and 128 Bit RC2 CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS12 V2 PBE with SHA1 and 40 Bit RC2 CBC +.RE +.RE +.PP +PKCS#5 PBE ciphers +.RS 4 +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #5 Password Based Encryption with MD2 and DES CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #5 Password Based Encryption with MD5 and DES CBC +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +PKCS #5 Password Based Encryption with SHA1 and DES CBC +.RE +.RE +.PP +With PKCS#12, the crypto provider may be the soft token module or an external hardware module\&. If the cryptographic module does not support the requested algorithm, then the next best fit will be selected (usually the default)\&. If no suitable replacement for the desired algorithm can be found, the tool returns the error +\fIno security module can perform the requested operation\fR\&. +.SH "NSS DATABASE TYPES" +.PP +NSS originally used BerkeleyDB databases to store security information\&. The last versions of these +\fIlegacy\fR +databases are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert8\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key3\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +secmod\&.db for PKCS #11 module information +.RE +.PP +BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously\&. NSS has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues\&. Still, NSS requires more flexibility to provide a truly shared security database\&. +.PP +In 2009, NSS introduced a new set of databases that are SQLite databases rather than BerkleyDB\&. These new databases provide more accessibility and performance: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert9\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key4\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +pkcs11\&.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory +.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 +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 +.fi +.if n \{\ +.RE +.\} +.PP +To set the shared database type as the default type for the tools, set the +\fBNSS_DEFAULT_DB_TYPE\fR +environment variable to +\fBsql\fR: +.sp +.if n \{\ +.RS 4 +.\} +.nf +export NSS_DEFAULT_DB_TYPE="sql" +.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 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.PP +For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "SEE ALSO" +.PP +certutil (1) +.PP +modutil (1) +.PP +The NSS wiki has information on the new database design and how to configure applications to use it\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/pp.1 b/security/nss/doc/nroff/pp.1 new file mode 100644 index 000000000..ce376398e --- /dev/null +++ b/security/nss/doc/nroff/pp.1 @@ -0,0 +1,108 @@ +'\" t +.\" Title: PP +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 29 July 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "PP" "1" "29 July 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +pp \- Prints certificates, keys, crls, and pkcs7 files +.SH "SYNOPSIS" +.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 +.SH "OPTIONS" +.PP +\fB\-t \fR \fItype\fR +.RS 4 +specify the input, one of {private\-key | public\-key | certificate | certificate\-request | pkcs7 | crl} +.sp +.RE +.PP +\fB\-a \fR +.RS 4 +Input is in ascii encoded form (RFC1113) +.RE +.PP +\fB\-i \fR \fIinputfile\fR +.RS 4 +Define an input file to use (default is stdin) +.RE +.PP +\fB\-o \fR \fIoutputfile\fR +.RS 4 +Define an output file to use (default is stdout) +.RE +.PP +\fB\-u \fR +.RS 4 +Use UTF\-8 (default is to show non\-ascii as \&.) +.RE +.PP +\fB\-w \fR +.RS 4 +Don\*(Aqt wrap long output lines +.RE +.SH "ADDITIONAL RESOURCES" +.PP +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 +\m[blue]\fBPKI Wiki\fR\m[]\&\s-2\u[2]\d\s+2\&. +.PP +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, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 +.RS 4 +\%http://pki.fedoraproject.org/wiki/ +.RE +.IP " 3." 4 +Mozilla NSS site +.RS 4 +\%http://www.mozilla.org/projects/security/pki/nss/ +.RE diff --git a/security/nss/doc/nroff/signtool.1 b/security/nss/doc/nroff/signtool.1 new file mode 100644 index 000000000..3a91ce69d --- /dev/null +++ b/security/nss/doc/nroff/signtool.1 @@ -0,0 +1,681 @@ +'\" t +.\" Title: signtool +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "SIGNTOOL" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +signtool \- Digitally sign objects and files\&. +.SH "SYNOPSIS" +.HP \w'\fBsigntool\fR\ 'u +\fBsigntool\fR [[\-b\ basename]] [[\-c\ Compression\ Level]] [[\-d\ cert\-dir]] [[\-e\ extension]] [[\-f\ filename]] [[\-i\ installer\ script]] [[\-h]] [[\-H]] [[\-v]] [[\-w]] [[\-G\ nickname]] [[\-J]] [[\-j\ directory]] [\-k\ keyName] [[\-\-keysize\ |\ \-s\ size]] [[\-l]] [[\-L]] [[\-M]] [[\-m\ metafile]] [[\-\-norecurse]] [[\-O]] [[\-o]] [[\-\-outfile]] [[\-p\ password]] [[\-t|\-\-token\ tokenname]] [[\-z]] [[\-X]] [[\-x\ name]] [[\-\-verbose\ value]] [[\-\-leavearc]] [[\-Z\ jarfile]] [directory\-tree] [archive] +.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 Signing Tool, +\fBsigntool\fR, creates digital signatures and uses a Java Archive (JAR) file to associate the signatures with files in a directory\&. Electronic software distribution over any network involves potential security problems\&. To help address some of these problems, you can associate digital signatures with the files in a JAR archive\&. Digital signatures allow SSL\-enabled clients to perform two important operations: +.PP +* Confirm the identity of the individual, company, or other entity whose digital signature is associated with the files +.PP +* Check whether the files have been tampered with since being signed +.PP +If you have a signing certificate, you can use Netscape Signing Tool to digitally sign files and package them as a JAR file\&. An object\-signing certificate is a special kind of certificate that allows you to associate your digital signature with one or more files\&. +.PP +An individual file can potentially be signed with multiple digital signatures\&. For example, a commercial software developer might sign the files that constitute a software product to prove that the files are indeed from a particular company\&. A network administrator manager might sign the same files with an additional digital signature based on a company\-generated certificate to indicate that the product is approved for use within the company\&. +.PP +The significance of a digital signature is comparable to the significance of a handwritten signature\&. Once you have signed a file, it is difficult to claim later that you didn\*(Aqt sign it\&. In some situations, a digital signature may be considered as legally binding as a handwritten signature\&. Therefore, you should take great care to ensure that you can stand behind any file you sign and distribute\&. +.PP +For example, if you are a software developer, you should test your code to make sure it is virus\-free before signing it\&. Similarly, if you are a network administrator, you should make sure, before signing any code, that it comes from a reliable source and will run correctly with the software installed on the machines to which you are distributing it\&. +.PP +Before you can use Netscape Signing Tool to sign files, you must have an object\-signing certificate, which is a special certificate whose associated private key is used to create digital signatures\&. For testing purposes only, you can create an object\-signing certificate with Netscape Signing Tool 1\&.3\&. When testing is finished and you are ready to disitribute your software, you should obtain an object\-signing certificate from one of two kinds of sources: +.PP +* An independent certificate authority (CA) that authenticates your identity and charges you a fee\&. You typically get a certificate from an independent CA if you want to sign software that will be distributed over the Internet\&. +.PP +* CA server software running on your corporate intranet or extranet\&. Netscape Certificate Management System provides a complete management solution for creating, deploying, and managing certificates, including CAs that issue object\-signing certificates\&. +.PP +You must also have a certificate for the CA that issues your signing certificate before you can sign files\&. If the certificate authority\*(Aqs certificate isn\*(Aqt already installed in your copy of Communicator, you typically install it by clicking the appropriate link on the certificate authority\*(Aqs web site, for example on the page from which you initiated enrollment for your signing certificate\&. This is the case for some test certificates, as well as certificates issued by Netscape Certificate Management System: you must download the the CA certificate in addition to obtaining your own signing certificate\&. CA certificates for several certificate authorities are preinstalled in the Communicator certificate database\&. +.PP +When you receive an object\-signing certificate for your own use, it is automatically installed in your copy of the Communicator client software\&. Communicator supports the public\-key cryptography standard known as PKCS #12, which governs key portability\&. You can, for example, move an object\-signing certificate and its associated private key from one computer to another on a credit\-card\-sized device called a smart card\&. +.SH "OPTIONS" +.PP +\-b basename +.RS 4 +Specifies the base filename for the \&.rsa and \&.sf files in the META\-INF directory to conform with the JAR format\&. For example, +\fI\-b signatures\fR +causes the files to be named signatures\&.rsa and signatures\&.sf\&. The default is signtool\&. +.RE +.PP +\-c# +.RS 4 +Specifies the compression level for the \-J or \-Z option\&. The symbol # represents a number from 0 to 9, where 0 means no compression and 9 means maximum compression\&. The higher the level of compression, the smaller the output but the longer the operation takes\&. If the \-c# option is not used with either the \-J or the \-Z option, the default compression value used by both the \-J and \-Z options is 6\&. +.RE +.PP +\-d certdir +.RS 4 +Specifies your certificate database directory; that is, the directory in which you placed your key3\&.db and cert7\&.db files\&. To specify the current directory, use "\-d\&." (including the period)\&. The Unix version of signtool assumes ~/\&.netscape unless told otherwise\&. The NT version of signtool always requires the use of the \-d option to specify where the database files are located\&. +.RE +.PP +\-e extension +.RS 4 +Tells signtool to sign only files with the given extension; for example, use \-e"\&.class" to sign only Java class files\&. Note that with Netscape Signing Tool version 1\&.1 and later this option can appear multiple times on one command line, making it possible to specify multiple file types or classes to include\&. +.RE +.PP +\-f commandfile +.RS 4 +Specifies a text file containing Netscape Signing Tool options and arguments in keyword=value format\&. All options and arguments can be expressed through this file\&. For more information about the syntax used with this file, see "Tips and Techniques"\&. +.RE +.PP +\-G nickname +.RS 4 +Generates a new private\-public key pair and corresponding object\-signing certificate with the given nickname\&. The newly generated keys and certificate are installed into the key and certificate databases in the directory specified by the \-d option\&. With the NT version of Netscape Signing Tool, you must use the \-d option with the \-G option\&. With the Unix version of Netscape Signing Tool, omitting the \-d option causes the tool to install the keys and certificate in the Communicator key and certificate databases\&. If you are installing the keys and certificate in the Communicator databases, you must exit Communicator before using this option; otherwise, you risk corrupting the databases\&. In all cases, the certificate is also output to a file named x509\&.cacert, which has the MIME\-type application/x\-x509\-ca\-cert\&. Unlike certificates normally used to sign finished code to be distributed over a network, a test certificate created with \-G is not signed by a recognized certificate authority\&. Instead, it is self\-signed\&. In addition, a single test signing certificate functions as both an object\-signing certificate and a CA\&. When you are using it to sign objects, it behaves like an object\-signing certificate\&. When it is imported into browser software such as Communicator, it behaves like an object\-signing CA and cannot be used to sign objects\&. The \-G option is available in Netscape Signing Tool 1\&.0 and later versions only\&. By default, it produces only RSA certificates with 1024\-byte keys in the internal token\&. However, you can use the \-s option specify the required key size and the \-t option to specify the token\&. +.RE +.PP +\-i scriptname +.RS 4 +Specifies the name of an installer script for SmartUpdate\&. This script installs files from the JAR archive in the local system after SmartUpdate has validated the digital signature\&. For more details, see the description of \-m that follows\&. The \-i option provides a straightforward way to provide this information if you don\*(Aqt need to specify any metadata other than an installer script\&. +.RE +.PP +\-J +.RS 4 +Signs a directory of HTML files containing JavaScript and creates as many archive files as are specified in the HTML tags\&. Even if signtool creates more than one archive file, you need to supply the key database password only once\&. The \-J option is available only in Netscape Signing Tool 1\&.0 and later versions\&. The \-J option cannot be used at the same time as the \-Z option\&. If the \-c# option is not used with the \-J option, the default compression value is 6\&. Note that versions 1\&.1 and later of Netscape Signing Tool correctly recognizes the CODEBASE attribute, allows paths to be expressed for the CLASS and SRC attributes instead of filenames only, processes LINK tags and parses HTML correctly, and offers clearer error messages\&. +.RE +.PP +\-j directory +.RS 4 +Specifies a special JavaScript directory\&. This option causes the specified directory to be signed and tags its entries as inline JavaScript\&. This special type of entry does not have to appear in the JAR file itself\&. Instead, it is located in the HTML page containing the inline scripts\&. When you use signtool \-v, these entries are displayed with the string NOT PRESENT\&. +.RE +.PP +\-k key \&.\&.\&. directory +.RS 4 +Specifies the nickname (key) of the certificate you want to sign with and signs the files in the specified directory\&. The directory to sign is always specified as the last command\-line argument\&. Thus, it is possible to write signtool \-k MyCert \-d \&. signdir You may have trouble if the nickname contains a single quotation mark\&. To avoid problems, escape the quotation mark using the escape conventions for your platform\&. It\*(Aqs also possible to use the \-k option without signing any files or specifying a directory\&. For example, you can use it with the \-l option to get detailed information about a particular signing certificate\&. +.RE +.PP +\-l +.RS 4 +Lists signing certificates, including issuing CAs\&. If any of your certificates are expired or invalid, the list will so specify\&. This option can be used with the \-k option to list detailed information about a particular signing certificate\&. The \-l option is available in Netscape Signing Tool 1\&.0 and later versions only\&. +.RE +.PP +\-L +.RS 4 +Lists the certificates in your database\&. An asterisk appears to the left of the nickname for any certificate that can be used to sign objects with signtool\&. +.RE +.PP +\-\-leavearc +.RS 4 +Retains the temporary \&.arc (archive) directories that the \-J option creates\&. These directories are automatically erased by default\&. Retaining the temporary directories can be an aid to debugging\&. +.RE +.PP +\-m metafile +.RS 4 +Specifies the name of a metadata control file\&. Metadata is signed information attached either to the JAR archive itself or to files within the archive\&. This metadata can be any ASCII string, but is used mainly for specifying an installer script\&. The metadata file contains one entry per line, each with three fields: field #1: file specification, or + if you want to specify global metadata (that is, metadata about the JAR archive itself or all entries in the archive) field #2: the name of the data you are specifying; for example: Install\-Script field #3: data corresponding to the name in field #2 For example, the \-i option uses the equivalent of this line: + Install\-Script: script\&.js This example associates a MIME type with a file: movie\&.qt MIME\-Type: video/quicktime For information about the way installer script information appears in the manifest file for a JAR archive, see The JAR Format on Netscape DevEdge\&. +.RE +.PP +\-M +.RS 4 +Lists the PKCS #11 modules available to signtool, including smart cards\&. The \-M option is available in Netscape Signing Tool 1\&.0 and later versions only\&. For information on using Netscape Signing Tool with smart cards, see "Using Netscape Signing Tool with Smart Cards"\&. For information on using the \-M option to verify FIPS\-140\-1 validated mode, see "Netscape Signing Tool and FIPS\-140\-1"\&. +.RE +.PP +\-\-norecurse +.RS 4 +Blocks recursion into subdirectories when signing a directory\*(Aqs contents or when parsing HTML\&. +.RE +.PP +\-o +.RS 4 +Optimizes the archive for size\&. Use this only if you are signing very large archives containing hundreds of files\&. This option makes the manifest files (required by the JAR format) considerably smaller, but they contain slightly less information\&. +.RE +.PP +\-\-outfile outputfile +.RS 4 +Specifies a file to receive redirected output from Netscape Signing Tool\&. +.RE +.PP +\-p password +.RS 4 +Specifies a password for the private\-key database\&. Note that the password entered on the command line is displayed as plain text\&. +.RE +.PP +\-s keysize +.RS 4 +Specifies the size of the key for generated certificate\&. Use the \-M option to find out what tokens are available\&. The \-s option can be used with the \-G option only\&. +.RE +.PP +\-t token +.RS 4 +Specifies which available token should generate the key and receive the certificate\&. Use the \-M option to find out what tokens are available\&. The \-t option can be used with the \-G option only\&. +.RE +.PP +\-v archive +.RS 4 +Displays the contents of an archive and verifies the cryptographic integrity of the digital signatures it contains and the files with which they are associated\&. This includes checking that the certificate for the issuer of the object\-signing certificate is listed in the certificate database, that the CA\*(Aqs digital signature on the object\-signing certificate is valid, that the relevant certificates have not expired, and so on\&. +.RE +.PP +\-\-verbosity value +.RS 4 +Sets the quantity of information Netscape Signing Tool generates in operation\&. A value of 0 (zero) is the default and gives full information\&. A value of \-1 suppresses most messages, but not error messages\&. +.RE +.PP +\-w archive +.RS 4 +Displays the names of signers of any files in the archive\&. +.RE +.PP +\-x directory +.RS 4 +Excludes the specified directory from signing\&. Note that with Netscape Signing Tool version 1\&.1 and later this option can appear multiple times on one command line, making it possible to specify several particular directories to exclude\&. +.RE +.PP +\-z +.RS 4 +Tells signtool not to store the signing time in the digital signature\&. This option is useful if you want the expiration date of the signature checked against the current date and time rather than the time the files were signed\&. +.RE +.PP +\-Z jarfile +.RS 4 +Creates a JAR file with the specified name\&. You must specify this option if you want signtool to create the JAR file; it does not do so automatically\&. If you don\*(Aqt specify \-Z, you must use an external ZIP tool to create the JAR file\&. The \-Z option cannot be used at the same time as the \-J option\&. If the \-c# option is not used with the \-Z option, the default compression value is 6\&. +.RE +.SH "THE COMMAND FILE FORMAT" +.PP +Entries in a Netscape Signing Tool command file have this general format: keyword=value Everything before the = sign on a single line is a keyword, and everything from the = sign to the end of line is a value\&. The value may include = signs; only the first = sign on a line is interpreted\&. Blank lines are ignored, but white space on a line with keywords and values is assumed to be part of the keyword (if it comes before the equal sign) or part of the value (if it comes after the first equal sign)\&. Keywords are case insensitive, values are generally case sensitive\&. Since the = sign and newline delimit the value, it should not be quoted\&. +.PP +\fBSubsection\fR +.PP +basename +.RS 4 +Same as \-b option\&. +.RE +.PP +compression +.RS 4 +Same as \-c option\&. +.RE +.PP +certdir +.RS 4 +Same as \-d option\&. +.RE +.PP +extension +.RS 4 +Same as \-e option\&. +.RE +.PP +generate +.RS 4 +Same as \-G option\&. +.RE +.PP +installscript +.RS 4 +Same as \-i option\&. +.RE +.PP +javascriptdir +.RS 4 +Same as \-j option\&. +.RE +.PP +htmldir +.RS 4 +Same as \-J option\&. +.RE +.PP +certname +.RS 4 +Nickname of certificate, as with \-k and \-l \-k options\&. +.RE +.PP +signdir +.RS 4 +The directory to be signed, as with \-k option\&. +.RE +.PP +list +.RS 4 +Same as \-l option\&. Value is ignored, but = sign must be present\&. +.RE +.PP +listall +.RS 4 +Same as \-L option\&. Value is ignored, but = sign must be present\&. +.RE +.PP +metafile +.RS 4 +Same as \-m option\&. +.RE +.PP +modules +.RS 4 +Same as \-M option\&. Value is ignored, but = sign must be present\&. +.RE +.PP +optimize +.RS 4 +Same as \-o option\&. Value is ignored, but = sign must be present\&. +.RE +.PP +password +.RS 4 +Same as \-p option\&. +.RE +.PP +keysize +.RS 4 +Same as \-s option\&. +.RE +.PP +token +.RS 4 +Same as \-t option\&. +.RE +.PP +verify +.RS 4 +Same as \-v option\&. +.RE +.PP +who +.RS 4 +Same as \-w option\&. +.RE +.PP +exclude +.RS 4 +Same as \-x option\&. +.RE +.PP +notime +.RS 4 +Same as \-z option\&. value is ignored, but = sign must be present\&. +.RE +.PP +jarfile +.RS 4 +Same as \-Z option\&. +.RE +.PP +outfile +.RS 4 +Name of a file to which output and error messages will be redirected\&. This option has no command\-line equivalent\&. +.RE +.SH "EXTENDED EXAMPLES" +.PP +The following example will do this and that +.PP +\fBListing Available Signing Certificates\fR +.PP +You use the \-L option to list the nicknames for all available certificates and check which ones are signing certificates\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-L + +using certificate directory: /u/jsmith/\&.netscape +S Certificates +\- \-\-\-\-\-\-\-\-\-\-\-\- + BBN Certificate Services CA Root 1 + IBM World Registry CA + VeriSign Class 1 CA \- Individual Subscriber \- VeriSign, Inc\&. + GTE CyberTrust Root CA + Uptime Group Plc\&. Class 4 CA +* Verisign Object Signing Cert + Integrion CA + GTE CyberTrust Secure Server CA + AT&T Directory Services +* test object signing cert + Uptime Group Plc\&. Class 1 CA + VeriSign Class 1 Primary CA +\- \-\-\-\-\-\-\-\-\-\-\-\- + +Certificates that can be used to sign objects have *\*(Aqs to their left\&. +.fi +.if n \{\ +.RE +.\} +.PP +Two signing certificates are displayed: Verisign Object Signing Cert and test object signing cert\&. +.PP +You use the \-l option to get a list of signing certificates only, including the signing CA for each\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-l + +using certificate directory: /u/jsmith/\&.netscape +Object signing certificates +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + +Verisign Object Signing Cert + Issued by: VeriSign, Inc\&. \- Verisign, Inc\&. + Expires: Tue May 19, 1998 +test object signing cert + Issued by: test object signing cert (Signtool 1\&.0 Testing +Certificate (960187691)) + Expires: Sun May 17, 1998 +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.fi +.if n \{\ +.RE +.\} +.PP +For a list including CAs, use the +\fB\-L\fR +option\&. +.PP +\fBSigning a File\fR +.PP +1\&. Create an empty directory\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +mkdir signdir +.fi +.if n \{\ +.RE +.\} +.PP +2\&. Put some file into it\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +echo boo > signdir/test\&.f +.fi +.if n \{\ +.RE +.\} +.PP +3\&. Specify the name of your object\-signing certificate and sign the directory\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-k MySignCert \-Z testjar\&.jar signdir + +using key "MySignCert" +using certificate directory: /u/jsmith/\&.netscape +Generating signdir/META\-INF/manifest\&.mf file\&.\&. +\-\-> test\&.f +adding signdir/test\&.f to testjar\&.jar +Generating signtool\&.sf file\&.\&. +Enter Password or Pin for "Communicator Certificate DB": + +adding signdir/META\-INF/manifest\&.mf to testjar\&.jar +adding signdir/META\-INF/signtool\&.sf to testjar\&.jar +adding signdir/META\-INF/signtool\&.rsa to testjar\&.jar + +tree "signdir" signed successfully +.fi +.if n \{\ +.RE +.\} +.PP +4\&. Test the archive you just created\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-v testjar\&.jar + +using certificate directory: /u/jsmith/\&.netscape +archive "testjar\&.jar" has passed crypto verification\&. + status path + \-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + verified test\&.f +.fi +.if n \{\ +.RE +.\} +.PP +\fBUsing Netscape Signing Tool with a ZIP Utility\fR +.PP +To use Netscape Signing Tool with a ZIP utility, you must have the utility in your path environment variable\&. You should use the zip\&.exe utility rather than pkzip\&.exe, which cannot handle long filenames\&. You can use a ZIP utility instead of the \-Z option to package a signed archive into a JAR file after you have signed it: +.sp +.if n \{\ +.RS 4 +.\} +.nf +cd signdir + + zip \-r \&.\&./myjar\&.jar * + adding: META\-INF/ (stored 0%) + adding: META\-INF/manifest\&.mf (deflated 15%) + adding: META\-INF/signtool\&.sf (deflated 28%) + adding: META\-INF/signtool\&.rsa (stored 0%) + adding: text\&.txt (stored 0%) +.fi +.if n \{\ +.RE +.\} +.PP +\fBGenerating the Keys and Certificate\fR +.PP +The signtool option \-G generates a new public\-private key pair and certificate\&. It takes the nickname of the new certificate as an argument\&. The newly generated keys and certificate are installed into the key and certificate databases in the directory specified by the \-d option\&. With the NT version of Netscape Signing Tool, you must use the \-d option with the \-G option\&. With the Unix version of Netscape Signing Tool, omitting the \-d option causes the tool to install the keys and certificate in the Communicator key and certificate databases\&. In all cases, the certificate is also output to a file named x509\&.cacert, which has the MIME\-type application/x\-x509\-ca\-cert\&. +.PP +Certificates contain standard information about the entity they identify, such as the common name and organization name\&. Netscape Signing Tool prompts you for this information when you run the command with the \-G option\&. However, all of the requested fields are optional for test certificates\&. If you do not enter a common name, the tool provides a default name\&. In the following example, the user input is in boldface: +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-G MyTestCert + +using certificate directory: /u/someuser/\&.netscape +Enter certificate information\&. All fields are optional\&. Acceptable +characters are numbers, letters, spaces, and apostrophes\&. +certificate common name: Test Object Signing Certificate +organization: Netscape Communications Corp\&. +organization unit: Server Products Division +state or province: California +country (must be exactly 2 characters): US +username: someuser +email address: someuser@netscape\&.com +Enter Password or Pin for "Communicator Certificate DB": [Password will not echo] +generated public/private key pair +certificate request generated +certificate has been signed +certificate "MyTestCert" added to database +Exported certificate to x509\&.raw and x509\&.cacert\&. +.fi +.if n \{\ +.RE +.\} +.PP +The certificate information is read from standard input\&. Therefore, the information can be read from a file using the redirection operator (<) in some operating systems\&. To create a file for this purpose, enter each of the seven input fields, in order, on a separate line\&. Make sure there is a newline character at the end of the last line\&. Then run signtool with standard input redirected from your file as follows: +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-G MyTestCert inputfile +.fi +.if n \{\ +.RE +.\} +.PP +The prompts show up on the screen, but the responses will be automatically read from the file\&. The password will still be read from the console unless you use the \-p option to give the password on the command line\&. +.PP +\fBUsing the \-M Option to List Smart Cards\fR +.PP +You can use the \-M option to list the PKCS #11 modules, including smart cards, that are available to signtool: +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-d "c:\enetscape\eusers\ejsmith" \-M + +using certificate directory: c:\enetscape\eusers\eusername +Listing of PKCS11 modules +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + 1\&. Netscape Internal PKCS #11 Module + (this module is internally loaded) + slots: 2 slots attached + status: loaded + slot: Communicator Internal Cryptographic Services Version 4\&.0 + token: Communicator Generic Crypto Svcs + slot: Communicator User Private Key and Certificate Services + token: Communicator Certificate DB + 2\&. CryptOS + (this is an external module) + DLL name: core32 + slots: 1 slots attached + status: loaded + slot: Litronic 210 + token: + \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.fi +.if n \{\ +.RE +.\} +.PP +\fBUsing Netscape Signing Tool and a Smart Card to Sign Files\fR +.PP +The signtool command normally takes an argument of the \-k option to specify a signing certificate\&. To sign with a smart card, you supply only the fully qualified name of the certificate\&. +.PP +To see fully qualified certificate names when you run Communicator, click the Security button in Navigator, then click Yours under Certificates in the left frame\&. Fully qualified names are of the format smart card:certificate, for example "MyCard:My Signing Cert"\&. You use this name with the \-k argument as follows: +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-k "MyCard:My Signing Cert" directory +.fi +.if n \{\ +.RE +.\} +.PP +\fBVerifying FIPS Mode\fR +.PP +Use the \-M option to verify that you are using the FIPS\-140\-1 module\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-d "c:\enetscape\eusers\ejsmith" \-M + +using certificate directory: c:\enetscape\eusers\ejsmith +Listing of PKCS11 modules +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + 1\&. Netscape Internal PKCS #11 Module + (this module is internally loaded) + slots: 2 slots attached + status: loaded + slot: Communicator Internal Cryptographic Services Version 4\&.0 + token: Communicator Generic Crypto Svcs + slot: Communicator User Private Key and Certificate Services + token: Communicator Certificate DB +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.fi +.if n \{\ +.RE +.\} +.PP +This Unix example shows that Netscape Signing Tool is using a FIPS\-140\-1 module: +.sp +.if n \{\ +.RS 4 +.\} +.nf +signtool \-d "c:\enetscape\eusers\ejsmith" \-M +using certificate directory: c:\enetscape\eusers\ejsmith +Enter Password or Pin for "Communicator Certificate DB": [password will not echo] +Listing of PKCS11 modules +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +1\&. Netscape Internal FIPS PKCS #11 Module +(this module is internally loaded) +slots: 1 slots attached +status: loaded +slot: Netscape Internal FIPS\-140\-1 Cryptographic Services +token: Communicator Certificate DB +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.fi +.if n \{\ +.RE +.\} +.SH "SEE ALSO" +.PP +signver (1) +.PP +The NSS wiki has information on the new database design and how to configure applications to use it\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/signver.1 b/security/nss/doc/nroff/signver.1 new file mode 100644 index 000000000..ad92c11a6 --- /dev/null +++ b/security/nss/doc/nroff/signver.1 @@ -0,0 +1,320 @@ +'\" t +.\" Title: SIGNVER +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "SIGNVER" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +signver \- Verify a detached PKCS#7 signature for a file\&. +.SH "SYNOPSIS" +.HP \w'\fBsigntool\fR\ 'u +\fBsigntool\fR \-A | \-V \-d\ \fIdirectory\fR [\-a] [\-i\ \fIinput_file\fR] [\-o\ \fIoutput_file\fR] [\-s\ \fIsignature_file\fR] [\-v] +.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 Signature Verification Tool, +\fBsignver\fR, 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\&. +.SH "OPTIONS" +.PP +\-A +.RS 4 +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 +.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\&. +.RE +.PP +\-a +.RS 4 +Sets that the given signature file is in ASCII format\&. +.RE +.PP +\-i \fIinput_file\fR +.RS 4 +Gives the input file for the object with signed data\&. +.RE +.PP +\-o \fIoutput_file\fR +.RS 4 +Gives the output file to which to write the results\&. +.RE +.PP +\-s \fIsignature_file\fR +.RS 4 +Gives the input file for the digital signature\&. +.RE +.PP +\-v +.RS 4 +Enables verbose output\&. +.RE +.SH "EXTENDED EXAMPLES" +.SS "Verifying a Signature" +.PP +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 + +signatureValid=yes +.fi +.if n \{\ +.RE +.\} +.SS "Printing Signature Data" +.PP +The +\fB\-A\fR +option prints all of the information contained in a signature file\&. Using the +\fB\-o\fR +option prints the signature file information to the given output file rather than stdout\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +signver \-A \-s \fIsignature_file\fR \-o \fIoutput_file\fR +.fi +.if n \{\ +.RE +.\} +.SH "NSS DATABASE TYPES" +.PP +NSS originally used BerkeleyDB databases to store security information\&. The last versions of these +\fIlegacy\fR +databases are: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert8\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key3\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +secmod\&.db for PKCS #11 module information +.RE +.PP +BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously\&. NSS has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues\&. Still, NSS requires more flexibility to provide a truly shared security database\&. +.PP +In 2009, NSS introduced a new set of databases that are SQLite databases rather than BerkleyDB\&. These new databases provide more accessibility and performance: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +cert9\&.db for certificates +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +key4\&.db for keys +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +pkcs11\&.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory +.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 +prefix with the given security directory\&. For example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +# signver \-A \-s \fIsignature\fR \-d sql:/home/my/sharednssdb +.fi +.if n \{\ +.RE +.\} +.PP +To set the shared database type as the default type for the tools, set the +\fBNSS_DEFAULT_DB_TYPE\fR +environment variable to +\fBsql\fR: +.sp +.if n \{\ +.RS 4 +.\} +.nf +export NSS_DEFAULT_DB_TYPE="sql" +.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 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.PP +For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "SEE ALSO" +.PP +signtool (1) +.PP +The NSS wiki has information on the new database design and how to configure applications to use it\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Setting up the shared NSS database +.sp +https://wiki\&.mozilla\&.org/NSS_Shared_DB_Howto +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Engineering and technical information about the shared NSS database +.sp +https://wiki\&.mozilla\&.org/NSS_Shared_DB +.RE +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/ssltap.1 b/security/nss/doc/nroff/ssltap.1 new file mode 100644 index 000000000..69129ecb0 --- /dev/null +++ b/security/nss/doc/nroff/ssltap.1 @@ -0,0 +1,609 @@ +'\" t +.\" Title: SSLTAP +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "SSLTAP" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +ssltap \- Tap into SSL connections and display the data going by +.SH "SYNOPSIS" +.HP \w'\fBssltap\fR\ 'u +\fBssltap\fR [\-fhlsvx] [\-p\ port] [hostname:port] +.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 SSL Debugging Tool +\fBssltap\fR +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 +.SH "OPTIONS" +.PP +\-f +.RS 4 +Turn on fancy printing\&. Output is printed in colored HTML\&. Data sent from the client to the server is in blue; the server\*(Aqs 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\&. +.RE +.PP +\-h +.RS 4 +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\&. +.RE +.PP +\-l prefix +.RS 4 +Turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete\&. +.RE +.PP +\-p port +.RS 4 +Change the default rendezvous port (1924) to another port\&. +.sp +The following are well\-known port numbers: +.sp +* HTTP 80 +.sp +* HTTPS 443 +.sp +* SMTP 25 +.sp +* FTP 21 +.sp +* IMAP 143 +.sp +* IMAPS 993 (IMAP over SSL) +.sp +* NNTP 119 +.sp +* NNTPS 563 (NNTP over SSL) +.RE +.PP +\-s +.RS 4 +Turn on SSL parsing and decoding\&. The tool does not automatically detect SSL sessions\&. If you are intercepting an SSL connection, use this option so that the tool can detect and decode SSL structures\&. +.sp +If the tool detects a certificate chain, it saves the DER\-encoded certificates into files in the current directory\&. The files are named cert\&.0x, where x is the sequence number of the certificate\&. +.sp +If the \-s option is used with \-h, two separate parts are printed for each record: the plain hex/ASCII output, and the parsed SSL output\&. +.RE +.PP +\-v +.RS 4 +Print a version string for the tool\&. +.RE +.PP +\-x +.RS 4 +Turn on extra SSL hex dumps\&. +.RE +.SH "USAGE AND EXAMPLES" +.PP +You can use the SSL Debugging Tool to intercept any connection information\&. Although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful\&. For example, assume your development machine is called intercept\&. The simplest way to use the debugging tool is to execute the following command from a command shell: +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ ssltap www\&.netscape\&.com +.fi +.if n \{\ +.RE +.\} +.PP +The program waits for an incoming connection on the default port 1924\&. In your browser window, enter the URL http://intercept:1924\&. The browser retrieves the requested page from the server at www\&.netscape\&.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept\&. On its way to the browser, the data is printed to the command shell from which you issued the command\&. Data sent from the client to the server is surrounded by the following symbols: \-\-> [ data ] Data sent from the server to the client is surrounded by the following symbols: "left arrow"\-\- [ data ] The raw data stream is sent to standard output and is not interpreted in any way\&. This can result in peculiar effects, such as sounds, flashes, and even crashes of the command shell window\&. To output a basic, printable interpretation of the data, use the \-h option, or, if you are looking at an SSL connection, the \-s option\&. You will notice that the page you retrieved looks incomplete in the browser\&. This is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images\&. To make the tool continue to accept connections, switch on looping mode with the \-l option\&. The following examples show the output from commonly used combinations of options\&. +.PP +Example 1 +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ ssltap\&.exe \-sx \-p 444 interzone\&.mcom\&.com:443 > sx\&.txt +.fi +.if n \{\ +.RE +.\} +.PP +Output +.sp +.if n \{\ +.RS 4 +.\} +.nf +Connected to interzone\&.mcom\&.com:443 +\-\->; [ +alloclen = 66 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher\-specs\-length = 39 (0x27) + sid\-length = 0 (0x00) + challenge\-length = 16 (0x10) + cipher\-suites = { + + (0x010080) SSL2/RSA/RC4\-128/MD5 + (0x020080) SSL2/RSA/RC4\-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x040080) SSL2/RSA/RC2CBC40/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE\-CBC/MD5 + (0x000004) SSL3/RSA/RC4\-128/MD5 + (0x00ffe0) SSL3/RSA\-FIPS/3DES192EDE\-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE\-CBC/SHA + (0x00ffe1) SSL3/RSA\-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4\-40/MD5 + (0x000006) SSL3/RSA/RC2CBC40/MD5 + } + session\-id = { } + challenge = { 0xec5d 0x8edb 0x37c9 0xb5c9 0x7b70 0x8fe9 0xd1d3 + +0x2592 } +} +] +<\-\- [ +SSLRecord { + 0: 16 03 00 03 e5 |\&.\&.\&.\&.\&. + type = 22 (handshake) + version = { 3,0 } + length = 997 (0x3e5) + handshake { + 0: 02 00 00 46 |\&.\&.\&.F + type = 2 (server_hello) + length = 70 (0x000046) + ServerHello { + server_version = {3, 0} + random = {\&.\&.\&.} + 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | +wn&l\&.\(`i\&.\&.XOG\&.\-\&.E + 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | + +\e\&.uC\(scL\&.\(,C\&.d<PAHO\&. + session ID = { + length = 32 + + contents = {\&.\&.} + 0: 14 11 07 a8 2a 31 91 29 11 94 40 37 57 10 a7 32 | \&.\&.\&.\(ad*1\&.)\&.\&.@7W\&.\(sc2 + 10: 56 6f 52 62 fe 3d b3 65 b1 e4 13 0f 52 a3 c8 f6 | VoRb\(Tp=\(S3e\(+-\&.\&.\&.R\(Po\(`E\&. + } + cipher_suite = (0x0003) SSL3/RSA/RC4\-40/MD5 + } + 0: 0b 00 02 c5 |\&.\&.\&.\(oA + type = 11 (certificate) + length = 709 (0x0002c5) + CertificateChain { + chainlength = 706 (0x02c2) + Certificate { + size = 703 (0x02bf) + data = { saved in file \*(Aqcert\&.001\*(Aq } + } + } + 0: 0c 00 00 ca |\&.\&.\&.\&. + type = 12 (server_key_exchange) + length = 202 (0x0000ca) + 0: 0e 00 00 00 |\&.\&.\&.\&. + type = 14 (server_hello_done) + length = 0 (0x000000) + } +} +] +\-\-> [ +SSLRecord { + 0: 16 03 00 00 44 |\&.\&.\&.\&.D + type = 22 (handshake) + version = { 3,0 } + length = 68 (0x44) + handshake { + 0: 10 00 00 40 |\&.\&.\&.@ + type = 16 (client_key_exchange) + length = 64 (0x000040) + ClientKeyExchange { + message = {\&.\&.\&.} + } + } +} +] +\-\-> [ +SSLRecord { + 0: 14 03 00 00 01 |\&.\&.\&.\&.\&. + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) + 0: 01 |\&. +} +SSLRecord { + 0: 16 03 00 00 38 |\&.\&.\&.\&.8 + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + < encrypted > + +} +] +<\-\- [ +SSLRecord { + 0: 14 03 00 00 01 |\&.\&.\&.\&.\&. + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) + 0: 01 |\&. +} +] +<\-\- [ +SSLRecord { + 0: 16 03 00 00 38 |\&.\&.\&.\&.8 + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + < encrypted > + +} +] +\-\-> [ +SSLRecord { + 0: 17 03 00 01 1f |\&.\&.\&.\&.\&. + type = 23 (application_data) + version = { 3,0 } + length = 287 (0x11f) + < encrypted > +} +] +<\-\- [ +SSLRecord { + 0: 17 03 00 00 a0 |\&.\&.\&.\&. + type = 23 (application_data) + version = { 3,0 } + length = 160 (0xa0) + < encrypted > + +} +] +<\-\- [ +SSLRecord { +0: 17 03 00 00 df |\&.\&.\&.\&.\(ss + type = 23 (application_data) + version = { 3,0 } + length = 223 (0xdf) + < encrypted > + +} +SSLRecord { + 0: 15 03 00 00 12 |\&.\&.\&.\&.\&. + type = 21 (alert) + version = { 3,0 } + length = 18 (0x12) + < encrypted > +} +] +Server socket closed\&. +.fi +.if n \{\ +.RE +.\} +.PP +Example 2 +.PP +The \-s option turns on SSL parsing\&. Because the \-x option is not used in this example, undecoded values are output as raw data\&. The output is routed to a text file\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ ssltap \-s \-p 444 interzone\&.mcom\&.com:443 > s\&.txt +.fi +.if n \{\ +.RE +.\} +.PP +Output +.sp +.if n \{\ +.RS 4 +.\} +.nf +Connected to interzone\&.mcom\&.com:443 +\-\-> [ +alloclen = 63 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher\-specs\-length = 36 (0x24) + sid\-length = 0 (0x00) + challenge\-length = 16 (0x10) + cipher\-suites = { + (0x010080) SSL2/RSA/RC4\-128/MD5 + (0x020080) SSL2/RSA/RC4\-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE\-CBC/MD5 + (0x000004) SSL3/RSA/RC4\-128/MD5 + (0x00ffe0) SSL3/RSA\-FIPS/3DES192EDE\-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE\-CBC/SHA + (0x00ffe1) SSL3/RSA\-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4\-40/MD5 + } + session\-id = { } + challenge = { 0x713c 0x9338 0x30e1 0xf8d6 0xb934 0x7351 0x200c +0x3fd0 } +] +>\-\- [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 997 (0x3e5) + handshake { + type = 2 (server_hello) + length = 70 (0x000046) + ServerHello { + server_version = {3, 0} + random = {\&.\&.\&.} + session ID = { + length = 32 + contents = {\&.\&.} + } + cipher_suite = (0x0003) SSL3/RSA/RC4\-40/MD5 + } + type = 11 (certificate) + length = 709 (0x0002c5) + CertificateChain { + chainlength = 706 (0x02c2) + Certificate { + size = 703 (0x02bf) + data = { saved in file \*(Aqcert\&.001\*(Aq } + } + } + type = 12 (server_key_exchange) + length = 202 (0x0000ca) + type = 14 (server_hello_done) + length = 0 (0x000000) + } +} +] +\-\-> [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 68 (0x44) + handshake { + type = 16 (client_key_exchange) + length = 64 (0x000040) + ClientKeyExchange { + message = {\&.\&.\&.} + } + } +} +] +\-\-> [ +SSLRecord { + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) +} +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + > encrypted > +} +] +>\-\- [ +SSLRecord { + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) +} +] +>\-\- [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + > encrypted > +} +] +\-\-> [ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 287 (0x11f) + > encrypted > +} +] +[ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 160 (0xa0) + > encrypted > +} +] +>\-\- [ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 223 (0xdf) + > encrypted > +} +SSLRecord { + type = 21 (alert) + version = { 3,0 } + length = 18 (0x12) + > encrypted > +} +] +Server socket closed\&. +.fi +.if n \{\ +.RE +.\} +.PP +Example 3 +.PP +In this example, the \-h option turns hex/ASCII format\&. There is no SSL parsing or decoding\&. The output is routed to a text file\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ ssltap \-h \-p 444 interzone\&.mcom\&.com:443 > h\&.txt +.fi +.if n \{\ +.RE +.\} +.PP +Output +.sp +.if n \{\ +.RS 4 +.\} +.nf +Connected to interzone\&.mcom\&.com:443 +\-\-> [ + 0: 80 40 01 03 00 00 27 00 00 00 10 01 00 80 02 00 | \&.@\&.\&.\&.\&.\*(Aq\&.\&.\&.\&.\&.\&.\&.\&.\&. + 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | \&.\&.\&.\&.\&.\&.\&.\&.\&.@\&.\&.\&.\&.\&.\&. + 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 00 | \&.\&.\&.\&.\&.\&.\&.\&.\('a\&.\&.\&.\&.\&.\&.\&. + 30: 00 06 9b fe 5b 56 96 49 1f 9f ca dd d5 ba b9 52 | \&.\&.\(Tp[V\&.I\&.\exd9 \&.\&.\&.\(Om\(S1R + 40: 6f 2d |o\- +] +<\-\- [ + 0: 16 03 00 03 e5 02 00 00 46 03 00 7f e5 0d 1b 1d | \&.\&.\&.\&.\&.\&.\&.\&.F\&.\&.\&.\&.\&.\&.\&. + 10: 68 7f 3a 79 60 d5 17 3c 1d 9c 96 b3 88 d2 69 3b | h\&.:y`\&.\&.<\&.\&.\(S3\&.\(`Oi; + 20: 78 e2 4b 8b a6 52 12 4b 46 e8 c2 20 14 11 89 05 | x\&.K\&.\(bbR\&.KF\(`e\&. \&.\&.\&. + 30: 4d 52 91 fd 93 e0 51 48 91 90 08 96 c1 b6 76 77 | MR\&.\('y\&.\&.QH\&.\&.\&.\&.\&.\(psvw + 40: 2a f4 00 08 a1 06 61 a2 64 1f 2e 9b 00 03 00 0b | *\(^o\&.\&.\(r!\&.a\(ctd\&.\&.\&.\&.\&.\&. + 50: 00 02 c5 00 02 c2 00 02 bf 30 82 02 bb 30 82 02 | \&.\&.\(oA\&.\&.\&.\&.\&.\&.0\&.\&.\&.0\&.\&. + 60: 24 a0 03 02 01 02 02 02 01 36 30 0d 06 09 2a 86 | $ \&.\&.\&.\&.\&.\&.\&.60\&.\&.\&.*\&. + 70: 48 86 f7 0d 01 01 04 05 00 30 77 31 0b 30 09 06 | H\&.\(di\&.\&.\&.\&.\&.\&.0w1\&.0\&.\&. + 80: 03 55 04 06 13 02 55 53 31 2c 30 2a 06 03 55 04 | \&.U\&.\&.\&.\&.US1,0*\&.\&.U\&. + 90: 0a 13 23 4e 65 74 73 63 61 70 65 20 43 6f 6d 6d | \&.\&.#Netscape Comm + a0: 75 6e 69 63 61 74 69 6f 6e 73 20 43 6f 72 70 6f | unications Corpo + b0: 72 61 74 69 6f 6e 31 11 30 0f 06 03 55 04 0b 13 | ration1\&.0\&.\&.\&.U\&.\&.\&. + c0: 08 48 61 72 64 63 6f 72 65 31 27 30 25 06 03 55 | \&.Hardcore1\*(Aq0%\&.\&.U + d0: 04 03 13 1e 48 61 72 64 63 6f 72 65 20 43 65 72 | \&.\&.\&.\&.Hardcore Cer + e0: 74 69 66 69 63 61 74 65 20 53 65 72 76 65 72 20 | tificate Server + f0: 49 49 30 1e 17 0d 39 38 30 35 31 36 30 31 30 33 | II0\&.\&.\&.9805160103 +<additional data lines> +] +<additional records in same format> +Server socket closed\&. +.fi +.if n \{\ +.RE +.\} +.PP +Example 4 +.PP +In this example, the \-s option turns on SSL parsing, and the \-h option turns on hex/ASCII format\&. Both formats are shown for each record\&. The output is routed to a text file\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +$ ssltap \-hs \-p 444 interzone\&.mcom\&.com:443 > hs\&.txt +.fi +.if n \{\ +.RE +.\} +.PP +Output +.sp +.if n \{\ +.RS 4 +.\} +.nf +Connected to interzone\&.mcom\&.com:443 +\-\-> [ + 0: 80 3d 01 03 00 00 24 00 00 00 10 01 00 80 02 00 | \&.=\&.\&.\&.\&.$\&.\&.\&.\&.\&.\&.\&.\&.\&. + 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | \&.\&.\&.\&.\&.\&.\&.\&.\&.@\&.\&.\&.\&.\&.\&. + 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 03 | \&.\&.\&.\&.\&.\&.\&.\&.\('a\&.\&.\&.\&.\&.\&.\&. + 30: 55 e6 e4 99 79 c7 d7 2c 86 78 96 5d b5 cf e9 |U\&.\&.y\(,C\exb0 ,\&.x\&.]\(mc\(:I\('e +alloclen = 63 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher\-specs\-length = 36 (0x24) + sid\-length = 0 (0x00) + challenge\-length = 16 (0x10) + cipher\-suites = { + (0x010080) SSL2/RSA/RC4\-128/MD5 + (0x020080) SSL2/RSA/RC4\-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x040080) SSL2/RSA/RC2CBC40/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE\-CBC/MD5 + (0x000004) SSL3/RSA/RC4\-128/MD5 + (0x00ffe0) SSL3/RSA\-FIPS/3DES192EDE\-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE\-CBC/SHA + (0x00ffe1) SSL3/RSA\-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4\-40/MD5 + } + session\-id = { } + challenge = { 0x0355 0xe6e4 0x9979 0xc7d7 0x2c86 0x7896 0x5db + +0xcfe9 } +} +] +<additional records in same formats> +Server socket closed\&. +.fi +.if n \{\ +.RE +.\} +.SH "USAGE TIPS" +.PP +When SSL restarts a previous session, it makes use of cached information to do a partial handshake\&. If you wish to capture a full SSL handshake, restart the browser to clear the session id cache\&. +.PP +If you run the tool on a machine other than the SSL server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate\&. If you are using the default BadCert callback, you can still connect through a dialog\&. If you are not using the default BadCert callback, the one you supply must allow for this possibility\&. +.SH "SEE ALSO" +.PP +The NSS Security Tools are also documented at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&\s-2\u[2]\d\s+2\&. +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 +http://www.mozilla.org/projects/security/pki/nss/ +.RS 4 +\%http://www.mozilla.org/projects/security/pki/nss/tools +.RE diff --git a/security/nss/doc/nroff/vfychain.1 b/security/nss/doc/nroff/vfychain.1 new file mode 100644 index 000000000..d5e37e4d8 --- /dev/null +++ b/security/nss/doc/nroff/vfychain.1 @@ -0,0 +1,169 @@ +'\" t +.\" Title: VFYCHAIN +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "VFYCHAIN" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +vfychain_ \- vfychain [options] [revocation options] certfile [[options] certfile] \&.\&.\&. +.SH "SYNOPSIS" +.HP \w'\fBvfychain\fR\ 'u +\fBvfychain\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 +The verification Tool, +\fBvfychain\fR, verifies certificate chains\&. +\fBmodutil\fR +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\&. +.PP +The tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases\&. +.SH "OPTIONS" +.PP +\fB\-a\fR +.RS 4 +the following certfile is base64 encoded +.RE +.PP +\fB\-b \fR \fIYYMMDDHHMMZ\fR +.RS 4 +Validate date (default: now) +.RE +.PP +\fB\-d \fR \fIdirectory\fR +.RS 4 +database directory +.RE +.PP +\fB\-f \fR +.RS 4 +Enable cert fetching from AIA URL +.RE +.PP +\fB\-o \fR \fIoid\fR +.RS 4 +Set policy OID for cert validation(Format OID\&.1\&.2\&.3) +.RE +.PP +\fB\-p \fR +.RS 4 +Use PKIX Library to validate certificate by calling: +.sp +* CERT_VerifyCertificate if specified once, +.sp +* CERT_PKIXVerifyCert if specified twice and more\&. +.RE +.PP +\fB\-r \fR +.RS 4 +Following certfile is raw binary DER (default) +.RE +.PP +\fB\-t\fR +.RS 4 +Following cert is explicitly trusted (overrides db trust) +.RE +.PP +\fB\-u \fR \fIusage\fR +.RS 4 +0=SSL client, 1=SSL server, 2=SSL StepUp, 3=SSL CA, 4=Email signer, 5=Email recipient, 6=Object signer, 9=ProtectedObjectSigner, 10=OCSP responder, 11=Any CA +.RE +.PP +\fB\-T \fR +.RS 4 +Trust both explicit trust anchors (\-t) and the database\&. (Without this option, the default is to only trust certificates marked \-t, if there are any, or to trust the database if there are certificates marked \-t\&.) +.RE +.PP +\fB\-v \fR +.RS 4 +Verbose mode\&. Prints root cert subject(double the argument for whole root cert info) +.RE +.PP +\fB\-w \fR \fIpassword\fR +.RS 4 +Database password +.RE +.PP +\fB\-W \fR \fIpwfile\fR +.RS 4 +Password file +.RE +.PP +.RS 4 +Revocation options for PKIX API (invoked with \-pp options) is a collection of the following flags: [\-g type [\-h flags] [\-m type [\-s flags]] \&.\&.\&.] \&.\&.\&. +.sp +Where: +.RE +.PP +\fB\-g \fR \fItest\-type\fR +.RS 4 +Sets status checking test type\&. Possible values are "leaf" or "chain" +.RE +.PP +\fB\-g \fR \fItest type\fR +.RS 4 +Sets status checking test type\&. Possible values are "leaf" or "chain"\&. +.RE +.PP +\fB\-h \fR \fItest flags\fR +.RS 4 +Sets revocation flags for the test type it follows\&. Possible flags: "testLocalInfoFirst" and "requireFreshInfo"\&. +.RE +.PP +\fB\-m \fR \fImethod type\fR +.RS 4 +Sets method type for the test type it follows\&. Possible types are "crl" and "ocsp"\&. +.RE +.PP +\fB\-s \fR \fImethod flags\fR +.RS 4 +Sets revocation flags for the method it follows\&. Possible types are "doNotUse", "forbidFetching", "ignoreDefaultSrc", "requireInfo" and "failIfNoInfo"\&. +.RE +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/nroff/vfyserv.1 b/security/nss/doc/nroff/vfyserv.1 new file mode 100644 index 000000000..ffe5f3614 --- /dev/null +++ b/security/nss/doc/nroff/vfyserv.1 @@ -0,0 +1,70 @@ +'\" t +.\" Title: VFYSERV +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> +.\" Date: 5 June 2014 +.\" Manual: NSS Security Tools +.\" Source: nss-tools +.\" Language: English +.\" +.TH "VFYSERV" "1" "5 June 2014" "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 +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +vfyserv_ \- TBD +.SH "SYNOPSIS" +.HP \w'\fBvfyserv\fR\ 'u +\fBvfyserv\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 +The +\fBvfyserv \fR +tool verifies a certificate chain +.SH "OPTIONS" +.PP +.RS 4 +.sp +.RE +.SH "ADDITIONAL RESOURCES" +.PP +For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at +\m[blue]\fBhttp://www\&.mozilla\&.org/projects/security/pki/nss/\fR\m[]\&. The NSS site relates directly to NSS code changes and releases\&. +.PP +Mailing lists: https://lists\&.mozilla\&.org/listinfo/dev\-tech\-crypto +.PP +IRC: Freenode at #dogtag\-pki +.SH "AUTHORS" +.PP +The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google\&. +.PP +Authors: Elio Maldonado <emaldona@redhat\&.com>, Deon Lackey <dlackey@redhat\&.com>\&. +.SH "LICENSE" +.PP +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 diff --git a/security/nss/doc/pk12util.xml b/security/nss/doc/pk12util.xml new file mode 100644 index 000000000..03ee356e6 --- /dev/null +++ b/security/nss/doc/pk12util.xml @@ -0,0 +1,478 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="pk12util"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>PK12UTIL</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>pk12util</refname> + <refpurpose>Export and import keys and certificate to or from a PKCS #12 file and the NSS database</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>pk12util</command> + <arg>-i p12File|-l p12File|-o p12File</arg> + <arg>-d [sql:]directory</arg> + <arg>-h tokenname</arg> + <arg>-P dbprefix</arg> + <arg>-r</arg> + <arg>-v</arg> + <arg>-k slotPasswordFile|-K slotPassword</arg> + <arg>-w p12filePasswordFile|-W p12filePassword</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + <para>The PKCS #12 utility, <command>pk12util</command>, 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.</para> + </refsection> + + <refsection id="options"> + <title>Options and Arguments</title> + <para><command>Options</command></para> + <variablelist> + <varlistentry> + <term>-i p12file</term> + <listitem><para>Import keys and certificates from a PKCS#12 file into a security database.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-l p12file</term> + <listitem><para>List the keys and certificates in PKCS#12 file.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-o p12file</term> + <listitem><para>Export keys and certificates from the security database to a PKCS#12 file.</para></listitem> + </varlistentry> + </variablelist> + + <para><command>Arguments</command></para> + <variablelist> + <varlistentry> + <term>-c keyCipher</term> + <listitem><para>Specify the key encryption algorithm.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-C certCipher</term> + <listitem><para>Specify the key cert (overall package) encryption algorithm.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-d [sql:]directory</term> + <listitem><para>Specify the database directory into which to import to or export from certificates and keys.</para> + <para><command>pk12util</command> supports two types of databases: the legacy security databases (<filename>cert8.db</filename>, <filename>key3.db</filename>, and <filename>secmod.db</filename>) and new SQLite databases (<filename>cert9.db</filename>, <filename>key4.db</filename>, and <filename>pkcs11.txt</filename>). If the prefix <command>sql:</command> is not used, then the tool assumes that the given databases are in the old format.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-h tokenname</term> + <listitem><para>Specify the name of the token to import into or export from.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-k slotPasswordFile</term> + <listitem><para>Specify the text file containing the slot's password.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-K slotPassword</term> + <listitem><para>Specify the slot's password.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-m | --key-len keyLength</term> + <listitem><para>Specify the desired length of the symmetric key to be used to encrypt the private key.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-n | --cert-key-len certKeyLength</term> + <listitem><para>Specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-n certname</term> + <listitem><para>Specify the nickname of the cert and private key to export.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-P prefix</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-r</term> + <listitem><para>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.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-v </term> + <listitem><para>Enable debug logging when importing.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-w p12filePasswordFile</term> + <listitem><para>Specify the text file containing the pkcs #12 file password.</para></listitem> + </varlistentry> + + <varlistentry> + <term>-W p12filePassword</term> + <listitem><para>Specify the pkcs #12 file password.</para></listitem> + </varlistentry> + + </variablelist> + </refsection> + + <refsection id="return-codes"> + <title>Return Codes</title> + <itemizedlist> + <listitem> + <para> 0 - No error</para> + </listitem> + <listitem> + <para> 1 - User Cancelled</para> + </listitem> + <listitem> + <para> 2 - Usage error</para> + </listitem> + <listitem> + <para> 6 - NLS init error</para> + </listitem> + <listitem> + <para> 8 - Certificate DB open error</para> + </listitem> + <listitem> + <para> 9 - Key DB open error</para> + </listitem> + <listitem> + <para> 10 - File initialization error</para> + </listitem> + <listitem> + <para> 11 - Unicode conversion error</para> + </listitem> + <listitem> + <para> 12 - Temporary file creation error</para> + </listitem> + <listitem> + <para> 13 - PKCS11 get slot error</para> + </listitem> + <listitem> + <para> 14 - PKCS12 decoder start error</para> + </listitem> + <listitem> + <para> 15 - error read from import file</para> + </listitem> + <listitem> + <para> 16 - pkcs12 decode error</para> + </listitem> + <listitem> + <para> 17 - pkcs12 decoder verify error</para> + </listitem> + <listitem> + <para> 18 - pkcs12 decoder validate bags error</para> + </listitem> + <listitem> + <para> 19 - pkcs12 decoder import bags error</para> + </listitem> + <listitem> + <para> 20 - key db conversion version 3 to version 2 error</para> + </listitem> + <listitem> + <para> 21 - cert db conversion version 7 to version 5 error</para> + </listitem> + <listitem> + <para> 22 - cert and key dbs patch error</para> + </listitem> + <listitem> + <para> 23 - get default cert db error</para> + </listitem> + <listitem> + <para> 24 - find cert by nickname error</para> + </listitem> + <listitem> + <para> 25 - create export context error</para> + </listitem> + <listitem> + <para> 26 - PKCS12 add password itegrity error</para> + </listitem> + <listitem> + <para> 27 - cert and key Safes creation error</para> + </listitem> + <listitem> + <para> 28 - PKCS12 add cert and key error</para> + </listitem> + <listitem> + <para> 29 - PKCS12 encode error</para> + </listitem> + </itemizedlist> + </refsection> + + <refsection id="examples"> + <title>Examples</title> + <para><command>Importing Keys and Certificates</command></para> + <para>The most basic usage of <command>pk12util</command> for importing a certificate or key is the PKCS#12 input file (<option>-i</option>) and some way to specify the security database being accessed (either <option>-d</option> for a directory or <option>-h</option> for a token). + </para> + <para> + pk12util -i p12File [-h tokenname] [-v] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword] + </para> + <para>For example:</para> + <para> </para> + <programlisting># pk12util -i /tmp/cert-files/users.p12 -d sql:/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</programlisting> + + <para><command>Exporting Keys and Certificates</command></para> + <para>Using the <command>pk12util</command> command to export certificates and keys requires both the name of the certificate to extract from the database (<option>-n</option>) 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. + </para> + <para>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]</para> + <para>For example:</para> + <programlisting># pk12util -o certs.p12 -n Server-Cert -d sql:/home/my/sharednssdb +Enter password for PKCS12 file: +Re-enter password: </programlisting> + + <para><command>Listing Keys and Certificates</command></para> + <para>The information in a <filename>.p12</filename> 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 <filename>.p12</filename> file. + </para> + <para>pk12util -l p12File [-h tokenname] [-r] [-d [sql:]directory] [-P dbprefix] [-k slotPasswordFile|-K slotPassword] [-w p12filePasswordFile|-W p12filePassword]</para> + <para>For example, this prints the default ASCII output:</para> + <programlisting># 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: + 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f + Iteration Count: 1 (0x1) +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 13 (0xd) + Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption + Issuer: "E=personal-freemail@thawte.com,CN=Thawte Personal Freemail C + A,OU=Certification Services Division,O=Thawte Consulting,L=Cape T + own,ST=Western Cape,C=ZA" + </programlisting> + <para>Alternatively, the <option>-r</option> prints the certificates and then exports them into separate DER binary files. This allows the certificates to be fed to another application that supports <filename>.p12</filename> files. Each certificate is written to a sequentially-number file, beginning with <filename>file0001.der</filename> and continuing through <filename>file000N.der</filename>, incrementing the number for every certificate:</para> + <programlisting>pk12util -l test.p12 -r +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: + 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f + Iteration Count: 1 (0x1) +Certificate Friendly Name: Thawte Personal Freemail Issuing CA - Thawte Consulting + +Certificate Friendly Name: Thawte Freemail Member's Thawte Consulting (Pty) Ltd. ID + </programlisting> + </refsection> + + <refsection id="encryption"> + <title>Password Encryption</title> + <para>PKCS#12 provides for not only the protection of the private keys but also the certificate and meta-data associated with the keys. Password-based encryption is used to protect private keys on export to a PKCS#12 file and, optionally, the entire package. If no algorithm is specified, the tool defaults to using <command>PKCS12 V2 PBE with SHA1 and 3KEY Triple DES-cbc</command> for private key encryption. <command>PKCS12 V2 PBE with SHA1 and 40 Bit RC4</command> is the default for the overall package encryption when not in FIPS mode. When in FIPS mode, there is no package encryption.</para> + <para>The private key is always protected with strong encryption by default.</para> + <para>Several types of ciphers are supported.</para> + <variablelist> + + <varlistentry> + <term>Symmetric CBC ciphers for PKCS#5 V2</term> + <listitem> + <itemizedlist> + <listitem><para>DES-CBC</para></listitem> + <listitem><para>RC2-CBC</para></listitem> + <listitem><para>RC5-CBCPad</para></listitem> + <listitem><para>DES-EDE3-CBC (the default for key encryption)</para></listitem> + <listitem><para>AES-128-CBC</para></listitem> + <listitem><para>AES-192-CBC</para></listitem> + <listitem><para>AES-256-CBC</para></listitem> + <listitem><para>CAMELLIA-128-CBC</para></listitem> + <listitem><para>CAMELLIA-192-CBC</para></listitem> + <listitem><para>CAMELLIA-256-CBC</para></listitem> + </itemizedlist> + </listitem> + </varlistentry> + + <varlistentry> + <term>PKCS#12 PBE ciphers</term> + <listitem> + <itemizedlist> + <listitem><para>PKCS #12 PBE with Sha1 and 128 Bit RC4</para></listitem> + <listitem><para>PKCS #12 PBE with Sha1 and 40 Bit RC4</para></listitem> + <listitem><para>PKCS #12 PBE with Sha1 and Triple DES CBC</para></listitem> + <listitem><para>PKCS #12 PBE with Sha1 and 128 Bit RC2 CBC</para></listitem> + <listitem><para>PKCS #12 PBE with Sha1 and 40 Bit RC2 CBC</para></listitem> + <listitem><para>PKCS12 V2 PBE with SHA1 and 128 Bit RC4</para></listitem> + <listitem><para>PKCS12 V2 PBE with SHA1 and 40 Bit RC4 (the default for non-FIPS mode)</para></listitem> + <listitem><para>PKCS12 V2 PBE with SHA1 and 3KEY Triple DES-cbc</para></listitem> + <listitem><para>PKCS12 V2 PBE with SHA1 and 2KEY Triple DES-cbc</para></listitem> + <listitem><para>PKCS12 V2 PBE with SHA1 and 128 Bit RC2 CBC</para></listitem> + <listitem><para>PKCS12 V2 PBE with SHA1 and 40 Bit RC2 CBC</para></listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry><term>PKCS#5 PBE ciphers</term> + <listitem> + <itemizedlist> + <listitem><para>PKCS #5 Password Based Encryption with MD2 and DES CBC</para></listitem> + <listitem><para>PKCS #5 Password Based Encryption with MD5 and DES CBC</para></listitem> + <listitem><para>PKCS #5 Password Based Encryption with SHA1 and DES CBC</para></listitem> + </itemizedlist> + </listitem> + </varlistentry> + </variablelist> + <para>With PKCS#12, the crypto provider may be the soft token module or an external hardware module. If the cryptographic module does not support the requested algorithm, then the next best fit will be selected (usually the default). If no suitable replacement for the desired algorithm can be found, the tool returns the error <emphasis>no security module can perform the requested operation</emphasis>.</para> + </refsection> + +<refsection id="databases"><title>NSS Database Types</title> +<para>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <emphasis>legacy</emphasis> databases are:</para> +<itemizedlist> + <listitem> + <para> + cert8.db for certificates + </para> + </listitem> + <listitem> + <para> + key3.db for keys + </para> + </listitem> + <listitem> + <para> + secmod.db for PKCS #11 module information + </para> + </listitem> +</itemizedlist> + +<para>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</para> + +<para>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkleyDB. These new databases provide more accessibility and performance:</para> +<itemizedlist> + <listitem> + <para> + cert9.db for certificates + </para> + </listitem> + <listitem> + <para> + key4.db for keys + </para> + </listitem> + <listitem> + <para> + pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory + </para> + </listitem> +</itemizedlist> + +<para>Because the SQLite databases are designed to be shared, these are the <emphasis>shared</emphasis> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</para> + +<para>By default, the tools (<command>certutil</command>, <command>pk12util</command>, <command>modutil</command>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <command>sql:</command> prefix with the given security directory. For example:</para> + +<programlisting># pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb</programlisting> + +<para>To set the shared database type as the default type for the tools, set the <envar>NSS_DEFAULT_DB_TYPE</envar> environment variable to <envar>sql</envar>:</para> +<programlisting>export NSS_DEFAULT_DB_TYPE="sql"</programlisting> + +<para>This line can be set added to the <filename>~/.bashrc</filename> file to make the change permanent.</para> + +<para>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:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> +</itemizedlist> +<para>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> +</itemizedlist> +</refsection> + + <refsection id="seealso"> + <title>See Also</title> + <para>certutil (1)</para> + <para>modutil (1)</para> + + <para>The NSS wiki has information on the new database design and how to configure applications to use it.</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> +</itemizedlist> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/pp.xml b/security/nss/doc/pp.xml new file mode 100644 index 000000000..24efdf876 --- /dev/null +++ b/security/nss/doc/pp.xml @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="pp"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>PP</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>pp</refname> + <refpurpose>Prints certificates, keys, crls, and pkcs7 files</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>pp -t type [-a] [-i input] [-o output] [-u] [-w]</command> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection> + <title>Description</title> + + <para><command>pp </command>pretty-prints private and public key, certificate, certificate-request, + pkcs7 or crl files + </para> + + </refsection> + +<refsection> + <title>Options</title> + + <variablelist> + + <varlistentry> + <term><option>-t </option> <replaceable>type</replaceable></term> + <listitem> + <simpara>specify the input, one of {private-key | public-key | certificate | certificate-request | pkcs7 | crl}</simpara> + <simpara></simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-a </option></term> + <listitem> + <simpara>Input is in ascii encoded form (RFC1113)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-i </option> <replaceable>inputfile</replaceable></term> + <listitem> + <simpara>Define an input file to use (default is stdin)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-o </option> <replaceable>outputfile</replaceable></term> + <listitem> + <simpara>Define an output file to use (default is stdout)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-u </option> </term> + <listitem> + <simpara>Use UTF-8 (default is to show non-ascii as .)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-w </option> </term> + <listitem> + <simpara>Don't wrap long output lines</simpara> + </listitem> + </varlistentry> + + </variablelist> + </refsection> + + <refsection id="resources"> + <title>Additional Resources</title> + <para>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 <ulink url="http://pki.fedoraproject.org/wiki/">PKI Wiki</ulink>. </para> + <para>For information specifically about NSS, the NSS project wiki is located at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">Mozilla NSS site</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: pki-devel@redhat.com and pki-users@redhat.com</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/signtool.xml b/security/nss/doc/signtool.xml new file mode 100644 index 000000000..3a6c2080e --- /dev/null +++ b/security/nss/doc/signtool.xml @@ -0,0 +1,681 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="signtool"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>signtool</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>signtool</refname> + <refpurpose>Digitally sign objects and files.</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>signtool</command> + <arg>[-b basename]</arg> + <arg>[-c Compression Level] </arg> + <arg>[-d cert-dir] </arg> + <arg>[-e extension] </arg> + <arg>[-f filename] </arg> + <arg>[-i installer script] </arg> + <arg>[-h]</arg> + <arg>[-H]</arg> + <arg>[-v]</arg> + <arg>[-w]</arg> + <arg>[-G nickname]</arg> + <arg>[-J]</arg> + <arg>[-j directory] </arg> + <arg>-k keyName</arg> + <arg>[--keysize | -s size]</arg> + <arg>[-l]</arg> + <arg>[-L]</arg> + <arg>[-M]</arg> + <arg>[-m metafile] </arg> + <arg>[--norecurse] </arg> + <arg>[-O] </arg> + <arg>[-o] </arg> + <arg>[--outfile] </arg> + <arg>[-p password] </arg> + <arg>[-t|--token tokenname] </arg> + <arg>[-z] </arg> + <arg>[-X] </arg> + <arg>[-x name] </arg> + <arg>[--verbose value] </arg> + <arg>[--leavearc] </arg> + <arg>[-Z jarfile] </arg> + <arg>directory-tree</arg> + <arg>archive</arg> +<!-- this isn't the ideal formatting, since docbook can handle reqiored/optional formatting automatically, but let's make it explicit --> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + + <para>The Signing Tool, <command>signtool</command>, creates digital signatures and uses a Java Archive (JAR) file to associate the signatures with files in a directory. Electronic software distribution over any network involves potential security problems. To help address some of these problems, you can associate digital signatures with the files in a JAR archive. Digital signatures allow SSL-enabled clients to perform two important operations:</para> + <para>* Confirm the identity of the individual, company, or other entity whose digital signature is associated with the files</para> + <para>* Check whether the files have been tampered with since being signed</para> + <para>If you have a signing certificate, you can use Netscape Signing Tool to digitally sign files and package them as a JAR file. An object-signing certificate is a special kind of certificate that allows you to associate your digital signature with one or more files.</para> + <para>An individual file can potentially be signed with multiple digital signatures. For example, a commercial software developer might sign the files that constitute a software product to prove that the files are indeed from a particular company. A network administrator manager might sign the same files with an additional digital signature based on a company-generated certificate to indicate that the product is approved for use within the company.</para> + <para>The significance of a digital signature is comparable to the significance of a handwritten signature. Once you have signed a file, it is difficult to claim later that you didn't sign it. In some situations, a digital signature may be considered as legally binding as a handwritten signature. Therefore, you should take great care to ensure that you can stand behind any file you sign and distribute.</para> + <para>For example, if you are a software developer, you should test your code to make sure it is virus-free before signing it. Similarly, if you are a network administrator, you should make sure, before signing any code, that it comes from a reliable source and will run correctly with the software installed on the machines to which you are distributing it.</para> + <para>Before you can use Netscape Signing Tool to sign files, you must have an object-signing certificate, which is a special certificate whose associated private key is used to create digital signatures. For testing purposes only, you can create an object-signing certificate with Netscape Signing Tool 1.3. When testing is finished and you are ready to disitribute your software, you should obtain an object-signing certificate from one of two kinds of sources:</para> + <para>* An independent certificate authority (CA) that authenticates your identity and charges you a fee. You typically get a certificate from an independent CA if you want to sign software that will be distributed over the Internet.</para> + <para>* CA server software running on your corporate intranet or extranet. Netscape Certificate Management System provides a complete management solution for creating, deploying, and managing certificates, including CAs that issue object-signing certificates.</para> + <para>You must also have a certificate for the CA that issues your signing certificate before you can sign files. If the certificate authority's certificate isn't already installed in your copy of Communicator, you typically install it by clicking the appropriate link on the certificate authority's web site, for example on the page from which you initiated enrollment for your signing certificate. This is the case for some test certificates, as well as certificates issued by Netscape Certificate Management System: you must download the the CA certificate in addition to obtaining your own signing certificate. CA certificates for several certificate authorities are preinstalled in the Communicator certificate database.</para> + <para>When you receive an object-signing certificate for your own use, it is automatically installed in your copy of the Communicator client software. Communicator supports the public-key cryptography standard known as PKCS #12, which governs key portability. You can, for example, move an object-signing certificate and its associated private key from one computer to another on a credit-card-sized device called a smart card.</para> + </refsection> + + <refsection id="options"> + <title>Options</title> + +<!-- for the moment, I can't find a way for italics and bold tags to work in varlist entries --> + <variablelist> + <varlistentry> + <term>-b basename</term> + <listitem><para>Specifies the base filename for the .rsa and .sf files in the META-INF directory to conform with the JAR format. For example, <emphasis>-b signatures</emphasis> causes the files to be named signatures.rsa and signatures.sf. The default is signtool.</para></listitem> + </varlistentry> + <varlistentry> + <term>-c#</term> + <listitem><para> + Specifies the compression level for the -J or -Z option. The symbol # represents a number from 0 to 9, where 0 means no compression and 9 means maximum compression. The higher the level of compression, the smaller the output but the longer the operation takes. + +If the -c# option is not used with either the -J or the -Z option, the default compression value used by both the -J and -Z options is 6. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-d certdir</term> + <listitem><para> + Specifies your certificate database directory; that is, the directory in which you placed your key3.db and cert7.db files. To specify the current directory, use "-d." (including the period). + +The Unix version of signtool assumes ~/.netscape unless told otherwise. The NT version of signtool always requires the use of the -d option to specify where the database files are located. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-e extension</term> + <listitem><para> + Tells signtool to sign only files with the given extension; for example, use -e".class" to sign only Java class files. Note that with Netscape Signing Tool version 1.1 and later this option can appear multiple times on one command line, making it possible to specify multiple file types or classes to include. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-f commandfile</term> + <listitem><para> + Specifies a text file containing Netscape Signing Tool options and arguments in keyword=value format. All options and arguments can be expressed through this file. For more information about the syntax used with this file, see "Tips and Techniques". +</para></listitem> + </varlistentry> + <varlistentry> + <term>-G nickname</term> + <listitem><para> + Generates a new private-public key pair and corresponding object-signing certificate with the given nickname. + +The newly generated keys and certificate are installed into the key and certificate databases in the directory specified by the -d option. With the NT version of Netscape Signing Tool, you must use the -d option with the -G option. With the Unix version of Netscape Signing Tool, omitting the -d option causes the tool to install the keys and certificate in the Communicator key and certificate databases. If you are installing the keys and certificate in the Communicator databases, you must exit Communicator before using this option; otherwise, you risk corrupting the databases. In all cases, the certificate is also output to a file named x509.cacert, which has the MIME-type application/x-x509-ca-cert. + +Unlike certificates normally used to sign finished code to be distributed over a network, a test certificate created with -G is not signed by a recognized certificate authority. Instead, it is self-signed. In addition, a single test signing certificate functions as both an object-signing certificate and a CA. When you are using it to sign objects, it behaves like an object-signing certificate. When it is imported into browser software such as Communicator, it behaves like an object-signing CA and cannot be used to sign objects. + +The -G option is available in Netscape Signing Tool 1.0 and later versions only. By default, it produces only RSA certificates with 1024-byte keys in the internal token. However, you can use the -s option specify the required key size and the -t option to specify the token. + </para></listitem> + </varlistentry> + <varlistentry> + <term>-i scriptname</term> + <listitem><para> +Specifies the name of an installer script for SmartUpdate. This script installs files from the JAR archive in the local system after SmartUpdate has validated the digital signature. For more details, see the description of -m that follows. The -i option provides a straightforward way to provide this information if you don't need to specify any metadata other than an installer script. + </para></listitem> + </varlistentry> + <varlistentry> + <term>-J</term> + <listitem> + <para> +Signs a directory of HTML files containing JavaScript and creates as many archive files as are specified in the HTML tags. Even if signtool creates more than one archive file, you need to supply the key database password only once. + +The -J option is available only in Netscape Signing Tool 1.0 and later versions. The -J option cannot be used at the same time as the -Z option. + +If the -c# option is not used with the -J option, the default compression value is 6. + +Note that versions 1.1 and later of Netscape Signing Tool correctly recognizes the CODEBASE attribute, allows paths to be expressed for the CLASS and SRC attributes instead of filenames only, processes LINK tags and parses HTML correctly, and offers clearer error messages. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>-j directory</term> + <listitem><para> + Specifies a special JavaScript directory. This option causes the specified directory to be signed and tags its entries as inline JavaScript. This special type of entry does not have to appear in the JAR file itself. Instead, it is located in the HTML page containing the inline scripts. When you use signtool -v, these entries are displayed with the string NOT PRESENT. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-k key ... directory</term> + <listitem><para> + Specifies the nickname (key) of the certificate you want to sign with and signs the files in the specified directory. The directory to sign is always specified as the last command-line argument. Thus, it is possible to write + +signtool -k MyCert -d . signdir + +You may have trouble if the nickname contains a single quotation mark. To avoid problems, escape the quotation mark using the escape conventions for your platform. + +It's also possible to use the -k option without signing any files or specifying a directory. For example, you can use it with the -l option to get detailed information about a particular signing certificate. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-l</term> + <listitem><para> + Lists signing certificates, including issuing CAs. If any of your certificates are expired or invalid, the list will so specify. This option can be used with the -k option to list detailed information about a particular signing certificate. + +The -l option is available in Netscape Signing Tool 1.0 and later versions only. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-L</term> + <listitem><para> + Lists the certificates in your database. An asterisk appears to the left of the nickname for any certificate that can be used to sign objects with signtool. +</para></listitem> + </varlistentry> + <varlistentry> + <term>--leavearc</term> + <listitem><para> + Retains the temporary .arc (archive) directories that the -J option creates. These directories are automatically erased by default. Retaining the temporary directories can be an aid to debugging. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-m metafile</term> + <listitem><para> + Specifies the name of a metadata control file. Metadata is signed information attached either to the JAR archive itself or to files within the archive. This metadata can be any ASCII string, but is used mainly for specifying an installer script. + +The metadata file contains one entry per line, each with three fields: + +field #1: file specification, or + if you want to specify global metadata (that is, metadata about the JAR archive itself or all entries in the archive) +field #2: the name of the data you are specifying; for example: Install-Script +field #3: data corresponding to the name in field #2 + +For example, the -i option uses the equivalent of this line: + ++ Install-Script: script.js + + +This example associates a MIME type with a file: + +movie.qt MIME-Type: video/quicktime + +For information about the way installer script information appears in the manifest file for a JAR archive, see The JAR Format on Netscape DevEdge. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-M</term> + <listitem><para> + Lists the PKCS #11 modules available to signtool, including smart cards. + +The -M option is available in Netscape Signing Tool 1.0 and later versions only. + +For information on using Netscape Signing Tool with smart cards, see "Using Netscape Signing Tool with Smart Cards". + +For information on using the -M option to verify FIPS-140-1 validated mode, see "Netscape Signing Tool and FIPS-140-1". +</para></listitem> + </varlistentry> + <varlistentry> + <term>--norecurse</term> + <listitem><para> + Blocks recursion into subdirectories when signing a directory's contents or when parsing HTML. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-o</term> + <listitem><para> + Optimizes the archive for size. Use this only if you are signing very large archives containing hundreds of files. This option makes the manifest files (required by the JAR format) considerably smaller, but they contain slightly less information. +</para></listitem> + </varlistentry> + <varlistentry> + <term>--outfile outputfile</term> + <listitem><para> + Specifies a file to receive redirected output from Netscape Signing Tool. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-p password</term> + <listitem><para> + Specifies a password for the private-key database. Note that the password entered on the command line is displayed as plain text. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-s keysize</term> + <listitem><para> + Specifies the size of the key for generated certificate. Use the -M option to find out what tokens are available. + +The -s option can be used with the -G option only. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-t token</term> + <listitem><para> + Specifies which available token should generate the key and receive the certificate. Use the -M option to find out what tokens are available. + +The -t option can be used with the -G option only. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-v archive</term> + <listitem><para> + Displays the contents of an archive and verifies the cryptographic integrity of the digital signatures it contains and the files with which they are associated. This includes checking that the certificate for the issuer of the object-signing certificate is listed in the certificate database, that the CA's digital signature on the object-signing certificate is valid, that the relevant certificates have not expired, and so on. +</para></listitem> + </varlistentry> + <varlistentry> + <term>--verbosity value</term> + <listitem><para> + Sets the quantity of information Netscape Signing Tool generates in operation. A value of 0 (zero) is the default and gives full information. A value of -1 suppresses most messages, but not error messages. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-w archive</term> + <listitem><para> + Displays the names of signers of any files in the archive. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-x directory</term> + <listitem><para> + Excludes the specified directory from signing. Note that with Netscape Signing Tool version 1.1 and later this option can appear multiple times on one command line, making it possible to specify several particular directories to exclude. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-z</term> + <listitem><para> + Tells signtool not to store the signing time in the digital signature. This option is useful if you want the expiration date of the signature checked against the current date and time rather than the time the files were signed. +</para></listitem> + </varlistentry> + <varlistentry> + <term>-Z jarfile</term> + <listitem><para> + Creates a JAR file with the specified name. You must specify this option if you want signtool to create the JAR file; it does not do so automatically. If you don't specify -Z, you must use an external ZIP tool to create the JAR file. + +The -Z option cannot be used at the same time as the -J option. + +If the -c# option is not used with the -Z option, the default compression value is 6.</para></listitem> + </varlistentry> + </variablelist> + </refsection> + + <refsection id="command-file"> + <title>The Command File Format</title> + <para>Entries in a Netscape Signing Tool command file have this general format: +keyword=value + +Everything before the = sign on a single line is a keyword, and everything from the = sign to the end of line is a value. The value may include = signs; only the first = sign on a line is interpreted. Blank lines are ignored, but white space on a line with keywords and values is assumed to be part of the keyword (if it comes before the equal sign) or part of the value (if it comes after the first equal sign). Keywords are case insensitive, values are generally case sensitive. Since the = sign and newline delimit the value, it should not be quoted. </para> +<!-- i'm working on a decent way to do embedded subsections; for now, just use a bold tag to show a new section --> + <para><command>Subsection</command></para> + <variablelist> + <varlistentry> + <term>basename</term> + <listitem><para>Same as -b option.</para></listitem> + </varlistentry> + <varlistentry> + <term>compression</term> + <listitem><para> + Same as -c option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>certdir</term> + <listitem><para> + Same as -d option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>extension</term> + <listitem><para> + Same as -e option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>generate</term> + <listitem><para> + Same as -G option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>installscript</term> + <listitem><para> + Same as -i option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>javascriptdir</term> + <listitem><para> + Same as -j option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>htmldir</term> + <listitem><para> + Same as -J option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>certname</term> + <listitem><para> + Nickname of certificate, as with -k and -l -k options. +</para></listitem> + </varlistentry> + <varlistentry> + <term>signdir</term> + <listitem><para> + The directory to be signed, as with -k option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>list</term> + <listitem><para> + Same as -l option. Value is ignored, but = sign must be present. +</para></listitem> + </varlistentry> + <varlistentry> + <term>listall</term> + <listitem><para> + Same as -L option. Value is ignored, but = sign must be present. +</para></listitem> + </varlistentry> + <varlistentry> + <term>metafile</term> + <listitem><para> + Same as -m option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>modules</term> + <listitem><para> + Same as -M option. Value is ignored, but = sign must be present. +</para></listitem> + </varlistentry> + <varlistentry> + <term>optimize</term> + <listitem><para> + Same as -o option. Value is ignored, but = sign must be present. +</para></listitem> + </varlistentry> + <varlistentry> + <term>password</term> + <listitem><para> + Same as -p option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>keysize</term> + <listitem><para> + Same as -s option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>token</term> + <listitem><para> + Same as -t option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>verify</term> + <listitem><para> + Same as -v option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>who</term> + <listitem><para> + Same as -w option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>exclude</term> + <listitem><para> + Same as -x option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>notime</term> + <listitem><para> + Same as -z option. value is ignored, but = sign must be present. +</para></listitem> + </varlistentry> + <varlistentry> + <term>jarfile</term> + <listitem><para> + Same as -Z option. +</para></listitem> + </varlistentry> + <varlistentry> + <term>outfile</term> + <listitem><para> + Name of a file to which output and error messages will be redirected. This option has no command-line equivalent. + </para></listitem></varlistentry></variablelist> + </refsection> + + <refsection id="examples"> + <title>Extended Examples</title> + <para>The following example will do this and that + </para> + <para><command>Listing Available Signing Certificates</command></para> + <para>You use the -L option to list the nicknames for all available certificates and check which ones are signing certificates.</para> +<programlisting >signtool -L + +using certificate directory: /u/jsmith/.netscape +S Certificates +- ------------ + BBN Certificate Services CA Root 1 + IBM World Registry CA + VeriSign Class 1 CA - Individual Subscriber - VeriSign, Inc. + GTE CyberTrust Root CA + Uptime Group Plc. Class 4 CA +* Verisign Object Signing Cert + Integrion CA + GTE CyberTrust Secure Server CA + AT&T Directory Services +* test object signing cert + Uptime Group Plc. Class 1 CA + VeriSign Class 1 Primary CA +- ------------ + +Certificates that can be used to sign objects have *'s to their left. </programlisting> + <para>Two signing certificates are displayed: Verisign Object Signing Cert and test object signing cert.</para> + <para>You use the -l option to get a list of signing certificates only, including the signing CA for each.</para> +<programlisting >signtool -l + +using certificate directory: /u/jsmith/.netscape +Object signing certificates +--------------------------------------- + +Verisign Object Signing Cert + Issued by: VeriSign, Inc. - Verisign, Inc. + Expires: Tue May 19, 1998 +test object signing cert + Issued by: test object signing cert (Signtool 1.0 Testing +Certificate (960187691)) + Expires: Sun May 17, 1998 +---------------------------------------</programlisting> + <para>For a list including CAs, use the <option>-L</option> option.</para> + + <para><command>Signing a File</command></para> + <para>1. Create an empty directory.</para> +<programlisting >mkdir signdir</programlisting> + + <para>2. Put some file into it.</para> +<programlisting >echo boo > signdir/test.f</programlisting> + + <para>3. Specify the name of your object-signing certificate and sign the directory.</para> +<programlisting >signtool -k MySignCert -Z testjar.jar signdir + +using key "MySignCert" +using certificate directory: /u/jsmith/.netscape +Generating signdir/META-INF/manifest.mf file.. +--> test.f +adding signdir/test.f to testjar.jar +Generating signtool.sf file.. +Enter Password or Pin for "Communicator Certificate DB": + +adding signdir/META-INF/manifest.mf to testjar.jar +adding signdir/META-INF/signtool.sf to testjar.jar +adding signdir/META-INF/signtool.rsa to testjar.jar + +tree "signdir" signed successfully</programlisting> + <para>4. Test the archive you just created.</para> +<programlisting >signtool -v testjar.jar + +using certificate directory: /u/jsmith/.netscape +archive "testjar.jar" has passed crypto verification. + status path + ------------ ------------------- + verified test.f</programlisting> + + <para><command>Using Netscape Signing Tool with a ZIP Utility</command></para> + <para>To use Netscape Signing Tool with a ZIP utility, you must have the utility in your path environment variable. You should use the zip.exe utility rather than pkzip.exe, which cannot handle long filenames. You can use a ZIP utility instead of the -Z option to package a signed archive into a JAR file after you have signed it:</para> +<programlisting >cd signdir + + zip -r ../myjar.jar * + adding: META-INF/ (stored 0%) + adding: META-INF/manifest.mf (deflated 15%) + adding: META-INF/signtool.sf (deflated 28%) + adding: META-INF/signtool.rsa (stored 0%) + adding: text.txt (stored 0%)</programlisting> + + <para><command>Generating the Keys and Certificate</command></para> + <para>The signtool option -G generates a new public-private key pair and certificate. It takes the nickname of the new certificate as an argument. The newly generated keys and certificate are installed into the key and certificate databases in the directory specified by the -d option. With the NT version of Netscape Signing Tool, you must use the -d option with the -G option. With the Unix version of Netscape Signing Tool, omitting the -d option causes the tool to install the keys and certificate in the Communicator key and certificate databases. In all cases, the certificate is also output to a file named x509.cacert, which has the MIME-type application/x-x509-ca-cert.</para> + <para>Certificates contain standard information about the entity they identify, such as the common name and organization name. Netscape Signing Tool prompts you for this information when you run the command with the -G option. However, all of the requested fields are optional for test certificates. If you do not enter a common name, the tool provides a default name. In the following example, the user input is in boldface:</para> +<programlisting >signtool -G MyTestCert + +using certificate directory: /u/someuser/.netscape +Enter certificate information. All fields are optional. Acceptable +characters are numbers, letters, spaces, and apostrophes. +certificate common name: Test Object Signing Certificate +organization: Netscape Communications Corp. +organization unit: Server Products Division +state or province: California +country (must be exactly 2 characters): US +username: someuser +email address: someuser@netscape.com +Enter Password or Pin for "Communicator Certificate DB": [Password will not echo] +generated public/private key pair +certificate request generated +certificate has been signed +certificate "MyTestCert" added to database +Exported certificate to x509.raw and x509.cacert.</programlisting> + <para>The certificate information is read from standard input. Therefore, the information can be read from a file using the redirection operator (<) in some operating systems. To create a file for this purpose, enter each of the seven input fields, in order, on a separate line. Make sure there is a newline character at the end of the last line. Then run signtool with standard input redirected from your file as follows:</para> +<programlisting >signtool -G MyTestCert inputfile</programlisting> + <para>The prompts show up on the screen, but the responses will be automatically read from the file. The password will still be read from the console unless you use the -p option to give the password on the command line.</para> + + <para><command>Using the -M Option to List Smart Cards</command></para> + <para>You can use the -M option to list the PKCS #11 modules, including smart cards, that are available to signtool:</para> +<programlisting >signtool -d "c:\netscape\users\jsmith" -M + +using certificate directory: c:\netscape\users\username +Listing of PKCS11 modules +----------------------------------------------- + 1. Netscape Internal PKCS #11 Module + (this module is internally loaded) + slots: 2 slots attached + status: loaded + slot: Communicator Internal Cryptographic Services Version 4.0 + token: Communicator Generic Crypto Svcs + slot: Communicator User Private Key and Certificate Services + token: Communicator Certificate DB + 2. CryptOS + (this is an external module) + DLL name: core32 + slots: 1 slots attached + status: loaded + slot: Litronic 210 + token: + ----------------------------------------------- </programlisting> + + <para><command>Using Netscape Signing Tool and a Smart Card to Sign Files</command></para> + <para>The signtool command normally takes an argument of the -k option to specify a signing certificate. To sign with a smart card, you supply only the fully qualified name of the certificate.</para> + <para>To see fully qualified certificate names when you run Communicator, click the Security button in Navigator, then click Yours under Certificates in the left frame. Fully qualified names are of the format smart card:certificate, for example "MyCard:My Signing Cert". You use this name with the -k argument as follows:</para> +<programlisting >signtool -k "MyCard:My Signing Cert" directory</programlisting> + + + <para><command>Verifying FIPS Mode</command></para> + <para>Use the -M option to verify that you are using the FIPS-140-1 module.</para> +<programlisting >signtool -d "c:\netscape\users\jsmith" -M + +using certificate directory: c:\netscape\users\jsmith +Listing of PKCS11 modules +----------------------------------------------- + 1. Netscape Internal PKCS #11 Module + (this module is internally loaded) + slots: 2 slots attached + status: loaded + slot: Communicator Internal Cryptographic Services Version 4.0 + token: Communicator Generic Crypto Svcs + slot: Communicator User Private Key and Certificate Services + token: Communicator Certificate DB +-----------------------------------------------</programlisting> + <para>This Unix example shows that Netscape Signing Tool is using a FIPS-140-1 module:</para> +<programlisting >signtool -d "c:\netscape\users\jsmith" -M +using certificate directory: c:\netscape\users\jsmith +Enter Password or Pin for "Communicator Certificate DB": [password will not echo] +Listing of PKCS11 modules +----------------------------------------------- +1. Netscape Internal FIPS PKCS #11 Module +(this module is internally loaded) +slots: 1 slots attached +status: loaded +slot: Netscape Internal FIPS-140-1 Cryptographic Services +token: Communicator Certificate DB +-----------------------------------------------</programlisting> + </refsection> + + <refsection id="seealso"> + <title>See Also</title> + <para>signver (1)</para> + + <para>The NSS wiki has information on the new database design and how to configure applications to use it.</para> + <itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> + </itemizedlist> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/signver.xml b/security/nss/doc/signver.xml new file mode 100644 index 000000000..e645e9190 --- /dev/null +++ b/security/nss/doc/signver.xml @@ -0,0 +1,230 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="signver"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>SIGNVER</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>signver</refname> + <refpurpose>Verify a detached PKCS#7 signature for a file.</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>signtool</command> + <group choice="plain"> + <arg choice="plain">-A</arg> + <arg choice="plain">-V</arg> + </group> + <arg choice="plain">-d <replaceable>directory</replaceable></arg> + <arg>-a</arg> + <arg>-i <replaceable>input_file</replaceable></arg> + <arg>-o <replaceable>output_file</replaceable></arg> + <arg>-s <replaceable>signature_file</replaceable></arg> + <arg>-v</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + + <para>The Signature Verification Tool, <command>signver</command>, 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.</para> + </refsection> + + <refsection id="options"> + <title>Options</title> + <variablelist> + <varlistentry> + <term>-A</term> + <listitem><para>Displays all of the information in the PKCS#7 signature.</para></listitem> + </varlistentry> + <varlistentry> + <term>-V</term> + <listitem><para>Verifies the digital signature.</para></listitem> + </varlistentry> + <varlistentry> + <term>-d [sql:]<emphasis>directory</emphasis></term> + <listitem><para>Specify the database directory which contains the certificates and keys.</para> + <para><command>signver</command> supports two types of databases: the legacy security databases (<filename>cert8.db</filename>, <filename>key3.db</filename>, and <filename>secmod.db</filename>) and new SQLite databases (<filename>cert9.db</filename>, <filename>key4.db</filename>, and <filename>pkcs11.txt</filename>). If the prefix <command>sql:</command> is not used, then the tool assumes that the given databases are in the old format.</para></listitem> + </varlistentry> + <varlistentry> + <term>-a</term> + <listitem><para>Sets that the given signature file is in ASCII format.</para></listitem> + </varlistentry> + <varlistentry> + <term>-i <emphasis>input_file</emphasis></term> + <listitem><para>Gives the input file for the object with signed data.</para></listitem> + </varlistentry> + <varlistentry> + <term>-o <emphasis>output_file</emphasis></term> + <listitem><para>Gives the output file to which to write the results.</para></listitem> + </varlistentry> + <varlistentry> + <term>-s <emphasis>signature_file</emphasis></term> + <listitem><para>Gives the input file for the digital signature.</para></listitem> + </varlistentry> + <varlistentry> + <term>-v</term> + <listitem><para>Enables verbose output.</para></listitem> + </varlistentry> + </variablelist> + </refsection> + + <refsection id="examples"> + <title>Extended Examples</title> + <refsection><title>Verifying a Signature</title> + <para>The <option>-V</option> option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file).</para> +<programlisting>signver -V -s <replaceable>signature_file</replaceable> -i <replaceable>signed_file</replaceable> -d sql:/home/my/sharednssdb + +signatureValid=yes</programlisting> + </refsection> + + <refsection><title>Printing Signature Data</title> + <para> + The <option>-A</option> option prints all of the information contained in a signature file. Using the <option>-o</option> option prints the signature file information to the given output file rather than stdout. + </para> +<programlisting>signver -A -s <replaceable>signature_file</replaceable> -o <replaceable>output_file</replaceable></programlisting> + </refsection> + </refsection> + +<refsection id="databases"><title>NSS Database Types</title> +<para>NSS originally used BerkeleyDB databases to store security information. +The last versions of these <emphasis>legacy</emphasis> databases are:</para> +<itemizedlist> + <listitem> + <para> + cert8.db for certificates + </para> + </listitem> + <listitem> + <para> + key3.db for keys + </para> + </listitem> + <listitem> + <para> + secmod.db for PKCS #11 module information + </para> + </listitem> +</itemizedlist> + +<para>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has +some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. Still, NSS +requires more flexibility to provide a truly shared security database.</para> + +<para>In 2009, NSS introduced a new set of databases that are SQLite databases rather than +BerkleyDB. These new databases provide more accessibility and performance:</para> +<itemizedlist> + <listitem> + <para> + cert9.db for certificates + </para> + </listitem> + <listitem> + <para> + key4.db for keys + </para> + </listitem> + <listitem> + <para> + pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory + </para> + </listitem> +</itemizedlist> + +<para>Because the SQLite databases are designed to be shared, these are the <emphasis>shared</emphasis> database type. The shared database type is preferred; the legacy format is included for backward compatibility.</para> + +<para>By default, the tools (<command>certutil</command>, <command>pk12util</command>, <command>modutil</command>) assume that the given security databases follow the more common legacy type. +Using the SQLite databases must be manually specified by using the <command>sql:</command> prefix with the given security directory. For example:</para> + +<programlisting># signver -A -s <replaceable>signature</replaceable> -d sql:/home/my/sharednssdb</programlisting> + +<para>To set the shared database type as the default type for the tools, set the <envar>NSS_DEFAULT_DB_TYPE</envar> environment variable to <envar>sql</envar>:</para> +<programlisting>export NSS_DEFAULT_DB_TYPE="sql"</programlisting> + +<para>This line can be added to the <filename>~/.bashrc</filename> file to make the change permanent for the user.</para> + +<para>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:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> +</itemizedlist> +<para>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</para> +<itemizedlist> + <listitem> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> +</itemizedlist> +</refsection> + + <refsection id="seealso"> + <title>See Also</title> + <para>signtool (1)</para> + + <para>The NSS wiki has information on the new database design and how to configure applications to use it.</para> + <itemizedlist> + <listitem> + <para>Setting up the shared NSS database</para> + <para>https://wiki.mozilla.org/NSS_Shared_DB_Howto</para> + </listitem> + <listitem> + <para> + Engineering and technical information about the shared NSS database + </para> + <para> + https://wiki.mozilla.org/NSS_Shared_DB + </para> + </listitem> + </itemizedlist> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/ssltap.xml b/security/nss/doc/ssltap.xml new file mode 100644 index 000000000..32b9e2f51 --- /dev/null +++ b/security/nss/doc/ssltap.xml @@ -0,0 +1,579 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="ssltap"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>SSLTAP</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>ssltap</refname> + <refpurpose>Tap into SSL connections and display the data going by </refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>ssltap</command> + <arg choice="opt">-fhlsvx</arg> + <arg choice="opt">-p port</arg> + <arg choice="opt">hostname:port</arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + <para>The SSL Debugging Tool <command>ssltap</command> 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</para> + </refsection> + + <refsection id="options"> + <title>Options</title> + <variablelist> + <varlistentry> + <term>-f </term> + <listitem><para> +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. + </para></listitem> + </varlistentry> + <varlistentry> + <term>-h </term> + <listitem><para> +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. + </para></listitem> + </varlistentry> + <varlistentry> + <term>-l prefix</term> + <listitem> + <para> +Turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>-p port</term> + <listitem> + <para>Change the default rendezvous port (1924) to another port.</para> + <para>The following are well-known port numbers:</para> + <para> + * HTTP 80 + </para> + <para> + * HTTPS 443 + </para> + <para> + * SMTP 25 + </para> + <para> + * FTP 21 + </para> + <para> + * IMAP 143 + </para> + <para> + * IMAPS 993 (IMAP over SSL) + </para> + <para> + * NNTP 119 + </para> + <para> + * NNTPS 563 (NNTP over SSL) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>-s </term> + <listitem> + <para> +Turn on SSL parsing and decoding. The tool does not automatically detect SSL sessions. If you are intercepting an SSL connection, use this option so that the tool can detect and decode SSL structures. + </para> + <para> +If the tool detects a certificate chain, it saves the DER-encoded certificates into files in the current directory. The files are named cert.0x, where x is the sequence number of the certificate. + </para> + <para> +If the -s option is used with -h, two separate parts are printed for each record: the plain hex/ASCII output, and the parsed SSL output. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>-v </term> + <listitem><para>Print a version string for the tool.</para></listitem> + </varlistentry> + <varlistentry> + <term>-x </term> + <listitem><para>Turn on extra SSL hex dumps.</para></listitem> + </varlistentry> + </variablelist> + </refsection> + + <refsection id="basic-usage"> + <title>Usage and Examples</title> + <para> +You can use the SSL Debugging Tool to intercept any connection information. Although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful. For example, assume your development machine is called intercept. The simplest way to use the debugging tool is to execute the following command from a command shell: + </para> +<programlisting>$ ssltap www.netscape.com</programlisting> + <para> +The program waits for an incoming connection on the default port 1924. In your browser window, enter the URL http://intercept:1924. The browser retrieves the requested page from the server at www.netscape.com, but the page is intercepted and passed on to the browser by the debugging tool on intercept. On its way to the browser, the data is printed to the command shell from which you issued the command. Data sent from the client to the server is surrounded by the following symbols: --> [ data ] Data sent from the server to the client is surrounded by the following symbols: +"left arrow"-- [ data ] The raw data stream is sent to standard output and is not interpreted in any way. This can result in peculiar effects, such as sounds, flashes, and even crashes of the command shell window. To output a basic, printable interpretation of the data, use the -h option, or, if you are looking at an SSL connection, the -s option. You will notice that the page you retrieved looks incomplete in the browser. This is because, by default, the tool closes down after the first connection is complete, so the browser is not able to load images. To make the tool +continue to accept connections, switch on looping mode with the -l option. The following examples show the output from commonly used combinations of options. + </para> + + <para>Example 1 </para> +<programlisting>$ ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt</programlisting> + <para>Output </para> +<programlisting> +Connected to interzone.mcom.com:443 +-->; [ +alloclen = 66 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher-specs-length = 39 (0x27) + sid-length = 0 (0x00) + challenge-length = 16 (0x10) + cipher-suites = { + + (0x010080) SSL2/RSA/RC4-128/MD5 + (0x020080) SSL2/RSA/RC4-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x040080) SSL2/RSA/RC2CBC40/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE-CBC/MD5 + (0x000004) SSL3/RSA/RC4-128/MD5 + (0x00ffe0) SSL3/RSA-FIPS/3DES192EDE-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE-CBC/SHA + (0x00ffe1) SSL3/RSA-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4-40/MD5 + (0x000006) SSL3/RSA/RC2CBC40/MD5 + } + session-id = { } + challenge = { 0xec5d 0x8edb 0x37c9 0xb5c9 0x7b70 0x8fe9 0xd1d3 + +0x2592 } +} +] +<-- [ +SSLRecord { + 0: 16 03 00 03 e5 |..... + type = 22 (handshake) + version = { 3,0 } + length = 997 (0x3e5) + handshake { + 0: 02 00 00 46 |...F + type = 2 (server_hello) + length = 70 (0x000046) + ServerHello { + server_version = {3, 0} + random = {...} + 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | +wn&l.ì..XOG.-.E + 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | + +\.uC§L.Ç.d<PAHO. + session ID = { + length = 32 + + contents = {..} + 0: 14 11 07 a8 2a 31 91 29 11 94 40 37 57 10 a7 32 | ...¨*1.)..@7W.§2 + 10: 56 6f 52 62 fe 3d b3 65 b1 e4 13 0f 52 a3 c8 f6 | VoRbþ=³e±...R£È. + } + cipher_suite = (0x0003) SSL3/RSA/RC4-40/MD5 + } + 0: 0b 00 02 c5 |...Å + type = 11 (certificate) + length = 709 (0x0002c5) + CertificateChain { + chainlength = 706 (0x02c2) + Certificate { + size = 703 (0x02bf) + data = { saved in file 'cert.001' } + } + } + 0: 0c 00 00 ca |.... + type = 12 (server_key_exchange) + length = 202 (0x0000ca) + 0: 0e 00 00 00 |.... + type = 14 (server_hello_done) + length = 0 (0x000000) + } +} +] +--> [ +SSLRecord { + 0: 16 03 00 00 44 |....D + type = 22 (handshake) + version = { 3,0 } + length = 68 (0x44) + handshake { + 0: 10 00 00 40 |...@ + type = 16 (client_key_exchange) + length = 64 (0x000040) + ClientKeyExchange { + message = {...} + } + } +} +] +--> [ +SSLRecord { + 0: 14 03 00 00 01 |..... + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) + 0: 01 |. +} +SSLRecord { + 0: 16 03 00 00 38 |....8 + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + < encrypted > + +} +] +<-- [ +SSLRecord { + 0: 14 03 00 00 01 |..... + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) + 0: 01 |. +} +] +<-- [ +SSLRecord { + 0: 16 03 00 00 38 |....8 + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + < encrypted > + +} +] +--> [ +SSLRecord { + 0: 17 03 00 01 1f |..... + type = 23 (application_data) + version = { 3,0 } + length = 287 (0x11f) + < encrypted > +} +] +<-- [ +SSLRecord { + 0: 17 03 00 00 a0 |.... + type = 23 (application_data) + version = { 3,0 } + length = 160 (0xa0) + < encrypted > + +} +] +<-- [ +SSLRecord { +0: 17 03 00 00 df |....ß + type = 23 (application_data) + version = { 3,0 } + length = 223 (0xdf) + < encrypted > + +} +SSLRecord { + 0: 15 03 00 00 12 |..... + type = 21 (alert) + version = { 3,0 } + length = 18 (0x12) + < encrypted > +} +] +Server socket closed. +</programlisting> + + + <para>Example 2</para> + <para> +The -s option turns on SSL parsing. Because the -x option is not used in this example, undecoded values are output as raw data. The output is routed to a text file. + </para> +<programlisting>$ ssltap -s -p 444 interzone.mcom.com:443 > s.txt</programlisting> + <para>Output </para> +<programlisting> +Connected to interzone.mcom.com:443 +--> [ +alloclen = 63 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher-specs-length = 36 (0x24) + sid-length = 0 (0x00) + challenge-length = 16 (0x10) + cipher-suites = { + (0x010080) SSL2/RSA/RC4-128/MD5 + (0x020080) SSL2/RSA/RC4-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE-CBC/MD5 + (0x000004) SSL3/RSA/RC4-128/MD5 + (0x00ffe0) SSL3/RSA-FIPS/3DES192EDE-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE-CBC/SHA + (0x00ffe1) SSL3/RSA-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4-40/MD5 + } + session-id = { } + challenge = { 0x713c 0x9338 0x30e1 0xf8d6 0xb934 0x7351 0x200c +0x3fd0 } +] +>-- [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 997 (0x3e5) + handshake { + type = 2 (server_hello) + length = 70 (0x000046) + ServerHello { + server_version = {3, 0} + random = {...} + session ID = { + length = 32 + contents = {..} + } + cipher_suite = (0x0003) SSL3/RSA/RC4-40/MD5 + } + type = 11 (certificate) + length = 709 (0x0002c5) + CertificateChain { + chainlength = 706 (0x02c2) + Certificate { + size = 703 (0x02bf) + data = { saved in file 'cert.001' } + } + } + type = 12 (server_key_exchange) + length = 202 (0x0000ca) + type = 14 (server_hello_done) + length = 0 (0x000000) + } +} +] +--> [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 68 (0x44) + handshake { + type = 16 (client_key_exchange) + length = 64 (0x000040) + ClientKeyExchange { + message = {...} + } + } +} +] +--> [ +SSLRecord { + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) +} +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + > encrypted > +} +] +>-- [ +SSLRecord { + type = 20 (change_cipher_spec) + version = { 3,0 } + length = 1 (0x1) +} +] +>-- [ +SSLRecord { + type = 22 (handshake) + version = { 3,0 } + length = 56 (0x38) + > encrypted > +} +] +--> [ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 287 (0x11f) + > encrypted > +} +] +[ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 160 (0xa0) + > encrypted > +} +] +>-- [ +SSLRecord { + type = 23 (application_data) + version = { 3,0 } + length = 223 (0xdf) + > encrypted > +} +SSLRecord { + type = 21 (alert) + version = { 3,0 } + length = 18 (0x12) + > encrypted > +} +] +Server socket closed. +</programlisting> + + <para>Example 3</para> + <para> +In this example, the -h option turns hex/ASCII format. There is no SSL parsing or decoding. The output is routed to a text file. + </para> +<programlisting>$ ssltap -h -p 444 interzone.mcom.com:443 > h.txt</programlisting> + <para>Output </para> +<programlisting> +Connected to interzone.mcom.com:443 +--> [ + 0: 80 40 01 03 00 00 27 00 00 00 10 01 00 80 02 00 | .@....'......... + 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | .........@...... + 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 00 | ........á....... + 30: 00 06 9b fe 5b 56 96 49 1f 9f ca dd d5 ba b9 52 | ..þ[V.I.\xd9 ...º¹R + 40: 6f 2d |o- +] +<-- [ + 0: 16 03 00 03 e5 02 00 00 46 03 00 7f e5 0d 1b 1d | ........F....... + 10: 68 7f 3a 79 60 d5 17 3c 1d 9c 96 b3 88 d2 69 3b | h.:y`..<..³.Òi; + 20: 78 e2 4b 8b a6 52 12 4b 46 e8 c2 20 14 11 89 05 | x.K.¦R.KFè. ... + 30: 4d 52 91 fd 93 e0 51 48 91 90 08 96 c1 b6 76 77 | MR.ý..QH.....¶vw + 40: 2a f4 00 08 a1 06 61 a2 64 1f 2e 9b 00 03 00 0b | *ô..¡.a¢d...... + 50: 00 02 c5 00 02 c2 00 02 bf 30 82 02 bb 30 82 02 | ..Å......0...0.. + 60: 24 a0 03 02 01 02 02 02 01 36 30 0d 06 09 2a 86 | $ .......60...*. + 70: 48 86 f7 0d 01 01 04 05 00 30 77 31 0b 30 09 06 | H.÷......0w1.0.. + 80: 03 55 04 06 13 02 55 53 31 2c 30 2a 06 03 55 04 | .U....US1,0*..U. + 90: 0a 13 23 4e 65 74 73 63 61 70 65 20 43 6f 6d 6d | ..#Netscape Comm + a0: 75 6e 69 63 61 74 69 6f 6e 73 20 43 6f 72 70 6f | unications Corpo + b0: 72 61 74 69 6f 6e 31 11 30 0f 06 03 55 04 0b 13 | ration1.0...U... + c0: 08 48 61 72 64 63 6f 72 65 31 27 30 25 06 03 55 | .Hardcore1'0%..U + d0: 04 03 13 1e 48 61 72 64 63 6f 72 65 20 43 65 72 | ....Hardcore Cer + e0: 74 69 66 69 63 61 74 65 20 53 65 72 76 65 72 20 | tificate Server + f0: 49 49 30 1e 17 0d 39 38 30 35 31 36 30 31 30 33 | II0...9805160103 +<additional data lines> +] +<additional records in same format> +Server socket closed. +</programlisting> + + <para>Example 4</para> + <para> +In this example, the -s option turns on SSL parsing, and the -h option turns on hex/ASCII format. +Both formats are shown for each record. The output is routed to a text file. + </para> +<programlisting>$ ssltap -hs -p 444 interzone.mcom.com:443 > hs.txt</programlisting> + <para>Output </para> +<programlisting> +Connected to interzone.mcom.com:443 +--> [ + 0: 80 3d 01 03 00 00 24 00 00 00 10 01 00 80 02 00 | .=....$......... + 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | .........@...... + 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 03 | ........á....... + 30: 55 e6 e4 99 79 c7 d7 2c 86 78 96 5d b5 cf e9 |U..yÇ\xb0 ,.x.]µÏé +alloclen = 63 bytes + [ssl2] ClientHelloV2 { + version = {0x03, 0x00} + cipher-specs-length = 36 (0x24) + sid-length = 0 (0x00) + challenge-length = 16 (0x10) + cipher-suites = { + (0x010080) SSL2/RSA/RC4-128/MD5 + (0x020080) SSL2/RSA/RC4-40/MD5 + (0x030080) SSL2/RSA/RC2CBC128/MD5 + (0x040080) SSL2/RSA/RC2CBC40/MD5 + (0x060040) SSL2/RSA/DES64CBC/MD5 + (0x0700c0) SSL2/RSA/3DES192EDE-CBC/MD5 + (0x000004) SSL3/RSA/RC4-128/MD5 + (0x00ffe0) SSL3/RSA-FIPS/3DES192EDE-CBC/SHA + (0x00000a) SSL3/RSA/3DES192EDE-CBC/SHA + (0x00ffe1) SSL3/RSA-FIPS/DES64CBC/SHA + (0x000009) SSL3/RSA/DES64CBC/SHA + (0x000003) SSL3/RSA/RC4-40/MD5 + } + session-id = { } + challenge = { 0x0355 0xe6e4 0x9979 0xc7d7 0x2c86 0x7896 0x5db + +0xcfe9 } +} +] +<additional records in same formats> +Server socket closed. +</programlisting> + + + + </refsection> + + <refsection id="usage-tips"> + <title>Usage Tips</title> + <para> +When SSL restarts a previous session, it makes use of cached information to do a partial handshake. +If you wish to capture a full SSL handshake, restart the browser to clear the session id cache. + </para> + <para> +If you run the tool on a machine other than the SSL server to which you are trying to connect, +the browser will complain that the host name you are trying to connect to is different from the certificate. +If you are using the default BadCert callback, you can still connect through a dialog. If you are not using +the default BadCert callback, the one you supply must allow for this possibility. + </para> + </refsection> + + <refsection id="seealso"> + <title>See Also</title> + <para>The NSS Security Tools are also documented at <ulink url="http://www.mozilla.org/projects/security/pki/nss/tools">http://www.mozilla.org/projects/security/pki/nss/</ulink>.</para> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/vfychain.xml b/security/nss/doc/vfychain.xml new file mode 100644 index 000000000..9a41008c9 --- /dev/null +++ b/security/nss/doc/vfychain.xml @@ -0,0 +1,232 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="vfychain"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>VFYCHAIN</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>vfychain </refname> + <refpurpose>vfychain [options] [revocation options] certfile [[options] certfile] ...</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>vfychain</command> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + <para>The verification Tool, <command>vfychain</command>, verifies certificate chains. <command>modutil</command> 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.</para> + + <para>The tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases.</para> + </refsection> + + <refsection id="options"> + <title>Options</title> + + <variablelist> + + <varlistentry> + <term><option>-a</option></term> + <listitem> + <simpara>the following certfile is base64 encoded</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-b </option> <replaceable>YYMMDDHHMMZ</replaceable></term> + <listitem> + <simpara>Validate date (default: now)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-d </option> <replaceable>directory</replaceable></term> <listitem> + <simpara>database directory</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-f </option> </term> + <listitem> + <simpara>Enable cert fetching from AIA URL</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-o </option> <replaceable>oid</replaceable></term> + <listitem> + <simpara>Set policy OID for cert validation(Format OID.1.2.3)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-p </option></term> + <listitem> + <simpara>Use PKIX Library to validate certificate by calling:</simpara> + <simpara> * CERT_VerifyCertificate if specified once,</simpara> + <simpara> * CERT_PKIXVerifyCert if specified twice and more.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-r </option></term> + <listitem> + <simpara>Following certfile is raw binary DER (default)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-t</option></term> + <listitem> + <simpara>Following cert is explicitly trusted (overrides db trust)</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-u </option> <replaceable>usage</replaceable></term> + <listitem> + <para> + 0=SSL client, 1=SSL server, 2=SSL StepUp, 3=SSL CA, + 4=Email signer, 5=Email recipient, 6=Object signer, + 9=ProtectedObjectSigner, 10=OCSP responder, 11=Any CA + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-T </option></term> + <listitem> + <simpara>Trust both explicit trust anchors (-t) and the database. (Without this option, the default is to only trust certificates marked -t, if there are any, or to trust the database if there are certificates marked -t.) + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-v </option></term> + <listitem> + <simpara>Verbose mode. Prints root cert subject(double the + argument for whole root cert info) + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-w </option> <replaceable>password</replaceable></term> + <listitem> + <simpara>Database password</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-W </option> <replaceable>pwfile</replaceable></term> + <listitem> + <simpara>Password file</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option></option></term> + <listitem> + <simpara>Revocation options for PKIX API (invoked with -pp options) is a + collection of the following flags: + [-g type [-h flags] [-m type [-s flags]] ...] ...</simpara> + <simpara>Where: </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-g </option> <replaceable>test-type</replaceable></term> + <listitem> + <simpara>Sets status checking test type. Possible values + are "leaf" or "chain" + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-g </option> <replaceable>test type</replaceable></term> + <listitem> + <simpara>Sets status checking test type. Possible values + are "leaf" or "chain". + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-h </option> <replaceable>test flags</replaceable></term> + <listitem> + <simpara>Sets revocation flags for the test type it + follows. Possible flags: "testLocalInfoFirst" and + "requireFreshInfo". + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>-m </option> <replaceable>method type</replaceable></term> + <listitem> + <simpara>Sets method type for the test type it follows. + Possible types are "crl" and "ocsp". + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><option>-s </option> <replaceable>method flags</replaceable></term> + <listitem> + <simpara>Sets revocation flags for the method it follows. + Possible types are "doNotUse", "forbidFetching", + "ignoreDefaultSrc", "requireInfo" and "failIfNoInfo". + </simpara> + </listitem> + </varlistentry> + </variablelist> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> diff --git a/security/nss/doc/vfyserv.xml b/security/nss/doc/vfyserv.xml new file mode 100644 index 000000000..db18e09bf --- /dev/null +++ b/security/nss/doc/vfyserv.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY date SYSTEM "date.xml"> +<!ENTITY version SYSTEM "version.xml"> +]> + +<refentry id="vfyserv"> + + <refentryinfo> + <date>&date;</date> + <title>NSS Security Tools</title> + <productname>nss-tools</productname> + <productnumber>&version;</productnumber> + </refentryinfo> + + <refmeta> + <refentrytitle>VFYSERV</refentrytitle> + <manvolnum>1</manvolnum> + </refmeta> + + <refnamediv> + <refname>vfyserv </refname> + <refpurpose>TBD</refpurpose> + </refnamediv> + + <refsynopsisdiv> + <cmdsynopsis> + <command>vfyserv</command> + </cmdsynopsis> + </refsynopsisdiv> + + <refsection> + <title>STATUS</title> + <para>This documentation is still work in progress. Please contribute to the initial review in <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink> + </para> + </refsection> + + <refsection id="description"> + <title>Description</title> + <para>The <command>vfyserv </command> tool verifies a certificate chain</para> + + </refsection> + + <refsection id="options"> + <title>Options</title> + + <variablelist> + + <varlistentry> + <term><option></option> <replaceable></replaceable></term> + <listitem> + <simpara></simpara> + <simpara></simpara> + </listitem> + </varlistentry> + + </variablelist> + </refsection> + +<!-- don't change --> + <refsection id="resources"> + <title>Additional Resources</title> + <para>For information about NSS and other tools related to NSS (like JSS), check out the NSS project wiki at <ulink url="http://www.mozilla.org/projects/security/pki/nss/">http://www.mozilla.org/projects/security/pki/nss/</ulink>. The NSS site relates directly to NSS code changes and releases.</para> + <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para> + <para>IRC: Freenode at #dogtag-pki</para> + </refsection> + +<!-- fill in your name first; keep the other names for reference --> + <refsection id="authors"> + <title>Authors</title> + <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para> + <para> + Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>. + </para> + </refsection> + +<!-- don't change --> + <refsection id="license"> + <title>LICENSE</title> + <para>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/. + </para> + </refsection> + +</refentry> |