Merge from mainline.
[official-gcc.git] / libjava / classpath / doc / tools.texinfo
blob53eadfaae56cbbac23c8b2cf8ac2ba8119e5b412
1 \input texinfo @c -*-texinfo-*-
3 @c %**start of header
4 @setfilename tools.info
5 @settitle GNU Classpath Tools Guide
6 @c %**end of header
8 @setchapternewpage off
10 @ifinfo
11 This file documents the Tools included in a standard distribution of the GNU
12 Classpath project deliverables.
14 Copyright (C) 2006 Free Software Foundation, Inc.
16 @ifnotplaintext
17 @dircategory GNU Libraries
18 @direntry
19 * Classpath Tools: (tools).       GNU Classpath Tools Guide
20 @end direntry
21 @end ifnotplaintext
22 @end ifinfo
24 @titlepage
25 @title GNU Classpath Tools Guide
26 @author Raif S. Naffah
28 @page
29 @vskip 0pt plus 1filll
30 Copyright @copyright{} 2006 Free Software Foundation, Inc.
31 @sp 2
32 Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies.
34 Permission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
36 Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.
38 @end titlepage
40 @ifinfo
41 @node Top, Security Tools, (dir), (dir)
42 @top GNU Classpath Tools Guide
44 This document contains important information you need to know in order to use
45 the tools included in the GNU Classpath project deliverables.
47 The Tools aim at providing a free replacement, similar in their behavior, to
48 their counter-parts found in the Reference Implementation (RI) of the Java
49 Software Development Kit (SDK).
51 @end ifinfo
53 @menu
54 * Security Tools::             Work securely with Java applications
55 * I18N Issues::                How to add support for non-English languages
57 @detailmenu
58  --- The Detailed Node Listing ---
60 Security Tools
62 * jarsigner Tool::             Sign and verify .JAR files
63 * keytool Tool::               Manage private keys and public certificates
65 I18N Issues
67 * Language Resources::         Where resources are located
68 * Message Formats::            How messages are internationalized
70 @end detailmenu
71 @end menu
73 @comment ----------------------------------------------------------------------
75 @node Security Tools, I18N Issues, Top, Top
76 @comment node-name, next, previous, up
77 @chapter Security Tools
79 Two Security Tools are available with GNU Classpath: @b{jarsugner} and @b{keytool}.
81 @menu
82 * jarsigner Tool::             Sign and verify .JAR files
83 * keytool Tool::               Manage private keys and public certificates
84 @end menu
86 If while using these tools you think you found a bug, then please report it at @uref{http://www.gnu.org/software/classpath/bugs.html,classpath-bugs}.
88 @comment ----------------------------------------------------------------------
90 @node jarsigner Tool, keytool Tool, Security Tools, Security Tools
91 @comment node-name, next, previous, up
92 @section The @code{jarsigner} Tool
94 @table @b
96 @item SYNOPSIS
97 @code{jarsigner [OPTION]... FILE ALIAS}@*
98 @code{jarsigner -verify [OPTION]... FILE}
100 @item DESCRIPTION
101 When the first form is used, the tool signs the designated JAR file.
103 The second form, on the other hand, is used to verify a previously signed JAR file.
105 @code{FILE} is the .JAR file to process; i.e. to sign if the first syntax form is used, or to verify if the second syntax form is used instead.
107 @code{ALIAS} must be a known @i{Alias} of a @i{Key Entry} in the designated key store. The private key material associated with this @i{Alias} is then used for signing the designated .JAR file.
109 @item SIGNING OPTIONS
110 @table @b
111 @item -keystore URL
112 Use this option to specify the location of the key store to use. The default value is a file URL referencing the file named @file{.keystore} located in the path returned by the call to @code{java.lang.System#getProperty(String)} using @code{user.home} as argument.
114 If a URL was specified, but was found to be malformed --e.g. missing protocol element-- the tool will attempt to use the URL value as a file-name (with absolute or relative path-name) of a key store --as if the protocol was @code{file:}.
116 @item -storetype STORE_TYPE
117 Use this option to specify the type of the key store to use. The default value, if this option is omitted, is that of the property @code{keystore.type} in the security properties file, which is obtained by invoking the static method call @code{getDefaultType()} in @code{java.security.KeyStore}.
119 @item -storepass PASSWORD
120 Use this option to specify the password which will be used to unlock the key store. If this option is missing, the User will be prompted to provide a password.
122 @item -keypass PASSWORD
123 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
125 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
127 @item -sigfile NAME
128 Use this option to designate a literal that will be used to construct file names for both the @code{.SF} and @code{.DSA} signature files. These files  will be generated, by the tool, and placed in the @file{META-INF} directory of the signed JAR.  Permissible characters for @code{NAME} must be in the range "a-zA-Z0-9_-".  All characters will be converted to upper-case ones.
130 If this option is missing, the first eight characters of the @code{ALIAS} argument will be used. When this is the case, any character in @code{ALIAS} that is outside the permissible range of characters will be replaced by an underscore.
132 @item -signedjar FILE_NAME
133 Use this option to specify the file name of the signed JAR. If this option is omitted, then the signed JAR will be named the same as @code{FILE}; i.e. the input JAR file will be replaced with the signed copy.
135 @end table
137 @item VERIFICATION OPTIONS
138 @table @b
139 @item -verify
140 Use this option to indicate that the tool is to be used for verification purposes.
142 @item -certs
143 This option is used in conjunction with the @code{-verbose} option. When present, along with the @code{-verbose} option, the tool will print more detailed information about the certificates of the signer(s) being processed.
145 @end table
147 @item COMMON OPTIONS
148 @table @b
149 @item -verbose
150 Use this option to force the tool to generate more verbose messages, during its processing.
152 @item -internalsf
153 When present, the tool will include --which otherwise it does not-- the @code{.SF} file in the @code{.DSA} generated file.
155 @item -sectionsonly
156 When present, the tool will include in the @code{.SF} generated file --which otherwise it does not-- a header containing a hash of the whole manifest file.  When that header is included, the tool can quickly check, during verification, if the hash (in the header) matches or not the manifest file.
158 @item -provider PROVIDER_CLASS_NAME
159 A fully qualified class name of a @i{Security Provider} to add to the current list of @i{Security Providers} already installed in the JVM in-use. If a provider class is specified with this option, and was successfully added to the runtime --i.e. it was not already installed-- then the tool will attempt to remove this @i{Security Provider} before exiting.
161 @item -help
162 Prints a help text similar to this one.
164 @end table
165 @end table
167 @comment ----------------------------------------------------------------------
169 @node keytool Tool, , jarsigner Tool, Security Tools
170 @comment node-name, next, previous, up
171 @section The @code{keytool} Tool
173 @table @b
174 @item SYNOPSIS
175 @code{keytool [COMMAND]...}
177 @item DESCRIPTION
178 A Java-based tool for managing both @i{Key Entries} as well as @i{Trusted Certificates}.
180 Multiple @code{COMMAND}s may be specified at once, each complete with its own options. @b{keytool} will parse all the arguments, before processing, and executing, each @code{COMMAND}. If an exception occurs while executing one @code{COMMAND} @b{keytool} will abort.
182 A @code{COMMAND} can be one of the followings:
184 @table @b
185 @item -genkey [OPTION]@dots{}
186 Generate a new @i{Key Entry}, eventually creating a new key store.
188 @item -import [OPTION]@dots{}
189 Add, to a key store, @i{Key Entries} (private keys and certificate chains authenticating the public keys) and @i{Trusted Certificates} (3rd party certificates which can be used as @i{Trust Anchors} when building chains-of-trust).
191 @item -selfcert [OPTION]@dots{}
192 Generate a new self-signed @i{Trusted Certificate}.
194 @item -identitydb [OPTION]@dots{}
195 @b{NOT IMPLEMENTED YET}.@*
196 Import a JDK 1.1 style Identity Database.
198 @item -certreq [OPTION]@dots{}
199 Issue a @i{Certificate Signing Request} (CSR) which can be then sent to a @i{Certification Authority} (CA) to issue a certificate signed (by the CA) and authenticating the @i{Subject} of the request.
201 @item -export [OPTION]@dots{}
202 Export a certificate from a key store.
204 @item -list [OPTION]@dots{}
205 Print one or all certificates in a key store to @code{STDOUT}.
207 @item -printcert [OPTION]@dots{}
208 Print a human-readable form of a certificate, in a designated file, to @code{STDOUT}.
210 @item -keyclone [OPTION]@dots{}
211 Clone a @i{Key Entry} in a key store.
213 @item -storepasswd [OPTION]@dots{}
214 Change the password protecting a key store.
216 @item -keypasswd [OPTION]@dots{}
217 Change the password protecting a @i{Key Entry} in a key store.
219 @item -delete [OPTION]@dots{}
220 Delete a @i{Key Entry} or a @i{Trusted Certificate} from a key store.
222 @item -help
223 Prints a help text similar to this one.
225 @end table
227 @item OPTIONS COMMON TO MORE THAN ONE COMMAND
228 The following @code{OPTION}s are used in more than one @code{COMMAND}. They are described here to reduce redundancy.
230 @table @b
231 @anchor{alias}
232 @item -alias ALIAS
233 Every entry, be it a @i{Key Entry} or a @i{Trusted Certificate}, in a key store is uniquely identified by a user-defined @i{Alias} string. Use this option to specify the @i{Alias} to use when referring to an entry in the key store. Unless specified otherwise, a default value of @code{mykey} shall be used when this option is omitted from the command line.
235 @anchor{keyalg}
236 @item -keyalg ALGORITHM
237 Use this option to specify the canonical name of the key-pair generation algorithm. The default value for this option is @code{DSS} (a synonym for the Digital Signature Algorithm also known as DSA).
239 @anchor{keysize}
240 @item -keysize SIZE
241 Use this option to specify the number of bits of the shared modulus (for both the public and private keys) to use when generating new keys. A default value of @code{1024} will be used if this option is omitted from the command line.
243 @anchor{validity}
244 @item -validity DAY_COUNT
245 Use this option to specify the number of days a newly generated certificate will be valid for. The default value is @code{90} (days) if this option is omitted from the command line.
247 @anchor{storetype}
248 @item -storetype STORE_TYPE
249 Use this option to specify the type of the key store to use. The default value, if this option is omitted, is that of the property @code{keystore.type} in the security properties file, which is obtained by invoking the static method call @code{getDefaultType()} in @code{java.security.KeyStore}.
251 @anchor{storepass}
252 @item -storepass PASSWORD
253 Use this option to specify the password protecting the key store. If this option is omitted from the command line, you will be prompted to provide a password.
255 @anchor{keystore}
256 @item -keystore URL
257 Use this option to specify the location of the key store to use. The default value is a file URL referencing the file named @file{.keystore} located in the path returned by the call to @code{java.lang.System#getProperty(String)} using @code{user.home} as argument.
259 If a URL was specified, but was found to be malformed --e.g. missing protocol element-- the tool will attempt to use the URL value as a file-name (with absolute or relative path-name) of a key store --as if the protocol was @code{file:}.
261 @anchor{provider}
262 @item -provider PROVIDER_CLASS_NAME
263 A fully qualified class name of a @i{Security Provider} to add to the current list of @i{Security Providers} already installed in the JVM in-use. If a provider class is specified with this option, and was successfully added to the runtime --i.e. it was not already installed-- then the tool will attempt to removed this @i{Security Provider} before exiting.
265 @anchor{file}
266 @item -file FILE_NAME
267 Use this option to designate a file to use with a command. When specified with this option, the value is expected to be the fully qualified path of a file accessible by the File System. Depending on the command, the file may be used as input or as output. When this option is omitted from the command line, @code{STDIN} will be used instead, as the source of input, and @code{STDOUT} will be used instead as the output destination.
269 @anchor{verbose}
270 @item -v
271 Unless specified otherwise, use this option to enable more verbose output.
273 @end table
275 @anchor{dn}
276 @item X.500 DISTINGUISHED NAME
277 A @i{Distinguished Name} (or DN) MUST be supplied with some of the @code{COMMAND}s using a @code{-dname} option. The syntax of a valid value for this option MUST follow RFC-2253 specifications. Namely the following components (with their accepted meaning) will be recognized. Note that the component name is case-insensitive:
279 @ftable @var
280 @item CN
281 The Common Name; e.g. @kbd{host.domain.com}
282 @item OU
283 The Organizational Unit; e.g. @kbd{IT Department}
284 @item O
285 The Organization Name; e.g. @kbd{The Sample Company}
286 @item L
287 The Locality Name; e.g. @kbd{Sydney}
288 @item ST
289 The State Name; e.g. @kbd{New South Wales}
290 @item C
291 The 2-letter Country identifier; e.g. @kbd{AU}
292 @end ftable
294 When specified with a @code{-dname} option, each pair of component/value will be separated from the other with a comma. Each component and value pair MUST be separated by an equal sign. For example, the following is a valid DN value:@*
296 @format
297 CN=host.domain.com, O=The Sample Company, L=Sydney, ST=NSW, C=AU
298 @end format
300 If the @i{Distinguished Name} is required, and no valid default value can be used, the tool will prompt you to enter the information through the console.
302 @item -genkey COMMAND
303 Generate a new key-pair (both private and public keys), and save these credentials in the key store as a @i{Key Entry}, associated with the designated (if was specified in the @code{-alias} option) or default (if the @code{-alias} option is omitted) @i{Alias}.
305 The private key material will be protected with a user-defined password (see @code{-keypass} option). The public key on the other hand will be part of a self-signed X.509 certificate, which will form a 1-element chain and will be saved in the key store.
307 @table @b
308 @item -alias ALIAS
309 For more details @pxref{alias,, ALIAS}.
311 @item -keyalg ALGORITHM
312 For more details @pxref{keyalg,, ALGORITHM}.
314 @item -keysize KEY_SIZE
315 For more details @pxref{keysize,, KEY_SIZE}.
317 @item -sigalg ALGORITHM
318 The canonical name of the digital signature algorithm to use for signing certificates. If this option is omitted, a default value will be chosen based on the type of the key-pair; i.e. the algorithm that ends up being used by the -keyalg option. If the key-pair generation algorithm is @code{DSA}, the value for the signature algorithm will be @code{SHA1withDSA}. If on the other hand the key-pair generation algorithm is @code{RSA}, then the tool will use @code{MD5withRSA} as the signature algorithm.
320 @item -dname NAME
321 This a mandatory value for the command. If no value is specified --i.e. the @code{-dname} option is omitted-- the tool will prompt you to enter a @i{Distinguished Name} to use as both the @i{Owner} and @i{Issuer} of the generated self-signed certificate.
323 For more details @pxref{dn,, X.500 DISTINGUISHED NAME}.
325 @item -keypass PASSWORD
326 Use this option to specify the password which the tool will use to protect the newly created @i{Key Entry}.
328 If this option is omitted, you will be prompted to provide a password.
330 @item -validity DAY_COUNT
331 For more details @pxref{validity,, DAY_COUNT}.
333 @item -storetype STORE_TYPE
334 For more details @pxref{storetype,, STORE_TYPE}.
336 @item -keystore URL
337 For more details @pxref{keystore,, URL}.
339 @item -storepass PASSWORD
340 For more details @pxref{storepass,, PASSWORD}.
342 @item -provider PROVIDER_CLASS_NAME
343 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
345 @item -v
346 For more details @pxref{verbose}.
348 @end table
350 @item -import COMMAND
351 Read an X.509 certificate, or a PKCS#7 @i{Certificate Reply} from a designated input source and incorporate the certificates into the key store.
353 If the @i{Alias} does not already exist in the key store, the tool treats the certificate read from the input source as a new @i{Trusted Certificate}. It then attempts to discover a chain-of-trust, starting from that certificate and ending at another @i{Trusted Certificate}, already stored in the key store. If the @code{-trustcacerts} option is present, an additional key store, of type @code{JKS} named @file{cacerts}, and assumed to be present in @file{$@{JAVA_HOME@}/lib/security} will also be consulted if found --@code{$@{JAVA_HOME@}} refers to the location of an installed @i{Java Runtime Environment} (JRE). If no chain-of-trust can be established, and unless the @code{-noprompt} option has been specified, the certificate is printed to @code{STDOUT} and the user is prompted for a confirmation.
355 If @i{Alias} exists in the key store, the tool will treat the certificate(s) read from the input source as a @i{Certificate Reply}, which can be a chain of certificates, that eventually would replace the chain of certificates associated with the @i{Key Entry} of that @i{Alias}. The substitution of the certificates only occurs if a chain-of-trust can be established between the bottom certificate of the chain read from the input file and the @i{Trusted Certificates} already present in the key store. Again, if the @code{-trustcacerts} option is specified, additional @i{Trusted Certificates} in the same @file{cacerts} key store will be considered. If no chain-of-trust can be established, the operation will abort.
357 @table @b
358 @item -alias ALIAS
359 For more details @pxref{alias,, ALIAS}.
361 @item -file FILE_NAME
362 For more details @pxref{file,, FILE_NAME}.
364 @item -keypass PASSWORD
365 Use this option to specify the password which the tool will use to protect the @i{Key Entry} associated with the designated @i{Alias}, when replacing this @i{Alias}' chain of certificates with that found in the certificate reply.
367 If this option is omitted, and the chain-of-trust for the certificate reply has been established, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
369 @item -noprompt
370 Use this option to prevent the tool from prompting the user.
372 @item -trustcacerts
373 Use this option to indicate to the tool that a key store, of type @code{JKS}, named @file{cacerts}, and usually located in @file{lib/security} in an installed @i{Java Runtime Environment} should be considered when trying to establish chain-of-trusts.
375 @item -storetype STORE_TYPE
376 For more details @pxref{storetype,, STORE_TYPE}.
378 @item -keystore URL
379 For more details @pxref{keystore,, URL}.
381 @item -storepass PASSWORD
382 For more details @pxref{storepass,, PASSWORD}.
384 @item -provider PROVIDER_CLASS_NAME
385 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
387 @item -v
388 For more details @pxref{verbose}.
390 @end table
392 @item -selfcert COMMAND
393 Generate a self-signed X.509 version 1 certificate. The newly generated certificate will form a chain of one element which will replace the previous chain associated with the designated @i{Alias} (if @code{-alias} option was specified), or the default @i{Alias} (if @code{-alias} option was omitted).
395 @table @b
396 @item -alias ALIAS
397 For more details @pxref{alias,, ALIAS}.
399 @item -sigalg ALGORITHM
400 The canonical name of the digital signature algorithm to use for signing the certificate. If this option is omitted, a default value will be chosen based on the type of the private key associated with the designated @i{Alias}. If the private key is a @code{DSA} one, the value for the signature algorithm will be @code{SHA1withDSA}. If on the other hand the private key is an @code{RSA} one, then the tool will use @code{MD5withRSA} as the signature algorithm.
402 @item -dname NAME
403 Use this option to specify the @i{Distinguished Name} of the newly generated self-signed certificate. If this option is omitted, the existing @i{Distinguished Name} of the base certificate in the chain associated with the designated @i{Alias} will be used instead.
405 For more details @pxref{dn,, X.500 DISTINGUISHED NAME}.
407 @item -validity DAY_COUNT
408 For more details @pxref{validity,, DAY_COUNT}.
410 @item -keypass PASSWORD
411 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
413 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
415 @item -storetype STORE_TYPE
416 For more details @pxref{storetype,, STORE_TYPE}.
418 @item -keystore URL
419 For more details @pxref{keystore,, URL}.
421 @item -storepass PASSWORD
422 For more details @pxref{storepass,, PASSWORD}.
424 @item -provider PROVIDER_CLASS_NAME
425 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
427 @item -v
428 For more details @pxref{verbose}.
430 @end table
432 @item -identitydb COMMAND
433 @b{NOT IMPLEMENTED YET}.
435 Import a JDK 1.1 style Identity Database.
437 @table @b
438 @item -file FILE_NAME
439 For more details @pxref{file,, FILE_NAME}.
441 @item -storetype STORE_TYPE
442 For more details @pxref{storetype,, STORE_TYPE}.
444 @item -keystore URL
445 For more details @pxref{keystore,, URL}.
447 @item -storepass PASSWORD
448 For more details @pxref{storepass,, PASSWORD}.
450 @item -provider PROVIDER_CLASS_NAME
451 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
453 @item -v
454 For more details @pxref{verbose}.
456 @end table
458 @item -certreq COMMAND
459 Generate a PKCS#10 @i{Certificate Signing Request} (CSR) and writes it to a designated output destination. The contents of the destination should look something like the following:
461 @example
462 -----BEGIN NEW CERTIFICATE REQUEST-----
463 MI...QAwXzEUMBIGA1UEAwwLcnNuQGdudS5vcmcxGzAZBgNVBAoMElUg
464 Q2...A0GA1UEBwwGU3lkbmV5MQwwCgYDVQQIDANOU1cxCzAJBgNVBACC
466 FC...IVwNVOfQLRX+O5kAhQ/a4RTZme2L8PnpvgRwrf7Eg8D6w==
467 -----END NEW CERTIFICATE REQUEST-----
468 @end example
470 @b{IMPORTANT}: Some documentation (e.g. RSA examples) claims that the @code{Attributes} field, in the CSR is @code{OPTIONAL} while RFC-2986 implies the opposite. This implementation considers this field, by default, as @code{OPTIONAL}, unless the option @code{-attributes} is specified on the command line.
472 @table @b
473 @item -alias ALIAS
474 For more details @pxref{alias,, ALIAS}.
476 @item -sigalg ALGORITHM
477 The canonical name of the digital signature algorithm to use for signing the certificate. If this option is omitted, a default value will be chosen based on the type of the private key associated with the designated @i{Alias}. If the private key is a @code{DSA} one, the value for the signature algorithm will be @code{SHA1withDSA}. If on the other hand the private key is an @code{RSA} one, then the tool will use @code{MD5withRSA} as the signature algorithm.
479 @item -file FILE_NAME
480 For more details @pxref{file,, FILE_NAME}.
482 @item -keypass PASSWORD
483 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
485 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
487 @item -storetype STORE_TYPE
488 For more details @pxref{storetype,, STORE_TYPE}.
490 @item -keystore URL
491 For more details @pxref{keystore,, URL}.
493 @item -storepass PASSWORD
494 For more details @pxref{storepass,, PASSWORD}.
496 @item -provider PROVIDER_CLASS_NAME
497 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
499 @item -v
500 For more details @pxref{verbose}.
502 @item -attributes
503 Use this option to force the tool to encode a @code{NULL} DER value in the CSR as the value of the @code{Attributes} field.
505 @end table
507 @item -export COMMAND
508 Export a certificate stored in the key store to a designated output destination, either in binary format (if the @code{-v} option is specified), or in RFC-1421 compliant encoding (if the @code{-rfc} option is specified
509 instead).
511 @table @b
512 @item -alias ALIAS
513 For more details @pxref{alias,, ALIAS}.
515 @item -file FILE_NAME
516 For more details @pxref{file,, FILE_NAME}.
518 @item -storetype STORE_TYPE
519 For more details @pxref{storetype,, STORE_TYPE}.
521 @item -keystore URL
522 For more details @pxref{keystore,, URL}.
524 @item -storepass PASSWORD
525 For more details @pxref{storepass,, PASSWORD}.
527 @item -provider PROVIDER_CLASS_NAME
528 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
530 @item -rfc
531 Use RFC-1421 specifications when encoding the output.
533 @item -v
534 Output the certificate in binary DER encoding. This is the default output format of the command if neither @code{-rfc} nor @code{-v} options were detected on the command line. If both this option and the @code{-rfc} option are detected on the command line, the tool will opt for the RFC-1421 style encoding.
536 @end table
538 @item -list COMMAND
539 Print one or all of the key store entries to @code{STDOUT}. Usually this command will only print a @i{fingerprint} of the certificate, unless either the @code{-rfc} or the @code{-v} option is specified.
541 @table @b
542 @item -alias ALIAS
543 If this option is omitted, the tool will print ALL the entries found in the key store.
545 For more details @pxref{alias,, ALIAS}.
547 @item -storetype STORE_TYPE
548 For more details @pxref{storetype,, STORE_TYPE}.
550 @item -keystore URL
551 For more details @pxref{keystore,, URL}.
553 @item -storepass PASSWORD
554 For more details @pxref{storepass,, PASSWORD}.
556 @item -provider PROVIDER_CLASS_NAME
557 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
559 @item -rfc
560 Use RFC-1421 specifications when encoding the output.
562 @item -v
563 Output the certificate in human-readable format. If both this option and the @code{-rfc} option are detected on the command line, the tool will opt for the human-readable form and will not abort the command.
565 @end table
567 @item -printcert COMMAND
568 Read a certificate from a designated input source and print it to @code{STDOUT} in a human-readable form.
570 @table @b
571 @item -file FILE_NAME
572 For more details @pxref{file,, FILE_NAME}.
574 @item -v
575 For more details @pxref{verbose}.
577 @end table
579 @item -keyclone COMMAND
580 Clone an existing @i{Key Entry} and store it under a new (different) @i{Alias} protecting, its private key material with possibly a new password.
582 @table @b
583 @item -alias ALIAS
584 For more details @pxref{alias,, ALIAS}.
586 @item -dest ALIAS
587 Use this option to specify the new @i{Alias} which will be used to identify the cloned copy of the @i{Key Entry}.
589 @item -keypass PASSWORD
590 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
592 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
594 @item -new PASSWORD
595 Use this option to specify the password protecting the private key material of the newly cloned copy of the @i{Key Entry}.
597 @item -storetype STORE_TYPE
598 For more details @pxref{storetype,, STORE_TYPE}.
600 @item -keystore URL
601 For more details @pxref{keystore,, URL}.
603 @item -storepass PASSWORD
604 For more details @pxref{storepass,, PASSWORD}.
606 @item -provider PROVIDER_CLASS_NAME
607 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
609 @item -v
610 For more details @pxref{verbose}.
612 @end table
614 @item -storepasswd COMMAND
615 Change the password protecting a key store.
617 @table @b
618 @item -new PASSWORD
619 The new, and different, password which will be used to protect the designated key store.
621 @item -storetype STORE_TYPE
622 For more details @pxref{storetype,, STORE_TYPE}.
624 @item -keystore URL
625 For more details @pxref{keystore,, URL}.
627 @item -storepass PASSWORD
628 For more details @pxref{storepass,, PASSWORD}.
630 @item -provider PROVIDER_CLASS_NAME
631 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
633 @item -v
634 For more details @pxref{verbose}.
636 @end table
638 @item -keypasswd COMMAND
639 Change the password protecting the private key material of a designated @i{Key Entry}.
641 @table @b
642 @item -alias ALIAS
643 For more details @pxref{alias,, ALIAS}.
645 @item -keypass PASSWORD
646 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
648 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
650 @item -new PASSWORD
651 The new, and different, password which will be used to protect the private key material of the designated @i{Key Entry}.
653 @item -storetype STORE_TYPE
654 For more details @pxref{storetype,, STORE_TYPE}.
656 @item -keystore URL
657 For more details @pxref{keystore,, URL}.
659 @item -storepass PASSWORD
660 For more details @pxref{storepass,, PASSWORD}.
662 @item -provider PROVIDER_CLASS_NAME
663 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
665 @item -v
666 For more details @pxref{verbose}.
668 @end table
670 @item -delete COMMAND
671 Delete a designated key store entry.
673 @table @b
674 @item -alias ALIAS
675 For more details @pxref{alias,, ALIAS}.
677 @item -storetype STORE_TYPE
678 For more details @pxref{storetype,, STORE_TYPE}.
680 @item -keystore URL
681 For more details @pxref{keystore,, URL}.
683 @item -storepass PASSWORD
684 For more details @pxref{storepass,, PASSWORD}.
686 @item -provider PROVIDER_CLASS_NAME
687 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
689 @item -v
690 For more details @pxref{verbose}.
692 @end table
693 @end table
695 @comment ----------------------------------------------------------------------
697 @node I18N Issues, , Security Tools, Top
698 @comment node-name, next, previous, up
699 @chapter I18N Issues
701 Some tools --@pxref{Security Tools}-- allow using other than the English language when prompting the User for input, and outputing messages. This chapter describes the elements used to offer this support and how they can be adapted for use with specific languages.
703 @menu
704 * Language Resources::         Where resources are located
705 * Message Formats::            How messages are internationalized
706 @end menu
708 @comment ----------------------------------------------------------------------
710 @node Language Resources, Message Formats, I18N Issues, I18N Issues
711 @comment node-name, next, previous, up
712 @section Language-Specific Resources
714 The Tools use Java @code{ResourceBundle}s to store messages, and message templates they use at runtime to generate the message text itself, depending on the locale in use at the time.
716 The @i{Resource Bundles} these tools use are essentially Java @i{Properties} files consisting of a set of @i{Name/Value} pairs. The @i{Name} is the @i{Propery Name} and the @i{Value} is a substitution string that is used when the code references the associated @i{Name}. For example the following is a line in a @i{Resource Bundle} used by the @code{keytool} Tool:
718 @example
719 Command.23=A correct key password MUST be provided
720 @end example
722 When the tool needs to signal a mandatory but missing key password, it would reference the property named @code{Command.23} and the message "@kbd{A correct key password MUST be provided}" will be used instead. This indirect referencing of "resources" permits replacing, as late as possible, the English strings with strings in other languages, provided of course @i{Resource Bundles} in those languages are provided.
724 For the GNU Classpath Tools described in this Guide, the @i{Resource Bundles} are files named @file{MessageBundle[_ll[_CC[_VV]]].properties} where:
726 @ftable @var
727 @item ll
728 Is the 2-letter code for the Language,
729 @item CC
730 Is the 2-letter code for the Region, and
731 @item VV
732 Is the 2-letter code for the Variant of the language.
733 @end ftable
735 The complete list of language codes can be found at @uref{http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt, Code for the representation of names of languages}. A similar list for the region codes can be found at @uref{http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html, ISO 3166 Codes (Countries)}.
737 The location of the @i{Resource Bundles} for the GNU Classpath Tools is specific to each tool. The next table shows where these files are found in a standard GNU Classpath distribution:
739 @ftable @code
740 @item jarsigner
741 @file{gnu/classpath/tools/jarsigner}
742 @item keytool
743 @file{gnu/classpath/tools/keytool}
744 @end ftable
746 The collection of @i{Resource Bundles} in a location act as an inverted tree with a parent-child relationship. For example suppose in the @file{gnu/classpath/tools/keytool} there are 3 message bundles named:
748 @enumerate
749 @item @code{MessageBundle.properties}
750 @item @code{MessageBundle_fr.properties}
751 @item @code{MessageBundle_fr_FR.properties}
752 @end enumerate
754 In the above example, bundle #1 will act as the parent of bundle #2, which in turn will act as the parent for bundle #3. This ordering is used by the Java runtime to choose which file to load based on the set Locale. For example if the Locale is @code{fr_CH}, @code{MessageBundle_fr.properties} will be used because (a) @code{MessageBundle_fr_CH.properties} does not exist, but (b) @code{MessageBundle_fr.properties} is the parent for the required bundle, and it exists. As another example, suppose the Locale was set to @code{en_AU}; then the tool will end up using @code{MessageBundle.properties} because (a) @code{MessageBundle_en_AU.properties} does not exist, (b) @code{MessageBundle_en.properties} which is the parent for the required bundle does not exist, but (c) @code{MessageBundle.properties} exists and is the root of the hierarchy.
756 You can see from the examples above that @file{MessageBundle.properties} is the safety net that the Java runtime falls back to when failing to find a specific bunlde and its parent(s). This file is always provided with the Tool. In time, more localized versions will be included to cater for other languages.
758 In the meantime, if you are willing to contribute localized versions of these resources, grab the @file{MessageBundle.properties} for a specific tool; translate it; save it with the appropriate language and region suffix and mail it to @code{classpath@@gnu.org}.
760 @comment ----------------------------------------------------------------------
762 @node Message Formats, , Language Resources, I18N Issues
763 @comment node-name, next, previous, up
764 @section Message Formats
766 If you open any of the @file{MessageBundle.properties} described in the previous section, you may see properties that look like so:
768 @example
769 Command.67=Issuer: @{0@}
770 Command.68=Serial number: @{0,number@}
771 Command.69=Valid from: @{0,date,full@} - @{0,time,full@}
772 Command.70=\ \ \ \ \ until: @{0,date,full@} - @{0,time,full@}
773 @end example
775 These are @i{Message Formats} used by the tools to customize a text string that will then be used either as a prompt for User input or as output.
777 If you are translating a @file{MessageBundle.properties} be careful not to alter text between curly braces.
779 @comment ----------------------------------------------------------------------
781 @bye