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 file 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.
1531 @item --completes-needed @code{n}
1532 Number of completely trusted users to introduce a new
1533 key signer (defaults to 1).
1535 @item --marginals-needed @code{n}
1536 Number of marginally trusted users to introduce a new
1537 key signer (defaults to 3)
1539 @item --max-cert-depth @code{n}
1540 Maximum depth of a certification chain (default is 5).
1542 @item --simple-sk-checksum
1543 Secret keys are integrity protected by using a SHA-1 checksum. This
1544 method is part of the upcoming enhanced OpenPGP specification but
1545 GnuPG already uses it as a countermeasure against certain attacks.
1546 Old applications don't understand this new format, so this option may
1547 be used to switch back to the old behaviour. Using this option bears
1548 a security risk. Note that using this option only takes effect when
1549 the secret key is encrypted - the simplest way to make this happen is
1550 to change the passphrase on the key (even changing it to the same
1551 value is acceptable).
1553 @item --no-sig-cache
1554 Do not cache the verification status of key signatures.
1555 Caching gives a much better performance in key listings. However, if
1556 you suspect that your public keyring is not save against write
1557 modifications, you can use this option to disable the caching. It
1558 probably does not make sense to disable it because all kind of damage
1559 can be done if someone else has write access to your public keyring.
1561 @item --no-sig-create-check
1562 GnuPG normally verifies each signature right after creation to protect
1563 against bugs and hardware malfunctions which could leak out bits from
1564 the secret key. This extra verification needs some time (about 115%
1565 for DSA keys), and so this option can be used to disable it.
1566 However, due to the fact that the signature creation needs manual
1567 interaction, this performance penalty does not matter in most settings.
1569 @item --auto-check-trustdb
1570 @itemx --no-auto-check-trustdb
1571 If GnuPG feels that its information about the Web of Trust has to be
1572 updated, it automatically runs the @option{--check-trustdb} command
1573 internally. This may be a time consuming
1574 process. @option{--no-auto-check-trustdb} disables this option.
1577 @itemx --no-use-agent
1579 This is dummy option. @command{@gpgname} always requires the agent.
1582 Try to use the GnuPG-Agent. With this option, GnuPG first tries to
1583 connect to the agent before it asks for a
1584 passphrase. @option{--no-use-agent} disables this option.
1587 @item --gpg-agent-info
1589 This is dummy option. It has no effect when used with @command{gpg2}.
1592 Override the value of the environment variable
1593 @samp{GPG_AGENT_INFO}. This is only used when @option{--use-agent} has
1594 been given. Given that this option is not anymore used by
1595 @command{gpg2}, it should be avoided if possible.
1599 Lock the databases the first time a lock is requested
1600 and do not release the lock until the process
1603 @item --lock-multiple
1604 Release the locks every time a lock is no longer
1605 needed. Use this to override a previous @option{--lock-once}
1609 Disable locking entirely. This option should be used only in very
1610 special environments, where it can be assured that only one process
1611 is accessing those files. A bootable floppy with a stand-alone
1612 encryption system will probably use this. Improper usage of this
1613 option may lead to data and key corruption.
1615 @item --exit-on-status-write-error
1616 This option will cause write errors on the status FD to immediately
1617 terminate the process. That should in fact be the default but it never
1618 worked this way and thus we need an option to enable this, so that the
1619 change won't break applications which close their end of a status fd
1620 connected pipe too early. Using this option along with
1621 @option{--enable-progress-filter} may be used to cleanly cancel long
1622 running gpg operations.
1624 @item --limit-card-insert-tries @code{n}
1625 With @code{n} greater than 0 the number of prompts asking to insert a
1626 smartcard gets limited to N-1. Thus with a value of 1 gpg won't at
1627 all ask to insert a card if none has been inserted at startup. This
1628 option is useful in the configuration file in case an application does
1629 not know about the smartcard support and waits ad infinitum for an
1632 @item --no-random-seed-file
1633 GnuPG uses a file to store its internal random pool over invocations.
1634 This makes random generation faster; however sometimes write operations
1635 are not desired. This option can be used to achieve that with the cost of
1636 slower random generation.
1639 Suppress the initial copyright message.
1641 @item --no-secmem-warning
1642 Suppress the warning about "using insecure memory".
1644 @item --no-permission-warning
1645 Suppress the warning about unsafe file and home directory (@option{--homedir})
1646 permissions. Note that the permission checks that GnuPG performs are
1647 not intended to be authoritative, but rather they simply warn about
1648 certain common permission problems. Do not assume that the lack of a
1649 warning means that your system is secure.
1651 Note that the warning for unsafe @option{--homedir} permissions cannot be
1652 suppressed in the gpg.conf file, as this would allow an attacker to
1653 place an unsafe gpg.conf file in place, and use this file to suppress
1654 warnings about itself. The @option{--homedir} permissions warning may only be
1655 suppressed on the command line.
1657 @item --no-mdc-warning
1658 Suppress the warning about missing MDC integrity protection.
1660 @item --require-secmem
1661 @itemx --no-require-secmem
1662 Refuse to run if GnuPG cannot get secure memory. Defaults to no
1663 (i.e. run, but give a warning).
1666 @item --require-cross-certification
1667 @itemx --no-require-cross-certification
1668 When verifying a signature made from a subkey, ensure that the cross
1669 certification "back signature" on the subkey is present and valid. This
1670 protects against a subtle attack against subkeys that can sign.
1671 Defaults to @option{--require-cross-certification} for
1676 Allow the user to do certain nonsensical or "silly" things like
1677 signing an expired or revoked key, or certain potentially incompatible
1678 things like generating unusual key types. This also disables certain
1679 warning messages about potentially incompatible actions. As the name
1680 implies, this option is for experts only. If you don't fully
1681 understand the implications of what it allows you to do, leave this
1682 off. @option{--no-expert} disables this option.
1690 @c *******************************************
1691 @c ******** KEY RELATED OPTIONS ************
1692 @c *******************************************
1693 @node GPG Key related Options
1694 @subsection Key related options
1698 @item --recipient @var{name}
1701 Encrypt for user id @var{name}. If this option or
1702 @option{--hidden-recipient} is not specified, GnuPG asks for the user-id
1703 unless @option{--default-recipient} is given.
1705 @item --hidden-recipient @var{name}
1707 @opindex hidden-recipient
1708 Encrypt for user ID @var{name}, but hide the key ID of this user's
1709 key. This option helps to hide the receiver of the message and is a
1710 limited countermeasure against traffic analysis. If this option or
1711 @option{--recipient} is not specified, GnuPG asks for the user ID unless
1712 @option{--default-recipient} is given.
1714 @item --encrypt-to @code{name}
1715 Same as @option{--recipient} but this one is intended for use in the
1716 options file and may be used with your own user-id as an
1717 "encrypt-to-self". These keys are only used when there are other
1718 recipients given either by use of @option{--recipient} or by the asked
1719 user id. No trust checking is performed for these user ids and even
1720 disabled keys can be used.
1722 @item --hidden-encrypt-to @code{name}
1723 Same as @option{--hidden-recipient} but this one is intended for use in the
1724 options file and may be used with your own user-id as a hidden
1725 "encrypt-to-self". These keys are only used when there are other
1726 recipients given either by use of @option{--recipient} or by the asked user id.
1727 No trust checking is performed for these user ids and even disabled
1730 @item --no-encrypt-to
1731 Disable the use of all @option{--encrypt-to} and
1732 @option{--hidden-encrypt-to} keys.
1734 @item --group @code{name=value1 }
1735 Sets up a named group, which is similar to aliases in email programs.
1736 Any time the group name is a recipient (@option{-r} or
1737 @option{--recipient}), it will be expanded to the values
1738 specified. Multiple groups with the same name are automatically merged
1739 into a single group.
1741 The values are @code{key IDs} or fingerprints, but any key description
1742 is accepted. Note that a value with spaces in it will be treated as
1743 two different values. Note also there is only one level of expansion
1744 --- you cannot make an group that points to another group. When used
1745 from the command line, it may be necessary to quote the argument to
1746 this option to prevent the shell from treating it as multiple
1749 @item --ungroup @code{name}
1750 Remove a given entry from the @option{--group} list.
1753 Remove all entries from the @option{--group} list.
1755 @item --local-user @var{name}
1758 Use @var{name} as the key to sign with. Note that this option overrides
1759 @option{--default-key}.
1761 @item --try-all-secrets
1762 Don't look at the key ID as stored in the message but try all secret
1763 keys in turn to find the right decryption key. This option forces the
1764 behaviour as used by anonymous recipients (created by using
1765 @option{--throw-keyids}) and might come handy in case where an encrypted
1766 message contains a bogus key ID.
1774 @c *******************************************
1775 @c ******** INPUT AND OUTPUT ***************
1776 @c *******************************************
1777 @node GPG Input and Output
1778 @subsection Input and Output
1785 Create ASCII armored output. The default is to create the binary
1789 Assume the input data is not in ASCII armored format.
1791 @item --output @var{file}
1792 @itemx -o @var{file}
1794 Write output to @var{file}.
1796 @item --max-output @code{n}
1798 This option sets a limit on the number of bytes that will be generated
1799 when processing a file. Since OpenPGP supports various levels of
1800 compression, it is possible that the plaintext of a given message may be
1801 significantly larger than the original OpenPGP message. While GnuPG
1802 works properly with such messages, there is often a desire to set a
1803 maximum file size that will be generated before processing is forced to
1804 stop by the OS limits. Defaults to 0, which means "no limit".
1806 @item --import-options @code{parameters}
1807 This is a space or comma delimited string that gives options for
1808 importing keys. Options can be prepended with a `no-' to give the
1809 opposite meaning. The options are:
1813 @item import-local-sigs
1814 Allow importing key signatures marked as "local". This is not
1815 generally useful unless a shared keyring scheme is being used.
1818 @item repair-pks-subkey-bug
1819 During import, attempt to repair the damage caused by the PKS keyserver
1820 bug (pre version 0.9.6) that mangles keys with multiple subkeys. Note
1821 that this cannot completely repair the damaged key as some crucial data
1822 is removed by the keyserver, but it does at least give you back one
1823 subkey. Defaults to no for regular @option{--import} and to yes for
1824 keyserver @option{--recv-keys}.
1827 During import, allow key updates to existing keys, but do not allow
1828 any new keys to be imported. Defaults to no.
1831 After import, compact (remove all signatures except the
1832 self-signature) any user IDs from the new key that are not usable.
1833 Then, remove any signatures from the new key that are not usable.
1834 This includes signatures that were issued by keys that are not present
1835 on the keyring. This option is the same as running the @option{--edit-key}
1836 command "clean" after import. Defaults to no.
1838 @item import-minimal
1839 Import the smallest key possible. This removes all signatures except
1840 the most recent self-signature on each user ID. This option is the
1841 same as running the @option{--edit-key} command "minimize" after import.
1845 @item --export-options @code{parameters}
1846 This is a space or comma delimited string that gives options for
1847 exporting keys. Options can be prepended with a `no-' to give the
1848 opposite meaning. The options are:
1852 @item export-local-sigs
1853 Allow exporting key signatures marked as "local". This is not
1854 generally useful unless a shared keyring scheme is being used.
1857 @item export-attributes
1858 Include attribute user IDs (photo IDs) while exporting. This is
1859 useful to export keys if they are going to be used by an OpenPGP
1860 program that does not accept attribute user IDs. Defaults to yes.
1862 @item export-sensitive-revkeys
1863 Include designated revoker information that was marked as
1864 "sensitive". Defaults to no.
1866 @item export-reset-subkey-passwd
1867 When using the @option{--export-secret-subkeys} command, this option resets
1868 the passphrases for all exported subkeys to empty. This is useful
1869 when the exported subkey is to be used on an unattended machine where
1870 a passphrase doesn't necessarily make sense. Defaults to no.
1873 Compact (remove all signatures from) user IDs on the key being
1874 exported if the user IDs are not usable. Also, do not export any
1875 signatures that are not usable. This includes signatures that were
1876 issued by keys that are not present on the keyring. This option is
1877 the same as running the @option{--edit-key} command "clean" before export
1878 except that the local copy of the key is not modified. Defaults to
1881 @item export-minimal
1882 Export the smallest key possible. This removes all signatures except the
1883 most recent self-signature on each user ID. This option is the same as
1884 running the @option{--edit-key} command "minimize" before export except
1885 that the local copy of the key is not modified. Defaults to no.
1889 @opindex with-colons
1890 Print key listings delimited by colons. Note that the output will be
1891 encoded in UTF-8 regardless of any @option{--display-charset} setting. This
1892 format is useful when GnuPG is called from scripts and other programs
1893 as it is easily machine parsed. The details of this format are
1894 documented in the file @file{doc/DETAILS}, which is included in the GnuPG
1895 source distribution.
1897 @item --fixed-list-mode
1898 @opindex fixed-list-mode
1899 Do not merge primary user ID and primary key in @option{--with-colon}
1900 listing mode and print all timestamps as seconds since 1970-01-01.
1902 Since GnuPG 2.0.10, this mode is always used and thus this option is
1903 obsolete; it does not harm to use it though.
1906 @item --with-fingerprint
1907 @opindex with-fingerprint
1908 Same as the command @option{--fingerprint} but changes only the format
1909 of the output and may be used together with another command.
1914 @c *******************************************
1915 @c ******** OPENPGP OPTIONS ****************
1916 @c *******************************************
1917 @node OpenPGP Options
1918 @subsection OpenPGP protocol specific options.
1922 @item -t, --textmode
1923 @itemx --no-textmode
1924 Treat input files as text and store them in the OpenPGP canonical text
1925 form with standard "CRLF" line endings. This also sets the necessary
1926 flags to inform the recipient that the encrypted or signed data is text
1927 and may need its line endings converted back to whatever the local
1928 system uses. This option is useful when communicating between two
1929 platforms that have different line ending conventions (UNIX-like to Mac,
1930 Mac to Windows, etc). @option{--no-textmode} disables this option, and
1934 If @option{-t} (but not @option{--textmode}) is used together with
1935 armoring and signing, this enables clearsigned messages. This kludge is
1936 needed for command-line compatibility with command-line versions of PGP;
1937 normally you would use @option{--sign} or @option{--clearsign} to select
1938 the type of the signature.
1941 @item --force-v3-sigs
1942 @itemx --no-force-v3-sigs
1943 OpenPGP states that an implementation should generate v4 signatures
1944 but PGP versions 5 through 7 only recognize v4 signatures on key
1945 material. This option forces v3 signatures for signatures on data.
1946 Note that this option implies @option{--ask-sig-expire},
1947 @option{--sig-policy-url}, @option{--sig-notation}, and
1948 @option{--sig-keyserver-url}, as these features cannot be used with v3
1949 signatures. @option{--no-force-v3-sigs} disables this option.
1951 @item --force-v4-certs
1952 @itemx --no-force-v4-certs
1953 Always use v4 key signatures even on v3 keys. This option also
1954 changes the default hash algorithm for v3 RSA keys from MD5 to SHA-1.
1955 @option{--no-force-v4-certs} disables this option.
1958 Force the use of encryption with a modification detection code. This
1959 is always used with the newer ciphers (those with a blocksize greater
1960 than 64 bits), or if all of the recipient keys indicate MDC support in
1961 their feature flags.
1964 Disable the use of the modification detection code. Note that by
1965 using this option, the encrypted message becomes vulnerable to a
1966 message modification attack.
1968 @item --personal-cipher-preferences @code{string}
1969 Set the list of personal cipher preferences to @code{string}. Use
1970 @command{@gpgname --version} to get a list of available algorithms,
1971 and use @code{none} to set no preference at all. This allows the user
1972 to safely override the algorithm chosen by the recipient key
1973 preferences, as GPG will only select an algorithm that is usable by
1974 all recipients. The most highly ranked cipher in this list is also
1975 used for the @option{--symmetric} encryption command.
1977 @item --personal-digest-preferences @code{string}
1978 Set the list of personal digest preferences to @code{string}. Use
1979 @command{@gpgname --version} to get a list of available algorithms,
1980 and use @code{none} to set no preference at all. This allows the user
1981 to safely override the algorithm chosen by the recipient key
1982 preferences, as GPG will only select an algorithm that is usable by
1983 all recipients. The most highly ranked digest algorithm in this list
1984 is also used when signing without encryption
1985 (e.g. @option{--clearsign} or @option{--sign}). The default value is
1988 @item --personal-compress-preferences @code{string}
1989 Set the list of personal compression preferences to @code{string}.
1990 Use @command{@gpgname --version} to get a list of available
1991 algorithms, and use @code{none} to set no preference at all. This
1992 allows the user to safely override the algorithm chosen by the
1993 recipient key preferences, as GPG will only select an algorithm that
1994 is usable by all recipients. The most highly ranked compression
1995 algorithm in this list is also used when there are no recipient keys
1996 to consider (e.g. @option{--symmetric}).
1998 @item --s2k-cipher-algo @code{name}
1999 Use @code{name} as the cipher algorithm used to protect secret keys.
2000 The default cipher is CAST5. This cipher is also used for
2001 conventional encryption if @option{--personal-cipher-preferences} and
2002 @option{--cipher-algo} is not given.
2004 @item --s2k-digest-algo @code{name}
2005 Use @code{name} as the digest algorithm used to mangle the passphrases.
2006 The default algorithm is SHA-1.
2008 @item --s2k-mode @code{n}
2009 Selects how passphrases are mangled. If @code{n} is 0 a plain
2010 passphrase (which is not recommended) will be used, a 1 adds a salt to
2011 the passphrase and a 3 (the default) iterates the whole process a
2012 number of times (see --s2k-count). Unless @option{--rfc1991} is used,
2013 this mode is also used for conventional encryption.
2015 @item --s2k-count @code{n}
2016 Specify how many times the passphrase mangling is repeated. This
2017 value may range between 1024 and 65011712 inclusive, and the default
2018 is 65536. Note that not all values in the 1024-65011712 range are
2019 legal and if an illegal value is selected, GnuPG will round up to the
2020 nearest legal value. This option is only meaningful if
2021 @option{--s2k-mode} is 3.
2026 @c ***************************
2027 @c ******* Compliance ********
2028 @c ***************************
2029 @subsection Compliance options
2031 These options control what GnuPG is compliant to. Only one of these
2032 options may be active at a time. Note that the default setting of
2033 this is nearly always the correct one. See the INTEROPERABILITY WITH
2034 OTHER OPENPGP PROGRAMS section below before using one of these
2041 Use standard GnuPG behavior. This is essentially OpenPGP behavior
2042 (see @option{--openpgp}), but with some additional workarounds for common
2043 compatibility problems in different versions of PGP. This is the
2044 default option, so it is not generally needed, but it may be useful to
2045 override a different compliance option in the gpg.conf file.
2049 Reset all packet, cipher and digest options to strict OpenPGP
2050 behavior. Use this option to reset all previous options like
2051 @option{--s2k-*}, @option{--cipher-algo}, @option{--digest-algo} and
2052 @option{--compress-algo} to OpenPGP compliant values. All PGP
2053 workarounds are disabled.
2057 Reset all packet, cipher and digest options to strict RFC-4880
2058 behavior. Note that this is currently the same thing as
2063 Reset all packet, cipher and digest options to strict RFC-2440
2068 Try to be more RFC-1991 (PGP 2.x) compliant.
2072 Set up all options to be as PGP 2.x compliant as possible, and warn if
2073 an action is taken (e.g. encrypting to a non-RSA key) that will create
2074 a message that PGP 2.x will not be able to handle. Note that `PGP
2075 2.x' here means `MIT PGP 2.6.2'. There are other versions of PGP 2.x
2076 available, but the MIT release is a good common baseline.
2078 This option implies @option{--rfc1991 --disable-mdc
2079 --no-force-v4-certs --escape-from-lines --force-v3-sigs --cipher-algo
2080 IDEA --digest-algo MD5 --compress-algo ZIP}. It also disables
2081 @option{--textmode} when encrypting.
2085 Set up all options to be as PGP 6 compliant as possible. This
2086 restricts you to the ciphers IDEA (if the IDEA plugin is installed),
2087 3DES, and CAST5, the hashes MD5, SHA1 and RIPEMD160, and the
2088 compression algorithms none and ZIP. This also disables
2089 --throw-keyids, and making signatures with signing subkeys as PGP 6
2090 does not understand signatures made by signing subkeys.
2092 This option implies @option{--disable-mdc --escape-from-lines
2097 Set up all options to be as PGP 7 compliant as possible. This is
2098 identical to @option{--pgp6} except that MDCs are not disabled, and the
2099 list of allowable ciphers is expanded to add AES128, AES192, AES256, and
2104 Set up all options to be as PGP 8 compliant as possible. PGP 8 is a lot
2105 closer to the OpenPGP standard than previous versions of PGP, so all
2106 this does is disable @option{--throw-keyids} and set
2107 @option{--escape-from-lines}. All algorithms are allowed except for the
2108 SHA224, SHA384, and SHA512 digests.
2113 @c *******************************************
2114 @c ******** ESOTERIC OPTIONS ***************
2115 @c *******************************************
2116 @node GPG Esoteric Options
2117 @subsection Doing things one usually doesn't want to do.
2124 Don't make any changes (this is not completely implemented).
2127 Changes the behaviour of some commands. This is like @option{--dry-run} but
2128 different in some cases. The semantic of this command may be extended in
2129 the future. Currently it only skips the actual decryption pass and
2130 therefore enables a fast listing of the encryption keys.
2133 @itemx --interactive
2134 @opindex interactive
2135 Prompt before overwriting any files.
2137 @item --debug @var{flags}
2139 Set debugging flags. All flags are or-ed and @var{flags} may
2140 be given in C syntax (e.g. 0x0042).
2143 Set all useful debugging flags.
2146 @item --debug-ccid-driver
2147 Enable debug output from the included CCID driver for smartcards.
2148 Note that this option is only available on some system.
2151 @item --enable-progress-filter
2152 Enable certain PROGRESS status outputs. This option allows frontends
2153 to display a progress indicator while gpg is processing larger files.
2154 There is a slight performance overhead using it.
2156 @item --status-fd @code{n}
2157 Write special status strings to the file descriptor @code{n}.
2158 See the file DETAILS in the documentation for a listing of them.
2160 @item --status-file @code{file}
2161 Same as @option{--status-fd}, except the status data is written to file
2164 @item --logger-fd @code{n}
2165 Write log output to file descriptor @code{n} and not to STDERR.
2167 @item --log-file @code{file}
2168 @itemx --logger-file @code{file}
2169 Same as @option{--logger-fd}, except the logger data is written to file
2170 @code{file}. Note that @option{--log-file} is only implemented for
2173 @item --attribute-fd @code{n}
2174 Write attribute subpackets to the file descriptor @code{n}. This is most
2175 useful for use with @option{--status-fd}, since the status messages are
2176 needed to separate out the various subpackets from the stream delivered
2177 to the file descriptor.
2179 @item --attribute-file @code{file}
2180 Same as @option{--attribute-fd}, except the attribute data is written to
2183 @item --comment @code{string}
2184 @itemx --no-comments
2185 Use @code{string} as a comment string in clear text signatures and ASCII
2186 armored messages or keys (see @option{--armor}). The default behavior is
2187 not to use a comment string. @option{--comment} may be repeated multiple
2188 times to get multiple comment strings. @option{--no-comments} removes
2189 all comments. It is a good idea to keep the length of a single comment
2190 below 60 characters to avoid problems with mail programs wrapping such
2191 lines. Note that comment lines, like all other header lines, are not
2192 protected by the signature.
2194 @item --emit-version
2195 @itemx --no-emit-version
2196 Force inclusion of the version string in ASCII armored output.
2197 @option{--no-emit-version} disables this option.
2199 @item --sig-notation @code{name=value}
2200 @itemx --cert-notation @code{name=value}
2201 @itemx -N, --set-notation @code{name=value}
2202 Put the name value pair into the signature as notation data.
2203 @code{name} must consist only of printable characters or spaces, and
2204 must contain a '@@' character in the form keyname@@domain.example.com
2205 (substituting the appropriate keyname and domain name, of course). This
2206 is to help prevent pollution of the IETF reserved notation
2207 namespace. The @option{--expert} flag overrides the '@@'
2208 check. @code{value} may be any printable string; it will be encoded in
2209 UTF8, so you should check that your @option{--display-charset} is set
2210 correctly. If you prefix @code{name} with an exclamation mark (!), the
2211 notation data will be flagged as critical
2212 (rfc2440:5.2.3.15). @option{--sig-notation} sets a notation for data
2213 signatures. @option{--cert-notation} sets a notation for key signatures
2214 (certifications). @option{--set-notation} sets both.
2216 There are special codes that may be used in notation names. "%k" will
2217 be expanded into the key ID of the key being signed, "%K" into the
2218 long key ID of the key being signed, "%f" into the fingerprint of the
2219 key being signed, "%s" into the key ID of the key making the
2220 signature, "%S" into the long key ID of the key making the signature,
2221 "%g" into the fingerprint of the key making the signature (which might
2222 be a subkey), "%p" into the fingerprint of the primary key of the key
2223 making the signature, "%c" into the signature count from the OpenPGP
2224 smartcard, and "%%" results in a single "%". %k, %K, and %f are only
2225 meaningful when making a key signature (certification), and %c is only
2226 meaningful when using the OpenPGP smartcard.
2228 @item --sig-policy-url @code{string}
2229 @itemx --cert-policy-url @code{string}
2230 @itemx --set-policy-url @code{string}
2231 Use @code{string} as a Policy URL for signatures (rfc2440:5.2.3.19). If
2232 you prefix it with an exclamation mark (!), the policy URL packet will
2233 be flagged as critical. @option{--sig-policy-url} sets a policy url for
2234 data signatures. @option{--cert-policy-url} sets a policy url for key
2235 signatures (certifications). @option{--set-policy-url} sets both.
2237 The same %-expandos used for notation data are available here as well.
2239 @item --sig-keyserver-url @code{string}
2240 Use @code{string} as a preferred keyserver URL for data signatures. If
2241 you prefix it with an exclamation mark (!), the keyserver URL packet
2242 will be flagged as critical.
2244 The same %-expandos used for notation data are available here as well.
2246 @item --set-filename @code{string}
2247 Use @code{string} as the filename which is stored inside messages.
2248 This overrides the default, which is to use the actual filename of the
2249 file being encrypted.
2251 @item --for-your-eyes-only
2252 @itemx --no-for-your-eyes-only
2253 Set the `for your eyes only' flag in the message. This causes GnuPG to
2254 refuse to save the file unless the @option{--output} option is given,
2255 and PGP to use a "secure viewer" with a claimed Tempest-resistant font
2256 to display the message. This option overrides @option{--set-filename}.
2257 @option{--no-for-your-eyes-only} disables this option.
2259 @item --use-embedded-filename
2260 @itemx --no-use-embedded-filename
2261 Try to create a file with a name as embedded in the data. This can be
2262 a dangerous option as it allows to overwrite files. Defaults to no.
2264 @item --cipher-algo @code{name}
2265 Use @code{name} as cipher algorithm. Running the program with the
2266 command @option{--version} yields a list of supported algorithms. If
2267 this is not used the cipher algorithm is selected from the preferences
2268 stored with the key. In general, you do not want to use this option as
2269 it allows you to violate the OpenPGP standard.
2270 @option{--personal-cipher-preferences} is the safe way to accomplish the
2273 @item --digest-algo @code{name}
2274 Use @code{name} as the message digest algorithm. Running the program
2275 with the command @option{--version} yields a list of supported algorithms. In
2276 general, you do not want to use this option as it allows you to
2277 violate the OpenPGP standard. @option{--personal-digest-preferences} is the
2278 safe way to accomplish the same thing.
2280 @item --compress-algo @code{name}
2281 Use compression algorithm @code{name}. "zlib" is RFC-1950 ZLIB
2282 compression. "zip" is RFC-1951 ZIP compression which is used by PGP.
2283 "bzip2" is a more modern compression scheme that can compress some
2284 things better than zip or zlib, but at the cost of more memory used
2285 during compression and decompression. "uncompressed" or "none"
2286 disables compression. If this option is not used, the default
2287 behavior is to examine the recipient key preferences to see which
2288 algorithms the recipient supports. If all else fails, ZIP is used for
2289 maximum compatibility.
2291 ZLIB may give better compression results than ZIP, as the compression
2292 window size is not limited to 8k. BZIP2 may give even better
2293 compression results than that, but will use a significantly larger
2294 amount of memory while compressing and decompressing. This may be
2295 significant in low memory situations. Note, however, that PGP (all
2296 versions) only supports ZIP compression. Using any algorithm other
2297 than ZIP or "none" will make the message unreadable with PGP. In
2298 general, you do not want to use this option as it allows you to
2299 violate the OpenPGP standard. @option{--personal-compress-preferences} is the
2300 safe way to accomplish the same thing.
2302 @item --cert-digest-algo @code{name}
2303 Use @code{name} as the message digest algorithm used when signing a
2304 key. Running the program with the command @option{--version} yields a
2305 list of supported algorithms. Be aware that if you choose an algorithm
2306 that GnuPG supports but other OpenPGP implementations do not, then some
2307 users will not be able to use the key signatures you make, or quite
2308 possibly your entire key.
2310 @item --disable-cipher-algo @code{name}
2311 Never allow the use of @code{name} as cipher algorithm.
2312 The given name will not be checked so that a later loaded algorithm
2313 will still get disabled.
2315 @item --disable-pubkey-algo @code{name}
2316 Never allow the use of @code{name} as public key algorithm.
2317 The given name will not be checked so that a later loaded algorithm
2318 will still get disabled.
2320 @item --throw-keyids
2321 @itemx --no-throw-keyids
2322 Do not put the recipient key IDs into encrypted messages. This helps to
2323 hide the receivers of the message and is a limited countermeasure
2324 against traffic analysis.@footnote{Using a little social engineering
2325 anyone who is able to decrypt the message can check whether one of the
2326 other recipients is the one he suspects.} On the receiving side, it may
2327 slow down the decryption process because all available secret keys must
2328 be tried. @option{--no-throw-keyids} disables this option. This option
2329 is essentially the same as using @option{--hidden-recipient} for all
2332 @item --not-dash-escaped
2333 This option changes the behavior of cleartext signatures
2334 so that they can be used for patch files. You should not
2335 send such an armored file via email because all spaces
2336 and line endings are hashed too. You can not use this
2337 option for data which has 5 dashes at the beginning of a
2338 line, patch files don't have this. A special armor header
2339 line tells GnuPG about this cleartext signature option.
2341 @item --escape-from-lines
2342 @itemx --no-escape-from-lines
2343 Because some mailers change lines starting with "From " to ">From " it
2344 is good to handle such lines in a special way when creating cleartext
2345 signatures to prevent the mail system from breaking the signature. Note
2346 that all other PGP versions do it this way too. Enabled by
2347 default. @option{--no-escape-from-lines} disables this option.
2349 @item --passphrase-repeat @code{n}
2350 Specify how many times @command{@gpgname} will request a new
2351 passphrase be repeated. This is useful for helping memorize a
2352 passphrase. Defaults to 1 repetition.
2354 @item --passphrase-fd @code{n}
2355 Read the passphrase from file descriptor @code{n}. Only the first line
2356 will be read from file descriptor @code{n}. If you use 0 for @code{n},
2357 the passphrase will be read from STDIN. This can only be used if only
2358 one passphrase is supplied.
2360 Note that this passphrase is only used if the option @option{--batch}
2361 has also been given. This is different from @command{gpg}.
2364 @item --passphrase-file @code{file}
2365 Read the passphrase from file @code{file}. Only the first line will
2366 be read from file @code{file}. This can only be used if only one
2367 passphrase is supplied. Obviously, a passphrase stored in a file is
2368 of questionable security if other users can read this file. Don't use
2369 this option if you can avoid it.
2371 Note that this passphrase is only used if the option @option{--batch}
2372 has also been given. This is different from @command{gpg}.
2375 @item --passphrase @code{string}
2376 Use @code{string} as the passphrase. This can only be used if only one
2377 passphrase is supplied. Obviously, this is of very questionable
2378 security on a multi-user system. Don't use this option if you can
2381 Note that this passphrase is only used if the option @option{--batch}
2382 has also been given. This is different from @command{gpg}.
2385 @item --command-fd @code{n}
2386 This is a replacement for the deprecated shared-memory IPC mode.
2387 If this option is enabled, user input on questions is not expected
2388 from the TTY but from the given file descriptor. It should be used
2389 together with @option{--status-fd}. See the file doc/DETAILS in the source
2390 distribution for details on how to use it.
2392 @item --command-file @code{file}
2393 Same as @option{--command-fd}, except the commands are read out of file
2396 @item --allow-non-selfsigned-uid
2397 @itemx --no-allow-non-selfsigned-uid
2398 Allow the import and use of keys with user IDs which are not
2399 self-signed. This is not recommended, as a non self-signed user ID is
2400 trivial to forge. @option{--no-allow-non-selfsigned-uid} disables.
2402 @item --allow-freeform-uid
2403 Disable all checks on the form of the user ID while generating a new
2404 one. This option should only be used in very special environments as
2405 it does not ensure the de-facto standard format of user IDs.
2407 @item --ignore-time-conflict
2408 GnuPG normally checks that the timestamps associated with keys and
2409 signatures have plausible values. However, sometimes a signature
2410 seems to be older than the key due to clock problems. This option
2411 makes these checks just a warning. See also @option{--ignore-valid-from} for
2412 timestamp issues on subkeys.
2414 @item --ignore-valid-from
2415 GnuPG normally does not select and use subkeys created in the future.
2416 This option allows the use of such keys and thus exhibits the
2417 pre-1.0.7 behaviour. You should not use this option unless you there
2418 is some clock problem. See also @option{--ignore-time-conflict} for timestamp
2419 issues with signatures.
2421 @item --ignore-crc-error
2422 The ASCII armor used by OpenPGP is protected by a CRC checksum against
2423 transmission errors. Occasionally the CRC gets mangled somewhere on
2424 the transmission channel but the actual content (which is protected by
2425 the OpenPGP protocol anyway) is still okay. This option allows GnuPG
2426 to ignore CRC errors.
2428 @item --ignore-mdc-error
2429 This option changes a MDC integrity protection failure into a warning.
2430 This can be useful if a message is partially corrupt, but it is
2431 necessary to get as much data as possible out of the corrupt message.
2432 However, be aware that a MDC protection failure may also mean that the
2433 message was tampered with intentionally by an attacker.
2435 @item --no-default-keyring
2436 Do not add the default keyrings to the list of keyrings. Note that
2437 GnuPG will not operate without any keyrings, so if you use this option
2438 and do not provide alternate keyrings via @option{--keyring} or
2439 @option{--secret-keyring}, then GnuPG will still use the default public or
2443 Skip the signature verification step. This may be
2444 used to make the decryption faster if the signature
2445 verification is not needed.
2447 @item --with-key-data
2448 Print key listings delimited by colons (like @option{--with-colons}) and
2449 print the public key data.
2451 @item --fast-list-mode
2452 Changes the output of the list commands to work faster; this is achieved
2453 by leaving some parts empty. Some applications don't need the user ID
2454 and the trust information given in the listings. By using this options
2455 they can get a faster listing. The exact behaviour of this option may
2456 change in future versions. If you are missing some information, don't
2460 This is not for normal use. Use the source to see for what it might be useful.
2462 @item --set-filesize
2463 This is not for normal use. Use the source to see for what it might be useful.
2465 @item --show-session-key
2466 Display the session key used for one message. See
2467 @option{--override-session-key} for the counterpart of this option.
2469 We think that Key Escrow is a Bad Thing; however the user should have
2470 the freedom to decide whether to go to prison or to reveal the content
2471 of one specific message without compromising all messages ever
2472 encrypted for one secret key. DON'T USE IT UNLESS YOU ARE REALLY
2475 @item --override-session-key @code{string}
2476 Don't use the public key but the session key @code{string}. The format
2477 of this string is the same as the one printed by
2478 @option{--show-session-key}. This option is normally not used but comes
2479 handy in case someone forces you to reveal the content of an encrypted
2480 message; using this option you can do this without handing out the
2483 @item --ask-sig-expire
2484 @itemx --no-ask-sig-expire
2485 When making a data signature, prompt for an expiration time. If this
2486 option is not specified, the expiration time set via
2487 @option{--default-sig-expire} is used. @option{--no-ask-sig-expire}
2488 disables this option. Note that by default, @option{--force-v3-sigs} is
2489 set which also disables this option. If you want signature expiration,
2490 you must set @option{--no-force-v3-sigs} as well as turning
2491 @option{--ask-sig-expire} on.
2493 @item --default-sig-expire
2494 The default expiration time to use for signature expiration. Valid
2495 values are "0" for no expiration, a number followed by the letter d
2496 (for days), w (for weeks), m (for months), or y (for years) (for
2497 example "2m" for two months, or "5y" for five years), or an absolute
2498 date in the form YYYY-MM-DD. Defaults to "0".
2500 @item --ask-cert-expire
2501 @itemx --no-ask-cert-expire
2502 When making a key signature, prompt for an expiration time. If this
2503 option is not specified, the expiration time set via
2504 @option{--default-cert-expire} is used. @option{--no-ask-cert-expire}
2505 disables this option.
2507 @item --default-cert-expire
2508 The default expiration time to use for key signature expiration.
2509 Valid values are "0" for no expiration, a number followed by the
2510 letter d (for days), w (for weeks), m (for months), or y (for years)
2511 (for example "2m" for two months, or "5y" for five years), or an
2512 absolute date in the form YYYY-MM-DD. Defaults to "0".
2514 @item --allow-secret-key-import
2515 This is an obsolete option and is not used anywhere.
2517 @item --allow-multiple-messages
2518 @item --no-allow-multiple-messages
2519 Allow processing of multiple OpenPGP messages contained in a single file
2520 or stream. Some programs that call GPG are not prepared to deal with
2521 multiple messages being processed together, so this option defaults to
2522 no. Note that versions of GPG prior to 1.4.7 always allowed multiple
2525 Warning: Do not use this option unless you need it as a temporary
2529 @item --enable-special-filenames
2530 This options enables a mode in which filenames of the form
2531 @file{-&n}, where n is a non-negative decimal number,
2532 refer to the file descriptor n and not to a file with that name.
2534 @item --no-expensive-trust-checks
2535 Experimental use only.
2537 @item --preserve-permissions
2538 Don't change the permissions of a secret keyring back to user
2539 read/write only. Use this option only if you really know what you are doing.
2541 @item --default-preference-list @code{string}
2542 @opindex default-preference-list
2543 Set the list of default preferences to @code{string}. This preference
2544 list is used for new keys and becomes the default for "setpref" in the
2547 @item --default-keyserver-url @code{name}
2548 @opindex default-keyserver-url
2549 Set the default keyserver URL to @code{name}. This keyserver will be
2550 used as the keyserver URL when writing a new self-signature on a key,
2551 which includes key generation and changing preferences.
2554 @opindex list-config
2555 Display various internal configuration parameters of GnuPG. This option
2556 is intended for external programs that call GnuPG to perform tasks, and
2557 is thus not generally useful. See the file @file{doc/DETAILS} in the
2558 source distribution for the details of which configuration items may be
2559 listed. @option{--list-config} is only usable with
2560 @option{--with-colons} set.
2562 @item --gpgconf-list
2563 @opindex gpgconf-list
2564 This command is similar to @option{--list-config} but in general only
2565 internally used by the @command{gpgconf} tool.
2567 @item --gpgconf-test
2568 @opindex gpgconf-test
2569 This is more or less dummy action. However it parses the configuration
2570 file and returns with failure if the configuration file would prevent
2571 @command{gpg} from startup. Thus it may be used to run a syntax check
2572 on the configuration file.
2576 @c *******************************
2577 @c ******* Deprecated ************
2578 @c *******************************
2579 @subsection Deprecated options
2584 @item --load-extension @code{name}
2585 Load an extension module. If @code{name} does not contain a slash it is
2586 searched for in the directory configured when GnuPG was built
2587 (generally "/usr/local/lib/gnupg"). Extensions are not generally
2588 useful anymore, and the use of this option is deprecated.
2592 @itemx --no-show-photos
2593 Causes @option{--list-keys}, @option{--list-sigs},
2594 @option{--list-public-keys}, @option{--list-secret-keys}, and verifying
2595 a signature to also display the photo ID attached to the key, if
2596 any. See also @option{--photo-viewer}. These options are deprecated. Use
2597 @option{--list-options [no-]show-photos} and/or @option{--verify-options
2598 [no-]show-photos} instead.
2600 @item --show-keyring
2601 Display the keyring name at the head of key listings to show which
2602 keyring a given key resides on. This option is deprecated: use
2603 @option{--list-options [no-]show-keyring} instead.
2606 @item --ctapi-driver @code{file}
2607 Use @code{file} to access the smartcard reader. The current default
2608 is `libtowitoko.so'. Note that the use of this interface is
2609 deprecated; it may be removed in future releases.
2612 @item --always-trust
2613 Identical to @option{--trust-model always}. This option is deprecated.
2615 @item --show-notation
2616 @itemx --no-show-notation
2617 Show signature notations in the @option{--list-sigs} or @option{--check-sigs} listings
2618 as well as when verifying a signature with a notation in it. These
2619 options are deprecated. Use @option{--list-options [no-]show-notation}
2620 and/or @option{--verify-options [no-]show-notation} instead.
2622 @item --show-policy-url
2623 @itemx --no-show-policy-url
2624 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
2625 listings as well as when verifying a signature with a policy URL in
2626 it. These options are deprecated. Use @option{--list-options
2627 [no-]show-policy-url} and/or @option{--verify-options
2628 [no-]show-policy-url} instead.
2634 @c *******************************************
2635 @c *************** ****************
2636 @c *************** FILES ****************
2637 @c *************** ****************
2638 @c *******************************************
2640 @node GPG Configuration
2641 @section Configuration files
2643 There are a few configuration files to control certain aspects of
2644 @command{@gpgname}'s operation. Unless noted, they are expected in the
2645 current home directory (@pxref{option --homedir}).
2651 This is the standard configuration file read by @command{@gpgname} on
2652 startup. It may contain any valid long option; the leading two dashes
2653 may not be entered and the option may not be abbreviated. This default
2654 name may be changed on the command line (@pxref{option --options}).
2655 You should backup this file.
2660 Note that on larger installations, it is useful to put predefined files
2661 into the directory @file{/etc/skel/.gnupg/} so that newly created users
2662 start up with a working configuration.
2664 For existing users the a small
2665 helper script is provided to create these files (@pxref{addgnupghome}).
2668 For internal purposes @command{@gpgname} creates and maintains a few other
2669 files; They all live in in the current home directory (@pxref{option
2670 --homedir}). Only the @command{@gpgname} may modify these files.
2674 @item ~/.gnupg/secring.gpg
2675 The secret keyring. You should backup this file.
2677 @item ~/.gnupg/secring.gpg.lock
2678 The lock file for the secret keyring.
2680 @item ~/.gnupg/pubring.gpg
2681 The public keyring. You should backup this file.
2683 @item ~/.gnupg/pubring.gpg.lock
2684 The lock file for the public keyring.
2686 @item ~/.gnupg/trustdb.gpg
2687 The trust database. There is no need to backup this file; it is better
2688 to backup the ownertrust values (@pxref{option --export-ownertrust}).
2690 @item ~/.gnupg/trustdb.gpg.lock
2691 The lock file for the trust database.
2693 @item ~/.gnupg/random_seed
2694 A file used to preserve the state of the internal random pool.
2696 @item /usr[/local]/share/gnupg/options.skel
2697 The skeleton options file.
2699 @item /usr[/local]/lib/gnupg/
2700 Default location for extensions.
2705 Operation is further controlled by a few environment variables:
2710 Used to locate the default home directory.
2713 If set directory used instead of "~/.gnupg".
2715 @item GPG_AGENT_INFO
2716 Used to locate the gpg-agent.
2718 This is only honored when @option{--use-agent} is set.
2720 The value consists of 3 colon delimited fields: The first is the path
2721 to the Unix Domain Socket, the second the PID of the gpg-agent and the
2722 protocol version which should be set to 1. When starting the gpg-agent
2723 as described in its documentation, this variable is set to the correct
2724 value. The option @option{--gpg-agent-info} can be used to override it.
2726 @item PINENTRY_USER_DATA
2727 This value is passed via gpg-agent to pinentry. It is useful to convey
2728 extra information to a custom pinentry.
2732 Used to size some displays to the full size of the screen.
2736 Apart from its use by GNU, it is used in the W32 version to override the
2737 language selection done through the Registry. If used and set to a
2738 valid and available language name (@var{langid}), the file with the
2739 translation is loaded from
2740 @code{@var{gpgdir}/gnupg.nls/@var{langid}.mo}. Here @var{gpgdir} is the
2741 directory out of which the gpg binary has been loaded. If it can't be
2742 loaded the Registry is tried and as last resort the native Windows
2743 locale system is used.
2748 @c *******************************************
2749 @c *************** ****************
2750 @c *************** EXAMPLES ****************
2751 @c *************** ****************
2752 @c *******************************************
2759 @item gpg -se -r @code{Bob} @code{file}
2760 sign and encrypt for user Bob
2762 @item gpg --clearsign @code{file}
2763 make a clear text signature
2765 @item gpg -sb @code{file}
2766 make a detached signature
2768 @item gpg -u 0x12345678 -sb @code{file}
2769 make a detached signature with the key 0x12345678
2771 @item gpg --list-keys @code{user_ID}
2774 @item gpg --fingerprint @code{user_ID}
2777 @item gpg --verify @code{pgpfile}
2778 @itemx gpg --verify @code{sigfile}
2779 Verify the signature of the file but do not output the data. The
2780 second form is used for detached signatures, where @code{sigfile}
2781 is the detached signature (either ASCII armored or binary) and
2782 are the signed data; if this is not given, the name of
2783 the file holding the signed data is constructed by cutting off the
2784 extension (".asc" or ".sig") of @code{sigfile} or by asking the
2785 user for the filename.
2789 @c *******************************************
2790 @c *************** ****************
2791 @c *************** USER ID ****************
2792 @c *************** ****************
2793 @c *******************************************
2794 @mansect how to specify a user id
2796 @include specify-user-id.texi
2799 @mansect return value
2800 @chapheading RETURN VALUE
2802 The program returns 0 if everything was fine, 1 if at least
2803 a signature was bad, and other error codes for fatal errors.
2806 @chapheading WARNINGS
2808 Use a *good* password for your user account and a *good* passphrase
2809 to protect your secret key. This passphrase is the weakest part of the
2810 whole system. Programs to do dictionary attacks on your secret keyring
2811 are very easy to write and so you should protect your "~/.gnupg/"
2812 directory very well.
2814 Keep in mind that, if this program is used over a network (telnet), it
2815 is *very* easy to spy out your passphrase!
2817 If you are going to verify detached signatures, make sure that the
2818 program knows about it; either give both filenames on the command line
2819 or use @samp{-} to specify STDIN.
2821 @mansect interoperability
2822 @chapheading INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS
2824 GnuPG tries to be a very flexible implementation of the OpenPGP
2825 standard. In particular, GnuPG implements many of the optional parts
2826 of the standard, such as the SHA-512 hash, and the ZLIB and BZIP2
2827 compression algorithms. It is important to be aware that not all
2828 OpenPGP programs implement these optional algorithms and that by
2829 forcing their use via the @option{--cipher-algo},
2830 @option{--digest-algo}, @option{--cert-digest-algo}, or
2831 @option{--compress-algo} options in GnuPG, it is possible to create a
2832 perfectly valid OpenPGP message, but one that cannot be read by the
2835 There are dozens of variations of OpenPGP programs available, and each
2836 supports a slightly different subset of these optional algorithms.
2837 For example, until recently, no (unhacked) version of PGP supported
2838 the BLOWFISH cipher algorithm. A message using BLOWFISH simply could
2839 not be read by a PGP user. By default, GnuPG uses the standard
2840 OpenPGP preferences system that will always do the right thing and
2841 create messages that are usable by all recipients, regardless of which
2842 OpenPGP program they use. Only override this safe default if you
2843 really know what you are doing.
2845 If you absolutely must override the safe default, or if the preferences
2846 on a given key are invalid for some reason, you are far better off using
2847 the @option{--pgp6}, @option{--pgp7}, or @option{--pgp8} options. These
2848 options are safe as they do not force any particular algorithms in
2849 violation of OpenPGP, but rather reduce the available algorithms to a
2855 On many systems this program should be installed as setuid(root). This
2856 is necessary to lock memory pages. Locking memory pages prevents the
2857 operating system from writing memory pages (which may contain
2858 passphrases or other sensitive material) to disk. If you get no
2859 warning message about insecure memory your operating system supports
2860 locking without being root. The program drops root privileges as soon
2861 as locked memory is allocated.
2863 Note also that some systems (especially laptops) have the ability to
2864 ``suspend to disk'' (also known as ``safe sleep'' or ``hibernate'').
2865 This writes all memory to disk before going into a low power or even
2866 powered off mode. Unless measures are taken in the operating system
2867 to protect the saved memory, passphrases or other sensitive material
2868 may be recoverable from it later.
2875 @command{gpg-agent}(1)
2878 @include see-also-note.texi