107 The default \f3jarsigner\fP behavior is to \f2sign\fP a JAR (or zip) file. Use the \f2\-verify\fP option to instead have it \f2verify\fP a signed JAR file. |
99 The default \f3jarsigner\fP behavior is to \f2sign\fP a JAR (or zip) file. Use the \f2\-verify\fP option to instead have it \f2verify\fP a signed JAR file. |
108 .LP |
100 .LP |
109 .SS |
101 .SS |
110 Keystore Aliases |
102 Keystore Aliases |
111 .LP |
103 .LP |
112 .RS 3 |
|
113 |
|
114 .LP |
|
115 .LP |
104 .LP |
116 All keystore entities are accessed via unique \f2aliases\fP. |
105 All keystore entities are accessed via unique \f2aliases\fP. |
117 .LP |
106 .LP |
118 .LP |
107 .LP |
119 When using \f3jarsigner\fP to sign a JAR file, you must specify the alias for the keystore entry containing the private key needed to generate the signature. For example, the following will sign the JAR file named "MyJARFile.jar", using the private key associated with the alias "duke" in the keystore named "mystore" in the "working" directory. Since no output file is specified, it overwrites MyJARFile.jar with the signed JAR file. |
108 When using \f3jarsigner\fP to sign a JAR file, you must specify the alias for the keystore entry containing the private key needed to generate the signature. For example, the following will sign the JAR file named "MyJARFile.jar", using the private key associated with the alias "duke" in the keystore named "mystore" in the "working" directory. Since no output file is specified, it overwrites MyJARFile.jar with the signed JAR file. |
120 .LP |
109 .LP |
121 .nf |
110 .nf |
122 \f3 |
111 \f3 |
123 .fl |
112 .fl |
124 jarsigner \-keystore /working/mystore \-storepass myspass |
113 jarsigner \-keystore /working/mystore \-storepass \fP\f4<keystore password>\fP\f3 |
125 .fl |
114 .fl |
126 \-keypass dukekeypasswd MyJARFile.jar duke |
115 \-keypass \fP\f4<private key password>\fP\f3 MyJARFile.jar duke |
127 .fl |
116 .fl |
128 \fP |
117 \fP |
129 .fi |
118 .fi |
130 |
119 |
131 .LP |
120 .LP |
132 .LP |
121 .LP |
133 Keystores are protected with a password, so the store password (in this case "myspass") must be specified. You will be prompted for it if you don't specify it on the command line. Similarly, private keys are protected in a keystore with a password, so the private key's password (in this case "dukekeypasswd") must be specified, and you will be prompted for it if you don't specify it on the command line and it isn't the same as the store password. |
122 Keystores are protected with a password, so the store password must be specified. You will be prompted for it if you don't specify it on the command line. Similarly, private keys are protected in a keystore with a password, so the private key's password must be specified, and you will be prompted for it if you don't specify it on the command line and it isn't the same as the store password. |
134 .LP |
123 .LP |
135 .RE |
|
136 .SS |
124 .SS |
137 Keystore Location |
125 Keystore Location |
138 .LP |
126 .LP |
139 .RS 3 |
|
140 |
|
141 .LP |
|
142 .LP |
127 .LP |
143 \f3jarsigner\fP has a \f2\-keystore\fP option for specifying the URL of the keystore to be used. The keystore is by default stored in a file named \f2.keystore\fP in the user's home directory, as determined by the \f2user.home\fP system property. On Solaris systems \f2user.home\fP defaults to the user's home directory. |
128 \f3jarsigner\fP has a \f2\-keystore\fP option for specifying the URL of the keystore to be used. The keystore is by default stored in a file named \f2.keystore\fP in the user's home directory, as determined by the \f2user.home\fP system property. On Solaris systems \f2user.home\fP defaults to the user's home directory. |
144 .LP |
129 .LP |
145 .LP |
130 .LP |
146 Note that the input stream from the \f2\-keystore\fP option is passed to the \f2KeyStore.load\fP method. If \f2NONE\fP is specified as the URL, then a null stream is passed to the \f2KeyStore.load\fP method. \f2NONE\fP should be specified if the \f2KeyStore\fP is not file\-based, for example, if it resides on a hardware token device. |
131 Note that the input stream from the \f2\-keystore\fP option is passed to the \f2KeyStore.load\fP method. If \f2NONE\fP is specified as the URL, then a null stream is passed to the \f2KeyStore.load\fP method. \f2NONE\fP should be specified if the \f2KeyStore\fP is not file\-based, for example, if it resides on a hardware token device. |
147 .LP |
132 .LP |
148 .RE |
|
149 .SS |
133 .SS |
150 Keystore Implementation |
134 Keystore Implementation |
151 .LP |
|
152 .RS 3 |
|
153 |
|
154 .LP |
135 .LP |
155 .LP |
136 .LP |
156 The \f2KeyStore\fP class provided in the \f2java.security\fP package supplies well\-defined interfaces to access and modify the information in a keystore. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular \f2type\fP of keystore. |
137 The \f2KeyStore\fP class provided in the \f2java.security\fP package supplies well\-defined interfaces to access and modify the information in a keystore. It is possible for there to be multiple different concrete implementations, where each implementation is that for a particular \f2type\fP of keystore. |
157 .LP |
138 .LP |
158 .LP |
139 .LP |
164 .LP |
145 .LP |
165 Keystore implementations are provider\-based. More specifically, the application interfaces supplied by \f2KeyStore\fP are implemented in terms of a "Service Provider Interface" (SPI). That is, there is a corresponding abstract \f2KeystoreSpi\fP class, also in the \f2java.security\fP package, which defines the Service Provider Interface methods that "providers" must implement. (The term "provider" refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API.) Thus, to provide a keystore implementation, clients must implement a provider and supply a KeystoreSpi subclass implementation, as described in |
146 Keystore implementations are provider\-based. More specifically, the application interfaces supplied by \f2KeyStore\fP are implemented in terms of a "Service Provider Interface" (SPI). That is, there is a corresponding abstract \f2KeystoreSpi\fP class, also in the \f2java.security\fP package, which defines the Service Provider Interface methods that "providers" must implement. (The term "provider" refers to a package or a set of packages that supply a concrete implementation of a subset of services that can be accessed by the Java Security API.) Thus, to provide a keystore implementation, clients must implement a provider and supply a KeystoreSpi subclass implementation, as described in |
166 .na |
147 .na |
167 \f2How to Implement a Provider for the Java Cryptography Architecture\fP @ |
148 \f2How to Implement a Provider for the Java Cryptography Architecture\fP @ |
168 .fi |
149 .fi |
169 http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/HowToImplAProvider.html. |
150 http://download.oracle.com/javase/7/docs/technotes/guides/security/crypto/HowToImplAProvider.html. |
170 .LP |
151 .LP |
171 .LP |
152 .LP |
172 Applications can choose different \f2types\fP of keystore implementations from different providers, using the "getInstance" factory method supplied in the \f2KeyStore\fP class. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself. Keystore implementations of different types are not compatible. |
153 Applications can choose different \f2types\fP of keystore implementations from different providers, using the "getInstance" factory method supplied in the \f2KeyStore\fP class. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself. Keystore implementations of different types are not compatible. |
173 .LP |
154 .LP |
174 .LP |
155 .LP |
175 \f3keytool\fP works on any file\-based keystore implementation. (It treats the keytore location that is passed to it at the command line as a filename and converts it to a FileInputStream, from which it loads the keystore information.) The \f3jarsigner\fP and \f3policytool\fP tools, on the other hand, can read a keystore from any location that can be specified using a URL. |
156 \f3keytool\fP works on any file\-based keystore implementation. (It treats the keystore location that is passed to it at the command line as a filename and converts it to a FileInputStream, from which it loads the keystore information.) The \f3jarsigner\fP and \f3policytool\fP tools, on the other hand, can read a keystore from any location that can be specified using a URL. |
176 .LP |
157 .LP |
177 .LP |
158 .LP |
178 For \f3jarsigner\fP and \f3keytool\fP, you can specify a keystore type at the command line, via the \f2\-storetype\fP option. For \f3Policy Tool\fP, you can specify a keystore type via the "Change Keystore" command in the Edit menu. |
159 For \f3jarsigner\fP and \f3keytool\fP, you can specify a keystore type at the command line, via the \f2\-storetype\fP option. For \f3Policy Tool\fP, you can specify a keystore type via the "Change Keystore" command in the Edit menu. |
179 .LP |
160 .LP |
180 .LP |
161 .LP |
225 .LP |
206 .LP |
226 Note that if you us the PKCS#11 provider package, you should refer to the |
207 Note that if you us the PKCS#11 provider package, you should refer to the |
227 .na |
208 .na |
228 \f2KeyTool and JarSigner\fP @ |
209 \f2KeyTool and JarSigner\fP @ |
229 .fi |
210 .fi |
230 http://java.sun.com/javase/6/docs/technotes/guides/security/p11guide.html#KeyToolJarSigner section of the Java PKCS#11 Reference Guide for details. |
211 http://download.oracle.com/javase/7/docs/technotes/guides/security/p11guide.html#KeyToolJarSigner section of the Java PKCS#11 Reference Guide for details. |
231 .LP |
212 .LP |
232 .RE |
|
233 .SS |
213 .SS |
234 Supported Algorithms |
214 Supported Algorithms |
235 .LP |
215 .LP |
236 .RS 3 |
216 .LP |
237 |
217 By default, \f3jarsigner\fP signs a JAR file using one of the following: |
238 .LP |
218 .LP |
239 .LP |
219 .RS 3 |
240 By default, \f3jarsigner\fP signs a JAR file using either |
220 .TP 2 |
241 .LP |
221 o |
242 .RS 3 |
222 DSA (Digital Signature Algorithm) with the SHA1 digest algorithm |
243 .TP 2 |
223 .TP 2 |
244 o |
224 o |
245 DSA (Digital Signature Algorithm) with the SHA\-1 digest algorithm, or |
225 RSA algorithm with the SHA256 digest algorithm. |
246 .TP 2 |
226 .TP 2 |
247 o |
227 o |
248 the RSA algorithm with the SHA\-256 digest algorithm. |
228 EC (Elliptic Curve) cryptography algorithm with the SHA256 with ECDSA (Elliptic Curve Digital Signature Algorithm). |
249 .RE |
229 .RE |
250 |
230 |
251 .LP |
231 .LP |
252 .LP |
232 .LP |
253 That is, if the signer's public and private keys are DSA keys, \f3jarsigner\fP will sign the JAR file using the "SHA1withDSA" algorithm. If the signer's keys are RSA keys, \f3jarsigner\fP will attempt to sign the JAR file using the "SHA256withRSA" algorithm. |
233 That is, if the signer's public and private keys are DSA keys, \f3jarsigner\fP will sign the JAR file using the "SHA1withDSA" algorithm. If the signer's keys are RSA keys, \f3jarsigner\fP will attempt to sign the JAR file using the "SHA256withRSA" algorithm. If the signer's keys are EC keys, \f3jarsigner\fP will sign the JAR file using the "SHA256withECDSA" algorithm. |
254 .LP |
234 .LP |
255 .LP |
235 .LP |
256 These default signature algorithms can be overridden using the \f2\-sigalg\fP option. |
236 These default signature algorithms can be overridden using the \f2\-sigalg\fP option. |
257 .LP |
237 .LP |
258 .RE |
|
259 .SS |
238 .SS |
260 The Signed JAR File |
239 The Signed JAR File |
261 .LP |
240 .LP |
262 .RS 3 |
|
263 |
|
264 .LP |
|
265 .LP |
241 .LP |
266 When \f3jarsigner\fP is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META\-INF directory: |
242 When \f3jarsigner\fP is used to sign a JAR file, the output signed JAR file is exactly the same as the input JAR file, except that it has two additional files placed in the META\-INF directory: |
267 .LP |
243 .LP |
268 .RS 3 |
244 .RS 3 |
269 .TP 2 |
245 .TP 2 |
270 o |
246 o |
271 a signature file, with a .SF extension, and |
247 a signature file, with a .SF extension, and |
272 .TP 2 |
248 .TP 2 |
273 o |
249 o |
274 a signature block file, with a .DSA extension. |
250 a signature block file, with a .DSA, .RSA, or .EC extension. |
275 .RE |
251 .RE |
276 |
252 |
277 .LP |
253 .LP |
278 .LP |
254 .LP |
279 The base file names for these two files come from the value of the \f2\-sigFile\fP option. For example, if the option appears as |
255 The base file names for these two files come from the value of the \f2\-sigFile\fP option. For example, if the option appears as |
280 .LP |
256 .LP |
281 .nf |
257 .nf |
282 \f3 |
258 \f3 |
283 .fl |
259 .fl |
284 \-sigFile MKSIGN |
260 \-sigFile MKSIGN |
285 .fl |
261 .fl |
286 \fP |
262 \fP |
287 .fi |
263 .fi |
288 |
264 |
289 .LP |
265 .LP |
290 .LP |
266 .LP |
291 the files are named "MKSIGN.SF" and "MKSIGN.DSA". |
267 The files are named "MKSIGN.SF" and "MKSIGN.DSA". |
292 .LP |
268 .LP |
293 .LP |
269 .LP |
294 If no \f2\-sigfile\fP option appears on the command line, the base file name for the .SF and .DSA files will be the first 8 characters of the alias name specified on the command line, all converted to upper case. If the alias name has fewer than 8 characters, the full alias name is used. If the alias name contains any characters that are not allowed in a signature file name, each such character is converted to an underscore ("_") character in forming the file name. Legal characters include letters, digits, underscores, and hyphens. |
270 If no \f2\-sigfile\fP option appears on the command line, the base file name for the .SF and .DSA files will be the first 8 characters of the alias name specified on the command line, all converted to upper case. If the alias name has fewer than 8 characters, the full alias name is used. If the alias name contains any characters that are not allowed in a signature file name, each such character is converted to an underscore ("_") character in forming the file name. Legal characters include letters, digits, underscores, and hyphens. |
295 .LP |
271 .LP |
296 \f3The Signature (.SF) File\fP |
272 \f3The Signature (.SF) File\fP |
297 .LP |
273 .LP |
298 .RS 3 |
|
299 |
|
300 .LP |
|
301 .LP |
274 .LP |
302 A signature file (the .SF file) looks similar to the manifest file that is always included in a JAR file when \f3jarsigner\fP is used to sign the file. That is, for each source file included in the JAR file, the .SF file has three lines, just as in the manifest file, listing the following: |
275 A signature file (the .SF file) looks similar to the manifest file that is always included in a JAR file when \f3jarsigner\fP is used to sign the file. That is, for each source file included in the JAR file, the .SF file has three lines, just as in the manifest file, listing the following: |
303 .LP |
276 .LP |
304 .RS 3 |
277 .RS 3 |
305 .TP 2 |
278 .TP 2 |
318 In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file. In the .SF file, on the other hand, the digest value for a given source file is the hash of the three lines in the manifest file for the source file. |
291 In the manifest file, the SHA digest value for each source file is the digest (hash) of the binary data in the source file. In the .SF file, on the other hand, the digest value for a given source file is the hash of the three lines in the manifest file for the source file. |
319 .LP |
292 .LP |
320 .LP |
293 .LP |
321 The signature file also, by default, includes a header containing a hash of the whole manifest file. The presence of the header enables verification optimization, as described in JAR File Verification. |
294 The signature file also, by default, includes a header containing a hash of the whole manifest file. The presence of the header enables verification optimization, as described in JAR File Verification. |
322 .LP |
295 .LP |
323 .RE |
296 \f3The Signature Block File\fP |
324 \f3The Signature Block (.DSA) File\fP |
297 .LP |
325 .LP |
298 The .SF file is signed and the signature is placed in the signature block file. This file also contains, encoded inside it, the certificate or certificate chain from the keystore which authenticates the public key corresponding to the private key used for signing. The file has the extension .DSA, .RSA, or .EC depending on the digest algorithm used. |
326 .RS 3 |
|
327 |
|
328 .LP |
|
329 .LP |
|
330 The .SF file is signed and the signature is placed in the .DSA file. The .DSA file also contains, encoded inside it, the certificate or certificate chain from the keystore which authenticates the public key corresponding to the private key used for signing. |
|
331 .LP |
|
332 .RE |
|
333 .RE |
|
334 .SS |
299 .SS |
335 Signature Timestamp |
300 Signature Timestamp |
336 .LP |
301 .LP |
337 .RS 3 |
302 .LP |
338 |
303 \f2jarsigner\fP tool can generate and store a signature timestamp when signing a JAR file. In addition, \f2jarsigner\fP supports alternative signing mechanisms. This behavior is optional and is controlled by the user at the time of signing through these options: |
339 .LP |
|
340 .LP |
|
341 \f2jarsigner\fP tool can now generate and store a signature timestamp when signing a JAR file. In addition, \f2jarsigner\fP supports alternative signing mechanisms. This behavior is optional and is controlled by the user at the time of signing through these options: |
|
342 .LP |
304 .LP |
343 .RS 3 |
305 .RS 3 |
344 .TP 2 |
306 .TP 2 |
345 o |
307 o |
346 \f2\-tsa url\fP |
308 \f2\-tsa url\fP |
357 |
319 |
358 .LP |
320 .LP |
359 .LP |
321 .LP |
360 Each of these options is detailed in the Options section below. |
322 Each of these options is detailed in the Options section below. |
361 .LP |
323 .LP |
362 .RE |
|
363 .SS |
324 .SS |
364 JAR File Verification |
325 JAR File Verification |
365 .LP |
326 .LP |
366 .RS 3 |
|
367 |
|
368 .LP |
|
369 .LP |
327 .LP |
370 A successful JAR file verification occurs if the signature(s) are valid, and none of the files that were in the JAR file when the signatures were generated have been changed since then. JAR file verification involves the following steps: |
328 A successful JAR file verification occurs if the signature(s) are valid, and none of the files that were in the JAR file when the signatures were generated have been changed since then. JAR file verification involves the following steps: |
371 .LP |
329 .LP |
372 .RS 3 |
330 .RS 3 |
373 .TP 3 |
331 .TP 3 |
374 1. |
332 1. |
375 Verify the signature of the .SF file itself. |
333 Verify the signature of the .SF file itself. |
376 .LP |
334 .br |
377 That is, the verification ensures that the signature stored in each signature block (.DSA) file was in fact generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the .DSA file. It also ensures that the signature is a valid signature of the corresponding signature (.SF) file, and thus the .SF file has not been tampered with. |
335 .br |
|
336 That is, the verification ensures that the signature stored in each signature block (.DSA) file was in fact generated using the private key corresponding to the public key whose certificate (or certificate chain) also appears in the .DSA file. It also ensures that the signature is a valid signature of the corresponding signature (.SF) file, and thus the .SF file has not been tampered with. |
378 .TP 3 |
337 .TP 3 |
379 2. |
338 2. |
380 Verify the digest listed in each entry in the .SF file with each corresponding section in the manifest. |
339 Verify the digest listed in each entry in the .SF file with each corresponding section in the manifest. |
381 .LP |
340 .br |
382 The .SF file by default includes a header containing a hash of the entire manifest file. When the header is present, then the verification can check to see whether or not the hash in the header indeed matches the hash of the manifest file. If that is the case, verification proceeds to the next step. |
341 .br |
383 .LP |
342 The .SF file by default includes a header containing a hash of the entire manifest file. When the header is present, then the verification can check to see whether or not the hash in the header indeed matches the hash of the manifest file. If that is the case, verification proceeds to the next step. |
384 If that is not the case, a less optimized verification is required to ensure that the hash in each source file information section in the .SF file equals the hash of its corresponding section in the manifest file (see The Signature (.SF) File). |
343 .br |
385 .LP |
344 .br |
386 One reason the hash of the manifest file that is stored in the .SF file header may not equal the hash of the current manifest file would be because one or more files were added to the JAR file (using the \f2jar\fP tool) after the signature (and thus the .SF file) was generated. When the \f2jar\fP tool is used to add files, the manifest file is changed (sections are added to it for the new files), but the .SF file is not. A verification is still considered successful if none of the files that were in the JAR file when the signature was generated have been changed since then, which is the case if the hashes in the non\-header sections of the .SF file equal the hashes of the corresponding sections in the manifest file. |
345 If that is not the case, a less optimized verification is required to ensure that the hash in each source file information section in the .SF file equals the hash of its corresponding section in the manifest file (see The Signature (.SF) File). |
|
346 .br |
|
347 .br |
|
348 One reason the hash of the manifest file that is stored in the .SF file header may not equal the hash of the current manifest file would be because one or more files were added to the JAR file (using the \f2jar\fP tool) after the signature (and thus the .SF file) was generated. When the \f2jar\fP tool is used to add files, the manifest file is changed (sections are added to it for the new files), but the .SF file is not. A verification is still considered successful if none of the files that were in the JAR file when the signature was generated have been changed since then, which is the case if the hashes in the non\-header sections of the .SF file equal the hashes of the corresponding sections in the manifest file. |
387 .TP 3 |
349 .TP 3 |
388 3. |
350 3. |
389 Read each file in the JAR file that has an entry in the .SF file. While reading, compute the file's digest, and then compare the result with the digest for this file in the manifest section. The digests should be the same, or verification fails. |
351 Read each file in the JAR file that has an entry in the .SF file. While reading, compute the file's digest, and then compare the result with the digest for this file in the manifest section. The digests should be the same, or verification fails. |
390 .RE |
352 .RE |
391 |
353 |
392 .LP |
354 .LP |
393 .LP |
355 .LP |
394 If any serious verification failures occur during the verification process, the process is stopped and a security exception is thrown. It is caught and displayed by \f3jarsigner\fP. |
356 If any serious verification failures occur during the verification process, the process is stopped and a security exception is thrown. It is caught and displayed by \f3jarsigner\fP. |
395 .LP |
357 .LP |
396 .RE |
|
397 .SS |
358 .SS |
398 Multiple Signatures for a JAR File |
359 Multiple Signatures for a JAR File |
399 .LP |
360 .LP |
400 .RS 3 |
|
401 |
|
402 .LP |
|
403 .LP |
361 .LP |
404 A JAR file can be signed by multiple people simply by running the \f3jarsigner\fP tool on the file multiple times, specifying the alias for a different person each time, as in: |
362 A JAR file can be signed by multiple people simply by running the \f3jarsigner\fP tool on the file multiple times, specifying the alias for a different person each time, as in: |
405 .LP |
363 .LP |
406 .nf |
364 .nf |
407 \f3 |
365 \f3 |
492 .TP 2 |
450 .TP 2 |
493 o |
451 o |
494 \f2\-storetype PKCS11\fP |
452 \f2\-storetype PKCS11\fP |
495 .RE |
453 .RE |
496 For example, this command lists the contents of the configured PKCS#11 token: |
454 For example, this command lists the contents of the configured PKCS#11 token: |
497 .RS 3 |
|
498 |
|
499 .LP |
|
500 .nf |
455 .nf |
501 \f3 |
456 \f3 |
502 .fl |
457 .fl |
503 jarsigner \-keystore NONE \-storetype PKCS11 \-list |
458 jarsigner \-keystore NONE \-storetype PKCS11 \-list |
504 .fl |
459 .fl |
505 |
460 \fP |
506 .fl |
461 .fi |
507 \fP |
|
508 .fi |
|
509 .RE |
|
510 .TP 3 |
462 .TP 3 |
511 \-storetype storetype |
463 \-storetype storetype |
512 Specifies the type of keystore to be instantiated. The default keystore type is the one that is specified as the value of the "keystore.type" property in the security properties file, which is returned by the static \f2getDefaultType\fP method in \f2java.security.KeyStore\fP. |
464 Specifies the type of keystore to be instantiated. The default keystore type is the one that is specified as the value of the "keystore.type" property in the security properties file, which is returned by the static \f2getDefaultType\fP method in \f2java.security.KeyStore\fP. |
513 .LP |
465 .br |
514 The PIN for a PCKS#11 token can also be specified using the \f2\-storepass\fP option. If none has been specified, keytool and jarsigner will prompt for the token PIN. If the token has a protected authentication path (such as a dedicated PIN\-pad or a biometric reader), then the \f2\-protected\fP option must be specified and no password options can be specified. |
466 .br |
515 .TP 3 |
467 The PIN for a PCKS#11 token can also be specified using the \f2\-storepass\fP option. If none has been specified, keytool and jarsigner will prompt for the token PIN. If the token has a protected authentication path (such as a dedicated PIN\-pad or a biometric reader), then the \f2\-protected\fP option must be specified and no password options can be specified. |
516 \-storepass password |
468 .TP 3 |
517 Specifies the password which is required to access the keystore. This is only needed when signing (not verifying) a JAR file. In that case, if a \f2\-storepass\fP option is not provided at the command line, the user is prompted for the password. |
469 \-storepass[:env | :file] argument |
518 .LP |
470 Specifies the password which is required to access the keystore. This is only needed when signing (not verifying) a JAR file. In that case, if a \f2\-storepass\fP option is not provided at the command line, the user is prompted for the password. |
519 Note: The password shouldn't be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system. |
471 .br |
520 .TP 3 |
472 .br |
521 \-keypass password |
473 If the modifier \f2env\fP or \f2file\fP is not specified, then the password has the value \f2argument\fP. Otherwise, the password is retrieved as follows: |
522 Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line. The password is required when using \f3jarsigner\fP to sign a JAR file. If no password is provided on the command line, and the required password is different from the store password, the user is prompted for it. |
474 .RS 3 |
523 .LP |
475 .TP 2 |
524 Note: The password shouldn't be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system. Also, when typing in a password at the password prompt, the password is echoed (displayed exactly as typed), so be careful not to type it in front of anyone. |
476 o |
|
477 \f2env\fP: Retrieve the password from the environment variable named \f2argument\fP |
|
478 .TP 2 |
|
479 o |
|
480 \f2file\fP: Retrieve the password from the file named \f2argument\fP |
|
481 .RE |
|
482 Note: The password shouldn't be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system. |
|
483 .TP 3 |
|
484 \-keypass[:env | :file] argument |
|
485 Specifies the password used to protect the private key of the keystore entry addressed by the alias specified on the command line. The password is required when using \f3jarsigner\fP to sign a JAR file. If no password is provided on the command line, and the required password is different from the store password, the user is prompted for it. |
|
486 .br |
|
487 .br |
|
488 If the modifier \f2env\fP or \f2file\fP is not specified, then the password has the value \f2argument\fP. Otherwise, the password is retrieved as follows: |
|
489 .RS 3 |
|
490 .TP 2 |
|
491 o |
|
492 \f2env\fP: Retrieve the password from the environment variable named \f2argument\fP |
|
493 .TP 2 |
|
494 o |
|
495 \f2file\fP: Retrieve the password from the file named \f2argument\fP |
|
496 .RE |
|
497 Note: The password shouldn't be specified on the command line or in a script unless it is for testing purposes, or you are on a secure system. |
525 .TP 3 |
498 .TP 3 |
526 \-sigfile file |
499 \-sigfile file |
527 Specifies the base file name to be used for the generated .SF and .DSA files. For example, if \f2file\fP is "DUKESIGN", the generated .SF and .DSA files will be named "DUKESIGN.SF" and "DUKESIGN.DSA", and will be placed in the "META\-INF" directory of the signed JAR file. |
500 Specifies the base file name to be used for the generated .SF and .DSA files. For example, if \f2file\fP is "DUKESIGN", the generated .SF and .DSA files will be named "DUKESIGN.SF" and "DUKESIGN.DSA", and will be placed in the "META\-INF" directory of the signed JAR file. |
528 .LP |
501 .br |
529 The characters in \f2file\fP must come from the set "a\-zA\-Z0\-9_\-". That is, only letters, numbers, underscore, and hyphen characters are allowed. Note: All lowercase characters will be converted to uppercase for the .SF and .DSA file names. |
502 .br |
530 .LP |
503 The characters in \f2file\fP must come from the set "a\-zA\-Z0\-9_\-". That is, only letters, numbers, underscore, and hyphen characters are allowed. Note: All lowercase characters will be converted to uppercase for the .SF and .DSA file names. |
531 If no \f2\-sigfile\fP option appears on the command line, the base file name for the .SF and .DSA files will be the first 8 characters of the alias name specified on the command line, all converted to upper case. If the alias name has fewer than 8 characters, the full alias name is used. If the alias name contains any characters that are not legal in a signature file name, each such character is converted to an underscore ("_") character in forming the file name. |
504 .br |
|
505 .br |
|
506 If no \f2\-sigfile\fP option appears on the command line, the base file name for the .SF and .DSA files will be the first 8 characters of the alias name specified on the command line, all converted to upper case. If the alias name has fewer than 8 characters, the full alias name is used. If the alias name contains any characters that are not legal in a signature file name, each such character is converted to an underscore ("_") character in forming the file name. |
532 .TP 3 |
507 .TP 3 |
533 \-sigalg algorithm |
508 \-sigalg algorithm |
534 .RS 3 |
509 Specifies the name of the signature algorithm to use to sign the JAR file. |
535 |
510 .br |
536 .LP |
511 .br |
537 Specifies the name of the signature algorithm to use to sign the JAR file. |
|
538 .LP |
|
539 See |
512 See |
540 .na |
513 .na |
541 \f2Appendix A\fP @ |
514 \f2Appendix A\fP @ |
542 .fi |
515 .fi |
543 http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard signature algorithm names. This algorithm must be compatible with the private key used to sign the JAR file. If this option is not specified, SHA1withDSA or SHA256withRSA will be used depending on the type of private key. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed. |
516 http://download.oracle.com/javase/7/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard signature algorithm names. This algorithm must be compatible with the private key used to sign the JAR file. If this option is not specified, SHA1withDSA, SHA256withRSA, or SHA256withECDSA will be used depending on the type of private key. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed. |
544 .LP |
|
545 .RE |
|
546 .TP 3 |
517 .TP 3 |
547 \-digestalg algorithm |
518 \-digestalg algorithm |
548 .RS 3 |
519 Specifies the name of the message digest algorithm to use when digesting the entries of a jar file. |
549 Specifies the name of the message digest algorithm to use when digesting the entries of a jar file. |
520 .br |
550 .LP |
521 .br |
551 See |
522 See |
552 .na |
523 .na |
553 \f2Appendix A\fP @ |
524 \f2Appendix A\fP @ |
554 .fi |
525 .fi |
555 http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard message digest algorithm names. If this option is not specified, SHA\-256 will be used. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed. |
526 http://download.oracle.com/javase/7/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard message digest algorithm names. If this option is not specified, SHA256 will be used. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed. |
556 .LP |
|
557 .RE |
|
558 .TP 3 |
527 .TP 3 |
559 \-signedjar file |
528 \-signedjar file |
560 Specifies the name to be used for the signed JAR file. |
529 Specifies the name to be used for the signed JAR file. |
561 .LP |
530 .br |
562 If no name is specified on the command line, the name used is the same as the input JAR file name (the name of the JAR file to be signed); in other words, that file is overwritten with the signed JAR file. |
531 .br |
|
532 If no name is specified on the command line, the name used is the same as the input JAR file name (the name of the JAR file to be signed); in other words, that file is overwritten with the signed JAR file. |
563 .TP 3 |
533 .TP 3 |
564 \-verify |
534 \-verify |
565 If this appears on the command line, the specified JAR file will be verified, not signed. If the verification is successful, "jar verified" will be displayed. If you try to verify an unsigned JAR file, or a JAR file signed with an unsupported algorithm (e.g., RSA when you don't have an RSA provider installed), the following is displayed: "jar is unsigned. (signatures missing or not parsable)" |
535 If this appears on the command line, the specified JAR file will be verified, not signed. If the verification is successful, "jar verified" will be displayed. If you try to verify an unsigned JAR file, or a JAR file signed with an unsupported algorithm (e.g., RSA when you don't have an RSA provider installed), the following is displayed: "jar is unsigned. (signatures missing or not parsable)" |
566 .LP |
536 .br |
567 It is possible to verify JAR files signed using either \f3jarsigner\fP or the JDK 1.1 \f3javakey\fP tool, or both. |
537 .br |
568 .LP |
538 It is possible to verify JAR files signed using either \f3jarsigner\fP or the JDK 1.1 \f3javakey\fP tool, or both. |
569 For further information on verification, see JAR File Verification. |
539 .br |
|
540 .br |
|
541 For further information on verification, see JAR File Verification. |
570 .TP 3 |
542 .TP 3 |
571 \-certs |
543 \-certs |
572 If this appears on the command line, along with the \f2\-verify\fP and \f2\-verbose\fP options, the output includes certificate information for each signer of the JAR file. This information includes |
544 If this appears on the command line, along with the \f2\-verify\fP and \f2\-verbose\fP options, the output includes certificate information for each signer of the JAR file. This information includes |
573 .RS 3 |
545 .RS 3 |
574 .TP 2 |
546 .TP 2 |
594 .TP 3 |
565 .TP 3 |
595 \-internalsf |
566 \-internalsf |
596 In the past, the .DSA (signature block) file generated when a JAR file was signed used to include a complete encoded copy of the .SF file (signature file) also generated. This behavior has been changed. To reduce the overall size of the output JAR file, the .DSA file by default doesn't contain a copy of the .SF file anymore. But if \f2\-internalsf\fP appears on the command line, the old behavior is utilized. \f3This option is mainly useful for testing; in practice, it should not be used, since doing so eliminates a useful optimization.\fP |
567 In the past, the .DSA (signature block) file generated when a JAR file was signed used to include a complete encoded copy of the .SF file (signature file) also generated. This behavior has been changed. To reduce the overall size of the output JAR file, the .DSA file by default doesn't contain a copy of the .SF file anymore. But if \f2\-internalsf\fP appears on the command line, the old behavior is utilized. \f3This option is mainly useful for testing; in practice, it should not be used, since doing so eliminates a useful optimization.\fP |
597 .TP 3 |
568 .TP 3 |
598 \-sectionsonly |
569 \-sectionsonly |
599 If this appears on the command line, the .SF file (signature file) generated when a JAR file is signed does \f2not\fP include a header containing a hash of the whole manifest file. It just contains information and hashes related to each individual source file included in the JAR file, as described in The Signature (.SF) File . |
570 If this appears on the command line, the .SF file (signature file) generated when a JAR file is signed does \f2not\fP include a header containing a hash of the whole manifest file. It just contains information and hashes related to each individual source file included in the JAR file, as described in The Signature (.SF) File . |
600 .LP |
571 .br |
601 By default, this header is added, as an optimization. When the header is present, then whenever the JAR file is verified, the verification can first check to see whether or not the hash in the header indeed matches the hash of the whole manifest file. If so, verification proceeds to the next step. If not, it is necessary to do a less optimized verification that the hash in each source file information section in the .SF file equals the hash of its corresponding section in the manifest file. |
572 .br |
602 .LP |
573 By default, this header is added, as an optimization. When the header is present, then whenever the JAR file is verified, the verification can first check to see whether or not the hash in the header indeed matches the hash of the whole manifest file. If so, verification proceeds to the next step. If not, it is necessary to do a less optimized verification that the hash in each source file information section in the .SF file equals the hash of its corresponding section in the manifest file. |
603 For further information, see JAR File Verification. |
574 .br |
604 .LP |
575 .br |
605 \f3This option is mainly useful for testing; in practice, it should not be used, since doing so eliminates a useful optimization.\fP |
576 For further information, see JAR File Verification. |
|
577 .br |
|
578 .br |
|
579 \f3This option is mainly useful for testing; in practice, it should not be used, since doing so eliminates a useful optimization.\fP |
606 .TP 3 |
580 .TP 3 |
607 \-protected |
581 \-protected |
608 Either \f2true\fP or \f2false\fP. This value should be specified as \f2true\fP if a password must be given via a protected authentication path such as a dedicated PIN reader. |
582 Either \f2true\fP or \f2false\fP. This value should be specified as \f2true\fP if a password must be given via a protected authentication path such as a dedicated PIN reader. |
609 .RE |
583 .TP 3 |
610 .RS 3 |
584 \-providerClass provider\-class\-name |
611 .TP 3 |
585 Used to specify the name of cryptographic service provider's master class file when the service provider is not listed in the security properties file, \f2java.security\fP. |
612 \-provider provider\-class\-name |
586 .br |
613 Used to specify the name of cryptographic service provider's master class file when the service provider is not listed in the security properties file, \f2java.security\fP. |
587 .br |
614 .LP |
|
615 Used in conjunction with the \f2\-providerArg\fP \f2ConfigFilePath\fP option, keytool and jarsigner will install the provider dynamically (where \f2ConfigFilePath\fP is the path to the token configuration file). Here's an example of a command to list a PKCS#11 keystore when the Sun PKCS#11 provider has not been configured in the security properties file. |
588 Used in conjunction with the \f2\-providerArg\fP \f2ConfigFilePath\fP option, keytool and jarsigner will install the provider dynamically (where \f2ConfigFilePath\fP is the path to the token configuration file). Here's an example of a command to list a PKCS#11 keystore when the Sun PKCS#11 provider has not been configured in the security properties file. |
616 .RS 3 |
|
617 |
|
618 .LP |
|
619 .nf |
589 .nf |
620 \f3 |
590 \f3 |
621 .fl |
591 .fl |
622 jarsigner \-keystore NONE \-storetype PKCS11 \\ |
592 jarsigner \-keystore NONE \-storetype PKCS11 \\ |
623 .fl |
593 .fl |
651 .fl |
618 .fl |
652 \-list |
619 \-list |
653 .fl |
620 .fl |
654 \fP |
621 \fP |
655 .fi |
622 .fi |
656 .RE |
|
657 .TP 3 |
623 .TP 3 |
658 \-Jjavaoption |
624 \-Jjavaoption |
659 Passes through the specified \f2javaoption\fP string directly to the Java interpreter. (\f3jarsigner\fP is actually a "wrapper" around the interpreter.) This option should not contain any spaces. It is useful for adjusting the execution environment or memory usage. For a list of possible interpreter options, type \f2java \-h\fP or \f2java \-X\fP at the command line. |
625 Passes through the specified \f2javaoption\fP string directly to the Java interpreter. (\f3jarsigner\fP is actually a "wrapper" around the interpreter.) This option should not contain any spaces. It is useful for adjusting the execution environment or memory usage. For a list of possible interpreter options, type \f2java \-h\fP or \f2java \-X\fP at the command line. |
660 .LP |
|
661 .TP 3 |
626 .TP 3 |
662 \-tsa url |
627 \-tsa url |
663 If \f2"\-tsa http://example.tsa.url"\fP appears on the command line when signing a JAR file then a timestamp is generated for the signature. The URL, \f2http://example.tsa.url\fP, identifies the location of the Time Stamping Authority (TSA). It overrides any URL found via the \f2\-tsacert\fP option. The \f2\-tsa\fP option does not require the TSA's public key certificate to be present in the keystore. |
628 If \f2"\-tsa http://example.tsa.url"\fP appears on the command line when signing a JAR file then a timestamp is generated for the signature. The URL, \f2http://example.tsa.url\fP, identifies the location of the Time Stamping Authority (TSA). It overrides any URL found via the \f2\-tsacert\fP option. The \f2\-tsa\fP option does not require the TSA's public key certificate to be present in the keystore. |
664 .LP |
629 .br |
|
630 .br |
665 To generate the timestamp, \f2jarsigner\fP communicates with the TSA using the Time\-Stamp Protocol (TSP) defined in |
631 To generate the timestamp, \f2jarsigner\fP communicates with the TSA using the Time\-Stamp Protocol (TSP) defined in |
666 .na |
632 .na |
667 \f2RFC 3161\fP @ |
633 \f2RFC 3161\fP @ |
668 .fi |
634 .fi |
669 http://www.ietf.org/rfc/rfc3161.txt. If successful, the timestamp token returned by the TSA is stored along with the signature in the signature block file. |
635 http://www.ietf.org/rfc/rfc3161.txt. If successful, the timestamp token returned by the TSA is stored along with the signature in the signature block file. |
670 .LP |
|
671 .TP 3 |
636 .TP 3 |
672 \-tsacert alias |
637 \-tsacert alias |
673 If \f2"\-tsacert alias"\fP appears on the command line when signing a JAR file then a timestamp is generated for the signature. The \f2alias\fP identifies the TSA's public key certificate in the keystore that is currently in effect. The entry's certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA. |
638 If \f2"\-tsacert alias"\fP appears on the command line when signing a JAR file then a timestamp is generated for the signature. The \f2alias\fP identifies the TSA's public key certificate in the keystore that is currently in effect. The entry's certificate is examined for a Subject Information Access extension that contains a URL identifying the location of the TSA. |
674 .LP |
639 .br |
675 The TSA's public key certificate must be present in the keystore when using \f2\-tsacert\fP. |
640 .br |
676 .LP |
641 The TSA's public key certificate must be present in the keystore when using \f2\-tsacert\fP. |
677 .TP 3 |
642 .TP 3 |
678 \-altsigner class |
643 \-altsigner class |
679 Specifies that an alternative signing mechanism be used. The fully\-qualified class name identifies a class file that extends the \f2com.sun.jarsigner.ContentSigner abstract class\fP. The path to this class file is defined by the \f2\-altsignerpath\fP option. If the \f2\-altsigner\fP option is used, \f2jarsigner\fP uses the signing mechanism provided by the specified class. Otherwise, \f2jarsigner\fP uses its default signing mechanism. |
644 Specifies that an alternative signing mechanism be used. The fully\-qualified class name identifies a class file that extends the \f2com.sun.jarsigner.ContentSigner abstract class\fP. The path to this class file is defined by the \f2\-altsignerpath\fP option. If the \f2\-altsigner\fP option is used, \f2jarsigner\fP uses the signing mechanism provided by the specified class. Otherwise, \f2jarsigner\fP uses its default signing mechanism. |
680 .LP |
645 .br |
681 For example, to use the signing mechanism provided by a class named \f2com.sun.sun.jarsigner.AuthSigner\fP, use the \f2jarsigner\fP option \f2"\-altsigner com.sun.jarsigner.AuthSigner"\fP |
646 .br |
682 .LP |
647 For example, to use the signing mechanism provided by a class named \f2com.sun.sun.jarsigner.AuthSigner\fP, use the \f2jarsigner\fP option \f2"\-altsigner com.sun.jarsigner.AuthSigner"\fP |
683 .TP 3 |
648 .TP 3 |
684 \-altsignerpath classpathlist |
649 \-altsignerpath classpathlist |
685 Specifies the path to the class file (the class file name is specified with the \f2\-altsigner\fP option described above) and any JAR files it depends on. If the class file is in a JAR file, then this specifies the path to that JAR file, as shown in the example below. |
650 Specifies the path to the class file (the class file name is specified with the \f2\-altsigner\fP option described above) and any JAR files it depends on. If the class file is in a JAR file, then this specifies the path to that JAR file, as shown in the example below. |
686 .LP |
651 .br |
687 An absolute path or a path relative to the current directory may be specified. If \f2classpathlist\fP contains multiple paths or JAR files, they should be separated with a colon (\f2:\fP) on Solaris and a semi\-colon (\f2;\fP) on Windows. This option is not necessary if the class is already in the search path. |
652 .br |
688 .LP |
653 An absolute path or a path relative to the current directory may be specified. If \f2classpathlist\fP contains multiple paths or JAR files, they should be separated with a colon (\f2:\fP) on Solaris and a semi\-colon (\f2;\fP) on Windows. This option is not necessary if the class is already in the search path. |
|
654 .br |
|
655 .br |
689 Example of specifying the path to a jar file that contains the class file: |
656 Example of specifying the path to a jar file that contains the class file: |
690 .RS 3 |
657 .nf |
691 |
658 \f3 |
692 .LP |
659 .fl |
693 .LP |
660 \-altsignerpath /home/user/lib/authsigner.jar |
694 \f2\-altsignerpath /home/user/lib/authsigner.jar\fP |
661 .fl |
695 .LP |
662 \fP |
696 .RE |
663 .fi |
697 .LP |
664 Note that the JAR file name is included. |
698 Note that the JAR file name is included. |
665 .br |
699 .LP |
666 .br |
700 Example of specifying the path to the jar file that contains the class file: |
667 Example of specifying the path to the jar file that contains the class file: |
701 .RS 3 |
668 .nf |
702 .LP |
669 \f3 |
703 \f2\-altsignerpath /home/user/classes/com/sun/tools/jarsigner/\fP |
670 .fl |
704 .LP |
671 \-altsignerpath /home/user/classes/com/sun/tools/jarsigner/ |
705 .RE |
672 .fl |
706 .LP |
673 \fP |
707 Note that the JAR file name is omitted. |
674 .fi |
|
675 Note that the JAR file name is omitted. |
708 .TP 3 |
676 .TP 3 |
709 \-strict |
677 \-strict |
710 During the signing or verifying process, some warning messages may be shown. If this option appears on the command line, the exit code of the tool will reflect the warning messages that are found. Read the "WARNINGS" section for details. |
678 During the signing or verifying process, some warning messages may be shown. If this option appears on the command line, the exit code of the tool will reflect the warning messages that are found. Read the "WARNINGS" section for details. |
711 .TP 3 |
679 .TP 3 |
712 \-verbose:sub\-options |
680 \-verbose:sub\-options |
713 For the verifying process, the \f2\-verbose\fP option takes sub\-options to determine how much information will be shown. If \f2\-certs\fP is also specified, the default mode (or sub\-option all) displays each entry as it is being processed and following that, the certificate information for each signer of the JAR file. If \f2\-certs\fP and the \f2\-verbose:grouped\fP sub\-option are specified, entries with the same signer info are grouped and displayed together along with their certificate information. If \f2\-certs\fP and the \f2\-verbose:summary\fP sub\-option are specified, then entries with the same signer info are grouped and displayed together along with their certificate information but details about each entry are summarized and displayed as "one entry (and more)". See the examples section for more information. |
681 For the verifying process, the \f2\-verbose\fP option takes sub\-options to determine how much information will be shown. If \f2\-certs\fP is also specified, the default mode (or sub\-option all) displays each entry as it is being processed and following that, the certificate information for each signer of the JAR file. If \f2\-certs\fP and the \f2\-verbose:grouped\fP sub\-option are specified, entries with the same signer info are grouped and displayed together along with their certificate information. If \f2\-certs\fP and the \f2\-verbose:summary\fP sub\-option are specified, then entries with the same signer info are grouped and displayed together along with their certificate information but details about each entry are summarized and displayed as "one entry (and more)". See the examples section for more information. |
714 .RE |
682 .RE |
|
683 |
|
684 .LP |
715 .SH "EXAMPLES" |
685 .SH "EXAMPLES" |
716 .LP |
|
717 |
|
718 .LP |
686 .LP |
719 .SS |
687 .SS |
720 Signing a JAR File |
688 Signing a JAR File |
721 .LP |
689 .LP |
722 .RS 3 |
690 .LP |
723 |
691 Suppose you have a JAR file named "bundle.jar" and you'd like to sign it using the private key of the user whose keystore alias is "jane" in the keystore named "mystore" in the "working" directory. You can use the following to sign the JAR file and name the signed JAR file "sbundle.jar": |
724 .LP |
692 .LP |
725 .LP |
693 .nf |
726 Suppose you have a JAR file named "bundle.jar" and you'd like to sign it using the private key of the user whose keystore alias is "jane" in the keystore named "mystore" in the "working" directory. Suppose the keystore password is "myspass" and the password for \f2jane\fP's private key is "j638klm". You can use the following to sign the JAR file and name the signed JAR file "sbundle.jar": |
694 \f3 |
727 .LP |
695 .fl |
728 .nf |
696 jarsigner \-keystore /working/mystore \-storepass \fP\f4<keystore password>\fP\f3 |
729 \f3 |
697 .fl |
730 .fl |
698 \-keypass \fP\f4<private key password>\fP\f3 \-signedjar sbundle.jar bundle.jar jane |
731 jarsigner \-keystore /working/mystore \-storepass myspass |
|
732 .fl |
|
733 \-keypass j638klm \-signedjar sbundle.jar bundle.jar jane |
|
734 .fl |
699 .fl |
735 \fP |
700 \fP |
736 .fi |
701 .fi |
737 |
702 |
738 .LP |
703 .LP |
978 .fl |
936 .fl |
979 hasExpiredCert 4 |
937 hasExpiredCert 4 |
980 .fl |
938 .fl |
981 This jar contains entries whose signer certificate has expired. |
939 This jar contains entries whose signer certificate has expired. |
982 .fl |
940 .fl |
983 |
941 |
984 .fl |
942 .fl |
985 notYetValidCert 4 |
943 notYetValidCert 4 |
986 .fl |
944 .fl |
987 This jar contains entries whose signer certificate is not yet valid. |
945 This jar contains entries whose signer certificate is not yet valid. |
988 .fl |
946 .fl |
989 |
947 |
990 .fl |
948 .fl |
991 chainNotValidated 4 |
949 chainNotValidated 4 |
992 .fl |
950 .fl |
993 This jar contains entries whose certificate chain cannot be correctly validated. |
951 This jar contains entries whose certificate chain cannot be correctly validated. |
994 .fl |
952 .fl |
995 |
953 |
996 .fl |
954 .fl |
997 badKeyUsage 8 |
955 badKeyUsage 8 |
998 .fl |
956 .fl |
999 This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing. |
957 This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing. |
1000 .fl |
958 .fl |
1001 |
959 |
1002 .fl |
960 .fl |
1003 badExtendedKeyUsage 8 |
961 badExtendedKeyUsage 8 |
1004 .fl |
962 .fl |
1005 This jar contains entries whose signer certificate's ExtendedKeyUsage extension |
963 This jar contains entries whose signer certificate's ExtendedKeyUsage extension |
1006 .fl |
964 .fl |
1007 doesn't allow code signing. |
965 doesn't allow code signing. |
1008 .fl |
966 .fl |
1009 |
967 |
1010 .fl |
968 .fl |
1011 badNetscapeCertType 8 |
969 badNetscapeCertType 8 |
1012 .fl |
970 .fl |
1013 This jar contains entries whose signer certificate's NetscapeCertType extension |
971 This jar contains entries whose signer certificate's NetscapeCertType extension |
1014 .fl |
972 .fl |
1015 doesn't allow code signing. |
973 doesn't allow code signing. |
1016 .fl |
974 .fl |
1017 |
975 |
1018 .fl |
976 .fl |
1019 hasUnsignedEntry 16 |
977 hasUnsignedEntry 16 |
1020 .fl |
978 .fl |
1021 This jar contains unsigned entries which have not been integrity\-checked. |
979 This jar contains unsigned entries which have not been integrity\-checked. |
1022 .fl |
980 .fl |
1023 |
981 |
1024 .fl |
982 .fl |
1025 notSignedByAlias 32 |
983 notSignedByAlias 32 |
1026 .fl |
984 .fl |
1027 This jar contains signed entries which are not signed by the specified alias(es) |
985 This jar contains signed entries which are not signed by the specified alias(es) |
1028 .fl |
986 .fl |
1029 |
987 |
1030 .fl |
988 .fl |
1031 aliasNotInStore 32 |
989 aliasNotInStore 32 |
1032 .fl |
990 .fl |
1033 This jar contains signed entries that are not signed by alias in this keystore |
991 This jar contains signed entries that are not signed by alias in this keystore |
1034 .fl |
992 .fl |
1035 |
993 |
1036 .fl |
994 .fl |
1037 \fP |
995 \fP |
1038 .fi |
996 .fi |
1039 |
997 |
1040 .LP |
998 .LP |
1041 .LP |
999 .LP |
1042 When the \f2\-strict\fP option is provided, an OR\-value of warnings detected will be returned as the exit code of the tool. For example, if a certificate used to sign an entry is expired and has a keyUsage extension that does not allow it to sign a file, an exit code 12 (=4+8) will be returned. |
1000 When the \f2\-strict\fP option is provided, an OR\-value of warnings detected will be returned as the exit code of the tool. For example, if a certificate used to sign an entry is expired and has a keyUsage extension that does not allow it to sign a file, an exit code 12 (=4+8) will be returned. |
1043 .LP |
1001 .LP |
1044 .LP |
1002 .LP |
1045 \f3Note\fP: Exit codes are reused because only 0\-255 is legal for Unix. In any case, if the signing/verifying process fails, the exit code |
1003 \f3Note\fP: Exit codes are reused because only 0\-255 is legal for Unix. In any case, if the signing/verifying process fails, the following exit code will be returned: |
1046 .LP |
1004 .LP |
1047 .nf |
1005 .nf |
1048 \f3 |
1006 \f3 |
1049 .fl |
1007 .fl |
1050 failure 1 |
1008 failure 1 |
1051 .fl |
1009 .fl |
1052 \fP |
1010 \fP |
1053 .fi |
1011 .fi |
1054 |
1012 |
1055 .LP |
1013 .LP |
1056 will be returned. |
|
1057 .SS |
1014 .SS |
1058 Compatibility with JDK 1.1 |
1015 Compatibility with JDK 1.1 |
1059 .LP |
|
1060 .RS 3 |
|
1061 |
|
1062 .LP |
1016 .LP |
1063 .LP |
1017 .LP |
1064 The \f3keytool\fP and \f3jarsigner\fP tools completely replace the \f3javakey\fP tool provided in JDK 1.1. These new tools provide more features than \f3javakey\fP, including the ability to protect the keystore and private keys with passwords, and the ability to verify signatures in addition to generating them. |
1018 The \f3keytool\fP and \f3jarsigner\fP tools completely replace the \f3javakey\fP tool provided in JDK 1.1. These new tools provide more features than \f3javakey\fP, including the ability to protect the keystore and private keys with passwords, and the ability to verify signatures in addition to generating them. |
1065 .LP |
1019 .LP |
1066 .LP |
1020 .LP |