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 **********
594 Toggle selection of user ID or photographic user ID with index @code{n}.
595 Use @code{*} to select all and @code{0} to deselect all.
599 Toggle selection of subkey with index @code{n}.
600 Use @code{*} to select all and @code{0} to deselect all.
603 @opindex keyedit:sign
604 Make a signature on key of user @code{name} If the key is not yet
605 signed by the default user (or the users given with -u), the program
606 displays the information of the key again, together with its
607 fingerprint and asks whether it should be signed. This question is
608 repeated for all users specified with
612 @opindex keyedit:lsign
613 Same as "sign" but the signature is marked as non-exportable and will
614 therefore never be used by others. This may be used to make keys
615 valid only in the local environment.
618 @opindex keyedit:nrsign
619 Same as "sign" but the signature is marked as non-revocable and can
620 therefore never be revoked.
623 @opindex keyedit:tsign
624 Make a trust signature. This is a signature that combines the notions
625 of certification (like a regular signature), and trust (like the
626 "trust" command). It is generally only useful in distinct communities
631 Note that "l" (for local / non-exportable), "nr" (for non-revocable,
632 and "t" (for trust) may be freely mixed and prefixed to "sign" to
633 create a signature of any type desired.
639 @opindex keyedit:delsig
640 Delete a signature. Note that it is not possible to retract a signature,
641 once it has been send to the public (i.e. to a keyserver). In that case
642 you better use @code{revsig}.
645 @opindex keyedit:revsig
646 Revoke a signature. For every signature which has been generated by
647 one of the secret keys, GnuPG asks whether a revocation certificate
651 @opindex keyedit:check
652 Check the signatures on all selected user IDs.
655 @opindex keyedit:adduid
656 Create an additional user ID.
659 @opindex keyedit:addphoto
660 Create a photographic user ID. This will prompt for a JPEG file that
661 will be embedded into the user ID. Note that a very large JPEG will make
662 for a very large key. Also note that some programs will display your
663 JPEG unchanged (GnuPG), and some programs will scale it to fit in a
667 @opindex keyedit:showphoto
668 Display the selected photographic user ID.
671 @opindex keyedit:deluid
672 Delete a user ID or photographic user ID. Note that it is not
673 possible to retract a user id, once it has been send to the public
674 (i.e. to a keyserver). In that case you better use @code{revuid}.
677 @opindex keyedit:revuid
678 Revoke a user ID or photographic user ID.
681 @opindex keyedit:primary
682 Flag the current user id as the primary one, removes the primary user
683 id flag from all other user ids and sets the timestamp of all affected
684 self-signatures one second ahead. Note that setting a photo user ID
685 as primary makes it primary over other photo user IDs, and setting a
686 regular user ID as primary makes it primary over other regular user
690 @opindex keyedit:keyserver
691 Set a preferred keyserver for the specified user ID(s). This allows
692 other users to know where you prefer they get your key from. See
693 @option{--keyserver-options honor-keyserver-url} for more on how this
694 works. Setting a value of "none" removes an existing preferred
698 @opindex keyedit:notation
699 Set a name=value notation for the specified user ID(s). See
700 @option{--cert-notation} for more on how this works. Setting a value of
701 "none" removes all notations, setting a notation prefixed with a minus
702 sign (-) removes that notation, and setting a notation name (without the
703 =value) prefixed with a minus sign removes all notations with that name.
706 @opindex keyedit:pref
707 List preferences from the selected user ID. This shows the actual
708 preferences, without including any implied preferences.
711 @opindex keyedit:showpref
712 More verbose preferences listing for the selected user ID. This shows
713 the preferences in effect by including the implied preferences of 3DES
714 (cipher), SHA-1 (digest), and Uncompressed (compression) if they are
715 not already included in the preference list. In addition, the
716 preferred keyserver and signature notations (if any) are shown.
718 @item setpref @code{string}
719 @opindex keyedit:setpref
720 Set the list of user ID preferences to @code{string} for all (or just
721 the selected) user IDs. Calling setpref with no arguments sets the
722 preference list to the default (either built-in or set via
723 @option{--default-preference-list}), and calling setpref with "none"
724 as the argument sets an empty preference list. Use @command{@gpgname
725 --version} to get a list of available algorithms. Note that while you
726 can change the preferences on an attribute user ID (aka "photo ID"),
727 GnuPG does not select keys via attribute user IDs so these preferences
728 will not be used by GnuPG.
730 When setting preferences, you should list the algorithms in the order
731 which you'd like to see them used by someone else when encrypting a
732 message to your key. If you don't include 3DES, it will be
733 automatically added at the end. Note that there are many factors that
734 go into choosing an algorithm (for example, your key may not be the
735 only recipient), and so the remote OpenPGP application being used to
736 send to you may or may not follow your exact chosen order for a given
737 message. It will, however, only choose an algorithm that is present
738 on the preference list of every recipient key. See also the
739 INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS section below.
742 @opindex keyedit:addkey
743 Add a subkey to this key.
746 @opindex keyedit:addcardkey
747 Generate a subkey on a card and add it to this key.
750 @opindex keyedit:keytocard
751 Transfer the selected secret subkey (or the primary key if no subkey
752 has been selected) to a smartcard. The secret key in the keyring will
753 be replaced by a stub if the key could be stored successfully on the
754 card and you use the save command later. Only certain key types may be
755 transferred to the card. A sub menu allows you to select on what card
756 to store the key. Note that it is not possible to get that key back
757 from the card - if the card gets broken your secret key will be lost
758 unless you have a backup somewhere.
760 @item bkuptocard @code{file}
761 @opindex keyedit:bkuptocard
762 Restore the given file to a card. This command may be used to restore a
763 backup key (as generated during card initialization) to a new card. In
764 almost all cases this will be the encryption key. You should use this
765 command only with the corresponding public key and make sure that the
766 file given as argument is indeed the backup to restore. You should then
767 select 2 to restore as encryption key. You will first be asked to enter
768 the passphrase of the backup key and then for the Admin PIN of the card.
771 @opindex keyedit:delkey
772 Remove a subkey (secondart key). Note that it is not possible to retract
773 a subkey, once it has been send to the public (i.e. to a keyserver). In
774 that case you better use @code{revkey}.
777 @opindex keyedit:revkey
781 @opindex keyedit:expire
782 Change the key or subkey expiration time. If a subkey is selected, the
783 expiration time of this subkey will be changed. With no selection, the
784 key expiration of the primary key is changed.
787 @opindex keyedit:trust
788 Change the owner trust value for the key. This updates the trust-db
789 immediately and no save is required.
793 @opindex keyedit:disable
794 @opindex keyedit:enable
795 Disable or enable an entire key. A disabled key can not normally be
799 @opindex keyedit:addrevoker
800 Add a designated revoker to the key. This takes one optional argument:
801 "sensitive". If a designated revoker is marked as sensitive, it will
802 not be exported by default (see export-options).
805 @opindex keyedit:passwd
806 Change the passphrase of the secret key.
809 @opindex keyedit:toggle
810 Toggle between public and secret key listing.
813 @opindex keyedit:clean
814 Compact (by removing all signatures except the selfsig) any user ID
815 that is no longer usable (e.g. revoked, or expired). Then, remove any
816 signatures that are not usable by the trust calculations.
817 Specifically, this removes any signature that does not validate, any
818 signature that is superseded by a later signature, revoked signatures,
819 and signatures issued by keys that are not present on the keyring.
822 @opindex keyedit:minimize
823 Make the key as small as possible. This removes all signatures from
824 each user ID except for the most recent self-signature.
827 @opindex keyedit:cross-certify
828 Add cross-certification signatures to signing subkeys that may not
829 currently have them. Cross-certification signatures protect against a
830 subtle attack against signing subkeys. See
831 @option{--require-cross-certification}. All new keys generated have
832 this signature by default, so this option is only useful to bring
833 older keys up to date.
836 @opindex keyedit:save
837 Save all changes to the key rings and quit.
840 @opindex keyedit:quit
841 Quit the program without updating the
847 The listing shows you the key with its secondary keys and all user
848 ids. Selected keys or user ids are indicated by an asterisk. The trust
849 value is displayed with the primary key: the first is the assigned owner
850 trust and the second is the calculated trust value. Letters are used for
857 No ownertrust assigned / not yet calculated.
861 calculation has failed; probably due to an expired key.
864 Not enough information for calculation.
867 Never trust this key.
878 @c ******** End Edit-key Options **********
880 @item --sign-key @code{name}
882 Signs a public key with your secret key. This is a shortcut version of
883 the subcommand "sign" from @option{--edit}.
885 @item --lsign-key @code{name}
887 Signs a public key with your secret key but marks it as
888 non-exportable. This is a shortcut version of the subcommand "lsign"
889 from @option{--edit-key}.
895 @c *******************************************
896 @c *************** ****************
897 @c *************** OPTIONS ****************
898 @c *************** ****************
899 @c *******************************************
902 @section Option Summary
904 @command{@gpgname} comes features a bunch of options to control the exact
905 behaviour and to change the default configuration.
908 * GPG Configuration Options:: How to change the configuration.
909 * GPG Key related Options:: Key related options.
910 * GPG Input and Output:: Input and Output.
911 * OpenPGP Options:: OpenPGP protocol specific options.
912 * GPG Esoteric Options:: Doing things one usually don't want to do.
915 Long options can be put in an options file (default
916 "~/.gnupg/gpg.conf"). Short option names will not work - for example,
917 "armor" is a valid option for the options file, while "a" is not. Do not
918 write the 2 dashes, but simply the name of the option and any required
919 arguments. Lines with a hash ('#') as the first non-white-space
920 character are ignored. Commands may be put in this file too, but that is
921 not generally useful as the command will execute automatically with
922 every execution of gpg.
924 Please remember that option parsing stops as soon as a non-option is
925 encountered, you can explicitly stop parsing by using the special option
928 @c *******************************************
929 @c ******** CONFIGURATION OPTIONS **********
930 @c *******************************************
931 @node GPG Configuration Options
932 @subsection How to change the configuration
934 These options are used to change the configuration and are usually found
939 @item --default-key @var{name}
941 Use @var{name} as the default key to sign with. If this option is not
942 used, the default key is the first key found in the secret keyring.
943 Note that @option{-u} or @option{--local-user} overrides this option.
945 @item --default-recipient @var{name}
946 @opindex default-recipient
947 Use @var{name} as default recipient if option @option{--recipient} is
948 not used and don't ask if this is a valid one. @var{name} must be
951 @item --default-recipient-self
952 @opindex default-recipient-self
953 Use the default key as default recipient if option @option{--recipient} is not
954 used and don't ask if this is a valid one. The default key is the first
955 one from the secret keyring or the one set with @option{--default-key}.
957 @item --no-default-recipient
958 @opindex no-default-recipient
959 Reset @option{--default-recipient} and @option{--default-recipient-self}.
963 Give more information during processing. If used
964 twice, the input data is listed in detail.
968 Reset verbose level to 0.
972 Try to be as quiet as possible.
978 Use batch mode. Never ask, do not allow interactive commands.
979 @option{--no-batch} disables this option. Note that even with a
980 filename given on the command line, gpg might still need to read from
981 STDIN (in particular if gpg figures that the input is a
982 detached signature and no data file has been specified). Thus if you
983 do not want to feed data via STDIN, you should connect STDIN to
988 Make sure that the TTY (terminal) is never used for any output.
989 This option is needed in some cases because GnuPG sometimes prints
990 warnings to the TTY even if @option{--batch} is used.
994 Assume "yes" on most questions.
998 Assume "no" on most questions.
1001 @item --list-options @code{parameters}
1002 @opindex list-options
1003 This is a space or comma delimited string that gives options used when
1004 listing keys and signatures (that is, @option{--list-keys},
1005 @option{--list-sigs}, @option{--list-public-keys},
1006 @option{--list-secret-keys}, and the @option{--edit-key} functions).
1007 Options can be prepended with a @option{no-} (after the two dashes) to
1008 give the opposite meaning. The options are:
1013 @opindex list-options:show-photos
1014 Causes @option{--list-keys}, @option{--list-sigs},
1015 @option{--list-public-keys}, and @option{--list-secret-keys} to display
1016 any photo IDs attached to the key. Defaults to no. See also
1017 @option{--photo-viewer}.
1019 @item show-policy-urls
1020 @opindex list-options:show-policy-urls
1021 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
1022 listings. Defaults to no.
1024 @item show-notations
1025 @itemx show-std-notations
1026 @itemx show-user-notations
1027 @opindex list-options:show-notations
1028 @opindex list-options:show-std-notations
1029 @opindex list-options:show-user-notations
1030 Show all, IETF standard, or user-defined signature notations in the
1031 @option{--list-sigs} or @option{--check-sigs} listings. Defaults to no.
1033 @item show-keyserver-urls
1035 Show any preferred keyserver URL in the @option{--list-sigs} or
1036 @option{--check-sigs} listings. Defaults to no.
1038 @item show-uid-validity
1039 Display the calculated validity of user IDs during key listings.
1042 @item show-unusable-uids
1043 Show revoked and expired user IDs in key listings. Defaults to no.
1045 @item show-unusable-subkeys
1046 Show revoked and expired subkeys in key listings. Defaults to no.
1049 Display the keyring name at the head of key listings to show which
1050 keyring a given key resides on. Defaults to no.
1052 @item show-sig-expire
1053 Show signature expiration dates (if any) during @option{--list-sigs} or
1054 @option{--check-sigs} listings. Defaults to no.
1056 @item show-sig-subpackets
1057 Include signature subpackets in the key listing. This option can take an
1058 optional argument list of the subpackets to list. If no argument is
1059 passed, list all subpackets. Defaults to no. This option is only
1060 meaningful when using @option{--with-colons} along with
1061 @option{--list-sigs} or @option{--check-sigs}.
1064 @item --verify-options @code{parameters}
1065 This is a space or comma delimited string that gives options used when
1066 verifying signatures. Options can be prepended with a `no-' to give
1067 the opposite meaning. The options are:
1072 Display any photo IDs present on the key that issued the signature.
1073 Defaults to no. See also @option{--photo-viewer}.
1075 @item show-policy-urls
1076 Show policy URLs in the signature being verified. Defaults to no.
1078 @item show-notations
1079 @itemx show-std-notations
1080 @itemx show-user-notations
1081 Show all, IETF standard, or user-defined signature notations in the
1082 signature being verified. Defaults to IETF standard.
1084 @item show-keyserver-urls
1085 Show any preferred keyserver URL in the signature being verified.
1088 @item show-uid-validity
1089 Display the calculated validity of the user IDs on the key that issued
1090 the signature. Defaults to no.
1092 @item show-unusable-uids
1093 Show revoked and expired user IDs during signature verification.
1096 @item show-primary-uid-only
1097 Show only the primary user ID during signature verification. That is
1098 all the AKA lines as well as photo Ids are not shown with the signature
1099 verification status.
1102 Enable PKA lookups to verify sender addresses. Note that PKA is based
1103 on DNS, and so enabling this option may disclose information on when
1104 and what signatures are verified or to whom data is encrypted. This
1105 is similar to the "web bug" described for the auto-key-retrieve
1108 @item pka-trust-increase
1109 Raise the trust in a signature to full if the signature passes PKA
1110 validation. This option is only meaningful if pka-lookups is set.
1114 @itemx --disable-dsa2
1115 Enable hash truncation for all DSA keys even for old DSA Keys up to
1116 1024 bit. This is also the default with @option{--openpgp}. Note
1117 that older versions of GnuPG also required this flag to allow the
1118 generation of DSA larger than 1024 bit.
1120 @item --photo-viewer @code{string}
1121 This is the command line that should be run to view a photo ID. "%i"
1122 will be expanded to a filename containing the photo. "%I" does the
1123 same, except the file will not be deleted once the viewer exits.
1124 Other flags are "%k" for the key ID, "%K" for the long key ID, "%f"
1125 for the key fingerprint, "%t" for the extension of the image type
1126 (e.g. "jpg"), "%T" for the MIME type of the image (e.g. "image/jpeg"),
1127 and "%%" for an actual percent sign. If neither %i or %I are present,
1128 then the photo will be supplied to the viewer on standard input.
1130 The default viewer is "xloadimage -fork -quiet -title 'KeyID 0x%k'
1131 STDIN". Note that if your image viewer program is not secure, then
1132 executing it from GnuPG does not make it secure.
1134 @item --exec-path @code{string}
1135 Sets a list of directories to search for photo viewers and keyserver
1136 helpers. If not provided, keyserver helpers use the compiled-in
1137 default directory, and photo viewers use the $PATH environment
1139 Note, that on W32 system this value is ignored when searching for
1142 @item --keyring @code{file}
1143 Add @code{file} to the current list of keyrings. If @code{file} begins
1144 with a tilde and a slash, these are replaced by the $HOME directory. If
1145 the filename does not contain a slash, it is assumed to be in the GnuPG
1146 home directory ("~/.gnupg" if @option{--homedir} or $GNUPGHOME is not
1149 Note that this adds a keyring to the current list. If the intent is to
1150 use the specified keyring alone, use @option{--keyring} along with
1151 @option{--no-default-keyring}.
1153 @item --secret-keyring @code{file}
1154 Same as @option{--keyring} but for the secret keyrings.
1156 @item --primary-keyring @code{file}
1157 Designate @code{file} as the primary public keyring. This means that
1158 newly imported keys (via @option{--import} or keyserver
1159 @option{--recv-from}) will go to this keyring.
1161 @item --trustdb-name @code{file}
1162 Use @code{file} instead of the default trustdb. If @code{file} begins
1163 with a tilde and a slash, these are replaced by the $HOME directory. If
1164 the filename does not contain a slash, it is assumed to be in the GnuPG
1165 home directory (@file{~/.gnupg} if @option{--homedir} or $GNUPGHOME is
1169 @anchor{option --homedir}
1171 @include opt-homedir.texi
1175 @item --pcsc-driver @code{file}
1176 Use @code{file} to access the smartcard reader. The current default is
1177 `libpcsclite.so.1' for GLIBC based systems,
1178 `/System/Library/Frameworks/PCSC.framework/PCSC' for MAC OS X,
1179 `winscard.dll' for Windows and `libpcsclite.so' for other systems.
1183 @item --disable-ccid
1184 Disable the integrated support for CCID compliant readers. This
1185 allows to fall back to one of the other drivers even if the internal
1186 CCID driver can handle the reader. Note, that CCID support is only
1187 available if libusb was available at build time.
1191 @item --reader-port @code{number_or_string}
1192 This option may be used to specify the port of the card terminal. A
1193 value of 0 refers to the first serial device; add 32768 to access USB
1194 devices. The default is 32768 (first USB device). PC/SC or CCID
1195 readers might need a string here; run the program in verbose mode to get
1196 a list of available readers. The default is then the first reader
1200 @item --display-charset @code{name}
1201 Set the name of the native character set. This is used to convert
1202 some informational strings like user IDs to the proper UTF-8 encoding.
1203 Note that this has nothing to do with the character set of data to be
1204 encrypted or signed; GnuPG does not recode user-supplied data. If
1205 this option is not used, the default character set is determined from
1206 the current locale. A verbosity level of 3 shows the chosen set.
1207 Valid values for @code{name} are:
1212 This is the Latin 1 set.
1218 This is currently an alias for
1222 The usual Russian set (rfc1489).
1225 Bypass all translations and assume
1226 that the OS uses native UTF-8 encoding.
1229 @item --utf8-strings
1230 @itemx --no-utf8-strings
1231 Assume that command line arguments are given as UTF8 strings. The
1232 default (@option{--no-utf8-strings}) is to assume that arguments are
1233 encoded in the character set as specified by
1234 @option{--display-charset}. These options affect all following
1235 arguments. Both options may be used multiple times.
1238 @anchor{option --options}
1240 @item --options @code{file}
1241 Read options from @code{file} and do not try to read them from the
1242 default options file in the homedir (see @option{--homedir}). This
1243 option is ignored if used in an options file.
1246 Shortcut for @option{--options /dev/null}. This option is detected
1247 before an attempt to open an option file. Using this option will also
1248 prevent the creation of a @file{~/.gnupg} homedir.
1253 @itemx --compress-level @code{n}
1254 @itemx --bzip2-compress-level @code{n}
1255 Set compression level to @code{n} for the ZIP and ZLIB compression
1256 algorithms. The default is to use the default compression level of zlib
1257 (normally 6). @option{--bzip2-compress-level} sets the compression level
1258 for the BZIP2 compression algorithm (defaulting to 6 as well). This is a
1259 different option from @option{--compress-level} since BZIP2 uses a
1260 significant amount of memory for each additional compression level.
1261 @option{-z} sets both. A value of 0 for @code{n} disables compression.
1263 @item --bzip2-decompress-lowmem
1264 Use a different decompression method for BZIP2 compressed files. This
1265 alternate method uses a bit more than half the memory, but also runs
1266 at half the speed. This is useful under extreme low memory
1267 circumstances when the file was originally compressed at a high
1268 @option{--bzip2-compress-level}.
1271 @item --mangle-dos-filenames
1272 @itemx --no-mangle-dos-filenames
1273 @opindex mangle-dos-filenames
1274 @opindex no-mangle-dos-filenames
1275 Older version of Windows cannot handle filenames with more than one
1276 dot. @option{--mangle-dos-filenames} causes GnuPG to replace (rather
1277 than add to) the extension of an output filename to avoid this
1278 problem. This option is off by default and has no effect on non-Windows
1281 @item --ask-cert-level
1282 @itemx --no-ask-cert-level
1283 When making a key signature, prompt for a certification level. If this
1284 option is not specified, the certification level used is set via
1285 @option{--default-cert-level}. See @option{--default-cert-level} for
1286 information on the specific levels and how they are
1287 used. @option{--no-ask-cert-level} disables this option. This option
1290 @item --default-cert-level @code{n}
1291 The default to use for the check level when signing a key.
1293 0 means you make no particular claim as to how carefully you verified
1296 1 means you believe the key is owned by the person who claims to own
1297 it but you could not, or did not verify the key at all. This is
1298 useful for a "persona" verification, where you sign the key of a
1301 2 means you did casual verification of the key. For example, this
1302 could mean that you verified that the key fingerprint and checked the
1303 user ID on the key against a photo ID.
1305 3 means you did extensive verification of the key. For example, this
1306 could mean that you verified the key fingerprint with the owner of the
1307 key in person, and that you checked, by means of a hard to forge
1308 document with a photo ID (such as a passport) that the name of the key
1309 owner matches the name in the user ID on the key, and finally that you
1310 verified (by exchange of email) that the email address on the key
1311 belongs to the key owner.
1313 Note that the examples given above for levels 2 and 3 are just that:
1314 examples. In the end, it is up to you to decide just what "casual"
1315 and "extensive" mean to you.
1317 This option defaults to 0 (no particular claim).
1319 @item --min-cert-level
1320 When building the trust database, treat any signatures with a
1321 certification level below this as invalid. Defaults to 2, which
1322 disregards level 1 signatures. Note that level 0 "no particular
1323 claim" signatures are always accepted.
1325 @item --trusted-key @code{long key ID}
1326 Assume that the specified key (which must be given
1327 as a full 8 byte key ID) is as trustworthy as one of
1328 your own secret keys. This option is useful if you
1329 don't want to keep your secret keys (or one of them)
1330 online but still want to be able to check the validity of a given
1331 recipient's or signator's key.
1333 @item --trust-model @code{pgp|classic|direct|always|auto}
1334 Set what trust model GnuPG should follow. The models are:
1339 This is the Web of Trust combined with trust signatures as used in PGP
1340 5.x and later. This is the default trust model when creating a new
1344 This is the standard Web of Trust as used in PGP 2.x and earlier.
1347 Key validity is set directly by the user and not calculated via the
1351 Skip key validation and assume that used keys are always fully
1352 trusted. You generally won't use this unless you are using some
1353 external validation scheme. This option also suppresses the
1354 "[uncertain]" tag printed with signature checks when there is no
1355 evidence that the user ID is bound to the key.
1358 Select the trust model depending on whatever the internal trust
1359 database says. This is the default model if such a database already
1363 @item --auto-key-locate @code{parameters}
1364 @itemx --no-auto-key-locate
1365 GnuPG can automatically locate and retrieve keys as needed using this
1366 option. This happens when encrypting to an email address (in the
1367 "user@@example.com" form), and there are no user@@example.com keys on
1368 the local keyring. This option takes any number of the following
1369 mechanisms, in the order they are to be tried:
1374 Locate a key using DNS CERT, as specified in rfc4398.
1377 Locate a key using DNS PKA.
1380 Using DNS Service Discovery, check the domain in question for any LDAP
1381 keyservers to use. If this fails, attempt to locate the key using the
1382 PGP Universal method of checking @samp{ldap://keys.(thedomain)}.
1385 Locate a key using whatever keyserver is defined using the
1386 @option{--keyserver} option.
1389 In addition, a keyserver URL as used in the @option{--keyserver} option
1390 may be used here to query that particular keyserver.
1393 Locate the key using the local keyrings. This mechanism allows to
1394 select the order a local key lookup is done. Thus using
1395 @samp{--auto-key-locate local} is identical to
1396 @option{--no-auto-key-locate}.
1399 This flag disables the standard local key lookup, done before any of the
1400 mechanisms defined by the @option{--auto-key-locate} are tried. The
1401 position of this mechanism in the list does not matter. It is not
1402 required if @code{local} is also used.
1406 @item --keyid-format @code{short|0xshort|long|0xlong}
1407 Select how to display key IDs. "short" is the traditional 8-character
1408 key ID. "long" is the more accurate (but less convenient)
1409 16-character key ID. Add an "0x" to either to include an "0x" at the
1410 beginning of the key ID, as in 0x99242560.
1412 @item --keyserver @code{name}
1413 Use @code{name} as your keyserver. This is the server that
1414 @option{--recv-keys}, @option{--send-keys}, and @option{--search-keys}
1415 will communicate with to receive keys from, send keys to, and search for
1416 keys on. The format of the @code{name} is a URI:
1417 `scheme:[//]keyservername[:port]' The scheme is the type of keyserver:
1418 "hkp" for the HTTP (or compatible) keyservers, "ldap" for the LDAP
1419 keyservers, or "mailto" for the Graff email keyserver. Note that your
1420 particular installation of GnuPG may have other keyserver types
1421 available as well. Keyserver schemes are case-insensitive. After the
1422 keyserver name, optional keyserver configuration options may be
1423 provided. These are the same as the global @option{--keyserver-options}
1424 from below, but apply only to this particular keyserver.
1426 Most keyservers synchronize with each other, so there is generally no
1427 need to send keys to more than one server. The keyserver
1428 @code{hkp://keys.gnupg.net} uses round robin DNS to give a different
1429 keyserver each time you use it.
1431 @item --keyserver-options @code{name=value1 }
1432 This is a space or comma delimited string that gives options for the
1433 keyserver. Options can be prefixed with a `no-' to give the opposite
1434 meaning. Valid import-options or export-options may be used here as
1435 well to apply to importing (@option{--recv-key}) or exporting
1436 (@option{--send-key}) a key from a keyserver. While not all options
1437 are available for all keyserver types, some common options are:
1441 @item include-revoked
1442 When searching for a key with @option{--search-keys}, include keys that
1443 are marked on the keyserver as revoked. Note that not all keyservers
1444 differentiate between revoked and unrevoked keys, and for such
1445 keyservers this option is meaningless. Note also that most keyservers do
1446 not have cryptographic verification of key revocations, and so turning
1447 this option off may result in skipping keys that are incorrectly marked
1450 @item include-disabled
1451 When searching for a key with @option{--search-keys}, include keys that
1452 are marked on the keyserver as disabled. Note that this option is not
1453 used with HKP keyservers.
1455 @item auto-key-retrieve
1456 This option enables the automatic retrieving of keys from a keyserver
1457 when verifying signatures made by keys that are not on the local
1460 Note that this option makes a "web bug" like behavior possible.
1461 Keyserver operators can see which keys you request, so by sending you
1462 a message signed by a brand new key (which you naturally will not have
1463 on your local keyring), the operator can tell both your IP address and
1464 the time when you verified the signature.
1466 @item honor-keyserver-url
1467 When using @option{--refresh-keys}, if the key in question has a preferred
1468 keyserver URL, then use that preferred keyserver to refresh the key
1469 from. In addition, if auto-key-retrieve is set, and the signature
1470 being verified has a preferred keyserver URL, then use that preferred
1471 keyserver to fetch the key from. Defaults to yes.
1473 @item honor-pka-record
1474 If auto-key-retrieve is set, and the signature being verified has a
1475 PKA record, then use the PKA information to fetch the key. Defaults
1478 @item include-subkeys
1479 When receiving a key, include subkeys as potential targets. Note that
1480 this option is not used with HKP keyservers, as they do not support
1481 retrieving keys by subkey id.
1483 @item use-temp-files
1484 On most Unix-like platforms, GnuPG communicates with the keyserver
1485 helper program via pipes, which is the most efficient method. This
1486 option forces GnuPG to use temporary files to communicate. On some
1487 platforms (such as Win32 and RISC OS), this option is always enabled.
1489 @item keep-temp-files
1490 If using `use-temp-files', do not delete the temp files after using
1491 them. This option is useful to learn the keyserver communication
1492 protocol by reading the temporary files.
1495 Tell the keyserver helper program to be more verbose. This option can
1496 be repeated multiple times to increase the verbosity level.
1499 Tell the keyserver helper program how long (in seconds) to try and
1500 perform a keyserver action before giving up. Note that performing
1501 multiple actions at the same time uses this timeout value per action.
1502 For example, when retrieving multiple keys via @option{--recv-keys}, the
1503 timeout applies separately to each key retrieval, and not to the
1504 @option{--recv-keys} command as a whole. Defaults to 30 seconds.
1506 @item http-proxy=@code{value}
1507 Set the proxy to use for HTTP and HKP keyservers. This overrides the
1508 "http_proxy" environment variable, if any.
1511 When retrieving a key via DNS CERT, only accept keys up to this size.
1512 Defaults to 16384 bytes.
1515 Turn on debug output in the keyserver helper program. Note that the
1516 details of debug output depends on which keyserver helper program is
1517 being used, and in turn, on any libraries that the keyserver helper
1518 program uses internally (libcurl, openldap, etc).
1521 Enable certificate checking if the keyserver presents one (for hkps or
1522 ldaps). Defaults to on.
1525 Provide a certificate store to override the system default. Only
1526 necessary if check-cert is enabled, and the keyserver is using a
1527 certificate that is not present in a system default certificate list.
1529 Note that depending on the SSL library that the keyserver helper is
1530 built with, this may actually be a directory or a file.
1533 @item --completes-needed @code{n}
1534 Number of completely trusted users to introduce a new
1535 key signer (defaults to 1).
1537 @item --marginals-needed @code{n}
1538 Number of marginally trusted users to introduce a new
1539 key signer (defaults to 3)
1541 @item --max-cert-depth @code{n}
1542 Maximum depth of a certification chain (default is 5).
1544 @item --simple-sk-checksum
1545 Secret keys are integrity protected by using a SHA-1 checksum. This
1546 method is part of the upcoming enhanced OpenPGP specification but
1547 GnuPG already uses it as a countermeasure against certain attacks.
1548 Old applications don't understand this new format, so this option may
1549 be used to switch back to the old behaviour. Using this option bears
1550 a security risk. Note that using this option only takes effect when
1551 the secret key is encrypted - the simplest way to make this happen is
1552 to change the passphrase on the key (even changing it to the same
1553 value is acceptable).
1555 @item --no-sig-cache
1556 Do not cache the verification status of key signatures.
1557 Caching gives a much better performance in key listings. However, if
1558 you suspect that your public keyring is not save against write
1559 modifications, you can use this option to disable the caching. It
1560 probably does not make sense to disable it because all kind of damage
1561 can be done if someone else has write access to your public keyring.
1563 @item --no-sig-create-check
1564 GnuPG normally verifies each signature right after creation to protect
1565 against bugs and hardware malfunctions which could leak out bits from
1566 the secret key. This extra verification needs some time (about 115%
1567 for DSA keys), and so this option can be used to disable it.
1568 However, due to the fact that the signature creation needs manual
1569 interaction, this performance penalty does not matter in most settings.
1571 @item --auto-check-trustdb
1572 @itemx --no-auto-check-trustdb
1573 If GnuPG feels that its information about the Web of Trust has to be
1574 updated, it automatically runs the @option{--check-trustdb} command
1575 internally. This may be a time consuming
1576 process. @option{--no-auto-check-trustdb} disables this option.
1579 @itemx --no-use-agent
1581 This is dummy option. @command{@gpgname} always requires the agent.
1584 Try to use the GnuPG-Agent. With this option, GnuPG first tries to
1585 connect to the agent before it asks for a
1586 passphrase. @option{--no-use-agent} disables this option.
1589 @item --gpg-agent-info
1591 This is dummy option. It has no effect when used with @command{gpg2}.
1594 Override the value of the environment variable
1595 @samp{GPG_AGENT_INFO}. This is only used when @option{--use-agent} has
1596 been given. Given that this option is not anymore used by
1597 @command{gpg2}, it should be avoided if possible.
1601 Lock the databases the first time a lock is requested
1602 and do not release the lock until the process
1605 @item --lock-multiple
1606 Release the locks every time a lock is no longer
1607 needed. Use this to override a previous @option{--lock-once}
1611 Disable locking entirely. This option should be used only in very
1612 special environments, where it can be assured that only one process
1613 is accessing those files. A bootable floppy with a stand-alone
1614 encryption system will probably use this. Improper usage of this
1615 option may lead to data and key corruption.
1617 @item --exit-on-status-write-error
1618 This option will cause write errors on the status FD to immediately
1619 terminate the process. That should in fact be the default but it never
1620 worked this way and thus we need an option to enable this, so that the
1621 change won't break applications which close their end of a status fd
1622 connected pipe too early. Using this option along with
1623 @option{--enable-progress-filter} may be used to cleanly cancel long
1624 running gpg operations.
1626 @item --limit-card-insert-tries @code{n}
1627 With @code{n} greater than 0 the number of prompts asking to insert a
1628 smartcard gets limited to N-1. Thus with a value of 1 gpg won't at
1629 all ask to insert a card if none has been inserted at startup. This
1630 option is useful in the configuration file in case an application does
1631 not know about the smartcard support and waits ad infinitum for an
1634 @item --no-random-seed-file
1635 GnuPG uses a file to store its internal random pool over invocations.
1636 This makes random generation faster; however sometimes write operations
1637 are not desired. This option can be used to achieve that with the cost of
1638 slower random generation.
1641 Suppress the initial copyright message.
1643 @item --no-secmem-warning
1644 Suppress the warning about "using insecure memory".
1646 @item --no-permission-warning
1647 Suppress the warning about unsafe file and home directory (@option{--homedir})
1648 permissions. Note that the permission checks that GnuPG performs are
1649 not intended to be authoritative, but rather they simply warn about
1650 certain common permission problems. Do not assume that the lack of a
1651 warning means that your system is secure.
1653 Note that the warning for unsafe @option{--homedir} permissions cannot be
1654 suppressed in the gpg.conf file, as this would allow an attacker to
1655 place an unsafe gpg.conf file in place, and use this file to suppress
1656 warnings about itself. The @option{--homedir} permissions warning may only be
1657 suppressed on the command line.
1659 @item --no-mdc-warning
1660 Suppress the warning about missing MDC integrity protection.
1662 @item --require-secmem
1663 @itemx --no-require-secmem
1664 Refuse to run if GnuPG cannot get secure memory. Defaults to no
1665 (i.e. run, but give a warning).
1668 @item --require-cross-certification
1669 @itemx --no-require-cross-certification
1670 When verifying a signature made from a subkey, ensure that the cross
1671 certification "back signature" on the subkey is present and valid. This
1672 protects against a subtle attack against subkeys that can sign.
1673 Defaults to @option{--require-cross-certification} for
1678 Allow the user to do certain nonsensical or "silly" things like
1679 signing an expired or revoked key, or certain potentially incompatible
1680 things like generating unusual key types. This also disables certain
1681 warning messages about potentially incompatible actions. As the name
1682 implies, this option is for experts only. If you don't fully
1683 understand the implications of what it allows you to do, leave this
1684 off. @option{--no-expert} disables this option.
1692 @c *******************************************
1693 @c ******** KEY RELATED OPTIONS ************
1694 @c *******************************************
1695 @node GPG Key related Options
1696 @subsection Key related options
1700 @item --recipient @var{name}
1703 Encrypt for user id @var{name}. If this option or
1704 @option{--hidden-recipient} is not specified, GnuPG asks for the user-id
1705 unless @option{--default-recipient} is given.
1707 @item --hidden-recipient @var{name}
1709 @opindex hidden-recipient
1710 Encrypt for user ID @var{name}, but hide the key ID of this user's
1711 key. This option helps to hide the receiver of the message and is a
1712 limited countermeasure against traffic analysis. If this option or
1713 @option{--recipient} is not specified, GnuPG asks for the user ID unless
1714 @option{--default-recipient} is given.
1716 @item --encrypt-to @code{name}
1717 Same as @option{--recipient} but this one is intended for use in the
1718 options file and may be used with your own user-id as an
1719 "encrypt-to-self". These keys are only used when there are other
1720 recipients given either by use of @option{--recipient} or by the asked
1721 user id. No trust checking is performed for these user ids and even
1722 disabled keys can be used.
1724 @item --hidden-encrypt-to @code{name}
1725 Same as @option{--hidden-recipient} but this one is intended for use in the
1726 options file and may be used with your own user-id as a hidden
1727 "encrypt-to-self". These keys are only used when there are other
1728 recipients given either by use of @option{--recipient} or by the asked user id.
1729 No trust checking is performed for these user ids and even disabled
1732 @item --no-encrypt-to
1733 Disable the use of all @option{--encrypt-to} and
1734 @option{--hidden-encrypt-to} keys.
1736 @item --group @code{name=value1 }
1737 Sets up a named group, which is similar to aliases in email programs.
1738 Any time the group name is a recipient (@option{-r} or
1739 @option{--recipient}), it will be expanded to the values
1740 specified. Multiple groups with the same name are automatically merged
1741 into a single group.
1743 The values are @code{key IDs} or fingerprints, but any key description
1744 is accepted. Note that a value with spaces in it will be treated as
1745 two different values. Note also there is only one level of expansion
1746 --- you cannot make an group that points to another group. When used
1747 from the command line, it may be necessary to quote the argument to
1748 this option to prevent the shell from treating it as multiple
1751 @item --ungroup @code{name}
1752 Remove a given entry from the @option{--group} list.
1755 Remove all entries from the @option{--group} list.
1757 @item --local-user @var{name}
1760 Use @var{name} as the key to sign with. Note that this option overrides
1761 @option{--default-key}.
1763 @item --try-all-secrets
1764 @opindex try-all-secrets
1765 Don't look at the key ID as stored in the message but try all secret
1766 keys in turn to find the right decryption key. This option forces the
1767 behaviour as used by anonymous recipients (created by using
1768 @option{--throw-keyids}) and might come handy in case where an encrypted
1769 message contains a bogus key ID.
1771 @item --skip-hidden-recipients
1772 @itemx --no-skip-hidden-recipients
1773 @opindex skip-hidden-recipients
1774 @opindex no-skip-hidden-recipients
1775 During decryption skip all anonymous recipients. This option helps in
1776 the case that people use the hidden recipients feature to hide there
1777 own encrypt-to key from others. If oneself has many secret keys this
1778 may lead to a major annoyance because all keys are tried in turn to
1779 decrypt soemthing which was not really intended for it. The drawback
1780 of this option is that it is currently not possible to decrypt a
1781 message which includes real anonymous recipients.
1786 @c *******************************************
1787 @c ******** INPUT AND OUTPUT ***************
1788 @c *******************************************
1789 @node GPG Input and Output
1790 @subsection Input and Output
1797 Create ASCII armored output. The default is to create the binary
1801 Assume the input data is not in ASCII armored format.
1803 @item --output @var{file}
1804 @itemx -o @var{file}
1806 Write output to @var{file}.
1808 @item --max-output @code{n}
1810 This option sets a limit on the number of bytes that will be generated
1811 when processing a file. Since OpenPGP supports various levels of
1812 compression, it is possible that the plaintext of a given message may be
1813 significantly larger than the original OpenPGP message. While GnuPG
1814 works properly with such messages, there is often a desire to set a
1815 maximum file size that will be generated before processing is forced to
1816 stop by the OS limits. Defaults to 0, which means "no limit".
1818 @item --import-options @code{parameters}
1819 This is a space or comma delimited string that gives options for
1820 importing keys. Options can be prepended with a `no-' to give the
1821 opposite meaning. The options are:
1825 @item import-local-sigs
1826 Allow importing key signatures marked as "local". This is not
1827 generally useful unless a shared keyring scheme is being used.
1830 @item repair-pks-subkey-bug
1831 During import, attempt to repair the damage caused by the PKS keyserver
1832 bug (pre version 0.9.6) that mangles keys with multiple subkeys. Note
1833 that this cannot completely repair the damaged key as some crucial data
1834 is removed by the keyserver, but it does at least give you back one
1835 subkey. Defaults to no for regular @option{--import} and to yes for
1836 keyserver @option{--recv-keys}.
1839 During import, allow key updates to existing keys, but do not allow
1840 any new keys to be imported. Defaults to no.
1843 After import, compact (remove all signatures except the
1844 self-signature) any user IDs from the new key that are not usable.
1845 Then, remove any signatures from the new key that are not usable.
1846 This includes signatures that were issued by keys that are not present
1847 on the keyring. This option is the same as running the @option{--edit-key}
1848 command "clean" after import. Defaults to no.
1850 @item import-minimal
1851 Import the smallest key possible. This removes all signatures except
1852 the most recent self-signature on each user ID. This option is the
1853 same as running the @option{--edit-key} command "minimize" after import.
1857 @item --export-options @code{parameters}
1858 This is a space or comma delimited string that gives options for
1859 exporting keys. Options can be prepended with a `no-' to give the
1860 opposite meaning. The options are:
1864 @item export-local-sigs
1865 Allow exporting key signatures marked as "local". This is not
1866 generally useful unless a shared keyring scheme is being used.
1869 @item export-attributes
1870 Include attribute user IDs (photo IDs) while exporting. This is
1871 useful to export keys if they are going to be used by an OpenPGP
1872 program that does not accept attribute user IDs. Defaults to yes.
1874 @item export-sensitive-revkeys
1875 Include designated revoker information that was marked as
1876 "sensitive". Defaults to no.
1878 @item export-reset-subkey-passwd
1879 When using the @option{--export-secret-subkeys} command, this option resets
1880 the passphrases for all exported subkeys to empty. This is useful
1881 when the exported subkey is to be used on an unattended machine where
1882 a passphrase doesn't necessarily make sense. Defaults to no.
1885 Compact (remove all signatures from) user IDs on the key being
1886 exported if the user IDs are not usable. Also, do not export any
1887 signatures that are not usable. This includes signatures that were
1888 issued by keys that are not present on the keyring. This option is
1889 the same as running the @option{--edit-key} command "clean" before export
1890 except that the local copy of the key is not modified. Defaults to
1893 @item export-minimal
1894 Export the smallest key possible. This removes all signatures except the
1895 most recent self-signature on each user ID. This option is the same as
1896 running the @option{--edit-key} command "minimize" before export except
1897 that the local copy of the key is not modified. Defaults to no.
1901 @opindex with-colons
1902 Print key listings delimited by colons. Note that the output will be
1903 encoded in UTF-8 regardless of any @option{--display-charset} setting. This
1904 format is useful when GnuPG is called from scripts and other programs
1905 as it is easily machine parsed. The details of this format are
1906 documented in the file @file{doc/DETAILS}, which is included in the GnuPG
1907 source distribution.
1909 @item --fixed-list-mode
1910 @opindex fixed-list-mode
1911 Do not merge primary user ID and primary key in @option{--with-colon}
1912 listing mode and print all timestamps as seconds since 1970-01-01.
1914 Since GnuPG 2.0.10, this mode is always used and thus this option is
1915 obsolete; it does not harm to use it though.
1918 @item --with-fingerprint
1919 @opindex with-fingerprint
1920 Same as the command @option{--fingerprint} but changes only the format
1921 of the output and may be used together with another command.
1926 @c *******************************************
1927 @c ******** OPENPGP OPTIONS ****************
1928 @c *******************************************
1929 @node OpenPGP Options
1930 @subsection OpenPGP protocol specific options.
1934 @item -t, --textmode
1935 @itemx --no-textmode
1936 Treat input files as text and store them in the OpenPGP canonical text
1937 form with standard "CRLF" line endings. This also sets the necessary
1938 flags to inform the recipient that the encrypted or signed data is text
1939 and may need its line endings converted back to whatever the local
1940 system uses. This option is useful when communicating between two
1941 platforms that have different line ending conventions (UNIX-like to Mac,
1942 Mac to Windows, etc). @option{--no-textmode} disables this option, and
1946 If @option{-t} (but not @option{--textmode}) is used together with
1947 armoring and signing, this enables clearsigned messages. This kludge is
1948 needed for command-line compatibility with command-line versions of PGP;
1949 normally you would use @option{--sign} or @option{--clearsign} to select
1950 the type of the signature.
1953 @item --force-v3-sigs
1954 @itemx --no-force-v3-sigs
1955 OpenPGP states that an implementation should generate v4 signatures
1956 but PGP versions 5 through 7 only recognize v4 signatures on key
1957 material. This option forces v3 signatures for signatures on data.
1958 Note that this option implies @option{--ask-sig-expire},
1959 @option{--sig-policy-url}, @option{--sig-notation}, and
1960 @option{--sig-keyserver-url}, as these features cannot be used with v3
1961 signatures. @option{--no-force-v3-sigs} disables this option.
1963 @item --force-v4-certs
1964 @itemx --no-force-v4-certs
1965 Always use v4 key signatures even on v3 keys. This option also
1966 changes the default hash algorithm for v3 RSA keys from MD5 to SHA-1.
1967 @option{--no-force-v4-certs} disables this option.
1970 Force the use of encryption with a modification detection code. This
1971 is always used with the newer ciphers (those with a blocksize greater
1972 than 64 bits), or if all of the recipient keys indicate MDC support in
1973 their feature flags.
1976 Disable the use of the modification detection code. Note that by
1977 using this option, the encrypted message becomes vulnerable to a
1978 message modification attack.
1980 @item --personal-cipher-preferences @code{string}
1981 Set the list of personal cipher preferences to @code{string}. Use
1982 @command{@gpgname --version} to get a list of available algorithms,
1983 and use @code{none} to set no preference at all. This allows the user
1984 to safely override the algorithm chosen by the recipient key
1985 preferences, as GPG will only select an algorithm that is usable by
1986 all recipients. The most highly ranked cipher in this list is also
1987 used for the @option{--symmetric} encryption command.
1989 @item --personal-digest-preferences @code{string}
1990 Set the list of personal digest preferences to @code{string}. Use
1991 @command{@gpgname --version} to get a list of available algorithms,
1992 and use @code{none} to set no preference at all. This allows the user
1993 to safely override the algorithm chosen by the recipient key
1994 preferences, as GPG will only select an algorithm that is usable by
1995 all recipients. The most highly ranked digest algorithm in this list
1996 is also used when signing without encryption
1997 (e.g. @option{--clearsign} or @option{--sign}). The default value is
2000 @item --personal-compress-preferences @code{string}
2001 Set the list of personal compression preferences to @code{string}.
2002 Use @command{@gpgname --version} to get a list of available
2003 algorithms, and use @code{none} to set no preference at all. This
2004 allows the user to safely override the algorithm chosen by the
2005 recipient key preferences, as GPG will only select an algorithm that
2006 is usable by all recipients. The most highly ranked compression
2007 algorithm in this list is also used when there are no recipient keys
2008 to consider (e.g. @option{--symmetric}).
2010 @item --s2k-cipher-algo @code{name}
2011 Use @code{name} as the cipher algorithm used to protect secret keys.
2012 The default cipher is CAST5. This cipher is also used for
2013 conventional encryption if @option{--personal-cipher-preferences} and
2014 @option{--cipher-algo} is not given.
2016 @item --s2k-digest-algo @code{name}
2017 Use @code{name} as the digest algorithm used to mangle the passphrases.
2018 The default algorithm is SHA-1.
2020 @item --s2k-mode @code{n}
2021 Selects how passphrases are mangled. If @code{n} is 0 a plain
2022 passphrase (which is not recommended) will be used, a 1 adds a salt to
2023 the passphrase and a 3 (the default) iterates the whole process a
2024 number of times (see --s2k-count). Unless @option{--rfc1991} is used,
2025 this mode is also used for conventional encryption.
2027 @item --s2k-count @code{n}
2028 Specify how many times the passphrase mangling is repeated. This
2029 value may range between 1024 and 65011712 inclusive, and the default
2030 is 65536. Note that not all values in the 1024-65011712 range are
2031 legal and if an illegal value is selected, GnuPG will round up to the
2032 nearest legal value. This option is only meaningful if
2033 @option{--s2k-mode} is 3.
2038 @c ***************************
2039 @c ******* Compliance ********
2040 @c ***************************
2041 @subsection Compliance options
2043 These options control what GnuPG is compliant to. Only one of these
2044 options may be active at a time. Note that the default setting of
2045 this is nearly always the correct one. See the INTEROPERABILITY WITH
2046 OTHER OPENPGP PROGRAMS section below before using one of these
2053 Use standard GnuPG behavior. This is essentially OpenPGP behavior
2054 (see @option{--openpgp}), but with some additional workarounds for common
2055 compatibility problems in different versions of PGP. This is the
2056 default option, so it is not generally needed, but it may be useful to
2057 override a different compliance option in the gpg.conf file.
2061 Reset all packet, cipher and digest options to strict OpenPGP
2062 behavior. Use this option to reset all previous options like
2063 @option{--s2k-*}, @option{--cipher-algo}, @option{--digest-algo} and
2064 @option{--compress-algo} to OpenPGP compliant values. All PGP
2065 workarounds are disabled.
2069 Reset all packet, cipher and digest options to strict RFC-4880
2070 behavior. Note that this is currently the same thing as
2075 Reset all packet, cipher and digest options to strict RFC-2440
2080 Try to be more RFC-1991 (PGP 2.x) compliant.
2084 Set up all options to be as PGP 2.x compliant as possible, and warn if
2085 an action is taken (e.g. encrypting to a non-RSA key) that will create
2086 a message that PGP 2.x will not be able to handle. Note that `PGP
2087 2.x' here means `MIT PGP 2.6.2'. There are other versions of PGP 2.x
2088 available, but the MIT release is a good common baseline.
2090 This option implies @option{--rfc1991 --disable-mdc
2091 --no-force-v4-certs --escape-from-lines --force-v3-sigs --cipher-algo
2092 IDEA --digest-algo MD5 --compress-algo ZIP}. It also disables
2093 @option{--textmode} when encrypting.
2097 Set up all options to be as PGP 6 compliant as possible. This
2098 restricts you to the ciphers IDEA (if the IDEA plugin is installed),
2099 3DES, and CAST5, the hashes MD5, SHA1 and RIPEMD160, and the
2100 compression algorithms none and ZIP. This also disables
2101 --throw-keyids, and making signatures with signing subkeys as PGP 6
2102 does not understand signatures made by signing subkeys.
2104 This option implies @option{--disable-mdc --escape-from-lines
2109 Set up all options to be as PGP 7 compliant as possible. This is
2110 identical to @option{--pgp6} except that MDCs are not disabled, and the
2111 list of allowable ciphers is expanded to add AES128, AES192, AES256, and
2116 Set up all options to be as PGP 8 compliant as possible. PGP 8 is a lot
2117 closer to the OpenPGP standard than previous versions of PGP, so all
2118 this does is disable @option{--throw-keyids} and set
2119 @option{--escape-from-lines}. All algorithms are allowed except for the
2120 SHA224, SHA384, and SHA512 digests.
2125 @c *******************************************
2126 @c ******** ESOTERIC OPTIONS ***************
2127 @c *******************************************
2128 @node GPG Esoteric Options
2129 @subsection Doing things one usually doesn't want to do.
2136 Don't make any changes (this is not completely implemented).
2139 Changes the behaviour of some commands. This is like @option{--dry-run} but
2140 different in some cases. The semantic of this command may be extended in
2141 the future. Currently it only skips the actual decryption pass and
2142 therefore enables a fast listing of the encryption keys.
2145 @itemx --interactive
2146 @opindex interactive
2147 Prompt before overwriting any files.
2149 @item --debug @var{flags}
2151 Set debugging flags. All flags are or-ed and @var{flags} may
2152 be given in C syntax (e.g. 0x0042).
2155 Set all useful debugging flags.
2158 @item --debug-ccid-driver
2159 Enable debug output from the included CCID driver for smartcards.
2160 Note that this option is only available on some system.
2163 @item --enable-progress-filter
2164 Enable certain PROGRESS status outputs. This option allows frontends
2165 to display a progress indicator while gpg is processing larger files.
2166 There is a slight performance overhead using it.
2168 @item --status-fd @code{n}
2169 Write special status strings to the file descriptor @code{n}.
2170 See the file DETAILS in the documentation for a listing of them.
2172 @item --status-file @code{file}
2173 Same as @option{--status-fd}, except the status data is written to file
2176 @item --logger-fd @code{n}
2177 Write log output to file descriptor @code{n} and not to STDERR.
2179 @item --log-file @code{file}
2180 @itemx --logger-file @code{file}
2181 Same as @option{--logger-fd}, except the logger data is written to file
2182 @code{file}. Note that @option{--log-file} is only implemented for
2185 @item --attribute-fd @code{n}
2186 Write attribute subpackets to the file descriptor @code{n}. This is most
2187 useful for use with @option{--status-fd}, since the status messages are
2188 needed to separate out the various subpackets from the stream delivered
2189 to the file descriptor.
2191 @item --attribute-file @code{file}
2192 Same as @option{--attribute-fd}, except the attribute data is written to
2195 @item --comment @code{string}
2196 @itemx --no-comments
2197 Use @code{string} as a comment string in clear text signatures and ASCII
2198 armored messages or keys (see @option{--armor}). The default behavior is
2199 not to use a comment string. @option{--comment} may be repeated multiple
2200 times to get multiple comment strings. @option{--no-comments} removes
2201 all comments. It is a good idea to keep the length of a single comment
2202 below 60 characters to avoid problems with mail programs wrapping such
2203 lines. Note that comment lines, like all other header lines, are not
2204 protected by the signature.
2206 @item --emit-version
2207 @itemx --no-emit-version
2208 Force inclusion of the version string in ASCII armored output.
2209 @option{--no-emit-version} disables this option.
2211 @item --sig-notation @code{name=value}
2212 @itemx --cert-notation @code{name=value}
2213 @itemx -N, --set-notation @code{name=value}
2214 Put the name value pair into the signature as notation data.
2215 @code{name} must consist only of printable characters or spaces, and
2216 must contain a '@@' character in the form keyname@@domain.example.com
2217 (substituting the appropriate keyname and domain name, of course). This
2218 is to help prevent pollution of the IETF reserved notation
2219 namespace. The @option{--expert} flag overrides the '@@'
2220 check. @code{value} may be any printable string; it will be encoded in
2221 UTF8, so you should check that your @option{--display-charset} is set
2222 correctly. If you prefix @code{name} with an exclamation mark (!), the
2223 notation data will be flagged as critical
2224 (rfc2440:5.2.3.15). @option{--sig-notation} sets a notation for data
2225 signatures. @option{--cert-notation} sets a notation for key signatures
2226 (certifications). @option{--set-notation} sets both.
2228 There are special codes that may be used in notation names. "%k" will
2229 be expanded into the key ID of the key being signed, "%K" into the
2230 long key ID of the key being signed, "%f" into the fingerprint of the
2231 key being signed, "%s" into the key ID of the key making the
2232 signature, "%S" into the long key ID of the key making the signature,
2233 "%g" into the fingerprint of the key making the signature (which might
2234 be a subkey), "%p" into the fingerprint of the primary key of the key
2235 making the signature, "%c" into the signature count from the OpenPGP
2236 smartcard, and "%%" results in a single "%". %k, %K, and %f are only
2237 meaningful when making a key signature (certification), and %c is only
2238 meaningful when using the OpenPGP smartcard.
2240 @item --sig-policy-url @code{string}
2241 @itemx --cert-policy-url @code{string}
2242 @itemx --set-policy-url @code{string}
2243 Use @code{string} as a Policy URL for signatures (rfc2440:5.2.3.19). If
2244 you prefix it with an exclamation mark (!), the policy URL packet will
2245 be flagged as critical. @option{--sig-policy-url} sets a policy url for
2246 data signatures. @option{--cert-policy-url} sets a policy url for key
2247 signatures (certifications). @option{--set-policy-url} sets both.
2249 The same %-expandos used for notation data are available here as well.
2251 @item --sig-keyserver-url @code{string}
2252 Use @code{string} as a preferred keyserver URL for data signatures. If
2253 you prefix it with an exclamation mark (!), the keyserver URL packet
2254 will be flagged as critical.
2256 The same %-expandos used for notation data are available here as well.
2258 @item --set-filename @code{string}
2259 Use @code{string} as the filename which is stored inside messages.
2260 This overrides the default, which is to use the actual filename of the
2261 file being encrypted.
2263 @item --for-your-eyes-only
2264 @itemx --no-for-your-eyes-only
2265 Set the `for your eyes only' flag in the message. This causes GnuPG to
2266 refuse to save the file unless the @option{--output} option is given,
2267 and PGP to use a "secure viewer" with a claimed Tempest-resistant font
2268 to display the message. This option overrides @option{--set-filename}.
2269 @option{--no-for-your-eyes-only} disables this option.
2271 @item --use-embedded-filename
2272 @itemx --no-use-embedded-filename
2273 Try to create a file with a name as embedded in the data. This can be
2274 a dangerous option as it allows to overwrite files. Defaults to no.
2276 @item --cipher-algo @code{name}
2277 Use @code{name} as cipher algorithm. Running the program with the
2278 command @option{--version} yields a list of supported algorithms. If
2279 this is not used the cipher algorithm is selected from the preferences
2280 stored with the key. In general, you do not want to use this option as
2281 it allows you to violate the OpenPGP standard.
2282 @option{--personal-cipher-preferences} is the safe way to accomplish the
2285 @item --digest-algo @code{name}
2286 Use @code{name} as the message digest algorithm. Running the program
2287 with the command @option{--version} yields a list of supported algorithms. In
2288 general, you do not want to use this option as it allows you to
2289 violate the OpenPGP standard. @option{--personal-digest-preferences} is the
2290 safe way to accomplish the same thing.
2292 @item --compress-algo @code{name}
2293 Use compression algorithm @code{name}. "zlib" is RFC-1950 ZLIB
2294 compression. "zip" is RFC-1951 ZIP compression which is used by PGP.
2295 "bzip2" is a more modern compression scheme that can compress some
2296 things better than zip or zlib, but at the cost of more memory used
2297 during compression and decompression. "uncompressed" or "none"
2298 disables compression. If this option is not used, the default
2299 behavior is to examine the recipient key preferences to see which
2300 algorithms the recipient supports. If all else fails, ZIP is used for
2301 maximum compatibility.
2303 ZLIB may give better compression results than ZIP, as the compression
2304 window size is not limited to 8k. BZIP2 may give even better
2305 compression results than that, but will use a significantly larger
2306 amount of memory while compressing and decompressing. This may be
2307 significant in low memory situations. Note, however, that PGP (all
2308 versions) only supports ZIP compression. Using any algorithm other
2309 than ZIP or "none" will make the message unreadable with PGP. In
2310 general, you do not want to use this option as it allows you to
2311 violate the OpenPGP standard. @option{--personal-compress-preferences} is the
2312 safe way to accomplish the same thing.
2314 @item --cert-digest-algo @code{name}
2315 Use @code{name} as the message digest algorithm used when signing a
2316 key. Running the program with the command @option{--version} yields a
2317 list of supported algorithms. Be aware that if you choose an algorithm
2318 that GnuPG supports but other OpenPGP implementations do not, then some
2319 users will not be able to use the key signatures you make, or quite
2320 possibly your entire key.
2322 @item --disable-cipher-algo @code{name}
2323 Never allow the use of @code{name} as cipher algorithm.
2324 The given name will not be checked so that a later loaded algorithm
2325 will still get disabled.
2327 @item --disable-pubkey-algo @code{name}
2328 Never allow the use of @code{name} as public key algorithm.
2329 The given name will not be checked so that a later loaded algorithm
2330 will still get disabled.
2332 @item --throw-keyids
2333 @itemx --no-throw-keyids
2334 Do not put the recipient key IDs into encrypted messages. This helps to
2335 hide the receivers of the message and is a limited countermeasure
2336 against traffic analysis.@footnote{Using a little social engineering
2337 anyone who is able to decrypt the message can check whether one of the
2338 other recipients is the one he suspects.} On the receiving side, it may
2339 slow down the decryption process because all available secret keys must
2340 be tried. @option{--no-throw-keyids} disables this option. This option
2341 is essentially the same as using @option{--hidden-recipient} for all
2344 @item --not-dash-escaped
2345 This option changes the behavior of cleartext signatures
2346 so that they can be used for patch files. You should not
2347 send such an armored file via email because all spaces
2348 and line endings are hashed too. You can not use this
2349 option for data which has 5 dashes at the beginning of a
2350 line, patch files don't have this. A special armor header
2351 line tells GnuPG about this cleartext signature option.
2353 @item --escape-from-lines
2354 @itemx --no-escape-from-lines
2355 Because some mailers change lines starting with "From " to ">From " it
2356 is good to handle such lines in a special way when creating cleartext
2357 signatures to prevent the mail system from breaking the signature. Note
2358 that all other PGP versions do it this way too. Enabled by
2359 default. @option{--no-escape-from-lines} disables this option.
2361 @item --passphrase-repeat @code{n}
2362 Specify how many times @command{@gpgname} will request a new
2363 passphrase be repeated. This is useful for helping memorize a
2364 passphrase. Defaults to 1 repetition.
2366 @item --passphrase-fd @code{n}
2367 Read the passphrase from file descriptor @code{n}. Only the first line
2368 will be read from file descriptor @code{n}. If you use 0 for @code{n},
2369 the passphrase will be read from STDIN. This can only be used if only
2370 one passphrase is supplied.
2372 Note that this passphrase is only used if the option @option{--batch}
2373 has also been given. This is different from @command{gpg}.
2376 @item --passphrase-file @code{file}
2377 Read the passphrase from file @code{file}. Only the first line will
2378 be read from file @code{file}. This can only be used if only one
2379 passphrase is supplied. Obviously, a passphrase stored in a file is
2380 of questionable security if other users can read this file. Don't use
2381 this option if you can avoid it.
2383 Note that this passphrase is only used if the option @option{--batch}
2384 has also been given. This is different from @command{gpg}.
2387 @item --passphrase @code{string}
2388 Use @code{string} as the passphrase. This can only be used if only one
2389 passphrase is supplied. Obviously, this is of very questionable
2390 security on a multi-user system. Don't use this option if you can
2393 Note that this passphrase is only used if the option @option{--batch}
2394 has also been given. This is different from @command{gpg}.
2397 @item --command-fd @code{n}
2398 This is a replacement for the deprecated shared-memory IPC mode.
2399 If this option is enabled, user input on questions is not expected
2400 from the TTY but from the given file descriptor. It should be used
2401 together with @option{--status-fd}. See the file doc/DETAILS in the source
2402 distribution for details on how to use it.
2404 @item --command-file @code{file}
2405 Same as @option{--command-fd}, except the commands are read out of file
2408 @item --allow-non-selfsigned-uid
2409 @itemx --no-allow-non-selfsigned-uid
2410 Allow the import and use of keys with user IDs which are not
2411 self-signed. This is not recommended, as a non self-signed user ID is
2412 trivial to forge. @option{--no-allow-non-selfsigned-uid} disables.
2414 @item --allow-freeform-uid
2415 Disable all checks on the form of the user ID while generating a new
2416 one. This option should only be used in very special environments as
2417 it does not ensure the de-facto standard format of user IDs.
2419 @item --ignore-time-conflict
2420 GnuPG normally checks that the timestamps associated with keys and
2421 signatures have plausible values. However, sometimes a signature
2422 seems to be older than the key due to clock problems. This option
2423 makes these checks just a warning. See also @option{--ignore-valid-from} for
2424 timestamp issues on subkeys.
2426 @item --ignore-valid-from
2427 GnuPG normally does not select and use subkeys created in the future.
2428 This option allows the use of such keys and thus exhibits the
2429 pre-1.0.7 behaviour. You should not use this option unless you there
2430 is some clock problem. See also @option{--ignore-time-conflict} for timestamp
2431 issues with signatures.
2433 @item --ignore-crc-error
2434 The ASCII armor used by OpenPGP is protected by a CRC checksum against
2435 transmission errors. Occasionally the CRC gets mangled somewhere on
2436 the transmission channel but the actual content (which is protected by
2437 the OpenPGP protocol anyway) is still okay. This option allows GnuPG
2438 to ignore CRC errors.
2440 @item --ignore-mdc-error
2441 This option changes a MDC integrity protection failure into a warning.
2442 This can be useful if a message is partially corrupt, but it is
2443 necessary to get as much data as possible out of the corrupt message.
2444 However, be aware that a MDC protection failure may also mean that the
2445 message was tampered with intentionally by an attacker.
2447 @item --no-default-keyring
2448 Do not add the default keyrings to the list of keyrings. Note that
2449 GnuPG will not operate without any keyrings, so if you use this option
2450 and do not provide alternate keyrings via @option{--keyring} or
2451 @option{--secret-keyring}, then GnuPG will still use the default public or
2455 Skip the signature verification step. This may be
2456 used to make the decryption faster if the signature
2457 verification is not needed.
2459 @item --with-key-data
2460 Print key listings delimited by colons (like @option{--with-colons}) and
2461 print the public key data.
2463 @item --fast-list-mode
2464 Changes the output of the list commands to work faster; this is achieved
2465 by leaving some parts empty. Some applications don't need the user ID
2466 and the trust information given in the listings. By using this options
2467 they can get a faster listing. The exact behaviour of this option may
2468 change in future versions. If you are missing some information, don't
2472 This is not for normal use. Use the source to see for what it might be useful.
2474 @item --set-filesize
2475 This is not for normal use. Use the source to see for what it might be useful.
2477 @item --show-session-key
2478 Display the session key used for one message. See
2479 @option{--override-session-key} for the counterpart of this option.
2481 We think that Key Escrow is a Bad Thing; however the user should have
2482 the freedom to decide whether to go to prison or to reveal the content
2483 of one specific message without compromising all messages ever
2484 encrypted for one secret key. DON'T USE IT UNLESS YOU ARE REALLY
2487 @item --override-session-key @code{string}
2488 Don't use the public key but the session key @code{string}. The format
2489 of this string is the same as the one printed by
2490 @option{--show-session-key}. This option is normally not used but comes
2491 handy in case someone forces you to reveal the content of an encrypted
2492 message; using this option you can do this without handing out the
2495 @item --ask-sig-expire
2496 @itemx --no-ask-sig-expire
2497 When making a data signature, prompt for an expiration time. If this
2498 option is not specified, the expiration time set via
2499 @option{--default-sig-expire} is used. @option{--no-ask-sig-expire}
2500 disables this option. Note that by default, @option{--force-v3-sigs} is
2501 set which also disables this option. If you want signature expiration,
2502 you must set @option{--no-force-v3-sigs} as well as turning
2503 @option{--ask-sig-expire} on.
2505 @item --default-sig-expire
2506 The default expiration time to use for signature expiration. Valid
2507 values are "0" for no expiration, a number followed by the letter d
2508 (for days), w (for weeks), m (for months), or y (for years) (for
2509 example "2m" for two months, or "5y" for five years), or an absolute
2510 date in the form YYYY-MM-DD. Defaults to "0".
2512 @item --ask-cert-expire
2513 @itemx --no-ask-cert-expire
2514 When making a key signature, prompt for an expiration time. If this
2515 option is not specified, the expiration time set via
2516 @option{--default-cert-expire} is used. @option{--no-ask-cert-expire}
2517 disables this option.
2519 @item --default-cert-expire
2520 The default expiration time to use for key signature expiration.
2521 Valid values are "0" for no expiration, a number followed by the
2522 letter d (for days), w (for weeks), m (for months), or y (for years)
2523 (for example "2m" for two months, or "5y" for five years), or an
2524 absolute date in the form YYYY-MM-DD. Defaults to "0".
2526 @item --allow-secret-key-import
2527 This is an obsolete option and is not used anywhere.
2529 @item --allow-multiple-messages
2530 @item --no-allow-multiple-messages
2531 Allow processing of multiple OpenPGP messages contained in a single file
2532 or stream. Some programs that call GPG are not prepared to deal with
2533 multiple messages being processed together, so this option defaults to
2534 no. Note that versions of GPG prior to 1.4.7 always allowed multiple
2537 Warning: Do not use this option unless you need it as a temporary
2541 @item --enable-special-filenames
2542 This options enables a mode in which filenames of the form
2543 @file{-&n}, where n is a non-negative decimal number,
2544 refer to the file descriptor n and not to a file with that name.
2546 @item --no-expensive-trust-checks
2547 Experimental use only.
2549 @item --preserve-permissions
2550 Don't change the permissions of a secret keyring back to user
2551 read/write only. Use this option only if you really know what you are doing.
2553 @item --default-preference-list @code{string}
2554 @opindex default-preference-list
2555 Set the list of default preferences to @code{string}. This preference
2556 list is used for new keys and becomes the default for "setpref" in the
2559 @item --default-keyserver-url @code{name}
2560 @opindex default-keyserver-url
2561 Set the default keyserver URL to @code{name}. This keyserver will be
2562 used as the keyserver URL when writing a new self-signature on a key,
2563 which includes key generation and changing preferences.
2566 @opindex list-config
2567 Display various internal configuration parameters of GnuPG. This option
2568 is intended for external programs that call GnuPG to perform tasks, and
2569 is thus not generally useful. See the file @file{doc/DETAILS} in the
2570 source distribution for the details of which configuration items may be
2571 listed. @option{--list-config} is only usable with
2572 @option{--with-colons} set.
2574 @item --gpgconf-list
2575 @opindex gpgconf-list
2576 This command is similar to @option{--list-config} but in general only
2577 internally used by the @command{gpgconf} tool.
2579 @item --gpgconf-test
2580 @opindex gpgconf-test
2581 This is more or less dummy action. However it parses the configuration
2582 file and returns with failure if the configuration file would prevent
2583 @command{gpg} from startup. Thus it may be used to run a syntax check
2584 on the configuration file.
2588 @c *******************************
2589 @c ******* Deprecated ************
2590 @c *******************************
2591 @subsection Deprecated options
2596 @item --load-extension @code{name}
2597 Load an extension module. If @code{name} does not contain a slash it is
2598 searched for in the directory configured when GnuPG was built
2599 (generally "/usr/local/lib/gnupg"). Extensions are not generally
2600 useful anymore, and the use of this option is deprecated.
2604 @itemx --no-show-photos
2605 Causes @option{--list-keys}, @option{--list-sigs},
2606 @option{--list-public-keys}, @option{--list-secret-keys}, and verifying
2607 a signature to also display the photo ID attached to the key, if
2608 any. See also @option{--photo-viewer}. These options are deprecated. Use
2609 @option{--list-options [no-]show-photos} and/or @option{--verify-options
2610 [no-]show-photos} instead.
2612 @item --show-keyring
2613 Display the keyring name at the head of key listings to show which
2614 keyring a given key resides on. This option is deprecated: use
2615 @option{--list-options [no-]show-keyring} instead.
2618 @item --ctapi-driver @code{file}
2619 Use @code{file} to access the smartcard reader. The current default
2620 is `libtowitoko.so'. Note that the use of this interface is
2621 deprecated; it may be removed in future releases.
2624 @item --always-trust
2625 Identical to @option{--trust-model always}. This option is deprecated.
2627 @item --show-notation
2628 @itemx --no-show-notation
2629 Show signature notations in the @option{--list-sigs} or @option{--check-sigs} listings
2630 as well as when verifying a signature with a notation in it. These
2631 options are deprecated. Use @option{--list-options [no-]show-notation}
2632 and/or @option{--verify-options [no-]show-notation} instead.
2634 @item --show-policy-url
2635 @itemx --no-show-policy-url
2636 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
2637 listings as well as when verifying a signature with a policy URL in
2638 it. These options are deprecated. Use @option{--list-options
2639 [no-]show-policy-url} and/or @option{--verify-options
2640 [no-]show-policy-url} instead.
2646 @c *******************************************
2647 @c *************** ****************
2648 @c *************** FILES ****************
2649 @c *************** ****************
2650 @c *******************************************
2652 @node GPG Configuration
2653 @section Configuration files
2655 There are a few configuration files to control certain aspects of
2656 @command{@gpgname}'s operation. Unless noted, they are expected in the
2657 current home directory (@pxref{option --homedir}).
2663 This is the standard configuration file read by @command{@gpgname} on
2664 startup. It may contain any valid long option; the leading two dashes
2665 may not be entered and the option may not be abbreviated. This default
2666 name may be changed on the command line (@pxref{option --options}).
2667 You should backup this file.
2672 Note that on larger installations, it is useful to put predefined files
2673 into the directory @file{/etc/skel/.gnupg/} so that newly created users
2674 start up with a working configuration.
2676 For existing users the a small
2677 helper script is provided to create these files (@pxref{addgnupghome}).
2680 For internal purposes @command{@gpgname} creates and maintains a few other
2681 files; They all live in in the current home directory (@pxref{option
2682 --homedir}). Only the @command{@gpgname} may modify these files.
2686 @item ~/.gnupg/secring.gpg
2687 The secret keyring. You should backup this file.
2689 @item ~/.gnupg/secring.gpg.lock
2690 The lock file for the secret keyring.
2692 @item ~/.gnupg/pubring.gpg
2693 The public keyring. You should backup this file.
2695 @item ~/.gnupg/pubring.gpg.lock
2696 The lock file for the public keyring.
2698 @item ~/.gnupg/trustdb.gpg
2699 The trust database. There is no need to backup this file; it is better
2700 to backup the ownertrust values (@pxref{option --export-ownertrust}).
2702 @item ~/.gnupg/trustdb.gpg.lock
2703 The lock file for the trust database.
2705 @item ~/.gnupg/random_seed
2706 A file used to preserve the state of the internal random pool.
2708 @item /usr[/local]/share/gnupg/options.skel
2709 The skeleton options file.
2711 @item /usr[/local]/lib/gnupg/
2712 Default location for extensions.
2717 Operation is further controlled by a few environment variables:
2722 Used to locate the default home directory.
2725 If set directory used instead of "~/.gnupg".
2727 @item GPG_AGENT_INFO
2728 Used to locate the gpg-agent.
2730 This is only honored when @option{--use-agent} is set.
2732 The value consists of 3 colon delimited fields: The first is the path
2733 to the Unix Domain Socket, the second the PID of the gpg-agent and the
2734 protocol version which should be set to 1. When starting the gpg-agent
2735 as described in its documentation, this variable is set to the correct
2736 value. The option @option{--gpg-agent-info} can be used to override it.
2738 @item PINENTRY_USER_DATA
2739 This value is passed via gpg-agent to pinentry. It is useful to convey
2740 extra information to a custom pinentry.
2744 Used to size some displays to the full size of the screen.
2748 Apart from its use by GNU, it is used in the W32 version to override the
2749 language selection done through the Registry. If used and set to a
2750 valid and available language name (@var{langid}), the file with the
2751 translation is loaded from
2752 @code{@var{gpgdir}/gnupg.nls/@var{langid}.mo}. Here @var{gpgdir} is the
2753 directory out of which the gpg binary has been loaded. If it can't be
2754 loaded the Registry is tried and as last resort the native Windows
2755 locale system is used.
2760 @c *******************************************
2761 @c *************** ****************
2762 @c *************** EXAMPLES ****************
2763 @c *************** ****************
2764 @c *******************************************
2771 @item gpg -se -r @code{Bob} @code{file}
2772 sign and encrypt for user Bob
2774 @item gpg --clearsign @code{file}
2775 make a clear text signature
2777 @item gpg -sb @code{file}
2778 make a detached signature
2780 @item gpg -u 0x12345678 -sb @code{file}
2781 make a detached signature with the key 0x12345678
2783 @item gpg --list-keys @code{user_ID}
2786 @item gpg --fingerprint @code{user_ID}
2789 @item gpg --verify @code{pgpfile}
2790 @itemx gpg --verify @code{sigfile}
2791 Verify the signature of the file but do not output the data. The
2792 second form is used for detached signatures, where @code{sigfile}
2793 is the detached signature (either ASCII armored or binary) and
2794 are the signed data; if this is not given, the name of
2795 the file holding the signed data is constructed by cutting off the
2796 extension (".asc" or ".sig") of @code{sigfile} or by asking the
2797 user for the filename.
2801 @c *******************************************
2802 @c *************** ****************
2803 @c *************** USER ID ****************
2804 @c *************** ****************
2805 @c *******************************************
2806 @mansect how to specify a user id
2808 @include specify-user-id.texi
2811 @mansect return value
2812 @chapheading RETURN VALUE
2814 The program returns 0 if everything was fine, 1 if at least
2815 a signature was bad, and other error codes for fatal errors.
2818 @chapheading WARNINGS
2820 Use a *good* password for your user account and a *good* passphrase
2821 to protect your secret key. This passphrase is the weakest part of the
2822 whole system. Programs to do dictionary attacks on your secret keyring
2823 are very easy to write and so you should protect your "~/.gnupg/"
2824 directory very well.
2826 Keep in mind that, if this program is used over a network (telnet), it
2827 is *very* easy to spy out your passphrase!
2829 If you are going to verify detached signatures, make sure that the
2830 program knows about it; either give both filenames on the command line
2831 or use @samp{-} to specify STDIN.
2833 @mansect interoperability
2834 @chapheading INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS
2836 GnuPG tries to be a very flexible implementation of the OpenPGP
2837 standard. In particular, GnuPG implements many of the optional parts
2838 of the standard, such as the SHA-512 hash, and the ZLIB and BZIP2
2839 compression algorithms. It is important to be aware that not all
2840 OpenPGP programs implement these optional algorithms and that by
2841 forcing their use via the @option{--cipher-algo},
2842 @option{--digest-algo}, @option{--cert-digest-algo}, or
2843 @option{--compress-algo} options in GnuPG, it is possible to create a
2844 perfectly valid OpenPGP message, but one that cannot be read by the
2847 There are dozens of variations of OpenPGP programs available, and each
2848 supports a slightly different subset of these optional algorithms.
2849 For example, until recently, no (unhacked) version of PGP supported
2850 the BLOWFISH cipher algorithm. A message using BLOWFISH simply could
2851 not be read by a PGP user. By default, GnuPG uses the standard
2852 OpenPGP preferences system that will always do the right thing and
2853 create messages that are usable by all recipients, regardless of which
2854 OpenPGP program they use. Only override this safe default if you
2855 really know what you are doing.
2857 If you absolutely must override the safe default, or if the preferences
2858 on a given key are invalid for some reason, you are far better off using
2859 the @option{--pgp6}, @option{--pgp7}, or @option{--pgp8} options. These
2860 options are safe as they do not force any particular algorithms in
2861 violation of OpenPGP, but rather reduce the available algorithms to a
2867 On many systems this program should be installed as setuid(root). This
2868 is necessary to lock memory pages. Locking memory pages prevents the
2869 operating system from writing memory pages (which may contain
2870 passphrases or other sensitive material) to disk. If you get no
2871 warning message about insecure memory your operating system supports
2872 locking without being root. The program drops root privileges as soon
2873 as locked memory is allocated.
2875 Note also that some systems (especially laptops) have the ability to
2876 ``suspend to disk'' (also known as ``safe sleep'' or ``hibernate'').
2877 This writes all memory to disk before going into a low power or even
2878 powered off mode. Unless measures are taken in the operating system
2879 to protect the saved memory, passphrases or other sensitive material
2880 may be recoverable from it later.
2887 @command{gpg-agent}(1)
2890 @include see-also-note.texi