security/nss/doc/signtool.xml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <?xml version="1.0" encoding="UTF-8"?>
michael@0 2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
michael@0 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
michael@0 4 <!ENTITY date SYSTEM "date.xml">
michael@0 5 <!ENTITY version SYSTEM "version.xml">
michael@0 6 ]>
michael@0 7
michael@0 8 <refentry id="signtool">
michael@0 9
michael@0 10 <refentryinfo>
michael@0 11 <date>&date;</date>
michael@0 12 <title>NSS Security Tools</title>
michael@0 13 <productname>nss-tools</productname>
michael@0 14 <productnumber>&version;</productnumber>
michael@0 15 </refentryinfo>
michael@0 16
michael@0 17 <refmeta>
michael@0 18 <refentrytitle>signtool</refentrytitle>
michael@0 19 <manvolnum>1</manvolnum>
michael@0 20 </refmeta>
michael@0 21
michael@0 22 <refnamediv>
michael@0 23 <refname>signtool</refname>
michael@0 24 <refpurpose>Digitally sign objects and files.</refpurpose>
michael@0 25 </refnamediv>
michael@0 26
michael@0 27 <refsynopsisdiv>
michael@0 28 <cmdsynopsis>
michael@0 29 <command>signtool</command>
michael@0 30 <arg>[-b basename]</arg>
michael@0 31 <arg>[-c Compression Level] </arg>
michael@0 32 <arg>[-d cert-dir] </arg>
michael@0 33 <arg>[-e extension] </arg>
michael@0 34 <arg>[-f filename] </arg>
michael@0 35 <arg>[-i installer script] </arg>
michael@0 36 <arg>[-h]</arg>
michael@0 37 <arg>[-H]</arg>
michael@0 38 <arg>[-v]</arg>
michael@0 39 <arg>[-w]</arg>
michael@0 40 <arg>[-G nickname]</arg>
michael@0 41 <arg>[-J]</arg>
michael@0 42 <arg>[-j directory] </arg>
michael@0 43 <arg>-k keyName</arg>
michael@0 44 <arg>[--keysize | -s size]</arg>
michael@0 45 <arg>[-l]</arg>
michael@0 46 <arg>[-L]</arg>
michael@0 47 <arg>[-M]</arg>
michael@0 48 <arg>[-m metafile] </arg>
michael@0 49 <arg>[--norecurse] </arg>
michael@0 50 <arg>[-O] </arg>
michael@0 51 <arg>[-o] </arg>
michael@0 52 <arg>[--outfile] </arg>
michael@0 53 <arg>[-p password] </arg>
michael@0 54 <arg>[-t|--token tokenname] </arg>
michael@0 55 <arg>[-z] </arg>
michael@0 56 <arg>[-X] </arg>
michael@0 57 <arg>[-x name] </arg>
michael@0 58 <arg>[--verbose value] </arg>
michael@0 59 <arg>[--leavearc] </arg>
michael@0 60 <arg>[-Z jarfile] </arg>
michael@0 61 <arg>directory-tree</arg>
michael@0 62 <arg>archive</arg>
michael@0 63 <!-- this isn't the ideal formatting, since docbook can handle reqiored/optional formatting automatically, but let's make it explicit -->
michael@0 64 </cmdsynopsis>
michael@0 65 </refsynopsisdiv>
michael@0 66
michael@0 67 <refsection>
michael@0 68 <title>STATUS</title>
michael@0 69 <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>
michael@0 70 </para>
michael@0 71 </refsection>
michael@0 72
michael@0 73 <refsection id="description">
michael@0 74 <title>Description</title>
michael@0 75
michael@0 76 <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>
michael@0 77 <para>* Confirm the identity of the individual, company, or other entity whose digital signature is associated with the files</para>
michael@0 78 <para>* Check whether the files have been tampered with since being signed</para>
michael@0 79 <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>
michael@0 80 <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>
michael@0 81 <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>
michael@0 82 <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>
michael@0 83 <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>
michael@0 84 <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>
michael@0 85 <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>
michael@0 86 <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>
michael@0 87 <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>
michael@0 88 </refsection>
michael@0 89
michael@0 90 <refsection id="options">
michael@0 91 <title>Options</title>
michael@0 92
michael@0 93 <!-- for the moment, I can't find a way for italics and bold tags to work in varlist entries -->
michael@0 94 <variablelist>
michael@0 95 <varlistentry>
michael@0 96 <term>-b basename</term>
michael@0 97 <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>
michael@0 98 </varlistentry>
michael@0 99 <varlistentry>
michael@0 100 <term>-c#</term>
michael@0 101 <listitem><para>
michael@0 102 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.
michael@0 103
michael@0 104 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.
michael@0 105 </para></listitem>
michael@0 106 </varlistentry>
michael@0 107 <varlistentry>
michael@0 108 <term>-d certdir</term>
michael@0 109 <listitem><para>
michael@0 110 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).
michael@0 111
michael@0 112 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.
michael@0 113 </para></listitem>
michael@0 114 </varlistentry>
michael@0 115 <varlistentry>
michael@0 116 <term>-e extension</term>
michael@0 117 <listitem><para>
michael@0 118 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.
michael@0 119 </para></listitem>
michael@0 120 </varlistentry>
michael@0 121 <varlistentry>
michael@0 122 <term>-f commandfile</term>
michael@0 123 <listitem><para>
michael@0 124 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".
michael@0 125 </para></listitem>
michael@0 126 </varlistentry>
michael@0 127 <varlistentry>
michael@0 128 <term>-G nickname</term>
michael@0 129 <listitem><para>
michael@0 130 Generates a new private-public key pair and corresponding object-signing certificate with the given nickname.
michael@0 131
michael@0 132 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.
michael@0 133
michael@0 134 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.
michael@0 135
michael@0 136 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.
michael@0 137 </para></listitem>
michael@0 138 </varlistentry>
michael@0 139 <varlistentry>
michael@0 140 <term>-i scriptname</term>
michael@0 141 <listitem><para>
michael@0 142 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.
michael@0 143 </para></listitem>
michael@0 144 </varlistentry>
michael@0 145 <varlistentry>
michael@0 146 <term>-J</term>
michael@0 147 <listitem>
michael@0 148 <para>
michael@0 149 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.
michael@0 150
michael@0 151 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.
michael@0 152
michael@0 153 If the -c# option is not used with the -J option, the default compression value is 6.
michael@0 154
michael@0 155 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.
michael@0 156 </para>
michael@0 157 </listitem>
michael@0 158 </varlistentry>
michael@0 159 <varlistentry>
michael@0 160 <term>-j directory</term>
michael@0 161 <listitem><para>
michael@0 162 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.
michael@0 163 </para></listitem>
michael@0 164 </varlistentry>
michael@0 165 <varlistentry>
michael@0 166 <term>-k key ... directory</term>
michael@0 167 <listitem><para>
michael@0 168 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
michael@0 169
michael@0 170 signtool -k MyCert -d . signdir
michael@0 171
michael@0 172 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.
michael@0 173
michael@0 174 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.
michael@0 175 </para></listitem>
michael@0 176 </varlistentry>
michael@0 177 <varlistentry>
michael@0 178 <term>-l</term>
michael@0 179 <listitem><para>
michael@0 180 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.
michael@0 181
michael@0 182 The -l option is available in Netscape Signing Tool 1.0 and later versions only.
michael@0 183 </para></listitem>
michael@0 184 </varlistentry>
michael@0 185 <varlistentry>
michael@0 186 <term>-L</term>
michael@0 187 <listitem><para>
michael@0 188 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.
michael@0 189 </para></listitem>
michael@0 190 </varlistentry>
michael@0 191 <varlistentry>
michael@0 192 <term>--leavearc</term>
michael@0 193 <listitem><para>
michael@0 194 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.
michael@0 195 </para></listitem>
michael@0 196 </varlistentry>
michael@0 197 <varlistentry>
michael@0 198 <term>-m metafile</term>
michael@0 199 <listitem><para>
michael@0 200 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.
michael@0 201
michael@0 202 The metadata file contains one entry per line, each with three fields:
michael@0 203
michael@0 204 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)
michael@0 205 field #2: the name of the data you are specifying; for example: Install-Script
michael@0 206 field #3: data corresponding to the name in field #2
michael@0 207
michael@0 208 For example, the -i option uses the equivalent of this line:
michael@0 209
michael@0 210 + Install-Script: script.js
michael@0 211
michael@0 212
michael@0 213 This example associates a MIME type with a file:
michael@0 214
michael@0 215 movie.qt MIME-Type: video/quicktime
michael@0 216
michael@0 217 For information about the way installer script information appears in the manifest file for a JAR archive, see The JAR Format on Netscape DevEdge.
michael@0 218 </para></listitem>
michael@0 219 </varlistentry>
michael@0 220 <varlistentry>
michael@0 221 <term>-M</term>
michael@0 222 <listitem><para>
michael@0 223 Lists the PKCS #11 modules available to signtool, including smart cards.
michael@0 224
michael@0 225 The -M option is available in Netscape Signing Tool 1.0 and later versions only.
michael@0 226
michael@0 227 For information on using Netscape Signing Tool with smart cards, see "Using Netscape Signing Tool with Smart Cards".
michael@0 228
michael@0 229 For information on using the -M option to verify FIPS-140-1 validated mode, see "Netscape Signing Tool and FIPS-140-1".
michael@0 230 </para></listitem>
michael@0 231 </varlistentry>
michael@0 232 <varlistentry>
michael@0 233 <term>--norecurse</term>
michael@0 234 <listitem><para>
michael@0 235 Blocks recursion into subdirectories when signing a directory's contents or when parsing HTML.
michael@0 236 </para></listitem>
michael@0 237 </varlistentry>
michael@0 238 <varlistentry>
michael@0 239 <term>-o</term>
michael@0 240 <listitem><para>
michael@0 241 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.
michael@0 242 </para></listitem>
michael@0 243 </varlistentry>
michael@0 244 <varlistentry>
michael@0 245 <term>--outfile outputfile</term>
michael@0 246 <listitem><para>
michael@0 247 Specifies a file to receive redirected output from Netscape Signing Tool.
michael@0 248 </para></listitem>
michael@0 249 </varlistentry>
michael@0 250 <varlistentry>
michael@0 251 <term>-p password</term>
michael@0 252 <listitem><para>
michael@0 253 Specifies a password for the private-key database. Note that the password entered on the command line is displayed as plain text.
michael@0 254 </para></listitem>
michael@0 255 </varlistentry>
michael@0 256 <varlistentry>
michael@0 257 <term>-s keysize</term>
michael@0 258 <listitem><para>
michael@0 259 Specifies the size of the key for generated certificate. Use the -M option to find out what tokens are available.
michael@0 260
michael@0 261 The -s option can be used with the -G option only.
michael@0 262 </para></listitem>
michael@0 263 </varlistentry>
michael@0 264 <varlistentry>
michael@0 265 <term>-t token</term>
michael@0 266 <listitem><para>
michael@0 267 Specifies which available token should generate the key and receive the certificate. Use the -M option to find out what tokens are available.
michael@0 268
michael@0 269 The -t option can be used with the -G option only.
michael@0 270 </para></listitem>
michael@0 271 </varlistentry>
michael@0 272 <varlistentry>
michael@0 273 <term>-v archive</term>
michael@0 274 <listitem><para>
michael@0 275 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.
michael@0 276 </para></listitem>
michael@0 277 </varlistentry>
michael@0 278 <varlistentry>
michael@0 279 <term>--verbosity value</term>
michael@0 280 <listitem><para>
michael@0 281 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.
michael@0 282 </para></listitem>
michael@0 283 </varlistentry>
michael@0 284 <varlistentry>
michael@0 285 <term>-w archive</term>
michael@0 286 <listitem><para>
michael@0 287 Displays the names of signers of any files in the archive.
michael@0 288 </para></listitem>
michael@0 289 </varlistentry>
michael@0 290 <varlistentry>
michael@0 291 <term>-x directory</term>
michael@0 292 <listitem><para>
michael@0 293 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.
michael@0 294 </para></listitem>
michael@0 295 </varlistentry>
michael@0 296 <varlistentry>
michael@0 297 <term>-z</term>
michael@0 298 <listitem><para>
michael@0 299 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.
michael@0 300 </para></listitem>
michael@0 301 </varlistentry>
michael@0 302 <varlistentry>
michael@0 303 <term>-Z jarfile</term>
michael@0 304 <listitem><para>
michael@0 305 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.
michael@0 306
michael@0 307 The -Z option cannot be used at the same time as the -J option.
michael@0 308
michael@0 309 If the -c# option is not used with the -Z option, the default compression value is 6.</para></listitem>
michael@0 310 </varlistentry>
michael@0 311 </variablelist>
michael@0 312 </refsection>
michael@0 313
michael@0 314 <refsection id="command-file">
michael@0 315 <title>The Command File Format</title>
michael@0 316 <para>Entries in a Netscape Signing Tool command file have this general format:
michael@0 317 keyword=value
michael@0 318
michael@0 319 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>
michael@0 320 <!-- i'm working on a decent way to do embedded subsections; for now, just use a bold tag to show a new section -->
michael@0 321 <para><command>Subsection</command></para>
michael@0 322 <variablelist>
michael@0 323 <varlistentry>
michael@0 324 <term>basename</term>
michael@0 325 <listitem><para>Same as -b option.</para></listitem>
michael@0 326 </varlistentry>
michael@0 327 <varlistentry>
michael@0 328 <term>compression</term>
michael@0 329 <listitem><para>
michael@0 330 Same as -c option.
michael@0 331 </para></listitem>
michael@0 332 </varlistentry>
michael@0 333 <varlistentry>
michael@0 334 <term>certdir</term>
michael@0 335 <listitem><para>
michael@0 336 Same as -d option.
michael@0 337 </para></listitem>
michael@0 338 </varlistentry>
michael@0 339 <varlistentry>
michael@0 340 <term>extension</term>
michael@0 341 <listitem><para>
michael@0 342 Same as -e option.
michael@0 343 </para></listitem>
michael@0 344 </varlistentry>
michael@0 345 <varlistentry>
michael@0 346 <term>generate</term>
michael@0 347 <listitem><para>
michael@0 348 Same as -G option.
michael@0 349 </para></listitem>
michael@0 350 </varlistentry>
michael@0 351 <varlistentry>
michael@0 352 <term>installscript</term>
michael@0 353 <listitem><para>
michael@0 354 Same as -i option.
michael@0 355 </para></listitem>
michael@0 356 </varlistentry>
michael@0 357 <varlistentry>
michael@0 358 <term>javascriptdir</term>
michael@0 359 <listitem><para>
michael@0 360 Same as -j option.
michael@0 361 </para></listitem>
michael@0 362 </varlistentry>
michael@0 363 <varlistentry>
michael@0 364 <term>htmldir</term>
michael@0 365 <listitem><para>
michael@0 366 Same as -J option.
michael@0 367 </para></listitem>
michael@0 368 </varlistentry>
michael@0 369 <varlistentry>
michael@0 370 <term>certname</term>
michael@0 371 <listitem><para>
michael@0 372 Nickname of certificate, as with -k and -l -k options.
michael@0 373 </para></listitem>
michael@0 374 </varlistentry>
michael@0 375 <varlistentry>
michael@0 376 <term>signdir</term>
michael@0 377 <listitem><para>
michael@0 378 The directory to be signed, as with -k option.
michael@0 379 </para></listitem>
michael@0 380 </varlistentry>
michael@0 381 <varlistentry>
michael@0 382 <term>list</term>
michael@0 383 <listitem><para>
michael@0 384 Same as -l option. Value is ignored, but = sign must be present.
michael@0 385 </para></listitem>
michael@0 386 </varlistentry>
michael@0 387 <varlistentry>
michael@0 388 <term>listall</term>
michael@0 389 <listitem><para>
michael@0 390 Same as -L option. Value is ignored, but = sign must be present.
michael@0 391 </para></listitem>
michael@0 392 </varlistentry>
michael@0 393 <varlistentry>
michael@0 394 <term>metafile</term>
michael@0 395 <listitem><para>
michael@0 396 Same as -m option.
michael@0 397 </para></listitem>
michael@0 398 </varlistentry>
michael@0 399 <varlistentry>
michael@0 400 <term>modules</term>
michael@0 401 <listitem><para>
michael@0 402 Same as -M option. Value is ignored, but = sign must be present.
michael@0 403 </para></listitem>
michael@0 404 </varlistentry>
michael@0 405 <varlistentry>
michael@0 406 <term>optimize</term>
michael@0 407 <listitem><para>
michael@0 408 Same as -o option. Value is ignored, but = sign must be present.
michael@0 409 </para></listitem>
michael@0 410 </varlistentry>
michael@0 411 <varlistentry>
michael@0 412 <term>password</term>
michael@0 413 <listitem><para>
michael@0 414 Same as -p option.
michael@0 415 </para></listitem>
michael@0 416 </varlistentry>
michael@0 417 <varlistentry>
michael@0 418 <term>keysize</term>
michael@0 419 <listitem><para>
michael@0 420 Same as -s option.
michael@0 421 </para></listitem>
michael@0 422 </varlistentry>
michael@0 423 <varlistentry>
michael@0 424 <term>token</term>
michael@0 425 <listitem><para>
michael@0 426 Same as -t option.
michael@0 427 </para></listitem>
michael@0 428 </varlistentry>
michael@0 429 <varlistentry>
michael@0 430 <term>verify</term>
michael@0 431 <listitem><para>
michael@0 432 Same as -v option.
michael@0 433 </para></listitem>
michael@0 434 </varlistentry>
michael@0 435 <varlistentry>
michael@0 436 <term>who</term>
michael@0 437 <listitem><para>
michael@0 438 Same as -w option.
michael@0 439 </para></listitem>
michael@0 440 </varlistentry>
michael@0 441 <varlistentry>
michael@0 442 <term>exclude</term>
michael@0 443 <listitem><para>
michael@0 444 Same as -x option.
michael@0 445 </para></listitem>
michael@0 446 </varlistentry>
michael@0 447 <varlistentry>
michael@0 448 <term>notime</term>
michael@0 449 <listitem><para>
michael@0 450 Same as -z option. value is ignored, but = sign must be present.
michael@0 451 </para></listitem>
michael@0 452 </varlistentry>
michael@0 453 <varlistentry>
michael@0 454 <term>jarfile</term>
michael@0 455 <listitem><para>
michael@0 456 Same as -Z option.
michael@0 457 </para></listitem>
michael@0 458 </varlistentry>
michael@0 459 <varlistentry>
michael@0 460 <term>outfile</term>
michael@0 461 <listitem><para>
michael@0 462 Name of a file to which output and error messages will be redirected. This option has no command-line equivalent.
michael@0 463 </para></listitem></varlistentry></variablelist>
michael@0 464 </refsection>
michael@0 465
michael@0 466 <refsection id="examples">
michael@0 467 <title>Extended Examples</title>
michael@0 468 <para>The following example will do this and that
michael@0 469 </para>
michael@0 470 <para><command>Listing Available Signing Certificates</command></para>
michael@0 471 <para>You use the -L option to list the nicknames for all available certificates and check which ones are signing certificates.</para>
michael@0 472 <programlisting >signtool -L
michael@0 473
michael@0 474 using certificate directory: /u/jsmith/.netscape
michael@0 475 S Certificates
michael@0 476 - ------------
michael@0 477 BBN Certificate Services CA Root 1
michael@0 478 IBM World Registry CA
michael@0 479 VeriSign Class 1 CA - Individual Subscriber - VeriSign, Inc.
michael@0 480 GTE CyberTrust Root CA
michael@0 481 Uptime Group Plc. Class 4 CA
michael@0 482 * Verisign Object Signing Cert
michael@0 483 Integrion CA
michael@0 484 GTE CyberTrust Secure Server CA
michael@0 485 AT&amp;T Directory Services
michael@0 486 * test object signing cert
michael@0 487 Uptime Group Plc. Class 1 CA
michael@0 488 VeriSign Class 1 Primary CA
michael@0 489 - ------------
michael@0 490
michael@0 491 Certificates that can be used to sign objects have *'s to their left. </programlisting>
michael@0 492 <para>Two signing certificates are displayed: Verisign Object Signing Cert and test object signing cert.</para>
michael@0 493 <para>You use the -l option to get a list of signing certificates only, including the signing CA for each.</para>
michael@0 494 <programlisting >signtool -l
michael@0 495
michael@0 496 using certificate directory: /u/jsmith/.netscape
michael@0 497 Object signing certificates
michael@0 498 ---------------------------------------
michael@0 499
michael@0 500 Verisign Object Signing Cert
michael@0 501 Issued by: VeriSign, Inc. - Verisign, Inc.
michael@0 502 Expires: Tue May 19, 1998
michael@0 503 test object signing cert
michael@0 504 Issued by: test object signing cert (Signtool 1.0 Testing
michael@0 505 Certificate (960187691))
michael@0 506 Expires: Sun May 17, 1998
michael@0 507 ---------------------------------------</programlisting>
michael@0 508 <para>For a list including CAs, use the <option>-L</option> option.</para>
michael@0 509
michael@0 510 <para><command>Signing a File</command></para>
michael@0 511 <para>1. Create an empty directory.</para>
michael@0 512 <programlisting >mkdir signdir</programlisting>
michael@0 513
michael@0 514 <para>2. Put some file into it.</para>
michael@0 515 <programlisting >echo boo > signdir/test.f</programlisting>
michael@0 516
michael@0 517 <para>3. Specify the name of your object-signing certificate and sign the directory.</para>
michael@0 518 <programlisting >signtool -k MySignCert -Z testjar.jar signdir
michael@0 519
michael@0 520 using key "MySignCert"
michael@0 521 using certificate directory: /u/jsmith/.netscape
michael@0 522 Generating signdir/META-INF/manifest.mf file..
michael@0 523 --> test.f
michael@0 524 adding signdir/test.f to testjar.jar
michael@0 525 Generating signtool.sf file..
michael@0 526 Enter Password or Pin for "Communicator Certificate DB":
michael@0 527
michael@0 528 adding signdir/META-INF/manifest.mf to testjar.jar
michael@0 529 adding signdir/META-INF/signtool.sf to testjar.jar
michael@0 530 adding signdir/META-INF/signtool.rsa to testjar.jar
michael@0 531
michael@0 532 tree "signdir" signed successfully</programlisting>
michael@0 533 <para>4. Test the archive you just created.</para>
michael@0 534 <programlisting >signtool -v testjar.jar
michael@0 535
michael@0 536 using certificate directory: /u/jsmith/.netscape
michael@0 537 archive "testjar.jar" has passed crypto verification.
michael@0 538 status path
michael@0 539 ------------ -------------------
michael@0 540 verified test.f</programlisting>
michael@0 541
michael@0 542 <para><command>Using Netscape Signing Tool with a ZIP Utility</command></para>
michael@0 543 <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>
michael@0 544 <programlisting >cd signdir
michael@0 545
michael@0 546 zip -r ../myjar.jar *
michael@0 547 adding: META-INF/ (stored 0%)
michael@0 548 adding: META-INF/manifest.mf (deflated 15%)
michael@0 549 adding: META-INF/signtool.sf (deflated 28%)
michael@0 550 adding: META-INF/signtool.rsa (stored 0%)
michael@0 551 adding: text.txt (stored 0%)</programlisting>
michael@0 552
michael@0 553 <para><command>Generating the Keys and Certificate</command></para>
michael@0 554 <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>
michael@0 555 <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>
michael@0 556 <programlisting >signtool -G MyTestCert
michael@0 557
michael@0 558 using certificate directory: /u/someuser/.netscape
michael@0 559 Enter certificate information. All fields are optional. Acceptable
michael@0 560 characters are numbers, letters, spaces, and apostrophes.
michael@0 561 certificate common name: Test Object Signing Certificate
michael@0 562 organization: Netscape Communications Corp.
michael@0 563 organization unit: Server Products Division
michael@0 564 state or province: California
michael@0 565 country (must be exactly 2 characters): US
michael@0 566 username: someuser
michael@0 567 email address: someuser@netscape.com
michael@0 568 Enter Password or Pin for "Communicator Certificate DB": [Password will not echo]
michael@0 569 generated public/private key pair
michael@0 570 certificate request generated
michael@0 571 certificate has been signed
michael@0 572 certificate "MyTestCert" added to database
michael@0 573 Exported certificate to x509.raw and x509.cacert.</programlisting>
michael@0 574 <para>The certificate information is read from standard input. Therefore, the information can be read from a file using the redirection operator (&lt;) 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>
michael@0 575 <programlisting >signtool -G MyTestCert inputfile</programlisting>
michael@0 576 <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>
michael@0 577
michael@0 578 <para><command>Using the -M Option to List Smart Cards</command></para>
michael@0 579 <para>You can use the -M option to list the PKCS #11 modules, including smart cards, that are available to signtool:</para>
michael@0 580 <programlisting >signtool -d "c:\netscape\users\jsmith" -M
michael@0 581
michael@0 582 using certificate directory: c:\netscape\users\username
michael@0 583 Listing of PKCS11 modules
michael@0 584 -----------------------------------------------
michael@0 585 1. Netscape Internal PKCS #11 Module
michael@0 586 (this module is internally loaded)
michael@0 587 slots: 2 slots attached
michael@0 588 status: loaded
michael@0 589 slot: Communicator Internal Cryptographic Services Version 4.0
michael@0 590 token: Communicator Generic Crypto Svcs
michael@0 591 slot: Communicator User Private Key and Certificate Services
michael@0 592 token: Communicator Certificate DB
michael@0 593 2. CryptOS
michael@0 594 (this is an external module)
michael@0 595 DLL name: core32
michael@0 596 slots: 1 slots attached
michael@0 597 status: loaded
michael@0 598 slot: Litronic 210
michael@0 599 token:
michael@0 600 ----------------------------------------------- </programlisting>
michael@0 601
michael@0 602 <para><command>Using Netscape Signing Tool and a Smart Card to Sign Files</command></para>
michael@0 603 <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>
michael@0 604 <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>
michael@0 605 <programlisting >signtool -k "MyCard:My Signing Cert" directory</programlisting>
michael@0 606
michael@0 607
michael@0 608 <para><command>Verifying FIPS Mode</command></para>
michael@0 609 <para>Use the -M option to verify that you are using the FIPS-140-1 module.</para>
michael@0 610 <programlisting >signtool -d "c:\netscape\users\jsmith" -M
michael@0 611
michael@0 612 using certificate directory: c:\netscape\users\jsmith
michael@0 613 Listing of PKCS11 modules
michael@0 614 -----------------------------------------------
michael@0 615 1. Netscape Internal PKCS #11 Module
michael@0 616 (this module is internally loaded)
michael@0 617 slots: 2 slots attached
michael@0 618 status: loaded
michael@0 619 slot: Communicator Internal Cryptographic Services Version 4.0
michael@0 620 token: Communicator Generic Crypto Svcs
michael@0 621 slot: Communicator User Private Key and Certificate Services
michael@0 622 token: Communicator Certificate DB
michael@0 623 -----------------------------------------------</programlisting>
michael@0 624 <para>This Unix example shows that Netscape Signing Tool is using a FIPS-140-1 module:</para>
michael@0 625 <programlisting >signtool -d "c:\netscape\users\jsmith" -M
michael@0 626 using certificate directory: c:\netscape\users\jsmith
michael@0 627 Enter Password or Pin for "Communicator Certificate DB": [password will not echo]
michael@0 628 Listing of PKCS11 modules
michael@0 629 -----------------------------------------------
michael@0 630 1. Netscape Internal FIPS PKCS #11 Module
michael@0 631 (this module is internally loaded)
michael@0 632 slots: 1 slots attached
michael@0 633 status: loaded
michael@0 634 slot: Netscape Internal FIPS-140-1 Cryptographic Services
michael@0 635 token: Communicator Certificate DB
michael@0 636 -----------------------------------------------</programlisting>
michael@0 637 </refsection>
michael@0 638
michael@0 639 <refsection id="seealso">
michael@0 640 <title>See Also</title>
michael@0 641 <para>signver (1)</para>
michael@0 642
michael@0 643 <para>The NSS wiki has information on the new database design and how to configure applications to use it.</para>
michael@0 644 <itemizedlist>
michael@0 645 <listitem>
michael@0 646 <para>
michael@0 647 https://wiki.mozilla.org/NSS_Shared_DB_Howto</para>
michael@0 648 </listitem>
michael@0 649 <listitem>
michael@0 650 <para>
michael@0 651 https://wiki.mozilla.org/NSS_Shared_DB
michael@0 652 </para>
michael@0 653 </listitem>
michael@0 654 </itemizedlist>
michael@0 655 </refsection>
michael@0 656
michael@0 657 <!-- don't change -->
michael@0 658 <refsection id="resources">
michael@0 659 <title>Additional Resources</title>
michael@0 660 <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>
michael@0 661 <para>Mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto</para>
michael@0 662 <para>IRC: Freenode at #dogtag-pki</para>
michael@0 663 </refsection>
michael@0 664
michael@0 665 <!-- fill in your name first; keep the other names for reference -->
michael@0 666 <refsection id="authors">
michael@0 667 <title>Authors</title>
michael@0 668 <para>The NSS tools were written and maintained by developers with Netscape, Red Hat, Sun, Oracle, Mozilla, and Google.</para>
michael@0 669 <para>
michael@0 670 Authors: Elio Maldonado &lt;emaldona@redhat.com>, Deon Lackey &lt;dlackey@redhat.com>.
michael@0 671 </para>
michael@0 672 </refsection>
michael@0 673
michael@0 674 <!-- don't change -->
michael@0 675 <refsection id="license">
michael@0 676 <title>LICENSE</title>
michael@0 677 <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/.
michael@0 678 </para>
michael@0 679 </refsection>
michael@0 680
michael@0 681 </refentry>

mercurial