~ubuntu-branches/ubuntu/precise/nss/precise-security

« back to all changes in this revision

Viewing changes to mozilla/security/nss/doc/signtool.xml

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-11-14 14:58:07 UTC
  • mfrom: (1.1.19)
  • Revision ID: package-import@ubuntu.com-20131114145807-ay302kimn72ovt88
Tags: 3.15.3-0ubuntu0.12.04.1
* SECURITY UPDATE: New upstream release to fix multiple security issues
  and add TLSv1.2 support.
  - CVE-2013-1739
  - CVE-2013-1741
  - CVE-2013-5605
  - CVE-2013-5606
* Adjusted packaging for 3.15.3:
  - debian/patches/*: refreshed.
  - debian/patches/lower-dhe-priority.patch: removed, no longer needed,
    was a workaround for an old version of firefox.
  - debian/libnss3.symbols: added new symbols.
  - debian/rules: updated for new source layout.

Show diffs side-by-side

added added

removed removed

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