1 @c Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2 @c 2008, 2009 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 except 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 Note 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
179 signed 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). The key to be used for
182 signing is chosen by default or can be set with the
183 @option{--local-user} and @option{--default-key} options.
187 Make a clear text signature. The content in a clear text signature is
188 readable without any special software. OpenPGP software is only needed
189 to verify the signature. Clear text signatures may modify end-of-line
190 whitespace for platform independence and are not intended to be
191 reversible. The key to be used for signing is chosen by default or
192 can be set with the @option{--local-user} and @option{--default-key}
199 Make a detached signature.
204 Encrypt data. This option may be combined with @option{--sign} (for a
205 signed and encrypted message), @option{--symmetric} (for a message that
206 may be decrypted via a secret key or a passphrase), or @option{--sign}
207 and @option{--symmetric} together (for a signed message that may be
208 decrypted via a secret key or a passphrase).
213 Encrypt with a symmetric cipher using a passphrase. The default
214 symmetric cipher used is CAST5, but may be chosen with the
215 @option{--cipher-algo} option. This option may be combined with
216 @option{--sign} (for a signed and symmetrically encrypted message),
217 @option{--encrypt} (for a message that may be decrypted via a secret key
218 or a passphrase), or @option{--sign} and @option{--encrypt} together
219 (for a signed message that may be decrypted via a secret key or a
224 Store only (make a simple RFC1991 literal data packet).
229 Decrypt the file given on the command line (or STDIN if no file
230 is specified) and write it to STDOUT (or the file specified with
231 @option{--output}). If the decrypted file is signed, the signature is also
232 verified. This command differs from the default operation, as it never
233 writes to the filename which is included in the file and it rejects
234 files which don't begin with an encrypted message.
238 Assume that the first argument is a signed file or a detached signature
239 and verify it without generating any output. With no arguments, the
240 signature packet is read from STDIN. If only a sigfile is given, it may
241 be a complete signature or a detached signature, in which case the
242 signed stuff is expected in a file without the ".sig" or ".asc"
243 extension. With more than 1 argument, the first should be a detached
244 signature and the remaining files are the signed stuff. To read the
245 signed stuff from STDIN, use @samp{-} as the second filename. For
246 security reasons a detached signature cannot read the signed material
247 from STDIN without denoting it in the above way.
251 This modifies certain other commands to accept multiple files for
252 processing on the command line or read from STDIN with each filename on
253 a separate line. This allows for many files to be processed at
254 once. @option{--multifile} may currently be used along with
255 @option{--verify}, @option{--encrypt}, and @option{--decrypt}. Note that
256 @option{--multifile --verify} may not be used with detached signatures.
259 @opindex verify-files
260 Identical to @option{--multifile --verify}.
262 @item --encrypt-files
263 @opindex encrypt-files
264 Identical to @option{--multifile --encrypt}.
266 @item --decrypt-files
267 @opindex decrypt-files
268 Identical to @option{--multifile --decrypt}.
272 @itemx --list-public-keys
274 List all keys from the public keyrings, or just the keys given on the
277 @option{-k} is slightly different from @option{--list-keys} in that it
278 allows only for one argument and takes the second argument as the
279 keyring to search. This is for command line compatibility with PGP 2
280 and has been removed in @command{gpg2}.
283 Avoid using the output of this command in scripts or other programs as
284 it is likely to change as GnuPG changes. See @option{--with-colons} for a
285 machine-parseable key listing command that is appropriate for use in
286 scripts and other programs.
288 @item --list-secret-keys
290 @opindex list-secret-keys
291 List all keys from the secret keyrings, or just the ones given on the
292 command line. A @code{#} after the letters @code{sec} means that the
293 secret key is not usable (for example, if it was created via
294 @option{--export-secret-subkeys}).
298 Same as @option{--list-keys}, but the signatures are listed too.
300 This command has the same effect as
301 using @option{--list-keys} with @option{--with-sig-list}.
304 For each signature listed, there are several flags in between the "sig"
305 tag and keyid. These flags give additional information about each
306 signature. From left to right, they are the numbers 1-3 for certificate
307 check level (see @option{--ask-cert-level}), "L" for a local or
308 non-exportable signature (see @option{--lsign-key}), "R" for a
309 nonRevocable signature (see the @option{--edit-key} command "nrsign"),
310 "P" for a signature that contains a policy URL (see
311 @option{--cert-policy-url}), "N" for a signature that contains a
312 notation (see @option{--cert-notation}), "X" for an eXpired signature
313 (see @option{--ask-cert-expire}), and the numbers 1-9 or "T" for 10 and
314 above to indicate trust signature levels (see the @option{--edit-key}
319 Same as @option{--list-sigs}, but the signatures are verified. Note
320 that for performance reasons the revocation status of a signing key is
323 This command has the same effect as
324 using @option{--list-keys} with @option{--with-sig-check}.
327 The status of the verification is indicated by a flag directly following
328 the "sig" tag (and thus before the flags described above for
329 @option{--list-sigs}). A "!" indicates that the signature has been
330 successfully verified, a "-" denotes a bad signature and a "%" is used
331 if an error occurred while checking the signature (e.g. a non supported
337 Locate the keys given as arguments. This command basically uses the
338 same algorithm as used when locating keys for encryption or signing and
339 may thus be used to see what keys @command{@gpgname} might use. In
340 particular external methods as defined by @option{--auto-key-locate} may
341 be used to locate a key. Only public keys are listed.
347 List all keys (or the specified ones) along with their
348 fingerprints. This is the same output as @option{--list-keys} but with
349 the additional output of a line with the fingerprint. May also be
350 combined with @option{--list-sigs} or @option{--check-sigs}. If this
351 command is given twice, the fingerprints of all secondary keys are
355 @opindex list-packets
356 List only the sequence of packets. This is mainly
357 useful for debugging.
362 Present a menu to work with a smartcard. The subcommand "help" provides
363 an overview on available commands. For a detailed description, please
364 see the Card HOWTO at
365 http://www.gnupg.org/documentation/howtos.html#GnuPG-cardHOWTO .
369 Show the content of the smart card.
373 Present a menu to allow changing the PIN of a smartcard. This
374 functionality is also available as the subcommand "passwd" with the
375 @option{--card-edit} command.
377 @item --delete-key @code{name}
379 Remove key from the public keyring. In batch mode either @option{--yes} is
380 required or the key must be specified by fingerprint. This is a
381 safeguard against accidental deletion of multiple keys.
383 @item --delete-secret-key @code{name}
384 @opindex delete-secret-key
385 Remove key from the secret and public keyring. In batch mode the key
386 must be specified by fingerprint.
388 @item --delete-secret-and-public-key @code{name}
389 @opindex delete-secret-and-public-key
390 Same as @option{--delete-key}, but if a secret key exists, it will be
391 removed first. In batch mode the key must be specified by fingerprint.
395 Either export all keys from all keyrings (default keyrings and those
396 registered via option @option{--keyring}), or if at least one name is given,
397 those of the given name. The new keyring is written to STDOUT or to the
398 file given with option @option{--output}. Use together with
399 @option{--armor} to mail those keys.
401 @item --send-keys @code{key IDs}
403 Similar to @option{--export} but sends the keys to a keyserver.
404 Fingerprints may be used instead of key IDs. Option @option{--keyserver}
405 must be used to give the name of this keyserver. Don't send your
406 complete keyring to a keyserver --- select only those keys which are new
407 or changed by you. If no key IDs are given, @command{gpg} does nothing.
409 @item --export-secret-keys
410 @itemx --export-secret-subkeys
411 @opindex export-secret-keys
412 @opindex export-secret-subkeys
413 Same as @option{--export}, but exports the secret keys instead. This is
414 normally not very useful and a security risk. The second form of the
415 command has the special property to render the secret part of the
416 primary key useless; this is a GNU extension to OpenPGP and other
417 implementations can not be expected to successfully import such a key.
418 See the option @option{--simple-sk-checksum} if you want to import such
419 an exported key with an older OpenPGP implementation.
424 Import/merge keys. This adds the given keys to the
425 keyring. The fast version is currently just a synonym.
427 There are a few other options which control how this command works.
428 Most notable here is the @option{--import-options merge-only} option
429 which does not insert new keys but does only the merging of new
430 signatures, user-IDs and subkeys.
432 @item --recv-keys @code{key IDs}
434 Import the keys with the given key IDs from a keyserver. Option
435 @option{--keyserver} must be used to give the name of this keyserver.
438 @opindex refresh-keys
439 Request updates from a keyserver for keys that already exist on the
440 local keyring. This is useful for updating a key with the latest
441 signatures, user IDs, etc. Calling this with no arguments will refresh
442 the entire keyring. Option @option{--keyserver} must be used to give the
443 name of the keyserver for all keys that do not have preferred keyservers
444 set (see @option{--keyserver-options honor-keyserver-url}).
446 @item --search-keys @code{names}
448 Search the keyserver for the given names. Multiple names given here will
449 be joined together to create the search string for the keyserver.
450 Option @option{--keyserver} must be used to give the name of this
451 keyserver. Keyservers that support different search methods allow using
452 the syntax specified in "How to specify a user ID" below. Note that
453 different keyserver types support different search methods. Currently
454 only LDAP supports them all.
456 @item --fetch-keys @code{URIs}
458 Retrieve keys located at the specified URIs. Note that different
459 installations of GnuPG may support different protocols (HTTP, FTP,
462 @item --update-trustdb
463 @opindex update-trustdb
464 Do trust database maintenance. This command iterates over all keys and
465 builds the Web of Trust. This is an interactive command because it may
466 have to ask for the "ownertrust" values for keys. The user has to give
467 an estimation of how far she trusts the owner of the displayed key to
468 correctly certify (sign) other keys. GnuPG only asks for the ownertrust
469 value if it has not yet been assigned to a key. Using the
470 @option{--edit-key} menu, the assigned value can be changed at any time.
472 @item --check-trustdb
473 @opindex check-trustdb
474 Do trust database maintenance without user interaction. From time to
475 time the trust database must be updated so that expired keys or
476 signatures and the resulting changes in the Web of Trust can be
477 tracked. Normally, GnuPG will calculate when this is required and do it
478 automatically unless @option{--no-auto-check-trustdb} is set. This
479 command can be used to force a trust database check at any time. The
480 processing is identical to that of @option{--update-trustdb} but it
481 skips keys with a not yet defined "ownertrust".
483 For use with cron jobs, this command can be used together with
484 @option{--batch} in which case the trust database check is done only if
485 a check is needed. To force a run even in batch mode add the option
488 @anchor{option --export-ownertrust}
489 @item --export-ownertrust
490 @opindex export-ownertrust
491 Send the ownertrust values to STDOUT. This is useful for backup purposes
492 as these values are the only ones which can't be re-created from a
493 corrupted trustdb. Example:
496 @gpgname{} --export-ownertrust > otrust.txt
501 @item --import-ownertrust
502 @opindex import-ownertrust
503 Update the trustdb with the ownertrust values stored in @code{files} (or
504 STDIN if not given); existing values will be overwritten. In case of a
505 severely damaged trustdb and if you have a recent backup of the
506 ownertrust values (e.g. in the file @file{otrust.txt}, you may re-create
507 the trustdb using these commands:
512 @gpgname{} --import-ownertrust < otrust.txt
517 @item --rebuild-keydb-caches
518 @opindex rebuild-keydb-caches
519 When updating from version 1.0.6 to 1.0.7 this command should be used
520 to create signature caches in the keyring. It might be handy in other
523 @item --print-md @code{algo}
526 Print message digest of algorithm ALGO for all given files or STDIN.
527 With the second form (or a deprecated "*" as algo) digests for all
528 available algorithms are printed.
530 @item --gen-random @code{0|1|2}
532 Emit @var{count} random bytes of the given quality level. If count is
533 not given or zero, an endless sequence of random bytes will be emitted.
534 PLEASE, don't use this command unless you know what you are doing; it
535 may remove precious entropy from the system!
537 @item --gen-prime @code{mode} @code{bits}
539 Use the source, Luke :-). The output format is still subject to change.
546 Pack or unpack an arbitrary input into/from an OpenPGP ASCII armor.
547 This is a GnuPG extension to OpenPGP and in general not very useful.
552 @c *******************************************
553 @c ******* KEY MANGEMENT COMMANDS **********
554 @c *******************************************
555 @node OpenPGP Key Management
556 @subsection How to manage your keys
558 This section explains the main commands for key management
564 Generate a new key pair. This command is normally only used
567 There is an experimental feature which allows you to create keys in
568 batch mode. See the file @file{doc/DETAILS} in the source distribution
571 @item --gen-revoke @code{name}
573 Generate a revocation certificate for the complete key. To revoke
574 a subkey or a signature, use the @option{--edit} command.
576 @item --desig-revoke @code{name}
577 @opindex desig-revoke
578 Generate a designated revocation certificate for a key. This allows a
579 user (with the permission of the keyholder) to revoke someone else's
585 Present a menu which enables you to do most of the key management
586 related tasks. It expects the specification of a key on the command
589 @c ******** Begin Edit-key Options **********
593 @opindex keyedit:sign
594 Make a signature on key of user @code{name} If the key is not yet
595 signed by the default user (or the users given with -u), the program
596 displays the information of the key again, together with its
597 fingerprint and asks whether it should be signed. This question is
598 repeated for all users specified with
602 @opindex keyedit:lsign
603 Same as "sign" but the signature is marked as non-exportable and will
604 therefore never be used by others. This may be used to make keys
605 valid only in the local environment.
608 @opindex keyedit:nrsign
609 Same as "sign" but the signature is marked as non-revocable and can
610 therefore never be revoked.
613 @opindex keyedit:tsign
614 Make a trust signature. This is a signature that combines the notions
615 of certification (like a regular signature), and trust (like the
616 "trust" command). It is generally only useful in distinct communities
621 Note that "l" (for local / non-exportable), "nr" (for non-revocable,
622 and "t" (for trust) may be freely mixed and prefixed to "sign" to
623 create a signature of any type desired.
629 @opindex keyedit:revsig
630 Revoke a signature. For every signature which has been generated by
631 one of the secret keys, GnuPG asks whether a revocation certificate
635 @opindex keyedit:trust
636 Change the owner trust value. This updates the
637 trust-db immediately and no save is required.
641 @opindex keyedit:disable
642 @opindex keyedit:enable
643 Disable or enable an entire key. A disabled key can not normally be
647 @opindex keyedit:adduid
648 Create an alternate user id.
651 @opindex keyedit:addphoto
652 Create a photographic user id. This will prompt for a JPEG file that
653 will be embedded into the user ID. Note that a very large JPEG will make
654 for a very large key. Also note that some programs will display your
655 JPEG unchanged (GnuPG), and some programs will scale it to fit in a
659 @opindex keyedit:deluid
660 Delete a user id. Note that it is not possible to retract a user id,
661 once it has been send to the public (i.e. to a keyserver). In that case
662 you better use @code{revuid}.
665 @opindex keyedit:delsig
666 Delete a signature. Note that it is not possible to retract a signature,
667 once it has been send to the public (i.e. to a keyserver). In that case
668 you better use @code{revsig}.
671 @opindex keyedit:revuid
675 @opindex keyedit:addkey
676 Add a subkey to this key.
679 @opindex keyedit:addcardkey
680 Generate a key on a card and add it to this key.
683 @opindex keyedit:keytocard
684 Transfer the selected secret key (or the primary key if no key has been
685 selected) to a smartcard. The secret key in the keyring will be replaced
686 by a stub if the key could be stored successfully on the card and you
687 use the save command later. Only certain key types may be transferred to
688 the card. A sub menu allows you to select on what card to store the
689 key. Note that it is not possible to get that key back from the card -
690 if the card gets broken your secret key will be lost unless you have a
693 @item bkuptocard @code{file}
694 @opindex keyedit:bkuptocard
695 Restore the given file to a card. This command may be used to restore a
696 backup key (as generated during card initialization) to a new card. In
697 almost all cases this will be the encryption key. You should use this
698 command only with the corresponding public key and make sure that the
699 file given as argument is indeed the backup to restore. You should then
700 select 2 to restore as encryption key. You will first be asked to enter
701 the passphrase of the backup key and then for the Admin PIN of the card.
704 @opindex keyedit:delkey
705 Remove a subkey (secondart key). Note that it is not possible to retract
706 a subkey, once it has been send to the public (i.e. to a keyserver). In
707 that case you better use @code{revkey}.
710 @opindex keyedit:addrevoker
711 Add a designated revoker. This takes one optional argument:
712 "sensitive". If a designated revoker is marked as sensitive, it will not
713 be exported by default (see export-options).
716 @opindex keyedit:revkey
720 @opindex keyedit:expire
721 Change the key expiration time. If a subkey is selected, the
722 expiration time of this subkey will be changed. With no selection,
723 the key expiration of the primary key is changed.
726 @opindex keyedit:passwd
727 Change the passphrase of the secret key.
730 @opindex keyedit:primary
731 Flag the current user id as the primary one, removes the primary user
732 id flag from all other user ids and sets the timestamp of all affected
733 self-signatures one second ahead. Note that setting a photo user ID
734 as primary makes it primary over other photo user IDs, and setting a
735 regular user ID as primary makes it primary over other regular user
740 Toggle selection of user id with index @code{n}.
741 Use 0 to deselect all.
745 Toggle selection of subkey with index @code{n}.
746 Use 0 to deselect all.
749 @opindex keyedit:check
750 Check all selected user ids.
753 @opindex keyedit:showphoto
754 Display the selected photographic user
758 @opindex keyedit:pref
759 List preferences from the selected user ID. This shows the actual
760 preferences, without including any implied preferences.
763 @opindex keyedit:showpref
764 More verbose preferences listing for the selected user ID. This shows
765 the preferences in effect by including the implied preferences of 3DES
766 (cipher), SHA-1 (digest), and Uncompressed (compression) if they are
767 not already included in the preference list. In addition, the
768 preferred keyserver and signature notations (if any) are shown.
770 @item setpref @code{string}
771 @opindex keyedit:setpref
772 Set the list of user ID preferences to @code{string} for all (or just
773 the selected) user IDs. Calling setpref with no arguments sets the
774 preference list to the default (either built-in or set via
775 @option{--default-preference-list}), and calling setpref with "none"
776 as the argument sets an empty preference list. Use @command{@gpgname
777 --version} to get a list of available algorithms. Note that while you
778 can change the preferences on an attribute user ID (aka "photo ID"),
779 GnuPG does not select keys via attribute user IDs so these preferences
780 will not be used by GnuPG.
782 When setting preferences, you should list the algorithms in the order
783 which you'd like to see them used by someone else when encrypting a
784 message to your key. If you don't include 3DES, it will be
785 automatically added at the end. Note that there are many factors that
786 go into choosing an algorithm (for example, your key may not be the
787 only recipient), and so the remote OpenPGP application being used to
788 send to you may or may not follow your exact chosen order for a given
789 message. It will, however, only choose an algorithm that is present
790 on the preference list of every recipient key. See also the
791 INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS section below.
794 @opindex keyedit:keyserver
795 Set a preferred keyserver for the specified user ID(s). This allows
796 other users to know where you prefer they get your key from. See
797 @option{--keyserver-options honor-keyserver-url} for more on how this
798 works. Setting a value of "none" removes an existing preferred
802 @opindex keyedit:notation
803 Set a name=value notation for the specified user ID(s). See
804 @option{--cert-notation} for more on how this works. Setting a value of
805 "none" removes all notations, setting a notation prefixed with a minus
806 sign (-) removes that notation, and setting a notation name (without the
807 =value) prefixed with a minus sign removes all notations with that name.
810 @opindex keyedit:toggle
811 Toggle between public and secret key listing.
814 @opindex keyedit:clean
815 Compact (by removing all signatures except the selfsig) any user ID
816 that is no longer usable (e.g. revoked, or expired). Then, remove any
817 signatures that are not usable by the trust calculations.
818 Specifically, this removes any signature that does not validate, any
819 signature that is superseded by a later signature, revoked signatures,
820 and signatures issued by keys that are not present on the keyring.
823 @opindex keyedit:minimize
824 Make the key as small as possible. This removes all signatures from
825 each user ID except for the most recent self-signature.
828 @opindex keyedit:cross-certify
829 Add cross-certification signatures to signing subkeys that may not
830 currently have them. Cross-certification signatures protect against a
831 subtle attack against signing subkeys. See
832 @option{--require-cross-certification}.
835 @opindex keyedit:save
836 Save all changes to the key rings and quit.
839 @opindex keyedit:quit
840 Quit the program without updating the
846 The listing shows you the key with its secondary keys and all user
847 ids. Selected keys or user ids are indicated by an asterisk. The trust
848 value is displayed with the primary key: the first is the assigned owner
849 trust and the second is the calculated trust value. Letters are used for
856 No ownertrust assigned / not yet calculated.
860 calculation has failed; probably due to an expired key.
863 Not enough information for calculation.
866 Never trust this key.
877 @c ******** End Edit-key Options **********
879 @item --sign-key @code{name}
881 Signs a public key with your secret key. This is a shortcut version of
882 the subcommand "sign" from @option{--edit}.
884 @item --lsign-key @code{name}
886 Signs a public key with your secret key but marks it as
887 non-exportable. This is a shortcut version of the subcommand "lsign"
888 from @option{--edit-key}.
894 @c *******************************************
895 @c *************** ****************
896 @c *************** OPTIONS ****************
897 @c *************** ****************
898 @c *******************************************
901 @section Option Summary
903 @command{@gpgname} comes features a bunch of options to control the exact
904 behaviour and to change the default configuration.
907 * GPG Configuration Options:: How to change the configuration.
908 * GPG Key related Options:: Key related options.
909 * GPG Input and Output:: Input and Output.
910 * OpenPGP Options:: OpenPGP protocol specific options.
911 * GPG Esoteric Options:: Doing things one usually don't want to do.
914 Long options can be put in an options file (default
915 "~/.gnupg/gpg.conf"). Short option names will not work - for example,
916 "armor" is a valid option for the options file, while "a" is not. Do not
917 write the 2 dashes, but simply the name of the option and any required
918 arguments. Lines with a hash ('#') as the first non-white-space
919 character are ignored. Commands may be put in this file too, but that is
920 not generally useful as the command will execute automatically with
921 every execution of gpg.
923 Please remember that option parsing stops as soon as a non-option is
924 encountered, you can explicitly stop parsing by using the special option
927 @c *******************************************
928 @c ******** CONFIGURATION OPTIONS **********
929 @c *******************************************
930 @node GPG Configuration Options
931 @subsection How to change the configuration
933 These options are used to change the configuration and are usually found
938 @item --default-key @var{name}
940 Use @var{name} as the default key to sign with. If this option is not
941 used, the default key is the first key found in the secret keyring.
942 Note that @option{-u} or @option{--local-user} overrides this option.
944 @item --default-recipient @var{name}
945 @opindex default-recipient
946 Use @var{name} as default recipient if option @option{--recipient} is
947 not used and don't ask if this is a valid one. @var{name} must be
950 @item --default-recipient-self
951 @opindex default-recipient-self
952 Use the default key as default recipient if option @option{--recipient} is not
953 used and don't ask if this is a valid one. The default key is the first
954 one from the secret keyring or the one set with @option{--default-key}.
956 @item --no-default-recipient
957 @opindex no-default-recipient
958 Reset @option{--default-recipient} and @option{--default-recipient-self}.
962 Give more information during processing. If used
963 twice, the input data is listed in detail.
967 Reset verbose level to 0.
971 Try to be as quiet as possible.
977 Use batch mode. Never ask, do not allow interactive commands.
978 @option{--no-batch} disables this option. Note that even with a
979 filename given on the command line, gpg might still need to read from
980 STDIN (in particular if gpg figures that the input is a
981 detached signature and no data file has been specified). Thus if you
982 do not want to feed data via STDIN, you should connect STDIN to
987 Make sure that the TTY (terminal) is never used for any output.
988 This option is needed in some cases because GnuPG sometimes prints
989 warnings to the TTY even if @option{--batch} is used.
993 Assume "yes" on most questions.
997 Assume "no" on most questions.
1000 @item --list-options @code{parameters}
1001 @opindex list-options
1002 This is a space or comma delimited string that gives options used when
1003 listing keys and signatures (that is, @option{--list-keys},
1004 @option{--list-sigs}, @option{--list-public-keys},
1005 @option{--list-secret-keys}, and the @option{--edit-key} functions).
1006 Options can be prepended with a @option{no-} (after the two dashes) to
1007 give the opposite meaning. The options are:
1012 @opindex list-options:show-photos
1013 Causes @option{--list-keys}, @option{--list-sigs},
1014 @option{--list-public-keys}, and @option{--list-secret-keys} to display
1015 any photo IDs attached to the key. Defaults to no. See also
1016 @option{--photo-viewer}.
1018 @item show-policy-urls
1019 @opindex list-options:show-policy-urls
1020 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
1021 listings. Defaults to no.
1023 @item show-notations
1024 @itemx show-std-notations
1025 @itemx show-user-notations
1026 @opindex list-options:show-notations
1027 @opindex list-options:show-std-notations
1028 @opindex list-options:show-user-notations
1029 Show all, IETF standard, or user-defined signature notations in the
1030 @option{--list-sigs} or @option{--check-sigs} listings. Defaults to no.
1032 @item show-keyserver-urls
1034 Show any preferred keyserver URL in the @option{--list-sigs} or
1035 @option{--check-sigs} listings. Defaults to no.
1037 @item show-uid-validity
1038 Display the calculated validity of user IDs during key listings.
1041 @item show-unusable-uids
1042 Show revoked and expired user IDs in key listings. Defaults to no.
1044 @item show-unusable-subkeys
1045 Show revoked and expired subkeys in key listings. Defaults to no.
1048 Display the keyring name at the head of key listings to show which
1049 keyring a given key resides on. Defaults to no.
1051 @item show-sig-expire
1052 Show signature expiration dates (if any) during @option{--list-sigs} or
1053 @option{--check-sigs} listings. Defaults to no.
1055 @item show-sig-subpackets
1056 Include signature subpackets in the key listing. This option can take an
1057 optional argument list of the subpackets to list. If no argument is
1058 passed, list all subpackets. Defaults to no. This option is only
1059 meaningful when using @option{--with-colons} along with
1060 @option{--list-sigs} or @option{--check-sigs}.
1063 @item --verify-options @code{parameters}
1064 This is a space or comma delimited string that gives options used when
1065 verifying signatures. Options can be prepended with a `no-' to give
1066 the opposite meaning. The options are:
1071 Display any photo IDs present on the key that issued the signature.
1072 Defaults to no. See also @option{--photo-viewer}.
1074 @item show-policy-urls
1075 Show policy URLs in the signature being verified. Defaults to no.
1077 @item show-notations
1078 @itemx show-std-notations
1079 @itemx show-user-notations
1080 Show all, IETF standard, or user-defined signature notations in the
1081 signature being verified. Defaults to IETF standard.
1083 @item show-keyserver-urls
1084 Show any preferred keyserver URL in the signature being verified.
1087 @item show-uid-validity
1088 Display the calculated validity of the user IDs on the key that issued
1089 the signature. Defaults to no.
1091 @item show-unusable-uids
1092 Show revoked and expired user IDs during signature verification.
1095 @item show-primary-uid-only
1096 Show only the primary user ID during signature verification. That is
1097 all the AKA lines as well as photo Ids are not shown with the signature
1098 verification status.
1101 Enable PKA lookups to verify sender addresses. Note that PKA is based
1102 on DNS, and so enabling this option may disclose information on when
1103 and what signatures are verified or to whom data is encrypted. This
1104 is similar to the "web bug" described for the auto-key-retrieve
1107 @item pka-trust-increase
1108 Raise the trust in a signature to full if the signature passes PKA
1109 validation. This option is only meaningful if pka-lookups is set.
1113 @itemx --disable-dsa2
1114 Enable hash truncation for all DSA keys even for old DSA Keys up to
1115 1024 bit. This is also the default with @option{--openpgp}. Note
1116 that older versions of GnuPG also required this flag to allow the
1117 generation of DSA larger than 1024 bit.
1119 @item --photo-viewer @code{string}
1120 This is the command line that should be run to view a photo ID. "%i"
1121 will be expanded to a filename containing the photo. "%I" does the
1122 same, except the file will not be deleted once the viewer exits.
1123 Other flags are "%k" for the key ID, "%K" for the long key ID, "%f"
1124 for the key fingerprint, "%t" for the extension of the image type
1125 (e.g. "jpg"), "%T" for the MIME type of the image (e.g. "image/jpeg"),
1126 and "%%" for an actual percent sign. If neither %i or %I are present,
1127 then the photo will be supplied to the viewer on standard input.
1129 The default viewer is "xloadimage -fork -quiet -title 'KeyID 0x%k'
1130 STDIN". Note that if your image viewer program is not secure, then
1131 executing it from GnuPG does not make it secure.
1133 @item --exec-path @code{string}
1134 Sets a list of directories to search for photo viewers and keyserver
1135 helpers. If not provided, keyserver helpers use the compiled-in
1136 default directory, and photo viewers use the $PATH environment
1138 Note, that on W32 system this value is ignored when searching for
1141 @item --keyring @code{file}
1142 Add @code{file} to the current list of keyrings. If @code{file} begins
1143 with a tilde and a slash, these are replaced by the $HOME directory. If
1144 the filename does not contain a slash, it is assumed to be in the GnuPG
1145 home directory ("~/.gnupg" if @option{--homedir} or $GNUPGHOME is not
1148 Note that this adds a keyring to the current list. If the intent is to
1149 use the specified keyring alone, use @option{--keyring} along with
1150 @option{--no-default-keyring}.
1152 @item --secret-keyring @code{file}
1153 Same as @option{--keyring} but for the secret keyrings.
1155 @item --primary-keyring @code{file}
1156 Designate @code{file} as the primary public keyring. This means that
1157 newly imported keys (via @option{--import} or keyserver
1158 @option{--recv-from}) will go to this keyring.
1160 @item --trustdb-name @code{file}
1161 Use @code{file} instead of the default trustdb. If @code{file} begins
1162 with a tilde and a slash, these are replaced by the $HOME directory. If
1163 the filename does not contain a slash, it is assumed to be in the GnuPG
1164 home directory (@file{~/.gnupg} if @option{--homedir} or $GNUPGHOME is
1168 @anchor{option --homedir}
1170 @include opt-homedir.texi
1174 @item --pcsc-driver @code{file}
1175 Use @code{file} to access the smartcard reader. The current default is
1176 `libpcsclite.so.1' for GLIBC based systems,
1177 `/System/Library/Frameworks/PCSC.framework/PCSC' for MAC OS X,
1178 `winscard.dll' for Windows and `libpcsclite.so' for other systems.
1182 @item --disable-ccid
1183 Disable the integrated support for CCID compliant readers. This
1184 allows to fall back to one of the other drivers even if the internal
1185 CCID driver can handle the reader. Note, that CCID support is only
1186 available if libusb was available at build time.
1190 @item --reader-port @code{number_or_string}
1191 This option may be used to specify the port of the card terminal. A
1192 value of 0 refers to the first serial device; add 32768 to access USB
1193 devices. The default is 32768 (first USB device). PC/SC or CCID
1194 readers might need a string here; run the program in verbose mode to get
1195 a list of available readers. The default is then the first reader
1199 @item --display-charset @code{name}
1200 Set the name of the native character set. This is used to convert
1201 some informational strings like user IDs to the proper UTF-8 encoding.
1202 Note that this has nothing to do with the character set of data to be
1203 encrypted or signed; GnuPG does not recode user-supplied data. If
1204 this option is not used, the default character set is determined from
1205 the current locale. A verbosity level of 3 shows the chosen set.
1206 Valid values for @code{name} are:
1211 This is the Latin 1 set.
1217 This is currently an alias for
1221 The usual Russian set (rfc1489).
1224 Bypass all translations and assume
1225 that the OS uses native UTF-8 encoding.
1228 @item --utf8-strings
1229 @itemx --no-utf8-strings
1230 Assume that command line arguments are given as UTF8 strings. The
1231 default (@option{--no-utf8-strings}) is to assume that arguments are
1232 encoded in the character set as specified by
1233 @option{--display-charset}. These options affect all following
1234 arguments. Both options may be used multiple times.
1237 @anchor{option --options}
1239 @item --options @code{file}
1240 Read options from @code{file} and do not try to read them from the
1241 default options file in the homedir (see @option{--homedir}). This
1242 option is ignored if used in an options file.
1245 Shortcut for @option{--options /dev/null}. This option is detected
1246 before an attempt to open an option file. Using this option will also
1247 prevent the creation of a @file{~/.gnupg} homedir.
1252 @itemx --compress-level @code{n}
1253 @itemx --bzip2-compress-level @code{n}
1254 Set compression level to @code{n} for the ZIP and ZLIB compression
1255 algorithms. The default is to use the default compression level of zlib
1256 (normally 6). @option{--bzip2-compress-level} sets the compression level
1257 for the BZIP2 compression algorithm (defaulting to 6 as well). This is a
1258 different option from @option{--compress-level} since BZIP2 uses a
1259 significant amount of memory for each additional compression level.
1260 @option{-z} sets both. A value of 0 for @code{n} disables compression.
1262 @item --bzip2-decompress-lowmem
1263 Use a different decompression method for BZIP2 compressed files. This
1264 alternate method uses a bit more than half the memory, but also runs
1265 at half the speed. This is useful under extreme low memory
1266 circumstances when the file was originally compressed at a high
1267 @option{--bzip2-compress-level}.
1270 @item --mangle-dos-filenames
1271 @itemx --no-mangle-dos-filenames
1272 @opindex mangle-dos-filenames
1273 @opindex no-mangle-dos-filenames
1274 Older version of Windows cannot handle filenames with more than one
1275 dot. @option{--mangle-dos-filenames} causes GnuPG to replace (rather
1276 than add to) the extension of an output filename to avoid this
1277 problem. This option is off by default and has no effect on non-Windows
1280 @item --ask-cert-level
1281 @itemx --no-ask-cert-level
1282 When making a key signature, prompt for a certification level. If this
1283 option is not specified, the certification level used is set via
1284 @option{--default-cert-level}. See @option{--default-cert-level} for
1285 information on the specific levels and how they are
1286 used. @option{--no-ask-cert-level} disables this option. This option
1289 @item --default-cert-level @code{n}
1290 The default to use for the check level when signing a key.
1292 0 means you make no particular claim as to how carefully you verified
1295 1 means you believe the key is owned by the person who claims to own
1296 it but you could not, or did not verify the key at all. This is
1297 useful for a "persona" verification, where you sign the key of a
1300 2 means you did casual verification of the key. For example, this
1301 could mean that you verified that the key fingerprint and checked the
1302 user ID on the key against a photo ID.
1304 3 means you did extensive verification of the key. For example, this
1305 could mean that you verified the key fingerprint with the owner of the
1306 key in person, and that you checked, by means of a hard to forge
1307 document with a photo ID (such as a passport) that the name of the key
1308 owner matches the name in the user ID on the key, and finally that you
1309 verified (by exchange of email) that the email address on the key
1310 belongs to the key owner.
1312 Note that the examples given above for levels 2 and 3 are just that:
1313 examples. In the end, it is up to you to decide just what "casual"
1314 and "extensive" mean to you.
1316 This option defaults to 0 (no particular claim).
1318 @item --min-cert-level
1319 When building the trust database, treat any signatures with a
1320 certification level below this as invalid. Defaults to 2, which
1321 disregards level 1 signatures. Note that level 0 "no particular
1322 claim" signatures are always accepted.
1324 @item --trusted-key @code{long key ID}
1325 Assume that the specified key (which must be given
1326 as a full 8 byte key ID) is as trustworthy as one of
1327 your own secret keys. This option is useful if you
1328 don't want to keep your secret keys (or one of them)
1329 online but still want to be able to check the validity of a given
1330 recipient's or signator's key.
1332 @item --trust-model @code{pgp|classic|direct|always|auto}
1333 Set what trust model GnuPG should follow. The models are:
1338 This is the Web of Trust combined with trust signatures as used in PGP
1339 5.x and later. This is the default trust model when creating a new
1343 This is the standard Web of Trust as used in PGP 2.x and earlier.
1346 Key validity is set directly by the user and not calculated via the
1350 Skip key validation and assume that used keys are always fully
1351 trusted. You generally won't use this unless you are using some
1352 external validation scheme. This option also suppresses the
1353 "[uncertain]" tag printed with signature checks when there is no
1354 evidence that the user ID is bound to the key.
1357 Select the trust model depending on whatever the internal trust
1358 database says. This is the default model if such a database already
1362 @item --auto-key-locate @code{parameters}
1363 @itemx --no-auto-key-locate
1364 GnuPG can automatically locate and retrieve keys as needed using this
1365 option. This happens when encrypting to an email address (in the
1366 "user@@example.com" form), and there are no user@@example.com keys on
1367 the local keyring. This option takes any number of the following
1368 mechanisms, in the order they are to be tried:
1373 Locate a key using DNS CERT, as specified in rfc4398.
1376 Locate a key using DNS PKA.
1379 Using DNS Service Discovery, check the domain in question for any LDAP
1380 keyservers to use. If this fails, attempt to locate the key using the
1381 PGP Universal method of checking @samp{ldap://keys.(thedomain)}.
1384 Locate a key using whatever keyserver is defined using the
1385 @option{--keyserver} option.
1388 In addition, a keyserver URL as used in the @option{--keyserver} option
1389 may be used here to query that particular keyserver.
1392 Locate the key using the local keyrings. This mechanism allows to
1393 select the order a local key lookup is done. Thus using
1394 @samp{--auto-key-locate local} is identical to
1395 @option{--no-auto-key-locate}.
1398 This flag disables the standard local key lookup, done before any of the
1399 mechanisms defined by the @option{--auto-key-locate} are tried. The
1400 position of this mechanism in the list does not matter. It is not
1401 required if @code{local} is also used.
1405 @item --keyid-format @code{short|0xshort|long|0xlong}
1406 Select how to display key IDs. "short" is the traditional 8-character
1407 key ID. "long" is the more accurate (but less convenient)
1408 16-character key ID. Add an "0x" to either to include an "0x" at the
1409 beginning of the key ID, as in 0x99242560.
1411 @item --keyserver @code{name}
1412 Use @code{name} as your keyserver. This is the server that
1413 @option{--recv-keys}, @option{--send-keys}, and @option{--search-keys}
1414 will communicate with to receive keys from, send keys to, and search for
1415 keys on. The format of the @code{name} is a URI:
1416 `scheme:[//]keyservername[:port]' The scheme is the type of keyserver:
1417 "hkp" for the HTTP (or compatible) keyservers, "ldap" for the LDAP
1418 keyservers, or "mailto" for the Graff email keyserver. Note that your
1419 particular installation of GnuPG may have other keyserver types
1420 available as well. Keyserver schemes are case-insensitive. After the
1421 keyserver name, optional keyserver configuration options may be
1422 provided. These are the same as the global @option{--keyserver-options}
1423 from below, but apply only to this particular keyserver.
1425 Most keyservers synchronize with each other, so there is generally no
1426 need to send keys to more than one server. The keyserver
1427 @code{hkp://keys.gnupg.net} uses round robin DNS to give a different
1428 keyserver each time you use it.
1430 @item --keyserver-options @code{name=value1 }
1431 This is a space or comma delimited string that gives options for the
1432 keyserver. Options can be prepended with a `no-' to give the opposite
1433 meaning. Valid import-options or export-options may be used here as well
1434 to apply to importing (@option{--recv-key}) or exporting
1435 (@option{--send-key}) a key from a keyserver. While not all options are
1436 available for all keyserver types, some common options are:
1440 @item include-revoked
1441 When searching for a key with @option{--search-keys}, include keys that
1442 are marked on the keyserver as revoked. Note that not all keyservers
1443 differentiate between revoked and unrevoked keys, and for such
1444 keyservers this option is meaningless. Note also that most keyservers do
1445 not have cryptographic verification of key revocations, and so turning
1446 this option off may result in skipping keys that are incorrectly marked
1449 @item include-disabled
1450 When searching for a key with @option{--search-keys}, include keys that
1451 are marked on the keyserver as disabled. Note that this option is not
1452 used with HKP keyservers.
1454 @item auto-key-retrieve
1455 This option enables the automatic retrieving of keys from a keyserver
1456 when verifying signatures made by keys that are not on the local
1459 Note that this option makes a "web bug" like behavior possible.
1460 Keyserver operators can see which keys you request, so by sending you
1461 a message signed by a brand new key (which you naturally will not have
1462 on your local keyring), the operator can tell both your IP address and
1463 the time when you verified the signature.
1465 @item honor-keyserver-url
1466 When using @option{--refresh-keys}, if the key in question has a preferred
1467 keyserver URL, then use that preferred keyserver to refresh the key
1468 from. In addition, if auto-key-retrieve is set, and the signature
1469 being verified has a preferred keyserver URL, then use that preferred
1470 keyserver to fetch the key from. Defaults to yes.
1472 @item honor-pka-record
1473 If auto-key-retrieve is set, and the signature being verified has a
1474 PKA record, then use the PKA information to fetch the key. Defaults
1477 @item include-subkeys
1478 When receiving a key, include subkeys as potential targets. Note that
1479 this option is not used with HKP keyservers, as they do not support
1480 retrieving keys by subkey id.
1482 @item use-temp-files
1483 On most Unix-like platforms, GnuPG communicates with the keyserver
1484 helper program via pipes, which is the most efficient method. This
1485 option forces GnuPG to use temporary files to communicate. On some
1486 platforms (such as Win32 and RISC OS), this option is always enabled.
1488 @item keep-temp-files
1489 If using `use-temp-files', do not delete the temp files after using
1490 them. This option is useful to learn the keyserver communication
1491 protocol by reading the temporary files.
1494 Tell the keyserver helper program to be more verbose. This option can
1495 be repeated multiple times to increase the verbosity level.
1498 Tell the keyserver helper program how long (in seconds) to try and
1499 perform a keyserver action before giving up. Note that performing
1500 multiple actions at the same time uses this timeout value per action.
1501 For example, when retrieving multiple keys via @option{--recv-keys}, the
1502 timeout applies separately to each key retrieval, and not to the
1503 @option{--recv-keys} command as a whole. Defaults to 30 seconds.
1505 @item http-proxy=@code{value}
1506 Set the proxy to use for HTTP and HKP keyservers. This overrides the
1507 "http_proxy" environment variable, if any.
1510 When retrieving a key via DNS CERT, only accept keys up to this size.
1511 Defaults to 16384 bytes.
1514 Turn on debug output in the keyserver helper program. Note that the
1515 details of debug output depends on which keyserver helper program is
1516 being used, and in turn, on any libraries that the keyserver helper
1517 program uses internally (libcurl, openldap, etc).
1520 @item --completes-needed @code{n}
1521 Number of completely trusted users to introduce a new
1522 key signer (defaults to 1).
1524 @item --marginals-needed @code{n}
1525 Number of marginally trusted users to introduce a new
1526 key signer (defaults to 3)
1528 @item --max-cert-depth @code{n}
1529 Maximum depth of a certification chain (default is 5).
1531 @item --simple-sk-checksum
1532 Secret keys are integrity protected by using a SHA-1 checksum. This
1533 method is part of the upcoming enhanced OpenPGP specification but
1534 GnuPG already uses it as a countermeasure against certain attacks.
1535 Old applications don't understand this new format, so this option may
1536 be used to switch back to the old behaviour. Using this option bears
1537 a security risk. Note that using this option only takes effect when
1538 the secret key is encrypted - the simplest way to make this happen is
1539 to change the passphrase on the key (even changing it to the same
1540 value is acceptable).
1542 @item --no-sig-cache
1543 Do not cache the verification status of key signatures.
1544 Caching gives a much better performance in key listings. However, if
1545 you suspect that your public keyring is not save against write
1546 modifications, you can use this option to disable the caching. It
1547 probably does not make sense to disable it because all kind of damage
1548 can be done if someone else has write access to your public keyring.
1550 @item --no-sig-create-check
1551 GnuPG normally verifies each signature right after creation to protect
1552 against bugs and hardware malfunctions which could leak out bits from
1553 the secret key. This extra verification needs some time (about 115%
1554 for DSA keys), and so this option can be used to disable it.
1555 However, due to the fact that the signature creation needs manual
1556 interaction, this performance penalty does not matter in most settings.
1558 @item --auto-check-trustdb
1559 @itemx --no-auto-check-trustdb
1560 If GnuPG feels that its information about the Web of Trust has to be
1561 updated, it automatically runs the @option{--check-trustdb} command
1562 internally. This may be a time consuming
1563 process. @option{--no-auto-check-trustdb} disables this option.
1566 @itemx --no-use-agent
1568 This is dummy option. @command{@gpgname} always requires the agent.
1571 Try to use the GnuPG-Agent. With this option, GnuPG first tries to
1572 connect to the agent before it asks for a
1573 passphrase. @option{--no-use-agent} disables this option.
1576 @item --gpg-agent-info
1578 This is dummy option. It has no effect when used with @command{gpg2}.
1581 Override the value of the environment variable
1582 @samp{GPG_AGENT_INFO}. This is only used when @option{--use-agent} has
1583 been given. Given that this option is not anymore used by
1584 @command{gpg2}, it should be avoided if possible.
1588 Lock the databases the first time a lock is requested
1589 and do not release the lock until the process
1592 @item --lock-multiple
1593 Release the locks every time a lock is no longer
1594 needed. Use this to override a previous @option{--lock-once}
1598 Disable locking entirely. This option should be used only in very
1599 special environments, where it can be assured that only one process
1600 is accessing those files. A bootable floppy with a stand-alone
1601 encryption system will probably use this. Improper usage of this
1602 option may lead to data and key corruption.
1604 @item --exit-on-status-write-error
1605 This option will cause write errors on the status FD to immediately
1606 terminate the process. That should in fact be the default but it never
1607 worked this way and thus we need an option to enable this, so that the
1608 change won't break applications which close their end of a status fd
1609 connected pipe too early. Using this option along with
1610 @option{--enable-progress-filter} may be used to cleanly cancel long
1611 running gpg operations.
1613 @item --limit-card-insert-tries @code{n}
1614 With @code{n} greater than 0 the number of prompts asking to insert a
1615 smartcard gets limited to N-1. Thus with a value of 1 gpg won't at
1616 all ask to insert a card if none has been inserted at startup. This
1617 option is useful in the configuration file in case an application does
1618 not know about the smartcard support and waits ad infinitum for an
1621 @item --no-random-seed-file
1622 GnuPG uses a file to store its internal random pool over invocations.
1623 This makes random generation faster; however sometimes write operations
1624 are not desired. This option can be used to achieve that with the cost of
1625 slower random generation.
1628 Suppress the initial copyright message.
1630 @item --no-secmem-warning
1631 Suppress the warning about "using insecure memory".
1633 @item --no-permission-warning
1634 Suppress the warning about unsafe file and home directory (@option{--homedir})
1635 permissions. Note that the permission checks that GnuPG performs are
1636 not intended to be authoritative, but rather they simply warn about
1637 certain common permission problems. Do not assume that the lack of a
1638 warning means that your system is secure.
1640 Note that the warning for unsafe @option{--homedir} permissions cannot be
1641 suppressed in the gpg.conf file, as this would allow an attacker to
1642 place an unsafe gpg.conf file in place, and use this file to suppress
1643 warnings about itself. The @option{--homedir} permissions warning may only be
1644 suppressed on the command line.
1646 @item --no-mdc-warning
1647 Suppress the warning about missing MDC integrity protection.
1649 @item --require-secmem
1650 @itemx --no-require-secmem
1651 Refuse to run if GnuPG cannot get secure memory. Defaults to no
1652 (i.e. run, but give a warning).
1655 @item --require-cross-certification
1656 @itemx --no-require-cross-certification
1657 When verifying a signature made from a subkey, ensure that the cross
1658 certification "back signature" on the subkey is present and valid. This
1659 protects against a subtle attack against subkeys that can sign.
1660 Defaults to @option{--require-cross-certification} for
1665 Allow the user to do certain nonsensical or "silly" things like
1666 signing an expired or revoked key, or certain potentially incompatible
1667 things like generating unusual key types. This also disables certain
1668 warning messages about potentially incompatible actions. As the name
1669 implies, this option is for experts only. If you don't fully
1670 understand the implications of what it allows you to do, leave this
1671 off. @option{--no-expert} disables this option.
1679 @c *******************************************
1680 @c ******** KEY RELATED OPTIONS ************
1681 @c *******************************************
1682 @node GPG Key related Options
1683 @subsection Key related options
1687 @item --recipient @var{name}
1690 Encrypt for user id @var{name}. If this option or
1691 @option{--hidden-recipient} is not specified, GnuPG asks for the user-id
1692 unless @option{--default-recipient} is given.
1694 @item --hidden-recipient @var{name}
1696 @opindex hidden-recipient
1697 Encrypt for user ID @var{name}, but hide the key ID of this user's
1698 key. This option helps to hide the receiver of the message and is a
1699 limited countermeasure against traffic analysis. If this option or
1700 @option{--recipient} is not specified, GnuPG asks for the user ID unless
1701 @option{--default-recipient} is given.
1703 @item --encrypt-to @code{name}
1704 Same as @option{--recipient} but this one is intended for use in the
1705 options file and may be used with your own user-id as an
1706 "encrypt-to-self". These keys are only used when there are other
1707 recipients given either by use of @option{--recipient} or by the asked
1708 user id. No trust checking is performed for these user ids and even
1709 disabled keys can be used.
1711 @item --hidden-encrypt-to @code{name}
1712 Same as @option{--hidden-recipient} but this one is intended for use in the
1713 options file and may be used with your own user-id as a hidden
1714 "encrypt-to-self". These keys are only used when there are other
1715 recipients given either by use of @option{--recipient} or by the asked user id.
1716 No trust checking is performed for these user ids and even disabled
1719 @item --no-encrypt-to
1720 Disable the use of all @option{--encrypt-to} and
1721 @option{--hidden-encrypt-to} keys.
1723 @item --group @code{name=value1 }
1724 Sets up a named group, which is similar to aliases in email programs.
1725 Any time the group name is a recipient (@option{-r} or
1726 @option{--recipient}), it will be expanded to the values
1727 specified. Multiple groups with the same name are automatically merged
1728 into a single group.
1730 The values are @code{key IDs} or fingerprints, but any key description
1731 is accepted. Note that a value with spaces in it will be treated as
1732 two different values. Note also there is only one level of expansion
1733 --- you cannot make an group that points to another group. When used
1734 from the command line, it may be necessary to quote the argument to
1735 this option to prevent the shell from treating it as multiple
1738 @item --ungroup @code{name}
1739 Remove a given entry from the @option{--group} list.
1742 Remove all entries from the @option{--group} list.
1744 @item --local-user @var{name}
1747 Use @var{name} as the key to sign with. Note that this option overrides
1748 @option{--default-key}.
1750 @item --try-all-secrets
1751 Don't look at the key ID as stored in the message but try all secret
1752 keys in turn to find the right decryption key. This option forces the
1753 behaviour as used by anonymous recipients (created by using
1754 @option{--throw-keyids}) and might come handy in case where an encrypted
1755 message contains a bogus key ID.
1763 @c *******************************************
1764 @c ******** INPUT AND OUTPUT ***************
1765 @c *******************************************
1766 @node GPG Input and Output
1767 @subsection Input and Output
1774 Create ASCII armored output. The default is to create the binary
1778 Assume the input data is not in ASCII armored format.
1780 @item --output @var{file}
1781 @itemx -o @var{file}
1783 Write output to @var{file}.
1785 @item --max-output @code{n}
1787 This option sets a limit on the number of bytes that will be generated
1788 when processing a file. Since OpenPGP supports various levels of
1789 compression, it is possible that the plaintext of a given message may be
1790 significantly larger than the original OpenPGP message. While GnuPG
1791 works properly with such messages, there is often a desire to set a
1792 maximum file size that will be generated before processing is forced to
1793 stop by the OS limits. Defaults to 0, which means "no limit".
1795 @item --import-options @code{parameters}
1796 This is a space or comma delimited string that gives options for
1797 importing keys. Options can be prepended with a `no-' to give the
1798 opposite meaning. The options are:
1802 @item import-local-sigs
1803 Allow importing key signatures marked as "local". This is not
1804 generally useful unless a shared keyring scheme is being used.
1807 @item repair-pks-subkey-bug
1808 During import, attempt to repair the damage caused by the PKS keyserver
1809 bug (pre version 0.9.6) that mangles keys with multiple subkeys. Note
1810 that this cannot completely repair the damaged key as some crucial data
1811 is removed by the keyserver, but it does at least give you back one
1812 subkey. Defaults to no for regular @option{--import} and to yes for
1813 keyserver @option{--recv-keys}.
1816 During import, allow key updates to existing keys, but do not allow
1817 any new keys to be imported. Defaults to no.
1820 After import, compact (remove all signatures except the
1821 self-signature) any user IDs from the new key that are not usable.
1822 Then, remove any signatures from the new key that are not usable.
1823 This includes signatures that were issued by keys that are not present
1824 on the keyring. This option is the same as running the @option{--edit-key}
1825 command "clean" after import. Defaults to no.
1827 @item import-minimal
1828 Import the smallest key possible. This removes all signatures except
1829 the most recent self-signature on each user ID. This option is the
1830 same as running the @option{--edit-key} command "minimize" after import.
1834 @item --export-options @code{parameters}
1835 This is a space or comma delimited string that gives options for
1836 exporting keys. Options can be prepended with a `no-' to give the
1837 opposite meaning. The options are:
1841 @item export-local-sigs
1842 Allow exporting key signatures marked as "local". This is not
1843 generally useful unless a shared keyring scheme is being used.
1846 @item export-attributes
1847 Include attribute user IDs (photo IDs) while exporting. This is
1848 useful to export keys if they are going to be used by an OpenPGP
1849 program that does not accept attribute user IDs. Defaults to yes.
1851 @item export-sensitive-revkeys
1852 Include designated revoker information that was marked as
1853 "sensitive". Defaults to no.
1855 @item export-reset-subkey-passwd
1856 When using the @option{--export-secret-subkeys} command, this option resets
1857 the passphrases for all exported subkeys to empty. This is useful
1858 when the exported subkey is to be used on an unattended machine where
1859 a passphrase doesn't necessarily make sense. Defaults to no.
1862 Compact (remove all signatures from) user IDs on the key being
1863 exported if the user IDs are not usable. Also, do not export any
1864 signatures that are not usable. This includes signatures that were
1865 issued by keys that are not present on the keyring. This option is
1866 the same as running the @option{--edit-key} command "clean" before export
1867 except that the local copy of the key is not modified. Defaults to
1870 @item export-minimal
1871 Export the smallest key possible. This removes all signatures except the
1872 most recent self-signature on each user ID. This option is the same as
1873 running the @option{--edit-key} command "minimize" before export except
1874 that the local copy of the key is not modified. Defaults to no.
1878 @opindex with-colons
1879 Print key listings delimited by colons. Note that the output will be
1880 encoded in UTF-8 regardless of any @option{--display-charset} setting. This
1881 format is useful when GnuPG is called from scripts and other programs
1882 as it is easily machine parsed. The details of this format are
1883 documented in the file @file{doc/DETAILS}, which is included in the GnuPG
1884 source distribution.
1886 @item --fixed-list-mode
1887 @opindex fixed-list-mode
1888 Do not merge primary user ID and primary key in @option{--with-colon}
1889 listing mode and print all timestamps as seconds since 1970-01-01.
1891 Since GnuPG 2.0.10, this mode is always used and thus this option is
1892 obsolete; it does not harm to use it though.
1895 @item --with-fingerprint
1896 @opindex with-fingerprint
1897 Same as the command @option{--fingerprint} but changes only the format
1898 of the output and may be used together with another command.
1903 @c *******************************************
1904 @c ******** OPENPGP OPTIONS ****************
1905 @c *******************************************
1906 @node OpenPGP Options
1907 @subsection OpenPGP protocol specific options.
1911 @item -t, --textmode
1912 @itemx --no-textmode
1913 Treat input files as text and store them in the OpenPGP canonical text
1914 form with standard "CRLF" line endings. This also sets the necessary
1915 flags to inform the recipient that the encrypted or signed data is text
1916 and may need its line endings converted back to whatever the local
1917 system uses. This option is useful when communicating between two
1918 platforms that have different line ending conventions (UNIX-like to Mac,
1919 Mac to Windows, etc). @option{--no-textmode} disables this option, and
1923 If @option{-t} (but not @option{--textmode}) is used together with
1924 armoring and signing, this enables clearsigned messages. This kludge is
1925 needed for command-line compatibility with command-line versions of PGP;
1926 normally you would use @option{--sign} or @option{--clearsign} to select
1927 the type of the signature.
1930 @item --force-v3-sigs
1931 @itemx --no-force-v3-sigs
1932 OpenPGP states that an implementation should generate v4 signatures
1933 but PGP versions 5 through 7 only recognize v4 signatures on key
1934 material. This option forces v3 signatures for signatures on data.
1935 Note that this option implies @option{--ask-sig-expire},
1936 @option{--sig-policy-url}, @option{--sig-notation}, and
1937 @option{--sig-keyserver-url}, as these features cannot be used with v3
1938 signatures. @option{--no-force-v3-sigs} disables this option.
1940 @item --force-v4-certs
1941 @itemx --no-force-v4-certs
1942 Always use v4 key signatures even on v3 keys. This option also
1943 changes the default hash algorithm for v3 RSA keys from MD5 to SHA-1.
1944 @option{--no-force-v4-certs} disables this option.
1947 Force the use of encryption with a modification detection code. This
1948 is always used with the newer ciphers (those with a blocksize greater
1949 than 64 bits), or if all of the recipient keys indicate MDC support in
1950 their feature flags.
1953 Disable the use of the modification detection code. Note that by
1954 using this option, the encrypted message becomes vulnerable to a
1955 message modification attack.
1957 @item --personal-cipher-preferences @code{string}
1958 Set the list of personal cipher preferences to @code{string}. Use
1959 @command{@gpgname --version} to get a list of available algorithms,
1960 and use @code{none} to set no preference at all. This allows the user
1961 to factor in their own preferred algorithms when algorithms are chosen
1962 via recipient key preferences. The most highly ranked cipher in this
1963 list is also used for the @option{--symmetric} encryption command.
1965 @item --personal-digest-preferences @code{string}
1966 Set the list of personal digest preferences to @code{string}. Use
1967 @command{@gpgname --version} to get a list of available algorithms,
1968 and use @code{none} to set no preference at all. This allows the user
1969 to factor in their own preferred algorithms when algorithms are chosen
1970 via recipient key preferences. The most highly ranked digest
1971 algorithm in this list is also used when signing without encryption
1972 (e.g. @option{--clearsign} or @option{--sign}). The default value is
1975 @item --personal-compress-preferences @code{string}
1976 Set the list of personal compression preferences to @code{string}.
1977 Use @command{@gpgname --version} to get a list of available
1978 algorithms, and use @code{none} to set no preference at all. This
1979 allows the user to factor in their own preferred algorithms when
1980 algorithms are chosen via recipient key preferences. The most highly
1981 ranked compression algorithm in this list is also used when there are
1982 no recipient keys to consider (e.g. @option{--symmetric}).
1984 @item --s2k-cipher-algo @code{name}
1985 Use @code{name} as the cipher algorithm used to protect secret keys.
1986 The default cipher is CAST5. This cipher is also used for
1987 conventional encryption if @option{--personal-cipher-preferences} and
1988 @option{--cipher-algo} is not given.
1990 @item --s2k-digest-algo @code{name}
1991 Use @code{name} as the digest algorithm used to mangle the passphrases.
1992 The default algorithm is SHA-1.
1994 @item --s2k-mode @code{n}
1995 Selects how passphrases are mangled. If @code{n} is 0 a plain
1996 passphrase (which is not recommended) will be used, a 1 adds a salt to
1997 the passphrase and a 3 (the default) iterates the whole process a
1998 number of times (see --s2k-count). Unless @option{--rfc1991} is used,
1999 this mode is also used for conventional encryption.
2001 @item --s2k-count @code{n}
2002 Specify how many times the passphrase mangling is repeated. This
2003 value may range between 1024 and 65011712 inclusive, and the default
2004 is 65536. Note that not all values in the 1024-65011712 range are
2005 legal and if an illegal value is selected, GnuPG will round up to the
2006 nearest legal value. This option is only meaningful if
2007 @option{--s2k-mode} is 3.
2012 @c ***************************
2013 @c ******* Compliance ********
2014 @c ***************************
2015 @subsection Compliance options
2017 These options control what GnuPG is compliant to. Only one of these
2018 options may be active at a time. Note that the default setting of
2019 this is nearly always the correct one. See the INTEROPERABILITY WITH
2020 OTHER OPENPGP PROGRAMS section below before using one of these
2027 Use standard GnuPG behavior. This is essentially OpenPGP behavior
2028 (see @option{--openpgp}), but with some additional workarounds for common
2029 compatibility problems in different versions of PGP. This is the
2030 default option, so it is not generally needed, but it may be useful to
2031 override a different compliance option in the gpg.conf file.
2035 Reset all packet, cipher and digest options to strict OpenPGP
2036 behavior. Use this option to reset all previous options like
2037 @option{--s2k-*}, @option{--cipher-algo}, @option{--digest-algo} and
2038 @option{--compress-algo} to OpenPGP compliant values. All PGP
2039 workarounds are disabled.
2043 Reset all packet, cipher and digest options to strict RFC-4880
2044 behavior. Note that this is currently the same thing as
2049 Reset all packet, cipher and digest options to strict RFC-2440
2054 Try to be more RFC-1991 (PGP 2.x) compliant.
2058 Set up all options to be as PGP 2.x compliant as possible, and warn if
2059 an action is taken (e.g. encrypting to a non-RSA key) that will create
2060 a message that PGP 2.x will not be able to handle. Note that `PGP
2061 2.x' here means `MIT PGP 2.6.2'. There are other versions of PGP 2.x
2062 available, but the MIT release is a good common baseline.
2064 This option implies @option{--rfc1991 --disable-mdc
2065 --no-force-v4-certs --escape-from-lines --force-v3-sigs --cipher-algo
2066 IDEA --digest-algo MD5 --compress-algo ZIP}. It also disables
2067 @option{--textmode} when encrypting.
2071 Set up all options to be as PGP 6 compliant as possible. This
2072 restricts you to the ciphers IDEA (if the IDEA plugin is installed),
2073 3DES, and CAST5, the hashes MD5, SHA1 and RIPEMD160, and the
2074 compression algorithms none and ZIP. This also disables
2075 --throw-keyids, and making signatures with signing subkeys as PGP 6
2076 does not understand signatures made by signing subkeys.
2078 This option implies @option{--disable-mdc --escape-from-lines
2083 Set up all options to be as PGP 7 compliant as possible. This is
2084 identical to @option{--pgp6} except that MDCs are not disabled, and the
2085 list of allowable ciphers is expanded to add AES128, AES192, AES256, and
2090 Set up all options to be as PGP 8 compliant as possible. PGP 8 is a lot
2091 closer to the OpenPGP standard than previous versions of PGP, so all
2092 this does is disable @option{--throw-keyids} and set
2093 @option{--escape-from-lines}. All algorithms are allowed except for the
2094 SHA224, SHA384, and SHA512 digests.
2099 @c *******************************************
2100 @c ******** ESOTERIC OPTIONS ***************
2101 @c *******************************************
2102 @node GPG Esoteric Options
2103 @subsection Doing things one usually doesn't want to do.
2110 Don't make any changes (this is not completely implemented).
2113 Changes the behaviour of some commands. This is like @option{--dry-run} but
2114 different in some cases. The semantic of this command may be extended in
2115 the future. Currently it only skips the actual decryption pass and
2116 therefore enables a fast listing of the encryption keys.
2119 @itemx --interactive
2120 @opindex interactive
2121 Prompt before overwriting any files.
2123 @item --debug @var{flags}
2125 Set debugging flags. All flags are or-ed and @var{flags} may
2126 be given in C syntax (e.g. 0x0042).
2129 Set all useful debugging flags.
2132 @item --debug-ccid-driver
2133 Enable debug output from the included CCID driver for smartcards.
2134 Note that this option is only available on some system.
2137 @item --enable-progress-filter
2138 Enable certain PROGRESS status outputs. This option allows frontends
2139 to display a progress indicator while gpg is processing larger files.
2140 There is a slight performance overhead using it.
2142 @item --status-fd @code{n}
2143 Write special status strings to the file descriptor @code{n}.
2144 See the file DETAILS in the documentation for a listing of them.
2146 @item --status-file @code{file}
2147 Same as @option{--status-fd}, except the status data is written to file
2150 @item --logger-fd @code{n}
2151 Write log output to file descriptor @code{n} and not to STDERR.
2153 @item --log-file @code{file}
2154 @itemx --logger-file @code{file}
2155 Same as @option{--logger-fd}, except the logger data is written to file
2156 @code{file}. Note that @option{--log-file} is only implemented for
2159 @item --attribute-fd @code{n}
2160 Write attribute subpackets to the file descriptor @code{n}. This is most
2161 useful for use with @option{--status-fd}, since the status messages are
2162 needed to separate out the various subpackets from the stream delivered
2163 to the file descriptor.
2165 @item --attribute-file @code{file}
2166 Same as @option{--attribute-fd}, except the attribute data is written to
2169 @item --comment @code{string}
2170 @itemx --no-comments
2171 Use @code{string} as a comment string in clear text signatures and ASCII
2172 armored messages or keys (see @option{--armor}). The default behavior is
2173 not to use a comment string. @option{--comment} may be repeated multiple
2174 times to get multiple comment strings. @option{--no-comments} removes
2175 all comments. It is a good idea to keep the length of a single comment
2176 below 60 characters to avoid problems with mail programs wrapping such
2177 lines. Note that comment lines, like all other header lines, are not
2178 protected by the signature.
2180 @item --emit-version
2181 @itemx --no-emit-version
2182 Force inclusion of the version string in ASCII armored output.
2183 @option{--no-emit-version} disables this option.
2185 @item --sig-notation @code{name=value}
2186 @itemx --cert-notation @code{name=value}
2187 @itemx -N, --set-notation @code{name=value}
2188 Put the name value pair into the signature as notation data.
2189 @code{name} must consist only of printable characters or spaces, and
2190 must contain a '@@' character in the form keyname@@domain.example.com
2191 (substituting the appropriate keyname and domain name, of course). This
2192 is to help prevent pollution of the IETF reserved notation
2193 namespace. The @option{--expert} flag overrides the '@@'
2194 check. @code{value} may be any printable string; it will be encoded in
2195 UTF8, so you should check that your @option{--display-charset} is set
2196 correctly. If you prefix @code{name} with an exclamation mark (!), the
2197 notation data will be flagged as critical
2198 (rfc2440:5.2.3.15). @option{--sig-notation} sets a notation for data
2199 signatures. @option{--cert-notation} sets a notation for key signatures
2200 (certifications). @option{--set-notation} sets both.
2202 There are special codes that may be used in notation names. "%k" will
2203 be expanded into the key ID of the key being signed, "%K" into the
2204 long key ID of the key being signed, "%f" into the fingerprint of the
2205 key being signed, "%s" into the key ID of the key making the
2206 signature, "%S" into the long key ID of the key making the signature,
2207 "%g" into the fingerprint of the key making the signature (which might
2208 be a subkey), "%p" into the fingerprint of the primary key of the key
2209 making the signature, "%c" into the signature count from the OpenPGP
2210 smartcard, and "%%" results in a single "%". %k, %K, and %f are only
2211 meaningful when making a key signature (certification), and %c is only
2212 meaningful when using the OpenPGP smartcard.
2214 @item --sig-policy-url @code{string}
2215 @itemx --cert-policy-url @code{string}
2216 @itemx --set-policy-url @code{string}
2217 Use @code{string} as a Policy URL for signatures (rfc2440:5.2.3.19). If
2218 you prefix it with an exclamation mark (!), the policy URL packet will
2219 be flagged as critical. @option{--sig-policy-url} sets a policy url for
2220 data signatures. @option{--cert-policy-url} sets a policy url for key
2221 signatures (certifications). @option{--set-policy-url} sets both.
2223 The same %-expandos used for notation data are available here as well.
2225 @item --sig-keyserver-url @code{string}
2226 Use @code{string} as a preferred keyserver URL for data signatures. If
2227 you prefix it with an exclamation mark (!), the keyserver URL packet
2228 will be flagged as critical.
2230 The same %-expandos used for notation data are available here as well.
2232 @item --set-filename @code{string}
2233 Use @code{string} as the filename which is stored inside messages.
2234 This overrides the default, which is to use the actual filename of the
2235 file being encrypted.
2237 @item --for-your-eyes-only
2238 @itemx --no-for-your-eyes-only
2239 Set the `for your eyes only' flag in the message. This causes GnuPG to
2240 refuse to save the file unless the @option{--output} option is given,
2241 and PGP to use a "secure viewer" with a claimed Tempest-resistant font
2242 to display the message. This option overrides @option{--set-filename}.
2243 @option{--no-for-your-eyes-only} disables this option.
2245 @item --use-embedded-filename
2246 @itemx --no-use-embedded-filename
2247 Try to create a file with a name as embedded in the data. This can be
2248 a dangerous option as it allows to overwrite files. Defaults to no.
2250 @item --cipher-algo @code{name}
2251 Use @code{name} as cipher algorithm. Running the program with the
2252 command @option{--version} yields a list of supported algorithms. If
2253 this is not used the cipher algorithm is selected from the preferences
2254 stored with the key. In general, you do not want to use this option as
2255 it allows you to violate the OpenPGP standard.
2256 @option{--personal-cipher-preferences} is the safe way to accomplish the
2259 @item --digest-algo @code{name}
2260 Use @code{name} as the message digest algorithm. Running the program
2261 with the command @option{--version} yields a list of supported algorithms. In
2262 general, you do not want to use this option as it allows you to
2263 violate the OpenPGP standard. @option{--personal-digest-preferences} is the
2264 safe way to accomplish the same thing.
2266 @item --compress-algo @code{name}
2267 Use compression algorithm @code{name}. "zlib" is RFC-1950 ZLIB
2268 compression. "zip" is RFC-1951 ZIP compression which is used by PGP.
2269 "bzip2" is a more modern compression scheme that can compress some
2270 things better than zip or zlib, but at the cost of more memory used
2271 during compression and decompression. "uncompressed" or "none"
2272 disables compression. If this option is not used, the default
2273 behavior is to examine the recipient key preferences to see which
2274 algorithms the recipient supports. If all else fails, ZIP is used for
2275 maximum compatibility.
2277 ZLIB may give better compression results than ZIP, as the compression
2278 window size is not limited to 8k. BZIP2 may give even better
2279 compression results than that, but will use a significantly larger
2280 amount of memory while compressing and decompressing. This may be
2281 significant in low memory situations. Note, however, that PGP (all
2282 versions) only supports ZIP compression. Using any algorithm other
2283 than ZIP or "none" will make the message unreadable with PGP. In
2284 general, you do not want to use this option as it allows you to
2285 violate the OpenPGP standard. @option{--personal-compress-preferences} is the
2286 safe way to accomplish the same thing.
2288 @item --cert-digest-algo @code{name}
2289 Use @code{name} as the message digest algorithm used when signing a
2290 key. Running the program with the command @option{--version} yields a
2291 list of supported algorithms. Be aware that if you choose an algorithm
2292 that GnuPG supports but other OpenPGP implementations do not, then some
2293 users will not be able to use the key signatures you make, or quite
2294 possibly your entire key.
2296 @item --disable-cipher-algo @code{name}
2297 Never allow the use of @code{name} as cipher algorithm.
2298 The given name will not be checked so that a later loaded algorithm
2299 will still get disabled.
2301 @item --disable-pubkey-algo @code{name}
2302 Never allow the use of @code{name} as public key algorithm.
2303 The given name will not be checked so that a later loaded algorithm
2304 will still get disabled.
2306 @item --throw-keyids
2307 @itemx --no-throw-keyids
2308 Do not put the recipient key IDs into encrypted messages. This helps to
2309 hide the receivers of the message and is a limited countermeasure
2310 against traffic analysis.@footnote{Using a little social engineering
2311 anyone who is able to decrypt the message can check whether one of the
2312 other recipients is the one he suspects.} On the receiving side, it may
2313 slow down the decryption process because all available secret keys must
2314 be tried. @option{--no-throw-keyids} disables this option. This option
2315 is essentially the same as using @option{--hidden-recipient} for all
2318 @item --not-dash-escaped
2319 This option changes the behavior of cleartext signatures
2320 so that they can be used for patch files. You should not
2321 send such an armored file via email because all spaces
2322 and line endings are hashed too. You can not use this
2323 option for data which has 5 dashes at the beginning of a
2324 line, patch files don't have this. A special armor header
2325 line tells GnuPG about this cleartext signature option.
2327 @item --escape-from-lines
2328 @itemx --no-escape-from-lines
2329 Because some mailers change lines starting with "From " to ">From " it
2330 is good to handle such lines in a special way when creating cleartext
2331 signatures to prevent the mail system from breaking the signature. Note
2332 that all other PGP versions do it this way too. Enabled by
2333 default. @option{--no-escape-from-lines} disables this option.
2335 @item --passphrase-repeat @code{n}
2336 Specify how many times @command{@gpgname} will request a new
2337 passphrase be repeated. This is useful for helping memorize a
2338 passphrase. Defaults to 1 repetition.
2340 @item --passphrase-fd @code{n}
2341 Read the passphrase from file descriptor @code{n}. Only the first line
2342 will be read from file descriptor @code{n}. If you use 0 for @code{n},
2343 the passphrase will be read from STDIN. This can only be used if only
2344 one passphrase is supplied.
2346 Note that this passphrase is only used if the option @option{--batch}
2347 has also been given. This is different from @command{gpg}.
2350 @item --passphrase-file @code{file}
2351 Read the passphrase from file @code{file}. Only the first line will
2352 be read from file @code{file}. This can only be used if only one
2353 passphrase is supplied. Obviously, a passphrase stored in a file is
2354 of questionable security if other users can read this file. Don't use
2355 this option if you can avoid it.
2357 Note that this passphrase is only used if the option @option{--batch}
2358 has also been given. This is different from @command{gpg}.
2361 @item --passphrase @code{string}
2362 Use @code{string} as the passphrase. This can only be used if only one
2363 passphrase is supplied. Obviously, this is of very questionable
2364 security on a multi-user system. Don't use this option if you can
2367 Note that this passphrase is only used if the option @option{--batch}
2368 has also been given. This is different from @command{gpg}.
2371 @item --command-fd @code{n}
2372 This is a replacement for the deprecated shared-memory IPC mode.
2373 If this option is enabled, user input on questions is not expected
2374 from the TTY but from the given file descriptor. It should be used
2375 together with @option{--status-fd}. See the file doc/DETAILS in the source
2376 distribution for details on how to use it.
2378 @item --command-file @code{file}
2379 Same as @option{--command-fd}, except the commands are read out of file
2382 @item --allow-non-selfsigned-uid
2383 @itemx --no-allow-non-selfsigned-uid
2384 Allow the import and use of keys with user IDs which are not
2385 self-signed. This is not recommended, as a non self-signed user ID is
2386 trivial to forge. @option{--no-allow-non-selfsigned-uid} disables.
2388 @item --allow-freeform-uid
2389 Disable all checks on the form of the user ID while generating a new
2390 one. This option should only be used in very special environments as
2391 it does not ensure the de-facto standard format of user IDs.
2393 @item --ignore-time-conflict
2394 GnuPG normally checks that the timestamps associated with keys and
2395 signatures have plausible values. However, sometimes a signature
2396 seems to be older than the key due to clock problems. This option
2397 makes these checks just a warning. See also @option{--ignore-valid-from} for
2398 timestamp issues on subkeys.
2400 @item --ignore-valid-from
2401 GnuPG normally does not select and use subkeys created in the future.
2402 This option allows the use of such keys and thus exhibits the
2403 pre-1.0.7 behaviour. You should not use this option unless you there
2404 is some clock problem. See also @option{--ignore-time-conflict} for timestamp
2405 issues with signatures.
2407 @item --ignore-crc-error
2408 The ASCII armor used by OpenPGP is protected by a CRC checksum against
2409 transmission errors. Occasionally the CRC gets mangled somewhere on
2410 the transmission channel but the actual content (which is protected by
2411 the OpenPGP protocol anyway) is still okay. This option allows GnuPG
2412 to ignore CRC errors.
2414 @item --ignore-mdc-error
2415 This option changes a MDC integrity protection failure into a warning.
2416 This can be useful if a message is partially corrupt, but it is
2417 necessary to get as much data as possible out of the corrupt message.
2418 However, be aware that a MDC protection failure may also mean that the
2419 message was tampered with intentionally by an attacker.
2421 @item --no-default-keyring
2422 Do not add the default keyrings to the list of keyrings. Note that
2423 GnuPG will not operate without any keyrings, so if you use this option
2424 and do not provide alternate keyrings via @option{--keyring} or
2425 @option{--secret-keyring}, then GnuPG will still use the default public or
2429 Skip the signature verification step. This may be
2430 used to make the decryption faster if the signature
2431 verification is not needed.
2433 @item --with-key-data
2434 Print key listings delimited by colons (like @option{--with-colons}) and
2435 print the public key data.
2437 @item --fast-list-mode
2438 Changes the output of the list commands to work faster; this is achieved
2439 by leaving some parts empty. Some applications don't need the user ID
2440 and the trust information given in the listings. By using this options
2441 they can get a faster listing. The exact behaviour of this option may
2442 change in future versions. If you are missing some information, don't
2446 This is not for normal use. Use the source to see for what it might be useful.
2448 @item --set-filesize
2449 This is not for normal use. Use the source to see for what it might be useful.
2451 @item --show-session-key
2452 Display the session key used for one message. See
2453 @option{--override-session-key} for the counterpart of this option.
2455 We think that Key Escrow is a Bad Thing; however the user should have
2456 the freedom to decide whether to go to prison or to reveal the content
2457 of one specific message without compromising all messages ever
2458 encrypted for one secret key. DON'T USE IT UNLESS YOU ARE REALLY
2461 @item --override-session-key @code{string}
2462 Don't use the public key but the session key @code{string}. The format
2463 of this string is the same as the one printed by
2464 @option{--show-session-key}. This option is normally not used but comes
2465 handy in case someone forces you to reveal the content of an encrypted
2466 message; using this option you can do this without handing out the
2469 @item --ask-sig-expire
2470 @itemx --no-ask-sig-expire
2471 When making a data signature, prompt for an expiration time. If this
2472 option is not specified, the expiration time set via
2473 @option{--default-sig-expire} is used. @option{--no-ask-sig-expire}
2474 disables this option. Note that by default, @option{--force-v3-sigs} is
2475 set which also disables this option. If you want signature expiration,
2476 you must set @option{--no-force-v3-sigs} as well as turning
2477 @option{--ask-sig-expire} on.
2479 @item --default-sig-expire
2480 The default expiration time to use for signature expiration. Valid
2481 values are "0" for no expiration, a number followed by the letter d
2482 (for days), w (for weeks), m (for months), or y (for years) (for
2483 example "2m" for two months, or "5y" for five years), or an absolute
2484 date in the form YYYY-MM-DD. Defaults to "0".
2486 @item --ask-cert-expire
2487 @itemx --no-ask-cert-expire
2488 When making a key signature, prompt for an expiration time. If this
2489 option is not specified, the expiration time set via
2490 @option{--default-cert-expire} is used. @option{--no-ask-cert-expire}
2491 disables this option.
2493 @item --default-cert-expire
2494 The default expiration time to use for key signature expiration.
2495 Valid values are "0" for no expiration, a number followed by the
2496 letter d (for days), w (for weeks), m (for months), or y (for years)
2497 (for example "2m" for two months, or "5y" for five years), or an
2498 absolute date in the form YYYY-MM-DD. Defaults to "0".
2500 @item --allow-secret-key-import
2501 This is an obsolete option and is not used anywhere.
2503 @item --allow-multiple-messages
2504 @item --no-allow-multiple-messages
2505 Allow processing of multiple OpenPGP messages contained in a single file
2506 or stream. Some programs that call GPG are not prepared to deal with
2507 multiple messages being processed together, so this option defaults to
2508 no. Note that versions of GPG prior to 1.4.7 always allowed multiple
2511 Warning: Do not use this option unless you need it as a temporary
2515 @item --enable-special-filenames
2516 This options enables a mode in which filenames of the form
2517 @file{-&n}, where n is a non-negative decimal number,
2518 refer to the file descriptor n and not to a file with that name.
2520 @item --no-expensive-trust-checks
2521 Experimental use only.
2523 @item --preserve-permissions
2524 Don't change the permissions of a secret keyring back to user
2525 read/write only. Use this option only if you really know what you are doing.
2527 @item --default-preference-list @code{string}
2528 @opindex default-preference-list
2529 Set the list of default preferences to @code{string}. This preference
2530 list is used for new keys and becomes the default for "setpref" in the
2533 @item --default-keyserver-url @code{name}
2534 @opindex default-keyserver-url
2535 Set the default keyserver URL to @code{name}. This keyserver will be
2536 used as the keyserver URL when writing a new self-signature on a key,
2537 which includes key generation and changing preferences.
2540 @opindex list-config
2541 Display various internal configuration parameters of GnuPG. This option
2542 is intended for external programs that call GnuPG to perform tasks, and
2543 is thus not generally useful. See the file @file{doc/DETAILS} in the
2544 source distribution for the details of which configuration items may be
2545 listed. @option{--list-config} is only usable with
2546 @option{--with-colons} set.
2548 @item --gpgconf-list
2549 @opindex gpgconf-list
2550 This command is similar to @option{--list-config} but in general only
2551 internally used by the @command{gpgconf} tool.
2553 @item --gpgconf-test
2554 @opindex gpgconf-test
2555 This is more or less dummy action. However it parses the configuration
2556 file and returns with failure if the configuration file would prevent
2557 @command{gpg} from startup. Thus it may be used to run a syntax check
2558 on the configuration file.
2562 @c *******************************
2563 @c ******* Deprecated ************
2564 @c *******************************
2565 @subsection Deprecated options
2570 @item --load-extension @code{name}
2571 Load an extension module. If @code{name} does not contain a slash it is
2572 searched for in the directory configured when GnuPG was built
2573 (generally "/usr/local/lib/gnupg"). Extensions are not generally
2574 useful anymore, and the use of this option is deprecated.
2578 @itemx --no-show-photos
2579 Causes @option{--list-keys}, @option{--list-sigs},
2580 @option{--list-public-keys}, @option{--list-secret-keys}, and verifying
2581 a signature to also display the photo ID attached to the key, if
2582 any. See also @option{--photo-viewer}. These options are deprecated. Use
2583 @option{--list-options [no-]show-photos} and/or @option{--verify-options
2584 [no-]show-photos} instead.
2586 @item --show-keyring
2587 Display the keyring name at the head of key listings to show which
2588 keyring a given key resides on. This option is deprecated: use
2589 @option{--list-options [no-]show-keyring} instead.
2592 @item --ctapi-driver @code{file}
2593 Use @code{file} to access the smartcard reader. The current default
2594 is `libtowitoko.so'. Note that the use of this interface is
2595 deprecated; it may be removed in future releases.
2598 @item --always-trust
2599 Identical to @option{--trust-model always}. This option is deprecated.
2601 @item --show-notation
2602 @itemx --no-show-notation
2603 Show signature notations in the @option{--list-sigs} or @option{--check-sigs} listings
2604 as well as when verifying a signature with a notation in it. These
2605 options are deprecated. Use @option{--list-options [no-]show-notation}
2606 and/or @option{--verify-options [no-]show-notation} instead.
2608 @item --show-policy-url
2609 @itemx --no-show-policy-url
2610 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
2611 listings as well as when verifying a signature with a policy URL in
2612 it. These options are deprecated. Use @option{--list-options
2613 [no-]show-policy-url} and/or @option{--verify-options
2614 [no-]show-policy-url} instead.
2620 @c *******************************************
2621 @c *************** ****************
2622 @c *************** FILES ****************
2623 @c *************** ****************
2624 @c *******************************************
2626 @node GPG Configuration
2627 @section Configuration files
2629 There are a few configuration files to control certain aspects of
2630 @command{@gpgname}'s operation. Unless noted, they are expected in the
2631 current home directory (@pxref{option --homedir}).
2637 This is the standard configuration file read by @command{@gpgname} on
2638 startup. It may contain any valid long option; the leading two dashes
2639 may not be entered and the option may not be abbreviated. This default
2640 name may be changed on the command line (@pxref{option --options}).
2641 You should backup this file.
2646 Note that on larger installations, it is useful to put predefined files
2647 into the directory @file{/etc/skel/.gnupg/} so that newly created users
2648 start up with a working configuration.
2650 For existing users the a small
2651 helper script is provided to create these files (@pxref{addgnupghome}).
2654 For internal purposes @command{@gpgname} creates and maintains a few other
2655 files; They all live in in the current home directory (@pxref{option
2656 --homedir}). Only the @command{@gpgname} may modify these files.
2660 @item ~/.gnupg/secring.gpg
2661 The secret keyring. You should backup this file.
2663 @item ~/.gnupg/secring.gpg.lock
2664 The lock file for the secret keyring.
2666 @item ~/.gnupg/pubring.gpg
2667 The public keyring. You should backup this file.
2669 @item ~/.gnupg/pubring.gpg.lock
2670 The lock file for the public keyring.
2672 @item ~/.gnupg/trustdb.gpg
2673 The trust database. There is no need to backup this file; it is better
2674 to backup the ownertrust values (@pxref{option --export-ownertrust}).
2676 @item ~/.gnupg/trustdb.gpg.lock
2677 The lock file for the trust database.
2679 @item ~/.gnupg/random_seed
2680 A file used to preserve the state of the internal random pool.
2682 @item /usr[/local]/share/gnupg/options.skel
2683 The skeleton options file.
2685 @item /usr[/local]/lib/gnupg/
2686 Default location for extensions.
2691 Operation is further controlled by a few environment variables:
2696 Used to locate the default home directory.
2699 If set directory used instead of "~/.gnupg".
2701 @item GPG_AGENT_INFO
2702 Used to locate the gpg-agent.
2704 This is only honored when @option{--use-agent} is set.
2706 The value consists of 3 colon delimited fields: The first is the path
2707 to the Unix Domain Socket, the second the PID of the gpg-agent and the
2708 protocol version which should be set to 1. When starting the gpg-agent
2709 as described in its documentation, this variable is set to the correct
2710 value. The option @option{--gpg-agent-info} can be used to override it.
2712 @item PINENTRY_USER_DATA
2713 This value is passed via gpg-agent to pinentry. It is useful to convey
2714 extra information to a custom pinentry.
2718 Used to size some displays to the full size of the screen.
2722 Apart from its use by GNU, it is used in the W32 version to override the
2723 language selection done through the Registry. If used and set to a
2724 valid and available language name (@var{langid}), the file with the
2725 translation is loaded from
2726 @code{@var{gpgdir}/gnupg.nls/@var{langid}.mo}. Here @var{gpgdir} is the
2727 directory out of which the gpg binary has been loaded. If it can't be
2728 loaded the Registry is tried and as last resort the native Windows
2729 locale system is used.
2734 @c *******************************************
2735 @c *************** ****************
2736 @c *************** EXAMPLES ****************
2737 @c *************** ****************
2738 @c *******************************************
2745 @item gpg -se -r @code{Bob} @code{file}
2746 sign and encrypt for user Bob
2748 @item gpg --clearsign @code{file}
2749 make a clear text signature
2751 @item gpg -sb @code{file}
2752 make a detached signature
2754 @item gpg -u 0x12345678 -sb @code{file}
2755 make a detached signature with the key 0x12345678
2757 @item gpg --list-keys @code{user_ID}
2760 @item gpg --fingerprint @code{user_ID}
2763 @item gpg --verify @code{pgpfile}
2764 @itemx gpg --verify @code{sigfile}
2765 Verify the signature of the file but do not output the data. The
2766 second form is used for detached signatures, where @code{sigfile}
2767 is the detached signature (either ASCII armored or binary) and
2768 are the signed data; if this is not given, the name of
2769 the file holding the signed data is constructed by cutting off the
2770 extension (".asc" or ".sig") of @code{sigfile} or by asking the
2771 user for the filename.
2775 @c *******************************************
2776 @c *************** ****************
2777 @c *************** USER ID ****************
2778 @c *************** ****************
2779 @c *******************************************
2780 @mansect how to specify a user id
2782 @include specify-user-id.texi
2785 @mansect return value
2786 @chapheading RETURN VALUE
2788 The program returns 0 if everything was fine, 1 if at least
2789 a signature was bad, and other error codes for fatal errors.
2792 @chapheading WARNINGS
2794 Use a *good* password for your user account and a *good* passphrase
2795 to protect your secret key. This passphrase is the weakest part of the
2796 whole system. Programs to do dictionary attacks on your secret keyring
2797 are very easy to write and so you should protect your "~/.gnupg/"
2798 directory very well.
2800 Keep in mind that, if this program is used over a network (telnet), it
2801 is *very* easy to spy out your passphrase!
2803 If you are going to verify detached signatures, make sure that the
2804 program knows about it; either give both filenames on the command line
2805 or use @samp{-} to specify STDIN.
2807 @mansect interoperability
2808 @chapheading INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS
2810 GnuPG tries to be a very flexible implementation of the OpenPGP
2811 standard. In particular, GnuPG implements many of the optional parts
2812 of the standard, such as the SHA-512 hash, and the ZLIB and BZIP2
2813 compression algorithms. It is important to be aware that not all
2814 OpenPGP programs implement these optional algorithms and that by
2815 forcing their use via the @option{--cipher-algo},
2816 @option{--digest-algo}, @option{--cert-digest-algo}, or
2817 @option{--compress-algo} options in GnuPG, it is possible to create a
2818 perfectly valid OpenPGP message, but one that cannot be read by the
2821 There are dozens of variations of OpenPGP programs available, and each
2822 supports a slightly different subset of these optional algorithms.
2823 For example, until recently, no (unhacked) version of PGP supported
2824 the BLOWFISH cipher algorithm. A message using BLOWFISH simply could
2825 not be read by a PGP user. By default, GnuPG uses the standard
2826 OpenPGP preferences system that will always do the right thing and
2827 create messages that are usable by all recipients, regardless of which
2828 OpenPGP program they use. Only override this safe default if you
2829 really know what you are doing.
2831 If you absolutely must override the safe default, or if the preferences
2832 on a given key are invalid for some reason, you are far better off using
2833 the @option{--pgp6}, @option{--pgp7}, or @option{--pgp8} options. These
2834 options are safe as they do not force any particular algorithms in
2835 violation of OpenPGP, but rather reduce the available algorithms to a
2841 On many systems this program should be installed as setuid(root). This
2842 is necessary to lock memory pages. Locking memory pages prevents the
2843 operating system from writing memory pages (which may contain
2844 passphrases or other sensitive material) to disk. If you get no
2845 warning message about insecure memory your operating system supports
2846 locking without being root. The program drops root privileges as soon
2847 as locked memory is allocated.
2849 Note also that some systems (especially laptops) have the ability to
2850 ``suspend to disk'' (also known as ``safe sleep'' or ``hibernate'').
2851 This writes all memory to disk before going into a low power or even
2852 powered off mode. Unless measures are taken in the operating system
2853 to protect the saved memory, passphrases or other sensitive material
2854 may be recoverable from it later.
2861 @command{gpg-agent}(1)
2864 @include see-also-note.texi