1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY date SYSTEM "date.xml">
5 <!ENTITY version SYSTEM "version.xml">
8 <refentry id="signver">
12 <title>NSS Security Tools</title>
13 <productname>nss-tools</productname>
14 <productnumber>&version;</productnumber>
18 <refentrytitle>SIGNVER</refentrytitle>
19 <manvolnum>1</manvolnum>
23 <refname>signver</refname>
24 <refpurpose>Verify a detached PKCS#7 signature for a file.</refpurpose>
29 <command>signtool</command>
30 <group choice="plain">
31 <arg choice="plain">-A</arg>
32 <arg choice="plain">-V</arg>
34 <arg choice="plain">-d <replaceable>directory</replaceable></arg>
36 <arg>-i <replaceable>input_file</replaceable></arg>
37 <arg>-o <replaceable>output_file</replaceable></arg>
38 <arg>-s <replaceable>signature_file</replaceable></arg>
45 <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>
49 <refsection id="description">
50 <title>Description</title>
52 <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>
55 <refsection id="options">
56 <title>Options</title>
60 <listitem><para>Displays all of the information in the PKCS#7 signature.</para></listitem>
64 <listitem><para>Verifies the digital signature.</para></listitem>
67 <term>-d [sql:]<emphasis>directory</emphasis></term>
68 <listitem><para>Specify the database directory which contains the certificates and keys.</para>
69 <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>
73 <listitem><para>Sets that the given signature file is in ASCII format.</para></listitem>
76 <term>-i <emphasis>input_file</emphasis></term>
77 <listitem><para>Gives the input file for the object with signed data.</para></listitem>
80 <term>-o <emphasis>output_file</emphasis></term>
81 <listitem><para>Gives the output file to which to write the results.</para></listitem>
84 <term>-s <emphasis>signature_file</emphasis></term>
85 <listitem><para>Gives the input file for the digital signature.</para></listitem>
89 <listitem><para>Enables verbose output.</para></listitem>
94 <refsection id="examples">
95 <title>Extended Examples</title>
96 <refsection><title>Verifying a Signature</title>
97 <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>
98 <programlisting>signver -V -s <replaceable>signature_file</replaceable> -i <replaceable>signed_file</replaceable> -d sql:/home/my/sharednssdb
100 signatureValid=yes</programlisting>
103 <refsection><title>Printing Signature Data</title>
105 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.
107 <programlisting>signver -A -s <replaceable>signature_file</replaceable> -o <replaceable>output_file</replaceable></programlisting>
111 <refsection id="databases"><title>NSS Database Types</title>
112 <para>NSS originally used BerkeleyDB databases to store security information.
113 The last versions of these <emphasis>legacy</emphasis> databases are:</para>
117 cert8.db for certificates
127 secmod.db for PKCS #11 module information
132 <para>BerkeleyDB has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. NSS has
133 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
134 requires more flexibility to provide a truly shared security database.</para>
136 <para>In 2009, NSS introduced a new set of databases that are SQLite databases rather than
137 BerkleyDB. These new databases provide more accessibility and performance:</para>
141 cert9.db for certificates
151 pkcs11.txt, which is listing of all of the PKCS #11 modules contained in a new subdirectory in the security databases directory
156 <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>
158 <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.
159 Using the SQLite databases must be manually specified by using the <command>sql:</command> prefix with the given security directory. For example:</para>
161 <programlisting># signver -A -s <replaceable>signature</replaceable> -d sql:/home/my/sharednssdb</programlisting>
163 <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>
164 <programlisting>export NSS_DEFAULT_DB_TYPE="sql"</programlisting>
166 <para>This line can be added to the <filename>~/.bashrc</filename> file to make the change permanent for the user.</para>
168 <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>
172 https://wiki.mozilla.org/NSS_Shared_DB_Howto</para>
175 <para>For an engineering draft on the changes in the shared NSS databases, see the NSS project wiki:</para>
179 https://wiki.mozilla.org/NSS_Shared_DB
185 <refsection id="seealso">
186 <title>See Also</title>
187 <para>signtool (1)</para>
189 <para>The NSS wiki has information on the new database design and how to configure applications to use it.</para>
192 <para>Setting up the shared NSS database</para>
193 <para>https://wiki.mozilla.org/NSS_Shared_DB_Howto</para>
197 Engineering and technical information about the shared NSS database
200 https://wiki.mozilla.org/NSS_Shared_DB
206 <!-- don't change -->
207 <refsection id="resources">
208 <title>Additional Resources</title>
209 <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>
210 <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para>
211 <para>IRC: Freenode at #dogtag-pki</para>
214 <!-- fill in your name first; keep the other names for reference -->
215 <refsection id="authors">
216 <title>Authors</title>
217 <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para>
219 Authors: Elio Maldonado <emaldona@redhat.com>, Deon Lackey <dlackey@redhat.com>.
223 <!-- don't change -->
224 <refsection id="license">
225 <title>LICENSE</title>
226 <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/.