1 @c Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
2 @c 2006 Free Software Foundation, Inc.
3 @c This is part of the GnuPG manual.
4 @c For copying conditions, see the file gnupg.texi.
8 @cindex GPG command options
9 @cindex command options
10 @cindex options, GPG command
12 @c Begin GnuPG 1.x specific stuff
20 \- OpenPGP encryption and signing tool
35 @c End GnuPG 1.x specific stuff
37 @c Begin GnuPG 2 specific stuff
45 \- OpenPGP encryption and signing tool
60 @c Begin GnuPG 2 specific stuff
63 @command{@gpgname} is the OpenPGP part of the GNU Privacy Guard (GnuPG). It
64 is a tool to provide digital encryption and signing services using the
65 OpenPGP standard. @command{@gpgname} features complete key management and
66 all bells and whistles you can expect from a decent OpenPGP
70 This is the standalone version of @command{gpg}. For desktop use you
71 should consider using @command{gpg2}.
75 In contrast to the standalone version @command{gpg}, which is more
76 suited for server and embedded platforms, this version is installed
77 under the name @command{gpg2} and more targeted to the desktop as it
78 requires several other modules to be installed. The standalone version
79 will be kept maintained and it is possible to install both versions on
80 the same system. If you need to use different configuration files, you
81 should make use of something like @file{gpg.conf-2} instead of just
87 Documentation for the old standard @command{gpg} is available as a man
88 page and at @inforef{Top,GnuPG 1,gpg}.
91 @xref{Option Index}, for an index to @command{@gpgname}'s commands and options.
95 * GPG Commands:: List of all commands.
96 * GPG Options:: List of all options.
97 * GPG Configuration:: Configuration files.
98 * GPG Examples:: Some usage examples.
100 Developer information:
101 @c * Unattended Usage:: Using @command{gpg} from other programs.
102 @c * GPG Protocol:: The protocol the server mode uses.
107 @c *******************************************
108 @c *************** ****************
109 @c *************** COMMANDS ****************
110 @c *************** ****************
111 @c *******************************************
116 Commands are not distinguished from options execpt for the fact that
117 only one command is allowed.
119 @command{@gpgname} may be run with no commands, in which case it will
120 perform a reasonable action depending on the type of file it is given
121 as input (an encrypted message is decrypted, a signature is verified,
122 a file containing keys is listed).
124 Please remember that option as well as command parsing stops as soon as
125 a non-option is encountered, you can explicitly stop parsing by
126 using the special option @option{--}.
130 * General GPG Commands:: Commands not specific to the functionality.
131 * Operational GPG Commands:: Commands to select the type of operation.
132 * OpenPGP Key Management:: How to manage your keys.
136 @c *******************************************
137 @c ********** GENERAL COMMANDS *************
138 @c *******************************************
139 @node General GPG Commands
140 @subsection Commands not specific to the function
145 Print the program version and licensing information. Note that you
146 cannot abbreviate this command.
151 Print a usage message summarizing the most useful command line options.
152 Not that you cannot abbreviate this command.
156 Print warranty information.
159 @opindex dump-options
160 Print a list of all available options and commands. Note that you cannot
161 abbreviate this command.
165 @c *******************************************
166 @c ******** OPERATIONAL COMMANDS ***********
167 @c *******************************************
168 @node Operational GPG Commands
169 @subsection Commands to select the type of operation
177 Make a signature. This command may be combined with @option{--encrypt}
178 (for a signed and encrypted message), @option{--symmetric} (for a signed
179 and symmetrically encrypted message), or @option{--encrypt} and
180 @option{--symmetric} together (for a signed message that may be
181 decrypted via a secret key or a passphrase).
185 Make a clear text signature. The content in a clear text signature is
186 readable without any special software. OpenPGP software is only
187 needed to verify the signature. Clear text signatures may modify
188 end-of-line whitespace for platform independence and are not intended
194 Make a detached signature.
199 Encrypt data. This option may be combined with @option{--sign} (for a
200 signed and encrypted message), @option{--symmetric} (for a message that
201 may be decrypted via a secret key or a passphrase), or @option{--sign}
202 and @option{--symmetric} together (for a signed message that may be
203 decrypted via a secret key or a passphrase).
208 Encrypt with a symmetric cipher using a passphrase. The default
209 symmetric cipher used is CAST5, but may be chosen with the
210 @option{--cipher-algo} option. This option may be combined with
211 @option{--sign} (for a signed and symmetrically encrypted message),
212 @option{--encrypt} (for a message that may be decrypted via a secret key
213 or a passphrase), or @option{--sign} and @option{--encrypt} together
214 (for a signed message that may be decrypted via a secret key or a
219 Store only (make a simple RFC1991 literal data packet).
224 Decrypt the file given on the command line (or @code{stdin} if no file
225 is specified) and write it to stdout (or the file specified with
226 @option{--output}). If the decrypted file is signed, the signature is also
227 verified. This command differs from the default operation, as it never
228 writes to the filename which is included in the file and it rejects
229 files which don't begin with an encrypted message.
233 Assume that the first argument is a signed file or a detached signature
234 and verify it without generating any output. With no arguments, the
235 signature packet is read from stdin. If only a sigfile is given, it may
236 be a complete signature or a detached signature, in which case the
237 signed stuff is expected in a file without the ".sig" or ".asc"
238 extension. With more than 1 argument, the first should be a detached
239 signature and the remaining files are the signed stuff. To read the
240 signed stuff from stdin, use @samp{-} as the second filename. For
241 security reasons a detached signature cannot read the signed material
242 from stdin without denoting it in the above way.
246 This modifies certain other commands to accept multiple files for
247 processing on the command line or read from stdin with each filename on
248 a separate line. This allows for many files to be processed at
249 once. @option{--multifile} may currently be used along with
250 @option{--verify}, @option{--encrypt}, and @option{--decrypt}. Note that
251 @option{--multifile --verify} may not be used with detached signatures.
254 @opindex verify-files
255 Identical to @option{--multifile --verify}.
257 @item --encrypt-files
258 @opindex encrypt-files
259 Identical to @option{--multifile --encrypt}.
261 @item --decrypt-files
262 @opindex decrypt-files
263 Identical to @option{--multifile --decrypt}.
267 @itemx --list-public-keys
269 List all keys from the public keyrings, or just the keys given on the
272 @option{-k} is slightly different from @option{--list-keys} in that it
273 allows only for one argument and takes the second argument as the
274 keyring to search. This is for command line compatibility with PGP 2
275 and has been removed in @command{gpg2}.
278 Avoid using the output of this command in scripts or other programs as
279 it is likely to change as GnuPG changes. See @option{--with-colons} for a
280 machine-parseable key listing command that is appropriate for use in
281 scripts and other programs.
283 @item --list-secret-keys
285 @opindex list-secret-keys
286 List all keys from the secret keyrings, or just the ones given on the
287 command line. A @code{#} after the letters @code{sec} means that the
288 secret key is not usable (for example, if it was created via
289 @option{--export-secret-subkeys}).
293 Same as @option{--list-keys}, but the signatures are listed too.
295 For each signature listed, there are several flags in between the "sig"
296 tag and keyid. These flags give additional information about each
297 signature. From left to right, they are the numbers 1-3 for certificate
298 check level (see @option{--ask-cert-level}), "L" for a local or
299 non-exportable signature (see @option{--lsign-key}), "R" for a
300 nonRevocable signature (see the @option{--edit-key} command "nrsign"),
301 "P" for a signature that contains a policy URL (see
302 @option{--cert-policy-url}), "N" for a signature that contains a
303 notation (see @option{--cert-notation}), "X" for an eXpired signature
304 (see @option{--ask-cert-expire}), and the numbers 1-9 or "T" for 10 and
305 above to indicate trust signature levels (see the @option{--edit-key}
310 Same as @option{--list-sigs}, but the signatures are verified.
314 List all keys (or the specified ones) along with their
315 fingerprints. This is the same output as @option{--list-keys} but with
316 the additional output of a line with the fingerprint. May also be
317 combined with @option{--list-sigs} or @option{--check-sigs}. If this
318 command is given twice, the fingerprints of all secondary keys are
322 @opindex list-packets
323 List only the sequence of packets. This is mainly
324 useful for debugging.
329 Present a menu to work with a smartcard. The subcommand "help" provides
330 an overview on available commands. For a detailed description, please
331 see the Card HOWTO at
332 http://www.gnupg.org/documentation/howtos.html#GnuPG-cardHOWTO .
336 Show the content of the smart card.
340 Present a menu to allow changing the PIN of a smartcard. This
341 functionality is also available as the subcommand "passwd" with the
342 @option{--card-edit} command.
344 @item --delete-key @code{name}
346 Remove key from the public keyring. In batch mode either @option{--yes} is
347 required or the key must be specified by fingerprint. This is a
348 safeguard against accidental deletion of multiple keys.
350 @item --delete-secret-key @code{name}
351 @opindex delete-secret-key
352 Remove key from the secret and public keyring. In batch mode the key
353 must be specified by fingerprint.
355 @item --delete-secret-and-public-key @code{name}
356 @opindex delete-secret-and-public-key
357 Same as @option{--delete-key}, but if a secret key exists, it will be
358 removed first. In batch mode the key must be specified by fingerprint.
362 Either export all keys from all keyrings (default keyrings and those
363 registered via option @option{--keyring}), or if at least one name is given,
364 those of the given name. The new keyring is written to stdout or to the
365 file given with option @option{--output}. Use together with
366 @option{--armor} to mail those keys.
368 @item --send-keys @code{key IDs}
370 Similar to @option{--export} but sends the keys to a keyserver.
371 Fingerprints may be used instead of key IDs. Option @option{--keyserver}
372 must be used to give the name of this keyserver. Don't send your
373 complete keyring to a keyserver --- select only those keys which are new
376 @item --export-secret-keys
377 @itemx --export-secret-subkeys
378 @opindex export-secret-keys
379 @opindex export-secret-subkeys
380 Same as @option{--export}, but exports the secret keys instead. This is
381 normally not very useful and a security risk. The second form of the
382 command has the special property to render the secret part of the
383 primary key useless; this is a GNU extension to OpenPGP and other
384 implementations can not be expected to successfully import such a key.
385 See the option @option{--simple-sk-checksum} if you want to import such
386 an exported key with an older OpenPGP implementation.
391 Import/merge keys. This adds the given keys to the
392 keyring. The fast version is currently just a synonym.
394 There are a few other options which control how this command works.
395 Most notable here is the @option{--keyserver-options merge-only} option
396 which does not insert new keys but does only the merging of new
397 signatures, user-IDs and subkeys.
399 @item --recv-keys @code{key IDs}
401 Import the keys with the given key IDs from a keyserver. Option
402 @option{--keyserver} must be used to give the name of this keyserver.
405 @opindex refresh-keys
406 Request updates from a keyserver for keys that already exist on the
407 local keyring. This is useful for updating a key with the latest
408 signatures, user IDs, etc. Calling this with no arguments will refresh
409 the entire keyring. Option @option{--keyserver} must be used to give the
410 name of the keyserver for all keys that do not have preferred keyservers
411 set (see @option{--keyserver-options honor-keyserver-url}).
413 @item --search-keys @code{names}
415 Search the keyserver for the given names. Multiple names given here will
416 be joined together to create the search string for the keyserver.
417 Option @option{--keyserver} must be used to give the name of this
418 keyserver. Keyservers that support different search methods allow using
419 the syntax specified in "How to specify a user ID" below. Note that
420 different keyserver types support different search methods. Currently
421 only LDAP supports them all.
423 @item --fetch-keys @code{URIs}
425 Retrieve keys located at the specified URIs. Note that different
426 installations of GnuPG may support different protocols (HTTP, FTP,
429 @item --update-trustdb
430 @opindex update-trustdb
431 Do trust database maintenance. This command iterates over all keys and
432 builds the Web of Trust. This is an interactive command because it may
433 have to ask for the "ownertrust" values for keys. The user has to give
434 an estimation of how far she trusts the owner of the displayed key to
435 correctly certify (sign) other keys. GnuPG only asks for the ownertrust
436 value if it has not yet been assigned to a key. Using the
437 @option{--edit-key} menu, the assigned value can be changed at any time.
439 @item --check-trustdb
440 @opindex check-trustdb
441 Do trust database maintenance without user interaction. From time to
442 time the trust database must be updated so that expired keys or
443 signatures and the resulting changes in the Web of Trust can be
444 tracked. Normally, GnuPG will calculate when this is required and do it
445 automatically unless @option{--no-auto-check-trustdb} is set. This
446 command can be used to force a trust database check at any time. The
447 processing is identical to that of @option{--update-trustdb} but it
448 skips keys with a not yet defined "ownertrust".
450 For use with cron jobs, this command can be used together with
451 @option{--batch} in which case the trust database check is done only if
452 a check is needed. To force a run even in batch mode add the option
455 @item --export-ownertrust
456 @opindex export-ownertrust
457 Send the ownertrust values to stdout. This is useful for backup purposes
458 as these values are the only ones which can't be re-created from a
461 @item --import-ownertrust
462 @opindex import-ownertrust
463 Update the trustdb with the ownertrust values stored in @code{files} (or
464 stdin if not given); existing values will be overwritten.
466 @item --rebuild-keydb-caches
467 @opindex rebuild-keydb-caches
468 When updating from version 1.0.6 to 1.0.7 this command should be used
469 to create signature caches in the keyring. It might be handy in other
472 @item --print-md @code{algo}
475 Print message digest of algorithm ALGO for all given files or stdin.
476 With the second form (or a deprecated "*" as algo) digests for all
477 available algorithms are printed.
479 @item --gen-random @code{0|1|2}
481 Emit @var{count} random bytes of the given quality level. If count is
482 not given or zero, an endless sequence of random bytes will be emitted.
483 PLEASE, don't use this command unless you know what you are doing; it
484 may remove precious entropy from the system!
486 @item --gen-prime @code{mode} @code{bits}
488 Use the source, Luke :-). The output format is still subject to change.
495 Pack or unpack an arbitrary input into/from an OpenPGP ASCII armor.
496 This is a GnuPG extension to OpenPGP and in general not very useful.
501 @c *******************************************
502 @c ******* KEY MANGEMENT COMMANDS **********
503 @c *******************************************
504 @node OpenPGP Key Management
505 @subsection How to manage your keys
507 This section explains the main commands for key management
513 Generate a new key pair. This command is normally only used
516 There is an experimental feature which allows you to create keys in
517 batch mode. See the file @file{doc/DETAILS} in the source distribution
520 @item --gen-revoke @code{name}
522 Generate a revocation certificate for the complete key. To revoke
523 a subkey or a signature, use the @option{--edit} command.
525 @item --desig-revoke @code{name}
526 @opindex desig-revoke
527 Generate a designated revocation certificate for a key. This allows a
528 user (with the permission of the keyholder) to revoke someone else's
534 Present a menu which enables you to do most of the key management
535 related tasks. It expects the specification of a key on the command
538 @c ******** Begin Edit-key Options **********
542 @opindex keyedit:sign
543 Make a signature on key of user @code{name} If the key is not yet
544 signed by the default user (or the users given with -u), the program
545 displays the information of the key again, together with its
546 fingerprint and asks whether it should be signed. This question is
547 repeated for all users specified with
551 @opindex keyedit:lsign
552 Same as "sign" but the signature is marked as non-exportable and will
553 therefore never be used by others. This may be used to make keys
554 valid only in the local environment.
557 @opindex keyedit:nrsign
558 Same as "sign" but the signature is marked as non-revocable and can
559 therefore never be revoked.
562 @opindex keyedit:tsign
563 Make a trust signature. This is a signature that combines the notions
564 of certification (like a regular signature), and trust (like the
565 "trust" command). It is generally only useful in distinct communities
570 Note that "l" (for local / non-exportable), "nr" (for non-revocable,
571 and "t" (for trust) may be freely mixed and prefixed to "sign" to
572 create a signature of any type desired.
578 @opindex keyedit:revsig
579 Revoke a signature. For every signature which has been generated by
580 one of the secret keys, GnuPG asks whether a revocation certificate
584 @opindex keyedit:trust
585 Change the owner trust value. This updates the
586 trust-db immediately and no save is required.
590 @opindex keyedit:disable
591 @opindex keyedit:enable
592 Disable or enable an entire key. A disabled key can not normally be
596 @opindex keyedit:adduid
597 Create an alternate user id.
600 @opindex keyedit:addphoto
601 Create a photographic user id. This will prompt for a JPEG file that
602 will be embedded into the user ID. Note that a very large JPEG will make
603 for a very large key. Also note that some programs will display your
604 JPEG unchanged (GnuPG), and some programs will scale it to fit in a
608 @opindex keyedit:deluid
609 Delete a user id. Note that it is not possible to retract a user id,
610 once it has been send to the public (i.e. to a keyserver). In that case
611 you better use @code{revuid}.
614 @opindex keyedit:delsig
615 Delete a signature. Note that it is not possible to retract a signature,
616 once it has been send to the public (i.e. to a keyserver). In that case
617 you better use @code{revsig}.
620 @opindex keyedit:revuid
624 @opindex keyedit:addkey
625 Add a subkey to this key.
628 @opindex keyedit:addcardkey
629 Generate a key on a card and add it to this key.
632 @opindex keyedit:keytocard
633 Transfer the selected secret key (or the primary key if no key has been
634 selected) to a smartcard. The secret key in the keyring will be replaced
635 by a stub if the key could be stored successfully on the card and you
636 use the save command later. Only certain key types may be transferred to
637 the card. A sub menu allows you to select on what card to store the
638 key. Note that it is not possible to get that key back from the card -
639 if the card gets broken your secret key will be lost unless you have a
642 @item bkuptocard @code{file}
643 @opindex keyedit:bkuptocard
644 Restore the given file to a card. This command may be used to restore a
645 backup key (as generated during card initialization) to a new card. In
646 almost all cases this will be the encryption key. You should use this
647 command only with the corresponding public key and make sure that the
648 file given as argument is indeed the backup to restore. You should then
649 select 2 to restore as encryption key. You will first be asked to enter
650 the passphrase of the backup key and then for the Admin PIN of the card.
653 @opindex keyedit:delkey
654 Remove a subkey (secondart key). Note that it is not possible to retract
655 a subkey, once it has been send to the public (i.e. to a keyserver). In
656 that case you better use @code{revkey}.
659 @opindex keyedit:addrevoker
660 Add a designated revoker. This takes one optional argument:
661 "sensitive". If a designated revoker is marked as sensitive, it will not
662 be exported by default (see export-options).
665 @opindex keyedit:revkey
669 @opindex keyedit:expire
670 Change the key expiration time. If a subkey is selected, the
671 expiration time of this subkey will be changed. With no selection,
672 the key expiration of the primary key is changed.
675 @opindex keyedit:passwd
676 Change the passphrase of the secret key.
679 @opindex keyedit:primary
680 Flag the current user id as the primary one, removes the primary user
681 id flag from all other user ids and sets the timestamp of all affected
682 self-signatures one second ahead. Note that setting a photo user ID
683 as primary makes it primary over other photo user IDs, and setting a
684 regular user ID as primary makes it primary over other regular user
689 Toggle selection of user id with index @code{n}.
690 Use 0 to deselect all.
694 Toggle selection of subkey with index @code{n}.
695 Use 0 to deselect all.
698 @opindex keyedit:check
699 Check all selected user ids.
702 @opindex keyedit:showphoto
703 Display the selected photographic user
707 @opindex keyedit:pref
708 List preferences from the selected user ID. This shows the actual
709 preferences, without including any implied preferences.
712 @opindex keyedit:showpref
713 More verbose preferences listing for the selected user ID. This shows
714 the preferences in effect by including the implied preferences of 3DES
715 (cipher), SHA-1 (digest), and Uncompressed (compression) if they are
716 not already included in the preference list. In addition, the
717 preferred keyserver and signature notations (if any) are shown.
719 @item setpref @code{string}
720 @opindex keyedit:setpref
721 Set the list of user ID preferences to @code{string} for all (or just
722 the selected) user IDs. Calling setpref with no arguments sets the
723 preference list to the default (either built-in or set via
724 @option{--default-preference-list}), and calling setpref with "none" as
725 the argument sets an empty preference list. Use @command{@gpgname
726 --version} to get a list of available algorithms. Note that while you
727 can change the preferences on an attribute user ID (aka "photo ID"),
728 GnuPG does not select keys via attribute user IDs so these preferences
729 will not be used by GnuPG.
732 @opindex keyedit:keyserver
733 Set a preferred keyserver for the specified user ID(s). This allows
734 other users to know where you prefer they get your key from. See
735 @option{--keyserver-options honor-keyserver-url} for more on how this
736 works. Setting a value of "none" removes an existing preferred
740 @opindex keyedit:notation
741 Set a name=value notation for the specified user ID(s). See
742 @option{--cert-notation} for more on how this works. Setting a value of
743 "none" removes all notations, setting a notation prefixed with a minus
744 sign (-) removes that notation, and setting a notation name (without the
745 =value) prefixed with a minus sign removes all notations with that name.
748 @opindex keyedit:toggle
749 Toggle between public and secret key listing.
752 @opindex keyedit:clean
753 Compact (by removing all signatures except the selfsig) any user ID
754 that is no longer usable (e.g. revoked, or expired). Then, remove any
755 signatures that are not usable by the trust calculations.
756 Specifically, this removes any signature that does not validate, any
757 signature that is superseded by a later signature, revoked signatures,
758 and signatures issued by keys that are not present on the keyring.
761 @opindex keyedit:minimize
762 Make the key as small as possible. This removes all signatures from
763 each user ID except for the most recent self-signature.
766 @opindex keyedit:cross-certify
767 Add cross-certification signatures to signing subkeys that may not
768 currently have them. Cross-certification signatures protect against a
769 subtle attack against signing subkeys. See
770 @option{--require-cross-certification}.
773 @opindex keyedit:save
774 Save all changes to the key rings and quit.
777 @opindex keyedit:quit
778 Quit the program without updating the
784 The listing shows you the key with its secondary keys and all user
785 ids. Selected keys or user ids are indicated by an asterisk. The trust
786 value is displayed with the primary key: the first is the assigned owner
787 trust and the second is the calculated trust value. Letters are used for
794 No ownertrust assigned / not yet calculated.
798 calculation has failed; probably due to an expired key.
801 Not enough information for calculation.
804 Never trust this key.
815 @c ******** End Edit-key Options **********
817 @item --sign-key @code{name}
819 Signs a public key with your secret key. This is a shortcut version of
820 the subcommand "sign" from @option{--edit}.
822 @item --lsign-key @code{name}
824 Signs a public key with your secret key but marks it as
825 non-exportable. This is a shortcut version of the subcommand "lsign"
826 from @option{--edit-key}.
832 @c *******************************************
833 @c *************** ****************
834 @c *************** OPTIONS ****************
835 @c *************** ****************
836 @c *******************************************
839 @section Option Summary
841 @command{@gpgname} comes features a bunch of options to control the exact
842 behaviour and to change the default configuration.
845 * GPG Configuration Options:: How to change the configuration.
846 * GPG Key related Options:: Key related options.
847 * GPG Input and Output:: Input and Output.
848 * OpenPGP Options:: OpenPGP protocol specific options.
849 * GPG Esoteric Options:: Doing things one usually don't want to do.
852 Long options can be put in an options file (default
853 "~/.gnupg/gpg.conf"). Short option names will not work - for example,
854 "armor" is a valid option for the options file, while "a" is not. Do not
855 write the 2 dashes, but simply the name of the option and any required
856 arguments. Lines with a hash ('#') as the first non-white-space
857 character are ignored. Commands may be put in this file too, but that is
858 not generally useful as the command will execute automatically with
859 every execution of gpg.
861 Please remember that option parsing stops as soon as a non-option is
862 encountered, you can explicitly stop parsing by using the special option
865 @c *******************************************
866 @c ******** CONFIGURATION OPTIONS **********
867 @c *******************************************
868 @node GPG Configuration Options
869 @subsection How to change the configuration
871 These options are used to change the configuraton and are usually found
876 @item --default-key @var{name}
878 Use @var{name} as the default key to sign with. If this option is not
879 used, the default key is the first key found in the secret keyring.
880 Note that @option{-u} or @option{--local-user} overrides this option.
882 @item --default-recipient @var{name}
883 @opindex default-recipient
884 Use @var{name} as default recipient if option @option{--recipient} is
885 not used and don't ask if this is a valid one. @var{name} must be
888 @item --default-recipient-self
889 @opindex default-recipient-self
890 Use the default key as default recipient if option @option{--recipient} is not
891 used and don't ask if this is a valid one. The default key is the first
892 one from the secret keyring or the one set with @option{--default-key}.
894 @item --no-default-recipient
895 @opindex no-default-recipient
896 Reset @option{--default-recipient} and @option{--default-recipient-self}.
900 Give more information during processing. If used
901 twice, the input data is listed in detail.
905 Reset verbose level to 0.
909 Try to be as quiet as possible.
911 @item --list-options @code{parameters}
912 @opindex list-options
913 This is a space or comma delimited string that gives options used when
914 listing keys and signatures (that is, @option{--list-keys},
915 @option{--list-sigs}, @option{--list-public-keys},
916 @option{--list-secret-keys}, and the @option{--edit-key} functions).
917 Options can be prepended with a @option{no-} (after the two dashes) to
918 give the opposite meaning. The options are:
923 @opindex list-options:show-photos
924 Causes @option{--list-keys}, @option{--list-sigs},
925 @option{--list-public-keys}, and @option{--list-secret-keys} to display
926 any photo IDs attached to the key. Defaults to no. See also
927 @option{--photo-viewer}.
929 @item show-policy-urls
930 @opindex list-options:show-policy-urls
931 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
932 listings. Defaults to no.
935 @itemx show-std-notations
936 @itemx show-user-notations
937 @opindex list-options:show-notations
938 @opindex list-options:show-std-notations
939 @opindex list-options:show-user-notations
940 Show all, IETF standard, or user-defined signature notations in the
941 @option{--list-sigs} or @option{--check-sigs} listings. Defaults to no.
943 @item show-keyserver-urls
945 Show any preferred keyserver URL in the @option{--list-sigs} or
946 @option{--check-sigs} listings. Defaults to no.
948 @item show-uid-validity
949 Display the calculated validity of user IDs during key listings.
952 @item show-unusable-uids
953 Show revoked and expired user IDs in key listings. Defaults to no.
955 @item show-unusable-subkeys
956 Show revoked and expired subkeys in key listings. Defaults to no.
959 Display the keyring name at the head of key listings to show which
960 keyring a given key resides on. Defaults to no.
962 @item show-sig-expire
963 Show signature expiration dates (if any) during @option{--list-sigs} or
964 @option{--check-sigs} listings. Defaults to no.
966 @item show-sig-subpackets
967 Include signature subpackets in the key listing. This option can take an
968 optional argument list of the subpackets to list. If no argument is
969 passed, list all subpackets. Defaults to no. This option is only
970 meaningful when using @option{--with-colons} along with
971 @option{--list-sigs} or @option{--check-sigs}.
974 @item --verify-options @code{parameters}
975 This is a space or comma delimited string that gives options used when
976 verifying signatures. Options can be prepended with a `no-' to give
977 the opposite meaning. The options are:
982 Display any photo IDs present on the key that issued the signature.
983 Defaults to no. See also @option{--photo-viewer}.
985 @item show-policy-urls
986 Show policy URLs in the signature being verified. Defaults to no.
989 @itemx show-std-notations
990 @itemx show-user-notations
991 Show all, IETF standard, or user-defined signature notations in the
992 signature being verified. Defaults to IETF standard.
994 @item show-keyserver-urls
995 Show any preferred keyserver URL in the signature being verified.
998 @item show-uid-validity
999 Display the calculated validity of the user IDs on the key that issued
1000 the signature. Defaults to no.
1002 @item show-unusable-uids
1003 Show revoked and expired user IDs during signature verification.
1007 Enable PKA lookups to verify sender addresses. Note that PKA is based
1008 on DNS, and so enabling this option may disclose information on when
1009 and what signatures are verified or to whom data is encrypted. This
1010 is similar to the "web bug" described for the auto-key-retrieve
1013 @item pka-trust-increase
1014 Raise the trust in a signature to full if the signature passes PKA
1015 validation. This option is only meaningful if pka-lookups is set.
1019 @itemx --disable-dsa2
1020 Enables new-style DSA keys which (unlike the old style) may be larger
1021 than 1024 bit and use hashes other than SHA-1 and RIPEMD/160. Note
1022 that very few programs currently support these keys and signatures
1025 @item --photo-viewer @code{string}
1026 This is the command line that should be run to view a photo ID. "%i"
1027 will be expanded to a filename containing the photo. "%I" does the
1028 same, except the file will not be deleted once the viewer exits.
1029 Other flags are "%k" for the key ID, "%K" for the long key ID, "%f"
1030 for the key fingerprint, "%t" for the extension of the image type
1031 (e.g. "jpg"), "%T" for the MIME type of the image (e.g. "image/jpeg"),
1032 and "%%" for an actual percent sign. If neither %i or %I are present,
1033 then the photo will be supplied to the viewer on standard input.
1035 The default viewer is "xloadimage -fork -quiet -title 'KeyID 0x%k'
1036 stdin". Note that if your image viewer program is not secure, then
1037 executing it from GnuPG does not make it secure.
1039 @item --exec-path @code{string}
1040 Sets a list of directories to search for photo viewers and keyserver
1041 helpers. If not provided, keyserver helpers use the compiled-in
1042 default directory, and photo viewers use the $PATH environment
1044 Note, that on W32 system this value is ignored when searching for
1047 @item --keyring @code{file}
1048 Add @code{file} to the current list of keyrings. If @code{file} begins
1049 with a tilde and a slash, these are replaced by the $HOME directory. If
1050 the filename does not contain a slash, it is assumed to be in the GnuPG
1051 home directory ("~/.gnupg" if @option{--homedir} or $GNUPGHOME is not
1054 Note that this adds a keyring to the current list. If the intent is to
1055 use the specified keyring alone, use @option{--keyring} along with
1056 @option{--no-default-keyring}.
1058 @item --secret-keyring @code{file}
1059 Same as @option{--keyring} but for the secret keyrings.
1061 @item --primary-keyring @code{file}
1062 Designate @code{file} as the primary public keyring. This means that
1063 newly imported keys (via @option{--import} or keyserver
1064 @option{--recv-from}) will go to this keyring.
1066 @item --trustdb-name @code{file}
1067 Use @code{file} instead of the default trustdb. If @code{file} begins
1068 with a tilde and a slash, these are replaced by the $HOME directory. If
1069 the filename does not contain a slash, it is assumed to be in the GnuPG
1070 home directory (@file{~/.gnupg} if @option{--homedir} or $GNUPGHOME is
1074 @anchor{option --homedir}
1076 @include opt-homedir.texi
1079 @item --pcsc-driver @code{file}
1080 Use @code{file} to access the smartcard reader. The current default is
1081 `libpcsclite.so.1' for GLIBC based systems,
1082 `/System/Library/Frameworks/PCSC.framework/PCSC' for MAC OS X,
1083 `winscard.dll' for Windows and `libpcsclite.so' for other systems.
1085 @item --disable-ccid
1086 Disable the integrated support for CCID compliant readers. This
1087 allows to fall back to one of the other drivers even if the internal
1088 CCID driver can handle the reader. Note, that CCID support is only
1089 available if libusb was available at build time.
1091 @item --reader-port @code{number_or_string}
1092 This option may be used to specify the port of the card terminal. A
1093 value of 0 refers to the first serial device; add 32768 to access USB
1094 devices. The default is 32768 (first USB device). PC/SC or CCID
1095 readers might need a string here; run the program in verbose mode to get
1096 a list of available readers. The default is then the first reader
1099 @item --display-charset @code{name}
1100 Set the name of the native character set. This is used to convert
1101 some informational strings like user IDs to the proper UTF-8 encoding.
1102 Note that this has nothing to do with the character set of data to be
1103 encrypted or signed; GnuPG does not recode user supplied data. If
1104 this option is not used, the default character set is determined from
1105 the current locale. A verbosity level of 3 shows the chosen set.
1106 Valid values for @code{name} are:
1111 This is the Latin 1 set.
1117 This is currently an alias for
1121 The usual Russian set (rfc1489).
1124 Bypass all translations and assume
1125 that the OS uses native UTF-8 encoding.
1128 @item --utf8-strings
1129 @itemx --no-utf8-strings
1130 Assume that command line arguments are given as UTF8 strings. The
1131 default (@option{--no-utf8-strings}) is to assume that arguments are
1132 encoded in the character set as specified by
1133 @option{--display-charset}. These options affect all following
1134 arguments. Both options may be used multiple times.
1137 @anchor{option --options}
1139 @item --options @code{file}
1140 Read options from @code{file} and do not try to read them from the
1141 default options file in the homedir (see @option{--homedir}). This
1142 option is ignored if used in an options file.
1145 Shortcut for @option{--options /dev/null}. This option is detected
1146 before an attempt to open an option file. Using this option will also
1147 prevent the creation of a @file{~/.gnupg} homedir.
1152 @itemx --compress-level @code{n}
1153 @itemx --bzip2-compress-level @code{n}
1154 Set compression level to @code{n} for the ZIP and ZLIB compression
1155 algorithms. The default is to use the default compression level of zlib
1156 (normally 6). @option{--bzip2-compress-level} sets the compression level
1157 for the BZIP2 compression algorithm (defaulting to 6 as well). This is a
1158 different option from @option{--compress-level} since BZIP2 uses a
1159 significant amount of memory for each additional compression level.
1160 @option{-z} sets both. A value of 0 for @code{n} disables compression.
1162 @item --bzip2-decompress-lowmem
1163 Use a different decompression method for BZIP2 compressed files. This
1164 alternate method uses a bit more than half the memory, but also runs
1165 at half the speed. This is useful under extreme low memory
1166 circumstances when the file was originally compressed at a high
1167 @option{--bzip2-compress-level}.
1170 @item --mangle-dos-filenames
1171 @itemx --no-mangle-dos-filenames
1172 @opindex mangle-dos-filenames
1173 @opindex no-mangle-dos-filenames
1174 Older version of Windows cannot handle filenames with more than one
1175 dot. @option{--mangle-dos-filenames} causes GnuPG to replace (rather
1176 than add to) the extension of an output filename to avoid this
1177 problem. This option is off by default and has no effect on non-Windows
1180 @item --ask-cert-level
1181 @itemx --no-ask-cert-level
1182 When making a key signature, prompt for a certification level. If this
1183 option is not specified, the certification level used is set via
1184 @option{--default-cert-level}. See @option{--default-cert-level} for
1185 information on the specific levels and how they are
1186 used. @option{--no-ask-cert-level} disables this option. This option
1189 @item --default-cert-level @code{n}
1190 The default to use for the check level when signing a key.
1192 0 means you make no particular claim as to how carefully you verified
1195 1 means you believe the key is owned by the person who claims to own
1196 it but you could not, or did not verify the key at all. This is
1197 useful for a "persona" verification, where you sign the key of a
1200 2 means you did casual verification of the key. For example, this
1201 could mean that you verified that the key fingerprint and checked the
1202 user ID on the key against a photo ID.
1204 3 means you did extensive verification of the key. For example, this
1205 could mean that you verified the key fingerprint with the owner of the
1206 key in person, and that you checked, by means of a hard to forge
1207 document with a photo ID (such as a passport) that the name of the key
1208 owner matches the name in the user ID on the key, and finally that you
1209 verified (by exchange of email) that the email address on the key
1210 belongs to the key owner.
1212 Note that the examples given above for levels 2 and 3 are just that:
1213 examples. In the end, it is up to you to decide just what "casual"
1214 and "extensive" mean to you.
1216 This option defaults to 0 (no particular claim).
1218 @item --min-cert-level
1219 When building the trust database, treat any signatures with a
1220 certification level below this as invalid. Defaults to 2, which
1221 disregards level 1 signatures. Note that level 0 "no particular
1222 claim" signatures are always accepted.
1224 @item --trusted-key @code{long key ID}
1225 Assume that the specified key (which must be given
1226 as a full 8 byte key ID) is as trustworthy as one of
1227 your own secret keys. This option is useful if you
1228 don't want to keep your secret keys (or one of them)
1229 online but still want to be able to check the validity of a given
1230 recipient's or signator's key.
1232 @item --trust-model @code{pgp|classic|direct|always|auto}
1233 Set what trust model GnuPG should follow. The models are:
1238 This is the Web of Trust combined with trust signatures as used in PGP
1239 5.x and later. This is the default trust model when creating a new
1243 This is the standard Web of Trust as used in PGP 2.x and earlier.
1246 Key validity is set directly by the user and not calculated via the
1250 Skip key validation and assume that used keys are always fully
1251 trusted. You generally won't use this unless you are using some
1252 external validation scheme. This option also suppresses the
1253 "[uncertain]" tag printed with signature checks when there is no
1254 evidence that the user ID is bound to the key.
1257 Select the trust model depending on whatever the internal trust
1258 database says. This is the default model if such a database already
1262 @item --auto-key-locate @code{parameters}
1263 @itemx --no-auto-key-locate
1264 GnuPG can automatically locate and retrieve keys as needed using this
1265 option. This happens when encrypting to an email address (in the
1266 "user@@example.com" form), and there are no user@@example.com keys on
1267 the local keyring. This option takes any number of the following
1268 arguments, in the order they are to be tried:
1273 locate a key using DNS CERT, as specified in 2538bis (currently in
1274 draft): http://www.josefsson.org/rfc2538bis/
1277 locate a key using DNS PKA.
1280 locate a key using the PGP Universal method of checking
1281 "ldap://keys.(thedomain)".
1284 locate a key using whatever keyserver is defined using the
1285 @option{--keyserver} option.
1287 @item (keyserver URL)
1288 In addition, a keyserver URL as used in the @option{--keyserver} option may be
1289 used here to query that particular keyserver.
1292 @item --keyid-format @code{short|0xshort|long|0xlong}
1293 Select how to display key IDs. "short" is the traditional 8-character
1294 key ID. "long" is the more accurate (but less convenient)
1295 16-character key ID. Add an "0x" to either to include an "0x" at the
1296 beginning of the key ID, as in 0x99242560.
1298 @item --keyserver @code{name}
1299 Use @code{name} as your keyserver. This is the server that
1300 @option{--recv-keys}, @option{--send-keys}, and @option{--search-keys}
1301 will communicate with to receive keys from, send keys to, and search for
1302 keys on. The format of the @code{name} is a URI:
1303 `scheme:[//]keyservername[:port]' The scheme is the type of keyserver:
1304 "hkp" for the HTTP (or compatible) keyservers, "ldap" for the LDAP
1305 keyservers, or "mailto" for the Graff email keyserver. Note that your
1306 particular installation of GnuPG may have other keyserver types
1307 available as well. Keyserver schemes are case-insensitive. After the
1308 keyserver name, optional keyserver configuration options may be
1309 provided. These are the same as the global @option{--keyserver-options}
1310 from below, but apply only to this particular keyserver.
1312 Most keyservers synchronize with each other, so there is generally no
1313 need to send keys to more than one server. The keyserver
1314 @code{hkp://subkeys.pgp.net} uses round robin DNS to give a different
1315 keyserver each time you use it.
1317 @item --keyserver-options @code{name=value1 }
1318 This is a space or comma delimited string that gives options for the
1319 keyserver. Options can be prepended with a `no-' to give the opposite
1320 meaning. Valid import-options or export-options may be used here as well
1321 to apply to importing (@option{--recv-key}) or exporting
1322 (@option{--send-key}) a key from a keyserver. While not all options are
1323 available for all keyserver types, some common options are:
1327 @item include-revoked
1328 When searching for a key with @option{--search-keys}, include keys that
1329 are marked on the keyserver as revoked. Note that not all keyservers
1330 differentiate between revoked and unrevoked keys, and for such
1331 keyservers this option is meaningless. Note also that most keyservers do
1332 not have cryptographic verification of key revocations, and so turning
1333 this option off may result in skipping keys that are incorrectly marked
1336 @item include-disabled
1337 When searching for a key with @option{--search-keys}, include keys that
1338 are marked on the keyserver as disabled. Note that this option is not
1339 used with HKP keyservers.
1341 @item auto-key-retrieve
1342 This option enables the automatic retrieving of keys from a keyserver
1343 when verifying signatures made by keys that are not on the local
1346 Note that this option makes a "web bug" like behavior possible.
1347 Keyserver operators can see which keys you request, so by sending you
1348 a message signed by a brand new key (which you naturally will not have
1349 on your local keyring), the operator can tell both your IP address and
1350 the time when you verified the signature.
1352 @item honor-keyserver-url
1353 When using @option{--refresh-keys}, if the key in question has a preferred
1354 keyserver URL, then use that preferred keyserver to refresh the key
1355 from. In addition, if auto-key-retrieve is set, and the signature
1356 being verified has a preferred keyserver URL, then use that preferred
1357 keyserver to fetch the key from. Defaults to yes.
1359 @item honor-pka-record
1360 If auto-key-retrieve is set, and the signature being verified has a
1361 PKA record, then use the PKA information to fetch the key. Defaults
1364 @item include-subkeys
1365 When receiving a key, include subkeys as potential targets. Note that
1366 this option is not used with HKP keyservers, as they do not support
1367 retrieving keys by subkey id.
1369 @item use-temp-files
1370 On most Unix-like platforms, GnuPG communicates with the keyserver
1371 helper program via pipes, which is the most efficient method. This
1372 option forces GnuPG to use temporary files to communicate. On some
1373 platforms (such as Win32 and RISC OS), this option is always enabled.
1375 @item keep-temp-files
1376 If using `use-temp-files', do not delete the temp files after using
1377 them. This option is useful to learn the keyserver communication
1378 protocol by reading the temporary files.
1381 Tell the keyserver helper program to be more verbose. This option can
1382 be repeated multiple times to increase the verbosity level.
1385 Tell the keyserver helper program how long (in seconds) to try and
1386 perform a keyserver action before giving up. Note that performing
1387 multiple actions at the same time uses this timeout value per action.
1388 For example, when retrieving multiple keys via @option{--recv-keys}, the
1389 timeout applies separately to each key retrieval, and not to the
1390 @option{--recv-keys} command as a whole. Defaults to 30 seconds.
1392 @item http-proxy=@code{value}
1393 Set the proxy to use for HTTP and HKP keyservers. This overrides the
1394 "http_proxy" environment variable, if any.
1397 When retrieving a key via DNS CERT, only accept keys up to this size.
1398 Defaults to 16384 bytes.
1401 @item --completes-needed @code{n}
1402 Number of completely trusted users to introduce a new
1403 key signer (defaults to 1).
1405 @item --marginals-needed @code{n}
1406 Number of marginally trusted users to introduce a new
1407 key signer (defaults to 3)
1409 @item --max-cert-depth @code{n}
1410 Maximum depth of a certification chain (default is 5).
1412 @item --simple-sk-checksum
1413 Secret keys are integrity protected by using a SHA-1 checksum. This
1414 method is part of the upcoming enhanced OpenPGP specification but
1415 GnuPG already uses it as a countermeasure against certain attacks.
1416 Old applications don't understand this new format, so this option may
1417 be used to switch back to the old behaviour. Using this option bears
1418 a security risk. Note that using this option only takes effect when
1419 the secret key is encrypted - the simplest way to make this happen is
1420 to change the passphrase on the key (even changing it to the same
1421 value is acceptable).
1423 @item --no-sig-cache
1424 Do not cache the verification status of key signatures.
1425 Caching gives a much better performance in key listings. However, if
1426 you suspect that your public keyring is not save against write
1427 modifications, you can use this option to disable the caching. It
1428 probably does not make sense to disable it because all kind of damage
1429 can be done if someone else has write access to your public keyring.
1431 @item --no-sig-create-check
1432 GnuPG normally verifies each signature right after creation to protect
1433 against bugs and hardware malfunctions which could leak out bits from
1434 the secret key. This extra verification needs some time (about 115%
1435 for DSA keys), and so this option can be used to disable it.
1436 However, due to the fact that the signature creation needs manual
1437 interaction, this performance penalty does not matter in most settings.
1439 @item --auto-check-trustdb
1440 @itemx --no-auto-check-trustdb
1441 If GnuPG feels that its information about the Web of Trust has to be
1442 updated, it automatically runs the @option{--check-trustdb} command
1443 internally. This may be a time consuming
1444 process. @option{--no-auto-check-trustdb} disables this option.
1447 @itemx --no-use-agent
1449 This is dummy option. @command{@gpgname} always requires the agent.
1452 Try to use the GnuPG-Agent. With this option, GnuPG first tries to
1453 connect to the agent before it asks for a
1454 passphrase. @option{--no-use-agent} disables this option.
1457 @item --gpg-agent-info
1458 Override the value of the environment variable
1459 @samp{GPG_AGENT_INFO}. This is only used when @option{--use-agent} has
1463 Lock the databases the first time a lock is requested
1464 and do not release the lock until the process
1467 @item --lock-multiple
1468 Release the locks every time a lock is no longer
1469 needed. Use this to override a previous @option{--lock-once}
1473 Disable locking entirely. This option should be used only in very
1474 special environments, where it can be assured that only one process
1475 is accessing those files. A bootable floppy with a stand-alone
1476 encryption system will probably use this. Improper usage of this
1477 option may lead to data and key corruption.
1479 @item --exit-on-status-write-error
1480 This option will cause write errors on the status FD to immediately
1481 terminate the process. That should in fact be the default but it never
1482 worked this way and thus we need an option to enable this, so that the
1483 change won't break applications which close their end of a status fd
1484 connected pipe too early. Using this option along with
1485 @option{--enable-progress-filter} may be used to cleanly cancel long
1486 running gpg operations.
1488 @item --limit-card-insert-tries @code{n}
1489 With @code{n} greater than 0 the number of prompts asking to insert a
1490 smartcard gets limited to N-1. Thus with a value of 1 gpg won't at
1491 all ask to insert a card if none has been inserted at startup. This
1492 option is useful in the configuration file in case an application does
1493 not know about the smartcard support and waits ad infinitum for an
1496 @item --no-random-seed-file
1497 GnuPG uses a file to store its internal random pool over invocations.
1498 This makes random generation faster; however sometimes write operations
1499 are not desired. This option can be used to achieve that with the cost of
1500 slower random generation.
1503 Suppress the initial copyright message.
1505 @item --no-secmem-warning
1506 Suppress the warning about "using insecure memory".
1508 @item --no-permission-warning
1509 Suppress the warning about unsafe file and home directory (@option{--homedir})
1510 permissions. Note that the permission checks that GnuPG performs are
1511 not intended to be authoritative, but rather they simply warn about
1512 certain common permission problems. Do not assume that the lack of a
1513 warning means that your system is secure.
1515 Note that the warning for unsafe @option{--homedir} permissions cannot be
1516 suppressed in the gpg.conf file, as this would allow an attacker to
1517 place an unsafe gpg.conf file in place, and use this file to suppress
1518 warnings about itself. The @option{--homedir} permissions warning may only be
1519 suppressed on the command line.
1521 @item --no-mdc-warning
1522 Suppress the warning about missing MDC integrity protection.
1524 @item --require-secmem
1525 @itemx --no-require-secmem
1526 Refuse to run if GnuPG cannot get secure memory. Defaults to no
1527 (i.e. run, but give a warning).
1530 @item --require-cross-certification
1531 @itemx --no-require-cross-certification
1532 When verifying a signature made from a subkey, ensure that the cross
1533 certification "back signature" on the subkey is present and valid. This
1534 protects against a subtle attack against subkeys that can sign.
1535 Defaults to @option{--require-cross-certification} for
1540 Allow the user to do certain nonsensical or "silly" things like
1541 signing an expired or revoked key, or certain potentially incompatible
1542 things like generating unusual key types. This also disables certain
1543 warning messages about potentially incompatible actions. As the name
1544 implies, this option is for experts only. If you don't fully
1545 understand the implications of what it allows you to do, leave this
1546 off. @option{--no-expert} disables this option.
1554 @c *******************************************
1555 @c ******** KEY RELATED OPTIONS ************
1556 @c *******************************************
1557 @node GPG Key related Options
1558 @subsection Key related options
1562 @item --recipient @var{name}
1565 Encrypt for user id @var{name}. If this option or
1566 @option{--hidden-recipient} is not specified, GnuPG asks for the user-id
1567 unless @option{--default-recipient} is given.
1569 @item --hidden-recipient @var{name}
1571 @opindex hidden-recipient
1572 Encrypt for user ID @var{name}, but hide the key ID of this user's
1573 key. This option helps to hide the receiver of the message and is a
1574 limited countermeasure against traffic analysis. If this option or
1575 @option{--recipient} is not specified, GnuPG asks for the user ID unless
1576 @option{--default-recipient} is given.
1578 @item --encrypt-to @code{name}
1579 Same as @option{--recipient} but this one is intended for use in the
1580 options file and may be used with your own user-id as an
1581 "encrypt-to-self". These keys are only used when there are other
1582 recipients given either by use of @option{--recipient} or by the asked
1583 user id. No trust checking is performed for these user ids and even
1584 disabled keys can be used.
1586 @item --hidden-encrypt-to @code{name}
1587 Same as @option{--hidden-recipient} but this one is intended for use in the
1588 options file and may be used with your own user-id as a hidden
1589 "encrypt-to-self". These keys are only used when there are other
1590 recipients given either by use of @option{--recipient} or by the asked user id.
1591 No trust checking is performed for these user ids and even disabled
1594 @item --no-encrypt-to
1595 Disable the use of all @option{--encrypt-to} and
1596 @option{--hidden-encrypt-to} keys.
1598 @item --group @code{name=value1 }
1599 Sets up a named group, which is similar to aliases in email programs.
1600 Any time the group name is a recipient (@option{-r} or
1601 @option{--recipient}), it will be expanded to the values
1602 specified. Multiple groups with the same name are automatically merged
1603 into a single group.
1605 The values are @code{key IDs} or fingerprints, but any key description
1606 is accepted. Note that a value with spaces in it will be treated as
1607 two different values. Note also there is only one level of expansion
1608 --- you cannot make an group that points to another group. When used
1609 from the command line, it may be necessary to quote the argument to
1610 this option to prevent the shell from treating it as multiple
1613 @item --ungroup @code{name}
1614 Remove a given entry from the @option{--group} list.
1617 Remove all entries from the @option{--group} list.
1619 @item --local-user @var{name}
1622 Use @var{name} as the key to sign with. Note that this option overrides
1623 @option{--default-key}.
1625 @item --try-all-secrets
1626 Don't look at the key ID as stored in the message but try all secret
1627 keys in turn to find the right decryption key. This option forces the
1628 behaviour as used by anonymous recipients (created by using
1629 @option{--throw-keyids}) and might come handy in case where an encrypted
1630 message contains a bogus key ID.
1638 @c *******************************************
1639 @c ******** INPUT AND OUTPUT ***************
1640 @c *******************************************
1641 @node GPG Input and Output
1642 @subsection Input and Output
1649 Create ASCII armored output. The default is to create the binary
1653 Assume the input data is not in ASCII armored format.
1655 @item --output @var{file}
1656 @itemx -o @var{file}
1658 Write output to @var{file}.
1660 @item --max-output @code{n}
1662 This option sets a limit on the number of bytes that will be generated
1663 when processing a file. Since OpenPGP supports various levels of
1664 compression, it is possible that the plaintext of a given message may be
1665 significantly larger than the original OpenPGP message. While GnuPG
1666 works properly with such messages, there is often a desire to set a
1667 maximum file size that will be generated before processing is forced to
1668 stop by the OS limits. Defaults to 0, which means "no limit".
1670 @item --import-options @code{parameters}
1671 This is a space or comma delimited string that gives options for
1672 importing keys. Options can be prepended with a `no-' to give the
1673 opposite meaning. The options are:
1677 @item import-local-sigs
1678 Allow importing key signatures marked as "local". This is not
1679 generally useful unless a shared keyring scheme is being used.
1682 @item repair-pks-subkey-bug
1683 During import, attempt to repair the damage caused by the PKS keyserver
1684 bug (pre version 0.9.6) that mangles keys with multiple subkeys. Note
1685 that this cannot completely repair the damaged key as some crucial data
1686 is removed by the keyserver, but it does at least give you back one
1687 subkey. Defaults to no for regular @option{--import} and to yes for
1688 keyserver @option{--recv-keys}.
1691 During import, allow key updates to existing keys, but do not allow
1692 any new keys to be imported. Defaults to no.
1695 After import, compact (remove all signatures except the
1696 self-signature) any user IDs from the new key that are not usable.
1697 Then, remove any signatures from the new key that are not usable.
1698 This includes signatures that were issued by keys that are not present
1699 on the keyring. This option is the same as running the @option{--edit-key}
1700 command "clean" after import. Defaults to no.
1702 @item import-minimal
1703 Import the smallest key possible. This removes all signatures except
1704 the most recent self-signature on each user ID. This option is the
1705 same as running the @option{--edit-key} command "minimize" after import.
1709 @item --export-options @code{parameters}
1710 This is a space or comma delimited string that gives options for
1711 exporting keys. Options can be prepended with a `no-' to give the
1712 opposite meaning. The options are:
1716 @item export-local-sigs
1717 Allow exporting key signatures marked as "local". This is not
1718 generally useful unless a shared keyring scheme is being used.
1721 @item export-attributes
1722 Include attribute user IDs (photo IDs) while exporting. This is
1723 useful to export keys if they are going to be used by an OpenPGP
1724 program that does not accept attribute user IDs. Defaults to yes.
1726 @item export-sensitive-revkeys
1727 Include designated revoker information that was marked as
1728 "sensitive". Defaults to no.
1730 @item export-reset-subkey-passwd
1731 When using the @option{--export-secret-subkeys} command, this option resets
1732 the passphrases for all exported subkeys to empty. This is useful
1733 when the exported subkey is to be used on an unattended machine where
1734 a passphrase doesn't necessarily make sense. Defaults to no.
1737 Compact (remove all signatures from) user IDs on the key being
1738 exported if the user IDs are not usable. Also, do not export any
1739 signatures that are not usable. This includes signatures that were
1740 issued by keys that are not present on the keyring. This option is
1741 the same as running the @option{--edit-key} command "clean" before export
1742 except that the local copy of the key is not modified. Defaults to
1745 @item export-minimal
1746 Export the smallest key possible. This removes all signatures except the
1747 most recent self-signature on each user ID. This option is the same as
1748 running the @option{--edit-key} command "minimize" before export except
1749 that the local copy of the key is not modified. Defaults to no.
1753 @opindex with-colons
1754 Print key listings delimited by colons. Note that the output will be
1755 encoded in UTF-8 regardless of any @option{--display-charset} setting. This
1756 format is useful when GnuPG is called from scripts and other programs
1757 as it is easily machine parsed. The details of this format are
1758 documented in the file @file{doc/DETAILS}, which is included in the GnuPG
1759 source distribution.
1761 @item --fixed-list-mode
1762 @opindex fixed-list-mode
1763 Do not merge primary user ID and primary key in @option{--with-colon}
1764 listing mode and print all timestamps as seconds since 1970-01-01.
1766 @item --with-fingerprint
1767 @opindex with-fingerprint
1768 Same as the command @option{--fingerprint} but changes only the format
1769 of the output and may be used together with another command.
1774 @c *******************************************
1775 @c ******** OPENPGP OPTIONS ****************
1776 @c *******************************************
1777 @node OpenPGP Options
1778 @subsection OpenPGP protocol specific options.
1782 @item -t, --textmode
1783 @itemx --no-textmode
1784 Treat input files as text and store them in the OpenPGP canonical text
1785 form with standard "CRLF" line endings. This also sets the necessary
1786 flags to inform the recipient that the encrypted or signed data is text
1787 and may need its line endings converted back to whatever the local
1788 system uses. This option is useful when communicating between two
1789 platforms that have different line ending conventions (UNIX-like to Mac,
1790 Mac to Windows, etc). @option{--no-textmode} disables this option, and
1794 If @option{-t} (but not @option{--textmode}) is used together with
1795 armoring and signing, this enables clearsigned messages. This kludge is
1796 needed for command-line compatibility with command-line versions of PGP;
1797 normally you would use @option{--sign} or @option{--clearsign} to select
1798 the type of the signature.
1803 @item --force-v3-sigs
1804 @itemx --no-force-v3-sigs
1805 OpenPGP states that an implementation should generate v4 signatures
1806 but PGP versions 5 through 7 only recognize v4 signatures on key
1807 material. This option forces v3 signatures for signatures on data.
1808 Note that this option overrides @option{--ask-sig-expire}, as v3 signatures
1809 cannot have expiration dates. @option{--no-force-v3-sigs} disables this
1812 @item --force-v4-certs
1813 @itemx --no-force-v4-certs
1814 Always use v4 key signatures even on v3 keys. This option also
1815 changes the default hash algorithm for v3 RSA keys from MD5 to SHA-1.
1816 @option{--no-force-v4-certs} disables this option.
1819 Force the use of encryption with a modification detection code. This
1820 is always used with the newer ciphers (those with a blocksize greater
1821 than 64 bits), or if all of the recipient keys indicate MDC support in
1822 their feature flags.
1825 Disable the use of the modification detection code. Note that by
1826 using this option, the encrypted message becomes vulnerable to a
1827 message modification attack.
1829 @item --personal-cipher-preferences @code{string}
1830 Set the list of personal cipher preferences to @code{string}, this list
1831 should be a string similar to the one printed by the command "pref" in
1832 the edit menu. This allows the user to factor in their own preferred
1833 algorithms when algorithms are chosen via recipient key preferences.
1834 The most highly ranked cipher in this list is also used for the
1835 @option{--symmetric} encryption command.
1837 @item --personal-digest-preferences @code{string}
1838 Set the list of personal digest preferences to @code{string}, this list
1839 should be a string similar to the one printed by the command "pref" in
1840 the edit menu. This allows the user to factor in their own preferred
1841 algorithms when algorithms are chosen via recipient key preferences.
1842 The most highly ranked digest algorithm in this list is algo used when
1843 signing without encryption (e.g. @option{--clearsign} or
1844 @option{--sign}). The default value is SHA-1.
1846 @item --personal-compress-preferences @code{string}
1847 Set the list of personal compression preferences to @code{string}, this
1848 list should be a string similar to the one printed by the command
1849 "pref" in the edit menu. This allows the user to factor in their own
1850 preferred algorithms when algorithms are chosen via recipient key
1851 preferences. The most highly ranked algorithm in this list is also
1852 used when there are no recipient keys to consider (e.g. @option{--symmetric}).
1856 @item --s2k-cipher-algo @code{name}
1857 Use @code{name} as the cipher algorithm used to protect secret keys.
1858 The default cipher is CAST5. This cipher is also used for
1859 conventional encryption if @option{--personal-cipher-preferences} and
1860 @option{--cipher-algo} is not given.
1862 @item --s2k-digest-algo @code{name}
1863 Use @code{name} as the digest algorithm used to mangle the passphrases.
1864 The default algorithm is SHA-1.
1866 @item --s2k-mode @code{n}
1867 Selects how passphrases are mangled. If @code{n} is 0 a plain
1868 passphrase (which is not recommended) will be used, a 1 adds a salt to
1869 the passphrase and a 3 (the default) iterates the whole process a
1870 number of times (see --s2k-count). Unless @option{--rfc1991} is used,
1871 this mode is also used for conventional encryption.
1873 @item --s2k-count @code{n}
1874 Specify how many times the passphrase mangling is repeated. This
1875 value may range between 1024 and 65011712 inclusive, and the default
1876 is 65536. Note that not all values in the 1024-65011712 range are
1877 legal and if an illegal value is selected, GnuPG will round up to the
1878 nearest legal value. This option is only meaningful if
1879 @option{--s2k-mode} is 3.
1884 @c ***************************
1885 @c ******* Compliance ********
1886 @c ***************************
1887 @subsection Compliance options
1889 These options control what GnuPG is compliant to. Only one of these
1890 options may be active at a time. Note that the default setting of
1891 this is nearly always the correct one. See the INTEROPERABILITY WITH
1892 OTHER OPENPGP PROGRAMS section below before using one of these
1899 Use standard GnuPG behavior. This is essentially OpenPGP behavior
1900 (see @option{--openpgp}), but with some additional workarounds for common
1901 compatibility problems in different versions of PGP. This is the
1902 default option, so it is not generally needed, but it may be useful to
1903 override a different compliance option in the gpg.conf file.
1907 Reset all packet, cipher and digest options to strict OpenPGP
1908 behavior. Use this option to reset all previous options like
1909 @option{--rfc1991}, @option{--force-v3-sigs}, @option{--s2k-*},
1910 @option{--cipher-algo}, @option{--digest-algo} and
1911 @option{--compress-algo} to OpenPGP compliant values. All PGP
1912 workarounds are disabled.
1916 Reset all packet, cipher and digest options to strict RFC-2440
1917 behavior. Note that this is currently the same thing as @option{--openpgp}.
1921 Try to be more RFC-1991 (PGP 2.x) compliant.
1925 Set up all options to be as PGP 2.x compliant as possible, and warn if
1926 an action is taken (e.g. encrypting to a non-RSA key) that will create
1927 a message that PGP 2.x will not be able to handle. Note that `PGP
1928 2.x' here means `MIT PGP 2.6.2'. There are other versions of PGP 2.x
1929 available, but the MIT release is a good common baseline.
1931 This option implies @option{--rfc1991 --disable-mdc --no-force-v4-certs
1932 --no-sk-comment --escape-from-lines --force-v3-sigs --no-ask-sig-expire
1933 --no-ask-cert-expire --cipher-algo IDEA --digest-algo MD5
1934 --compress-algo 1}. It also disables @option{--textmode} when
1939 Set up all options to be as PGP 6 compliant as possible. This
1940 restricts you to the ciphers IDEA (if the IDEA plugin is installed),
1941 3DES, and CAST5, the hashes MD5, SHA1 and RIPEMD160, and the
1942 compression algorithms none and ZIP. This also disables
1943 --throw-keyids, and making signatures with signing subkeys as PGP 6
1944 does not understand signatures made by signing subkeys.
1946 This option implies @option{--disable-mdc --no-sk-comment
1947 --escape-from-lines --force-v3-sigs --no-ask-sig-expire}.
1951 Set up all options to be as PGP 7 compliant as possible. This is
1952 identical to @option{--pgp6} except that MDCs are not disabled, and the
1953 list of allowable ciphers is expanded to add AES128, AES192, AES256, and
1958 Set up all options to be as PGP 8 compliant as possible. PGP 8 is a lot
1959 closer to the OpenPGP standard than previous versions of PGP, so all
1960 this does is disable @option{--throw-keyids} and set
1961 @option{--escape-from-lines}. All algorithms are allowed except for the
1962 SHA224, SHA384, and SHA512 digests.
1967 @c *******************************************
1968 @c ******** ESOTERIC OPTIONS ***************
1969 @c *******************************************
1970 @node GPG Esoteric Options
1971 @subsection Doing things one usually don't want to do.
1978 Don't make any changes (this is not completely implemented).
1981 Changes the behaviour of some commands. This is like @option{--dry-run} but
1982 different in some cases. The semantic of this command may be extended in
1983 the future. Currently it only skips the actual decryption pass and
1984 therefore enables a fast listing of the encryption keys.
1987 @itemx --interactive
1988 @opindex interactive
1989 Prompt before overwriting any files.
1991 @item --debug @var{flags}
1993 Set debugging flags. All flags are or-ed and @var{flags} may
1994 be given in C syntax (e.g. 0x0042).
1997 Set all useful debugging flags.
2000 @item --debug-ccid-driver
2001 Enable debug output from the included CCID driver for smartcards.
2002 Note that this option is only available on some system.
2005 @item --enable-progress-filter
2006 Enable certain PROGRESS status outputs. This option allows frontends
2007 to display a progress indicator while gpg is processing larger files.
2008 There is a slight performance overhead using it.
2010 @item --status-fd @code{n}
2011 Write special status strings to the file descriptor @code{n}.
2012 See the file DETAILS in the documentation for a listing of them.
2014 @item --status-file @code{file}
2015 Same as @option{--status-fd}, except the status data is written to file
2018 @item --logger-fd @code{n}
2019 Write log output to file descriptor @code{n} and not to stderr.
2021 @item --logger-file @code{file}
2022 Same as @option{--logger-fd}, except the logger data is written to file
2025 @item --attribute-fd @code{n}
2026 Write attribute subpackets to the file descriptor @code{n}. This is most
2027 useful for use with @option{--status-fd}, since the status messages are
2028 needed to separate out the various subpackets from the stream delivered
2029 to the file descriptor.
2031 @item --attribute-file @code{file}
2032 Same as @option{--attribute-fd}, except the attribute data is written to
2035 @item --comment @code{string}
2036 @itemx --no-comments
2037 Use @code{string} as a comment string in clear text signatures and ASCII
2038 armored messages or keys (see @option{--armor}). The default behavior is
2039 not to use a comment string. @option{--comment} may be repeated multiple
2040 times to get multiple comment strings. @option{--no-comments} removes
2041 all comments. It is a good idea to keep the length of a single comment
2042 below 60 characters to avoid problems with mail programs wrapping such
2043 lines. Note that comment lines, like all other header lines, are not
2044 protected by the signature.
2046 @item --emit-version
2047 @itemx --no-emit-version
2048 Force inclusion of the version string in ASCII armored output.
2049 @option{--no-emit-version} disables this option.
2051 @item --sig-notation @code{name=value}
2052 @itemx --cert-notation @code{name=value}
2053 @itemx -N, --set-notation @code{name=value}
2054 Put the name value pair into the signature as notation data.
2055 @code{name} must consist only of printable characters or spaces, and
2056 must contain a '@@' character in the form keyname@@domain.example.com
2057 (substituting the appropriate keyname and domain name, of course). This
2058 is to help prevent pollution of the IETF reserved notation
2059 namespace. The @option{--expert} flag overrides the '@@'
2060 check. @code{value} may be any printable string; it will be encoded in
2061 UTF8, so you should check that your @option{--display-charset} is set
2062 correctly. If you prefix @code{name} with an exclamation mark (!), the
2063 notation data will be flagged as critical
2064 (rfc2440:5.2.3.15). @option{--sig-notation} sets a notation for data
2065 signatures. @option{--cert-notation} sets a notation for key signatures
2066 (certifications). @option{--set-notation} sets both.
2068 There are special codes that may be used in notation names. "%k" will
2069 be expanded into the key ID of the key being signed, "%K" into the
2070 long key ID of the key being signed, "%f" into the fingerprint of the
2071 key being signed, "%s" into the key ID of the key making the
2072 signature, "%S" into the long key ID of the key making the signature,
2073 "%g" into the fingerprint of the key making the signature (which might
2074 be a subkey), "%p" into the fingerprint of the primary key of the key
2075 making the signature, "%c" into the signature count from the OpenPGP
2076 smartcard, and "%%" results in a single "%". %k, %K, and %f are only
2077 meaningful when making a key signature (certification), and %c is only
2078 meaningful when using the OpenPGP smartcard.
2080 @item --sig-policy-url @code{string}
2081 @itemx --cert-policy-url @code{string}
2082 @itemx --set-policy-url @code{string}
2083 Use @code{string} as a Policy URL for signatures (rfc2440:5.2.3.19). If
2084 you prefix it with an exclamation mark (!), the policy URL packet will
2085 be flagged as critical. @option{--sig-policy-url} sets a policy url for
2086 data signatures. @option{--cert-policy-url} sets a policy url for key
2087 signatures (certifications). @option{--set-policy-url} sets both.
2089 The same %-expandos used for notation data are available here as well.
2091 @item --sig-keyserver-url @code{string}
2092 Use @code{string} as a preferred keyserver URL for data signatures. If
2093 you prefix it with an exclamation mark (!), the keyserver URL packet
2094 will be flagged as critical.
2096 The same %-expandos used for notation data are available here as well.
2098 @item --set-filename @code{string}
2099 Use @code{string} as the filename which is stored inside messages.
2100 This overrides the default, which is to use the actual filename of the
2101 file being encrypted.
2103 @item --for-your-eyes-only
2104 @itemx --no-for-your-eyes-only
2105 Set the `for your eyes only' flag in the message. This causes GnuPG
2106 to refuse to save the file unless the @option{--output} option is given, and
2107 PGP to use the "secure viewer" with a Tempest-resistant font to
2108 display the message. This option overrides @option{--set-filename}.
2109 @option{--no-for-your-eyes-only} disables this option.
2111 @item --use-embedded-filename
2112 @itemx --no-use-embedded-filename
2113 Try to create a file with a name as embedded in the data. This can be
2114 a dangerous option as it allows to overwrite files. Defaults to no.
2116 @item --cipher-algo @code{name}
2117 Use @code{name} as cipher algorithm. Running the program with the
2118 command @option{--version} yields a list of supported algorithms. If
2119 this is not used the cipher algorithm is selected from the preferences
2120 stored with the key. In general, you do not want to use this option as
2121 it allows you to violate the OpenPGP standard.
2122 @option{--personal-cipher-preferences} is the safe way to accomplish the
2125 @item --digest-algo @code{name}
2126 Use @code{name} as the message digest algorithm. Running the program
2127 with the command @option{--version} yields a list of supported algorithms. In
2128 general, you do not want to use this option as it allows you to
2129 violate the OpenPGP standard. @option{--personal-digest-preferences} is the
2130 safe way to accomplish the same thing.
2132 @item --compress-algo @code{name}
2133 Use compression algorithm @code{name}. "zlib" is RFC-1950 ZLIB
2134 compression. "zip" is RFC-1951 ZIP compression which is used by PGP.
2135 "bzip2" is a more modern compression scheme that can compress some
2136 things better than zip or zlib, but at the cost of more memory used
2137 during compression and decompression. "uncompressed" or "none"
2138 disables compression. If this option is not used, the default
2139 behavior is to examine the recipient key preferences to see which
2140 algorithms the recipient supports. If all else fails, ZIP is used for
2141 maximum compatibility.
2143 ZLIB may give better compression results than ZIP, as the compression
2144 window size is not limited to 8k. BZIP2 may give even better
2145 compression results than that, but will use a significantly larger
2146 amount of memory while compressing and decompressing. This may be
2147 significant in low memory situations. Note, however, that PGP (all
2148 versions) only supports ZIP compression. Using any algorithm other
2149 than ZIP or "none" will make the message unreadable with PGP. In
2150 general, you do not want to use this option as it allows you to
2151 violate the OpenPGP standard. @option{--personal-compress-preferences} is the
2152 safe way to accomplish the same thing.
2154 @item --cert-digest-algo @code{name}
2155 Use @code{name} as the message digest algorithm used when signing a
2156 key. Running the program with the command @option{--version} yields a
2157 list of supported algorithms. Be aware that if you choose an algorithm
2158 that GnuPG supports but other OpenPGP implementations do not, then some
2159 users will not be able to use the key signatures you make, or quite
2160 possibly your entire key.
2162 @item --disable-cipher-algo @code{name}
2163 Never allow the use of @code{name} as cipher algorithm.
2164 The given name will not be checked so that a later loaded algorithm
2165 will still get disabled.
2167 @item --disable-pubkey-algo @code{name}
2168 Never allow the use of @code{name} as public key algorithm.
2169 The given name will not be checked so that a later loaded algorithm
2170 will still get disabled.
2172 @item --throw-keyids
2173 @itemx --no-throw-keyids
2174 Do not put the recipient key IDs into encrypted messages. This helps
2175 to hide the receivers of the message and is a limited countermeasure
2176 against traffic analysis. On the receiving side, it may slow down the
2177 decryption process because all available secret keys must be tried.
2178 @option{--no-throw-keyids} disables this option. This option is essentially
2179 the same as using @option{--hidden-recipient} for all recipients.
2181 @item --not-dash-escaped
2182 This option changes the behavior of cleartext signatures
2183 so that they can be used for patch files. You should not
2184 send such an armored file via email because all spaces
2185 and line endings are hashed too. You can not use this
2186 option for data which has 5 dashes at the beginning of a
2187 line, patch files don't have this. A special armor header
2188 line tells GnuPG about this cleartext signature option.
2190 @item --escape-from-lines
2191 @itemx --no-escape-from-lines
2192 Because some mailers change lines starting with "From " to ">From " it
2193 is good to handle such lines in a special way when creating cleartext
2194 signatures to prevent the mail system from breaking the signature. Note
2195 that all other PGP versions do it this way too. Enabled by
2196 default. @option{--no-escape-from-lines} disables this option.
2198 @item --passphrase-repeat @code{n}
2199 Specify how many times @command{@gpgname} will request a new
2200 passphrase be repeated. This is useful for helping memorize a
2201 passphrase. Defaults to 1 repetition.
2203 @item --passphrase-fd @code{n}
2204 Read the passphrase from file descriptor @code{n}. Only the first line
2205 will be read from file descriptor @code{n}. If you use 0 for @code{n},
2206 the passphrase will be read from stdin. This can only be used if only
2207 one passphrase is supplied.
2209 Note that this passphrase is only used if the option @option{--batch}
2210 has also been given. This is different from @command{gpg}.
2213 @item --passphrase-file @code{file}
2214 Read the passphrase from file @code{file}. Only the first line will
2215 be read from file @code{file}. This can only be used if only one
2216 passphrase is supplied. Obviously, a passphrase stored in a file is
2217 of questionable security if other users can read this file. Don't use
2218 this option if you can avoid it.
2220 Note that this passphrase is only used if the option @option{--batch}
2221 has also been given. This is different from @command{gpg}.
2224 @item --passphrase @code{string}
2225 Use @code{string} as the passphrase. This can only be used if only one
2226 passphrase is supplied. Obviously, this is of very questionable
2227 security on a multi-user system. Don't use this option if you can
2230 Note that this passphrase is only used if the option @option{--batch}
2231 has also been given. This is different from @command{gpg}.
2234 @item --command-fd @code{n}
2235 This is a replacement for the deprecated shared-memory IPC mode.
2236 If this option is enabled, user input on questions is not expected
2237 from the TTY but from the given file descriptor. It should be used
2238 together with @option{--status-fd}. See the file doc/DETAILS in the source
2239 distribution for details on how to use it.
2241 @item --command-file @code{file}
2242 Same as @option{--command-fd}, except the commands are read out of file
2245 @item --allow-non-selfsigned-uid
2246 @itemx --no-allow-non-selfsigned-uid
2247 Allow the import and use of keys with user IDs which are not
2248 self-signed. This is not recommended, as a non self-signed user ID is
2249 trivial to forge. @option{--no-allow-non-selfsigned-uid} disables.
2251 @item --allow-freeform-uid
2252 Disable all checks on the form of the user ID while generating a new
2253 one. This option should only be used in very special environments as
2254 it does not ensure the de-facto standard format of user IDs.
2256 @item --ignore-time-conflict
2257 GnuPG normally checks that the timestamps associated with keys and
2258 signatures have plausible values. However, sometimes a signature
2259 seems to be older than the key due to clock problems. This option
2260 makes these checks just a warning. See also @option{--ignore-valid-from} for
2261 timestamp issues on subkeys.
2263 @item --ignore-valid-from
2264 GnuPG normally does not select and use subkeys created in the future.
2265 This option allows the use of such keys and thus exhibits the
2266 pre-1.0.7 behaviour. You should not use this option unless you there
2267 is some clock problem. See also @option{--ignore-time-conflict} for timestamp
2268 issues with signatures.
2270 @item --ignore-crc-error
2271 The ASCII armor used by OpenPGP is protected by a CRC checksum against
2272 transmission errors. Occasionally the CRC gets mangled somewhere on
2273 the transmission channel but the actual content (which is protected by
2274 the OpenPGP protocol anyway) is still okay. This option allows GnuPG
2275 to ignore CRC errors.
2277 @item --ignore-mdc-error
2278 This option changes a MDC integrity protection failure into a warning.
2279 This can be useful if a message is partially corrupt, but it is
2280 necessary to get as much data as possible out of the corrupt message.
2281 However, be aware that a MDC protection failure may also mean that the
2282 message was tampered with intentionally by an attacker.
2284 @item --no-default-keyring
2285 Do not add the default keyrings to the list of keyrings. Note that
2286 GnuPG will not operate without any keyrings, so if you use this option
2287 and do not provide alternate keyrings via @option{--keyring} or
2288 @option{--secret-keyring}, then GnuPG will still use the default public or
2292 Skip the signature verification step. This may be
2293 used to make the decryption faster if the signature
2294 verification is not needed.
2296 @item --with-key-data
2297 Print key listings delimited by colons (like @option{--with-colons}) and
2298 print the public key data.
2300 @item --fast-list-mode
2301 Changes the output of the list commands to work faster; this is achieved
2302 by leaving some parts empty. Some applications don't need the user ID
2303 and the trust information given in the listings. By using this options
2304 they can get a faster listing. The exact behaviour of this option may
2305 change in future versions. If you are missing some information, don't
2309 This is not for normal use. Use the source to see for what it might be useful.
2311 @item --set-filesize
2312 This is not for normal use. Use the source to see for what it might be useful.
2314 @item --show-session-key
2315 Display the session key used for one message. See
2316 @option{--override-session-key} for the counterpart of this option.
2318 We think that Key Escrow is a Bad Thing; however the user should have
2319 the freedom to decide whether to go to prison or to reveal the content
2320 of one specific message without compromising all messages ever
2321 encrypted for one secret key. DON'T USE IT UNLESS YOU ARE REALLY
2324 @item --override-session-key @code{string}
2325 Don't use the public key but the session key @code{string}. The format
2326 of this string is the same as the one printed by
2327 @option{--show-session-key}. This option is normally not used but comes
2328 handy in case someone forces you to reveal the content of an encrypted
2329 message; using this option you can do this without handing out the
2332 @item --ask-sig-expire
2333 @itemx --no-ask-sig-expire
2334 When making a data signature, prompt for an expiration time. If this
2335 option is not specified, the expiration time set via
2336 @option{--default-sig-expire} is used. @option{--no-ask-sig-expire}
2337 disables this option. Note that by default, @option{--force-v3-sigs} is
2338 set which also disables this option. If you want signature expiration,
2339 you must set @option{--no-force-v3-sigs} as well as turning
2340 @option{--ask-sig-expire} on.
2342 @item --default-sig-expire
2343 The default expiration time to use for signature expiration. Valid
2344 values are "0" for no expiration, a number followed by the letter d
2345 (for days), w (for weeks), m (for months), or y (for years) (for
2346 example "2m" for two months, or "5y" for five years), or an absolute
2347 date in the form YYYY-MM-DD. Defaults to "0".
2349 @item --ask-cert-expire
2350 @itemx --no-ask-cert-expire
2351 When making a key signature, prompt for an expiration time. If this
2352 option is not specified, the expiration time set via
2353 @option{--default-cert-expire} is used. @option{--no-ask-cert-expire}
2354 disables this option.
2356 @item --default-cert-expire
2357 The default expiration time to use for key signature expiration.
2358 Valid values are "0" for no expiration, a number followed by the
2359 letter d (for days), w (for weeks), m (for months), or y (for years)
2360 (for example "2m" for two months, or "5y" for five years), or an
2361 absolute date in the form YYYY-MM-DD. Defaults to "0".
2363 @item --allow-secret-key-import
2364 This is an obsolete option and is not used anywhere.
2366 @item --allow-multisig-verification
2367 Allow verification of concatenated signed messages. This will run a
2368 signature verification for each data+signature block. There are some
2369 security issues with this option and thus it is off by default. Note
2370 that versions of GPG prior to version 1.4.3 implicitly allowed this.
2372 @item --enable-special-filenames
2373 This options enables a mode in which filenames of the form
2374 @file{-&n}, where n is a non-negative decimal number,
2375 refer to the file descriptor n and not to a file with that name.
2377 @item --no-expensive-trust-checks
2378 Experimental use only.
2380 @item --preserve-permissions
2381 Don't change the permissions of a secret keyring back to user
2382 read/write only. Use this option only if you really know what you are doing.
2384 @item --default-preference-list @code{string}
2385 @opindex default-preference-list
2386 Set the list of default preferences to @code{string}. This preference
2387 list is used for new keys and becomes the default for "setpref" in the
2390 @item --default-keyserver-url @code{name}
2391 @opindex default-keyserver-url
2392 Set the default keyserver URL to @code{name}. This keyserver will be
2393 used as the keyserver URL when writing a new self-signature on a key,
2394 which includes key generation and changing preferences.
2397 @opindex list-config
2398 Display various internal configuration parameters of GnuPG. This option
2399 is intended for external programs that call GnuPG to perform tasks, and
2400 is thus not generally useful. See the file @file{doc/DETAILS} in the
2401 source distribution for the details of which configuration items may be
2402 listed. @option{--list-config} is only usable with
2403 @option{--with-colons} set.
2405 @item --gpgconf-list
2406 @opindex gpgconf-list
2407 This command is simliar to @option{--list-config} but in general only
2408 internally used by the @command{gpgconf} tool.
2410 @item --gpgconf-test
2411 @opindex gpgconf-test
2412 This is more or less dummy action. However it parses the configuration
2413 file and returns with failure if the configuraion file would prevent
2414 @command{gpg} from startup. Thus it may be used to run a syntax check
2415 on the configuration file.
2419 @c *******************************
2420 @c ******* Deprecated ************
2421 @c *******************************
2422 @subsection Deprecated options
2427 @item --load-extension @code{name}
2428 Load an extension module. If @code{name} does not contain a slash it is
2429 searched for in the directory configured when GnuPG was built
2430 (generally "/usr/local/lib/gnupg"). Extensions are not generally
2431 useful anymore, and the use of this option is deprecated.
2435 @itemx --no-show-photos
2436 Causes @option{--list-keys}, @option{--list-sigs},
2437 @option{--list-public-keys}, @option{--list-secret-keys}, and verifying
2438 a signature to also display the photo ID attached to the key, if
2439 any. See also @option{--photo-viewer}. These options are deprecated. Use
2440 @option{--list-options [no-]show-photos} and/or @option{--verify-options
2441 [no-]show-photos} instead.
2443 @item --show-keyring
2444 Display the keyring name at the head of key listings to show which
2445 keyring a given key resides on. This option is deprecated: use
2446 @option{--list-options [no-]show-keyring} instead.
2448 @item --ctapi-driver @code{file}
2449 Use @code{file} to access the smartcard reader. The current default
2450 is `libtowitoko.so'. Note that the use of this interface is
2451 deprecated; it may be removed in future releases.
2453 @item --always-trust
2454 Identical to @option{--trust-model always}. This option is deprecated.
2456 @item --show-notation
2457 @itemx --no-show-notation
2458 Show signature notations in the @option{--list-sigs} or @option{--check-sigs} listings
2459 as well as when verifying a signature with a notation in it. These
2460 options are deprecated. Use @option{--list-options [no-]show-notation}
2461 and/or @option{--verify-options [no-]show-notation} instead.
2463 @item --show-policy-url
2464 @itemx --no-show-policy-url
2465 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
2466 listings as well as when verifying a signature with a policy URL in
2467 it. These options are deprecated. Use @option{--list-options
2468 [no-]show-policy-url} and/or @option{--verify-options
2469 [no-]show-policy-url} instead.
2475 @c *******************************************
2476 @c *************** ****************
2477 @c *************** FILES ****************
2478 @c *************** ****************
2479 @c *******************************************
2481 @node GPG Configuration
2482 @section Configuration files
2484 There are a few configuration files to control certain aspects of
2485 @command{@gpgname}'s operation. Unless noted, they are expected in the
2486 current home directory (@pxref{option --homedir}).
2492 This is the standard configuration file read by @command{@gpgname} on
2493 startup. It may contain any valid long option; the leading two dashes
2494 may not be entered and the option may not be abbreviated. This default
2495 name may be changed on the command line (@pxref{option
2501 Note that on larger installations, it is useful to put predefined files
2502 into the directory @file{/etc/skel/.gnupg/} so that newly created users
2503 start up with a working configuration.
2505 For existing users the a small
2506 helper script is provided to create these files (@pxref{addgnupghome}).
2509 For internal purposes @command{@gpgname} creates and maintaines a few other
2510 files; They all live in in the current home directory (@pxref{option
2511 --homedir}). Only the @command{@gpgname} may modify these files.
2515 @item ~/.gnupg/secring.gpg
2518 @item ~/.gnupg/secring.gpg.lock
2521 @item ~/.gnupg/pubring.gpg
2524 @item ~/.gnupg/pubring.gpg.lock
2527 @item ~/.gnupg/trustdb.gpg
2530 @item ~/.gnupg/trustdb.gpg.lock
2533 @item ~/.gnupg/random_seed
2534 used to preserve the internal random pool
2536 @item /usr[/local]/share/gnupg/options.skel
2537 Skeleton options file
2539 @item /usr[/local]/lib/gnupg/
2540 Default location for extensions
2545 Operation is further controlled by a few environment variables:
2550 Used to locate the default home directory.
2553 If set directory used instead of "~/.gnupg".
2555 @item GPG_AGENT_INFO
2556 Used to locate the gpg-agent.
2558 This is only honored when @option{--use-agent} is set.
2560 The value consists of 3 colon delimited fields: The first is the path
2561 to the Unix Domain Socket, the second the PID of the gpg-agent and the
2562 protocol version which should be set to 1. When starting the gpg-agent
2563 as described in its documentation, this variable is set to the correct
2564 value. The option @option{--gpg-agent-info} can be used to override it.
2568 Used to size some displays to the full size of the screen.
2573 @c *******************************************
2574 @c *************** ****************
2575 @c *************** EXAMPLES ****************
2576 @c *************** ****************
2577 @c *******************************************
2584 @item gpg -se -r @code{Bob} @code{file}
2585 sign and encrypt for user Bob
2587 @item gpg --clearsign @code{file}
2588 make a clear text signature
2590 @item gpg -sb @code{file}
2591 make a detached signature
2593 @item gpg --list-keys @code{user_ID}
2596 @item gpg --fingerprint @code{user_ID}
2599 @item gpg --verify @code{pgpfile}
2600 @itemx gpg --verify @code{sigfile}
2601 Verify the signature of the file but do not output the data. The
2602 second form is used for detached signatures, where @code{sigfile}
2603 is the detached signature (either ASCII armored or binary) and
2604 are the signed data; if this is not given, the name of
2605 the file holding the signed data is constructed by cutting off the
2606 extension (".asc" or ".sig") of @code{sigfile} or by asking the
2607 user for the filename.
2611 @c *******************************************
2612 @c *************** ****************
2613 @c *************** USER ID ****************
2614 @c *************** ****************
2615 @c *******************************************
2616 @mansect how to specify a user id
2618 @include specify-user-id.texi
2621 @mansect return vaue
2622 @chapheading RETURN VALUE
2624 The program returns 0 if everything was fine, 1 if at least
2625 a signature was bad, and other error codes for fatal errors.
2628 @chapheading WARNINGS
2630 Use a *good* password for your user account and a *good* passphrase
2631 to protect your secret key. This passphrase is the weakest part of the
2632 whole system. Programs to do dictionary attacks on your secret keyring
2633 are very easy to write and so you should protect your "~/.gnupg/"
2634 directory very well.
2636 Keep in mind that, if this program is used over a network (telnet), it
2637 is *very* easy to spy out your passphrase!
2639 If you are going to verify detached signatures, make sure that the
2640 program knows about it; either give both filenames on the command line
2641 or use @samp{-} to specify stdin.
2643 @mansect interoperability
2644 @chapheading INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS
2646 GnuPG tries to be a very flexible implementation of the OpenPGP
2647 standard. In particular, GnuPG implements many of the optional parts
2648 of the standard, such as the SHA-512 hash, and the ZLIB and BZIP2
2649 compression algorithms. It is important to be aware that not all
2650 OpenPGP programs implement these optional algorithms and that by
2651 forcing their use via the @option{--cipher-algo}, @option{--digest-algo},
2652 @option{--cert-digest-algo}, or @option{--compress-algo} options in GnuPG, it is
2653 possible to create a perfectly valid OpenPGP message, but one that
2654 cannot be read by the intended recipient.
2656 There are dozens of variations of OpenPGP programs available, and each
2657 supports a slightly different subset of these optional algorithms.
2658 For example, until recently, no (unhacked) version of PGP supported
2659 the BLOWFISH cipher algorithm. A message using BLOWFISH simply could
2660 not be read by a PGP user. By default, GnuPG uses the standard
2661 OpenPGP preferences system that will always do the right thing and
2662 create messages that are usable by all recipients, regardless of which
2663 OpenPGP program they use. Only override this safe default if you
2664 really know what you are doing.
2666 If you absolutely must override the safe default, or if the preferences
2667 on a given key are invalid for some reason, you are far better off using
2668 the @option{--pgp6}, @option{--pgp7}, or @option{--pgp8} options. These
2669 options are safe as they do not force any particular algorithms in
2670 violation of OpenPGP, but rather reduce the available algorithms to a
2676 On many systems this program should be installed as setuid(root). This
2677 is necessary to lock memory pages. Locking memory pages prevents the
2678 operating system from writing memory pages (which may contain
2679 passphrases or other sensitive material) to disk. If you get no
2680 warning message about insecure memory your operating system supports
2681 locking without being root. The program drops root privileges as soon
2682 as locked memory is allocated.
2684 Note also that some systems (especially laptops) have the ability to
2685 ``suspend to disk'' (also known as ``safe sleep'' or ``hibernate'').
2686 This writes all memory to disk before going into a low power or even
2687 powered off mode. Unless measures are taken in the operating system
2688 to protect the saved memory, passphrases or other sensitive material
2689 may be recoverable from it later.
2696 @command{gpg-agent}(1)
2699 @include see-also-note.texi