<html><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>SIGNVER</title><metaname="generator"content="DocBook XSL Stylesheets V1.78.1"><linkrel="home"href="index.html"title="SIGNVER"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><tablewidth="100%"summary="Navigation header"><tr><thcolspan="3"align="center">SIGNVER</th></tr></table><hr></div><divclass="refentry"><aname="signver"></a><divclass="titlepage"></div><divclass="refnamediv"><h2>Name</h2><p>signver — Verify a detached PKCS#7 signature for a file.</p></div><divclass="refsynopsisdiv"><h2>Synopsis</h2><divclass="cmdsynopsis"><p><codeclass="command">signtool</code> -A | -V -d <emclass="replaceable"><code>directory</code></em> [-a] [-i <emclass="replaceable"><code>input_file</code></em>] [-o <emclass="replaceable"><code>output_file</code></em>] [-s <emclass="replaceable"><code>signature_file</code></em>] [-v]</p></div></div><divclass="refsection"><aname="idm233257229808"></a><h2>STATUS</h2><p>This documentation is still work in progress. Please contribute to the initial review in <aclass="ulink"href="https://bugzilla.mozilla.org/show_bug.cgi?id=836477"target="_top">Mozilla NSS bug 836477</a>
</p></div><divclass="refsection"><aname="description"></a><h2>Description</h2><p>The Signature Verification Tool, <spanclass="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><divclass="refsection"><aname="options"></a><h2>Options</h2><divclass="variablelist"><dlclass="variablelist"><dt><spanclass="term">-A</span></dt><dd><p>Displays all of the information in the PKCS#7 signature.</p></dd><dt><spanclass="term">-V</span></dt><dd><p>Verifies the digital signature.</p></dd><dt><spanclass="term">-d [sql:]<spanclass="emphasis"><em>directory</em></span></span></dt><dd><p>Specify the database directory which contains the certificates and keys.</p><p><spanclass="command"><strong>signver</strong></span> supports two types of databases: the legacy security databases (<codeclass="filename">cert8.db</code>, <codeclass="filename">key3.db</code>, and <codeclass="filename">secmod.db</code>) and new SQLite databases (<codeclass="filename">cert9.db</code>, <codeclass="filename">key4.db</code>, and <codeclass="filename">pkcs11.txt</code>). If the prefix <spanclass="command"><strong>sql:</strong></span> is not used, then the tool assumes that the given databases are in the old format.</p></dd><dt><spanclass="term">-a</span></dt><dd><p>Sets that the given signature file is in ASCII format.</p></dd><dt><spanclass="term">-i <spanclass="emphasis"><em>input_file</em></span></span></dt><dd><p>Gives the input file for the object with signed data.</p></dd><dt><spanclass="term">-o <spanclass="emphasis"><em>output_file</em></span></span></dt><dd><p>Gives the output file to which to write the results.</p></dd><dt><spanclass="term">-s <spanclass="emphasis"><em>signature_file</em></span></span></dt><dd><p>Gives the input file for the digital signature.</p></dd><dt><spanclass="term">-v</span></dt><dd><p>Enables verbose output.</p></dd></dl></div></div><divclass="refsection"><aname="examples"></a><h2>Extended Examples</h2><divclass="refsection"><aname="idm233261091008"></a><h3>Verifying a Signature</h3><p>The <codeclass="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><preclass="programlisting">signver -V -s <emclass="replaceable"><code>signature_file</code></em> -i <emclass="replaceable"><code>signed_file</code></em> -d sql:/home/my/sharednssdb
The <codeclass="option">-A</code> option prints all of the information contained in a signature file. Using the <codeclass="option">-o</code> option prints the signature file information to the given output file rather than stdout.
</p><preclass="programlisting">signver -A -s <emclass="replaceable"><code>signature_file</code></em> -o <emclass="replaceable"><code>output_file</code></em></pre></div></div><divclass="refsection"><aname="databases"></a><h2>NSS Database Types</h2><p>NSS originally used BerkeleyDB databases to store security information.
The last versions of these <spanclass="emphasis"><em>legacy</em></span> databases are:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><p>
cert8.db for certificates
</p></li><liclass="listitem"><p>
key3.db for keys
</p></li><liclass="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><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><p>
cert9.db for certificates
</p></li><liclass="listitem"><p>
key4.db for keys
</p></li><liclass="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 <spanclass="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 (<spanclass="command"><strong>certutil</strong></span>, <spanclass="command"><strong>pk12util</strong></span>, <spanclass="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 <spanclass="command"><strong>sql:</strong></span> prefix with the given security directory. For example:</p><preclass="programlisting"># signver -A -s <emclass="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 <codeclass="envar">NSS_DEFAULT_DB_TYPE</code> environment variable to <codeclass="envar">sql</code>:</p><preclass="programlisting">export NSS_DEFAULT_DB_TYPE="sql"</pre><p>This line can be added to the <codeclass="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><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="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><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><p>
https://wiki.mozilla.org/NSS_Shared_DB
</p></li></ul></div></div><divclass="refsection"><aname="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><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><p>Setting up the shared NSS database</p><p>https://wiki.mozilla.org/NSS_Shared_DB_Howto</p></li><liclass="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><divclass="refsection"><aname="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 <aclass="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><divclass="refsection"><aname="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>
</p></div><divclass="refsection"><aname="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/.