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