<para>This documentation is still work in progress. Please contribute to the initial review in <ulinkurl="https://bugzilla.mozilla.org/show_bug.cgi?id=836477">Mozilla NSS bug 836477</ulink>
</para>
</refsection>
<refsectionid="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>
<refsectionid="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>
<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>
<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>
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>
<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>
<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>
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 -->
<refsectionid="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 <ulinkurl="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>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/.