1 @c Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2 @c 2008, 2009, 2010 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 algorithm defaults
14 @set DEFSYMENCALGO AES128
16 @c End algorithm defaults
25 \- OpenPGP encryption and signing tool
41 @command{@gpgname} is the OpenPGP only version of the GNU Privacy
42 Guard (GnuPG). It is a tool to provide digital encryption and signing
43 services using the OpenPGP standard. @command{@gpgname} features
44 complete key management and all bells and whistles you can expect from
45 a decent OpenPGP implementation.
47 This is the standalone version of @command{gpg}. For desktop use you
48 should consider using @command{gpg2} from the GnuPG-2 package
49 @footnote{On some platforms gpg2 is installed under the name
54 @xref{Option Index}, for an index to @command{@gpgname}'s commands and options.
58 * GPG Commands:: List of all commands.
59 * GPG Options:: List of all options.
60 * GPG Configuration:: Configuration files.
61 * GPG Examples:: Some usage examples.
63 Developer information:
64 * Unattended Usage of GPG:: Using @command{gpg} from other programs.
67 @c * GPG Protocol:: The protocol the server mode uses.
70 @c *******************************************
71 @c *************** ****************
72 @c *************** COMMANDS ****************
73 @c *************** ****************
74 @c *******************************************
79 Commands are not distinguished from options except for the fact that
80 only one command is allowed.
82 @command{@gpgname} may be run with no commands, in which case it will
83 perform a reasonable action depending on the type of file it is given
84 as input (an encrypted message is decrypted, a signature is verified,
85 a file containing keys is listed).
87 Please remember that option as well as command parsing stops as soon as
88 a non-option is encountered, you can explicitly stop parsing by
89 using the special option @option{--}.
93 * General GPG Commands:: Commands not specific to the functionality.
94 * Operational GPG Commands:: Commands to select the type of operation.
95 * OpenPGP Key Management:: How to manage your keys.
99 @c *******************************************
100 @c ********** GENERAL COMMANDS *************
101 @c *******************************************
102 @node General GPG Commands
103 @subsection Commands not specific to the function
108 Print the program version and licensing information. Note that you
109 cannot abbreviate this command.
114 Print a usage message summarizing the most useful command line options.
115 Note that you cannot abbreviate this command.
119 Print warranty information.
122 @opindex dump-options
123 Print a list of all available options and commands. Note that you cannot
124 abbreviate this command.
128 @c *******************************************
129 @c ******** OPERATIONAL COMMANDS ***********
130 @c *******************************************
131 @node Operational GPG Commands
132 @subsection Commands to select the type of operation
140 Make a signature. This command may be combined with @option{--encrypt}
141 (for a signed and encrypted message), @option{--symmetric} (for a
142 signed and symmetrically encrypted message), or @option{--encrypt} and
143 @option{--symmetric} together (for a signed message that may be
144 decrypted via a secret key or a passphrase). The key to be used for
145 signing is chosen by default or can be set with the
146 @option{--local-user} and @option{--default-key} options.
150 Make a clear text signature. The content in a clear text signature is
151 readable without any special software. OpenPGP software is only needed
152 to verify the signature. Clear text signatures may modify end-of-line
153 whitespace for platform independence and are not intended to be
154 reversible. The key to be used for signing is chosen by default or
155 can be set with the @option{--local-user} and @option{--default-key}
162 Make a detached signature.
167 Encrypt data. This option may be combined with @option{--sign} (for a
168 signed and encrypted message), @option{--symmetric} (for a message that
169 may be decrypted via a secret key or a passphrase), or @option{--sign}
170 and @option{--symmetric} together (for a signed message that may be
171 decrypted via a secret key or a passphrase).
176 Encrypt with a symmetric cipher using a passphrase. The default
177 symmetric cipher used is @value{DEFSYMENCALGO}, but may be chosen with the
178 @option{--cipher-algo} option. This option may be combined with
179 @option{--sign} (for a signed and symmetrically encrypted message),
180 @option{--encrypt} (for a message that may be decrypted via a secret key
181 or a passphrase), or @option{--sign} and @option{--encrypt} together
182 (for a signed message that may be decrypted via a secret key or a
187 Store only (make a simple RFC1991 literal data packet).
192 Decrypt the file given on the command line (or STDIN if no file
193 is specified) and write it to STDOUT (or the file specified with
194 @option{--output}). If the decrypted file is signed, the signature is also
195 verified. This command differs from the default operation, as it never
196 writes to the filename which is included in the file and it rejects
197 files which don't begin with an encrypted message.
201 Assume that the first argument is a signed file and verify it without
202 generating any output. With no arguments, the signature packet is
203 read from STDIN. If only a one argument is given, it is expected to
204 be a complete signature.
206 With more than 1 argument, the first should be a detached signature
207 and the remaining files ake up the the signed data. To read the signed
208 data from STDIN, use @samp{-} as the second filename. For security
209 reasons a detached signature cannot read the signed material from
210 STDIN without denoting it in the above way.
212 Note: If the option @option{--batch} is not used, @command{gpg}
213 may assume that a single argument is a file with a detached signature
214 and it will try to find a matching data file by stripping certain
215 suffixes. Using this historical feature to verify a detached
216 signature is strongly discouraged; always specify the data file too.
218 Note: When verifying a cleartext signature, @command{gpg} verifies
219 only what makes up the cleartext signed data and not any extra data
220 outside of the cleartext signature or header lines following directly
221 the dash marker line. The option @code{--output} may be used to write
222 out the actual signed data; but there are other pitfalls with this
223 format as well. It is suggested to avoid cleartext signatures in
224 favor of detached signatures.
229 This modifies certain other commands to accept multiple files for
230 processing on the command line or read from STDIN with each filename on
231 a separate line. This allows for many files to be processed at
232 once. @option{--multifile} may currently be used along with
233 @option{--verify}, @option{--encrypt}, and @option{--decrypt}. Note that
234 @option{--multifile --verify} may not be used with detached signatures.
237 @opindex verify-files
238 Identical to @option{--multifile --verify}.
240 @item --encrypt-files
241 @opindex encrypt-files
242 Identical to @option{--multifile --encrypt}.
244 @item --decrypt-files
245 @opindex decrypt-files
246 Identical to @option{--multifile --decrypt}.
250 @itemx --list-public-keys
252 List all keys from the public keyrings, or just the keys given on the
255 @option{-k} is slightly different from @option{--list-keys} in that it
256 allows only for one argument and takes the second argument as the
257 keyring to search. This is for command line compatibility with PGP 2
258 and has been removed in @command{gpg2}.
260 Avoid using the output of this command in scripts or other programs as
261 it is likely to change as GnuPG changes. See @option{--with-colons} for a
262 machine-parseable key listing command that is appropriate for use in
263 scripts and other programs.
265 @item --list-secret-keys
267 @opindex list-secret-keys
268 List all keys from the secret keyrings, or just the ones given on the
269 command line. A @code{#} after the letters @code{sec} means that the
270 secret key is not usable (for example, if it was created via
271 @option{--export-secret-subkeys}).
275 Same as @option{--list-keys}, but the signatures are listed too.
277 For each signature listed, there are several flags in between the "sig"
278 tag and keyid. These flags give additional information about each
279 signature. From left to right, they are the numbers 1-3 for certificate
280 check level (see @option{--ask-cert-level}), "L" for a local or
281 non-exportable signature (see @option{--lsign-key}), "R" for a
282 nonRevocable signature (see the @option{--edit-key} command "nrsign"),
283 "P" for a signature that contains a policy URL (see
284 @option{--cert-policy-url}), "N" for a signature that contains a
285 notation (see @option{--cert-notation}), "X" for an eXpired signature
286 (see @option{--ask-cert-expire}), and the numbers 1-9 or "T" for 10 and
287 above to indicate trust signature levels (see the @option{--edit-key}
292 Same as @option{--list-sigs}, but the signatures are verified. Note
293 that for performance reasons the revocation status of a signing key is
296 The status of the verification is indicated by a flag directly following
297 the "sig" tag (and thus before the flags described above for
298 @option{--list-sigs}). A "!" indicates that the signature has been
299 successfully verified, a "-" denotes a bad signature and a "%" is used
300 if an error occurred while checking the signature (e.g. a non supported
306 List all keys (or the specified ones) along with their
307 fingerprints. This is the same output as @option{--list-keys} but with
308 the additional output of a line with the fingerprint. May also be
309 combined with @option{--list-sigs} or @option{--check-sigs}. If this
310 command is given twice, the fingerprints of all secondary keys are
314 @opindex list-packets
315 List only the sequence of packets. This is mainly
316 useful for debugging.
321 Present a menu to work with a smartcard. The subcommand "help" provides
322 an overview on available commands. For a detailed description, please
323 see the Card HOWTO at
324 https://gnupg.org/documentation/howtos.html#GnuPG-cardHOWTO .
328 Show the content of the smart card.
332 Present a menu to allow changing the PIN of a smartcard. This
333 functionality is also available as the subcommand "passwd" with the
334 @option{--card-edit} command.
336 @item --delete-key @code{name}
338 Remove key from the public keyring. In batch mode either @option{--yes} is
339 required or the key must be specified by fingerprint. This is a
340 safeguard against accidental deletion of multiple keys.
342 @item --delete-secret-key @code{name}
343 @opindex delete-secret-key
344 Remove key from the secret keyring. In batch mode the key
345 must be specified by fingerprint.
347 @item --delete-secret-and-public-key @code{name}
348 @opindex delete-secret-and-public-key
349 Same as @option{--delete-key}, but if a secret key exists, it will be
350 removed first. In batch mode the key must be specified by fingerprint.
354 Either export all keys from all keyrings (default keyrings and those
355 registered via option @option{--keyring}), or if at least one name is given,
356 those of the given name. The exported keys are written to STDOUT or to the
357 file given with option @option{--output}. Use together with
358 @option{--armor} to mail those keys.
360 @item --send-keys @code{key IDs}
362 Similar to @option{--export} but sends the keys to a keyserver.
363 Fingerprints may be used instead of key IDs. Option @option{--keyserver}
364 must be used to give the name of this keyserver. Don't send your
365 complete keyring to a keyserver --- select only those keys which are new
366 or changed by you. If no key IDs are given, @command{gpg} does nothing.
368 @item --export-secret-keys
369 @itemx --export-secret-subkeys
370 @opindex export-secret-keys
371 @opindex export-secret-subkeys
372 Same as @option{--export}, but exports the secret keys instead. The
373 exported keys are written to STDOUT or to the file given with option
374 @option{--output}. This command is often used along with the option
375 @option{--armor} to allow easy printing of the key for paper backup;
376 however the external tool @command{paperkey} does a better job for
377 creating backups on paper. Note that exporting a secret key can be a
378 security risk if the exported keys are send over an insecure channel.
380 The second form of the command has the special property to render the
381 secret part of the primary key useless; this is a GNU extension to
382 OpenPGP and other implementations can not be expected to successfully
383 import such a key. Its intended use is to generated a full key with
384 an additional signing subkey on a dedicated machine and then using
385 this command to export the key without the primary key to the main
388 See the option @option{--simple-sk-checksum} if you want to import an
389 exported secret key into ancient OpenPGP implementations.
394 Import/merge keys. This adds the given keys to the
395 keyring. The fast version is currently just a synonym.
397 There are a few other options which control how this command works.
398 Most notable here is the @option{--import-options merge-only} option
399 which does not insert new keys but does only the merging of new
400 signatures, user-IDs and subkeys.
402 @item --recv-keys @code{key IDs}
404 Import the keys with the given key IDs from a keyserver. Option
405 @option{--keyserver} must be used to give the name of this keyserver.
408 @opindex refresh-keys
409 Request updates from a keyserver for keys that already exist on the
410 local keyring. This is useful for updating a key with the latest
411 signatures, user IDs, etc. Calling this with no arguments will refresh
412 the entire keyring. Option @option{--keyserver} must be used to give the
413 name of the keyserver for all keys that do not have preferred keyservers
414 set (see @option{--keyserver-options honor-keyserver-url}).
416 @item --search-keys @code{names}
418 Search the keyserver for the given names. Multiple names given here will
419 be joined together to create the search string for the keyserver.
420 Option @option{--keyserver} must be used to give the name of this
421 keyserver. Keyservers that support different search methods allow using
422 the syntax specified in "How to specify a user ID" below. Note that
423 different keyserver types support different search methods. Currently
424 only LDAP supports them all.
426 @item --fetch-keys @code{URIs}
428 Retrieve keys located at the specified URIs. Note that different
429 installations of GnuPG may support different protocols (HTTP, FTP,
432 @item --update-trustdb
433 @opindex update-trustdb
434 Do trust database maintenance. This command iterates over all keys and
435 builds the Web of Trust. This is an interactive command because it may
436 have to ask for the "ownertrust" values for keys. The user has to give
437 an estimation of how far she trusts the owner of the displayed key to
438 correctly certify (sign) other keys. GnuPG only asks for the ownertrust
439 value if it has not yet been assigned to a key. Using the
440 @option{--edit-key} menu, the assigned value can be changed at any time.
442 @item --check-trustdb
443 @opindex check-trustdb
444 Do trust database maintenance without user interaction. From time to
445 time the trust database must be updated so that expired keys or
446 signatures and the resulting changes in the Web of Trust can be
447 tracked. Normally, GnuPG will calculate when this is required and do it
448 automatically unless @option{--no-auto-check-trustdb} is set. This
449 command can be used to force a trust database check at any time. The
450 processing is identical to that of @option{--update-trustdb} but it
451 skips keys with a not yet defined "ownertrust".
453 For use with cron jobs, this command can be used together with
454 @option{--batch} in which case the trust database check is done only if
455 a check is needed. To force a run even in batch mode add the option
458 @anchor{option --export-ownertrust}
459 @item --export-ownertrust
460 @opindex export-ownertrust
461 Send the ownertrust values to STDOUT. This is useful for backup purposes
462 as these values are the only ones which can't be re-created from a
463 corrupted trustdb. Example:
466 @gpgname{} --export-ownertrust > otrust.txt
471 @item --import-ownertrust
472 @opindex import-ownertrust
473 Update the trustdb with the ownertrust values stored in @code{files} (or
474 STDIN if not given); existing values will be overwritten. In case of a
475 severely damaged trustdb and if you have a recent backup of the
476 ownertrust values (e.g. in the file @file{otrust.txt}, you may re-create
477 the trustdb using these commands:
482 @gpgname{} --import-ownertrust < otrust.txt
487 @item --rebuild-keydb-caches
488 @opindex rebuild-keydb-caches
489 When updating from version 1.0.6 to 1.0.7 this command should be used
490 to create signature caches in the keyring. It might be handy in other
493 @item --print-md @code{algo}
496 Print message digest of algorithm ALGO for all given files or STDIN.
497 With the second form (or a deprecated "*" as algo) digests for all
498 available algorithms are printed.
500 @item --gen-random @code{0|1|2} @code{count}
502 Emit @var{count} random bytes of the given quality level 0, 1 or 2. If
503 @var{count} is not given or zero, an endless sequence of random bytes
504 will be emitted. If used with @option{--armor} the output will be
505 base64 encoded. PLEASE, don't use this command unless you know what
506 you are doing; it may remove precious entropy from the system!
508 @item --gen-prime @code{mode} @code{bits}
510 Use the source, Luke :-). The output format is still subject to change.
517 Pack or unpack an arbitrary input into/from an OpenPGP ASCII armor.
518 This is a GnuPG extension to OpenPGP and in general not very useful.
523 @c *******************************************
524 @c ******* KEY MANGEMENT COMMANDS **********
525 @c *******************************************
526 @node OpenPGP Key Management
527 @subsection How to manage your keys
529 This section explains the main commands for key management
535 Generate a new key pair using the current default parameters. This is
536 the standard command to create a new key.
538 There is also a feature which allows you to create keys in batch
539 mode. See the the manual section ``Unattended key generation'' on how
542 @item --gen-revoke @code{name}
544 Generate a revocation certificate for the complete key. To revoke
545 a subkey or a signature, use the @option{--edit} command.
547 @item --desig-revoke @code{name}
548 @opindex desig-revoke
549 Generate a designated revocation certificate for a key. This allows a
550 user (with the permission of the keyholder) to revoke someone else's
556 Present a menu which enables you to do most of the key management
557 related tasks. It expects the specification of a key on the command
560 @c ******** Begin Edit-key Options **********
565 Toggle selection of user ID or photographic user ID with index @code{n}.
566 Use @code{*} to select all and @code{0} to deselect all.
570 Toggle selection of subkey with index @code{n}.
571 Use @code{*} to select all and @code{0} to deselect all.
574 @opindex keyedit:sign
575 Make a signature on key of user @code{name} If the key is not yet
576 signed by the default user (or the users given with -u), the program
577 displays the information of the key again, together with its
578 fingerprint and asks whether it should be signed. This question is
579 repeated for all users specified with
583 @opindex keyedit:lsign
584 Same as "sign" but the signature is marked as non-exportable and will
585 therefore never be used by others. This may be used to make keys
586 valid only in the local environment.
589 @opindex keyedit:nrsign
590 Same as "sign" but the signature is marked as non-revocable and can
591 therefore never be revoked.
594 @opindex keyedit:tsign
595 Make a trust signature. This is a signature that combines the notions
596 of certification (like a regular signature), and trust (like the
597 "trust" command). It is generally only useful in distinct communities
602 Note that "l" (for local / non-exportable), "nr" (for non-revocable,
603 and "t" (for trust) may be freely mixed and prefixed to "sign" to
604 create a signature of any type desired.
610 @opindex keyedit:delsig
611 Delete a signature. Note that it is not possible to retract a signature,
612 once it has been send to the public (i.e. to a keyserver). In that case
613 you better use @code{revsig}.
616 @opindex keyedit:revsig
617 Revoke a signature. For every signature which has been generated by
618 one of the secret keys, GnuPG asks whether a revocation certificate
622 @opindex keyedit:check
623 Check the signatures on all selected user IDs.
626 @opindex keyedit:adduid
627 Create an additional user ID.
630 @opindex keyedit:addphoto
631 Create a photographic user ID. This will prompt for a JPEG file that
632 will be embedded into the user ID. Note that a very large JPEG will make
633 for a very large key. Also note that some programs will display your
634 JPEG unchanged (GnuPG), and some programs will scale it to fit in a
638 @opindex keyedit:showphoto
639 Display the selected photographic user ID.
642 @opindex keyedit:deluid
643 Delete a user ID or photographic user ID. Note that it is not
644 possible to retract a user id, once it has been send to the public
645 (i.e. to a keyserver). In that case you better use @code{revuid}.
648 @opindex keyedit:revuid
649 Revoke a user ID or photographic user ID.
652 @opindex keyedit:primary
653 Flag the current user id as the primary one, removes the primary user
654 id flag from all other user ids and sets the timestamp of all affected
655 self-signatures one second ahead. Note that setting a photo user ID
656 as primary makes it primary over other photo user IDs, and setting a
657 regular user ID as primary makes it primary over other regular user
661 @opindex keyedit:keyserver
662 Set a preferred keyserver for the specified user ID(s). This allows
663 other users to know where you prefer they get your key from. See
664 @option{--keyserver-options honor-keyserver-url} for more on how this
665 works. Setting a value of "none" removes an existing preferred
669 @opindex keyedit:notation
670 Set a name=value notation for the specified user ID(s). See
671 @option{--cert-notation} for more on how this works. Setting a value of
672 "none" removes all notations, setting a notation prefixed with a minus
673 sign (-) removes that notation, and setting a notation name (without the
674 =value) prefixed with a minus sign removes all notations with that name.
677 @opindex keyedit:pref
678 List preferences from the selected user ID. This shows the actual
679 preferences, without including any implied preferences.
682 @opindex keyedit:showpref
683 More verbose preferences listing for the selected user ID. This shows
684 the preferences in effect by including the implied preferences of 3DES
685 (cipher), SHA-1 (digest), and Uncompressed (compression) if they are
686 not already included in the preference list. In addition, the
687 preferred keyserver and signature notations (if any) are shown.
689 @item setpref @code{string}
690 @opindex keyedit:setpref
691 Set the list of user ID preferences to @code{string} for all (or just
692 the selected) user IDs. Calling setpref with no arguments sets the
693 preference list to the default (either built-in or set via
694 @option{--default-preference-list}), and calling setpref with "none"
695 as the argument sets an empty preference list. Use @command{@gpgname
696 --version} to get a list of available algorithms. Note that while you
697 can change the preferences on an attribute user ID (aka "photo ID"),
698 GnuPG does not select keys via attribute user IDs so these preferences
699 will not be used by GnuPG.
701 When setting preferences, you should list the algorithms in the order
702 which you'd like to see them used by someone else when encrypting a
703 message to your key. If you don't include 3DES, it will be
704 automatically added at the end. Note that there are many factors that
705 go into choosing an algorithm (for example, your key may not be the
706 only recipient), and so the remote OpenPGP application being used to
707 send to you may or may not follow your exact chosen order for a given
708 message. It will, however, only choose an algorithm that is present
709 on the preference list of every recipient key. See also the
710 INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS section below.
713 @opindex keyedit:addkey
714 Add a subkey to this key.
717 @opindex keyedit:addcardkey
718 Generate a subkey on a card and add it to this key.
721 @opindex keyedit:keytocard
722 Transfer the selected secret subkey (or the primary key if no subkey
723 has been selected) to a smartcard. The secret key in the keyring will
724 be replaced by a stub if the key could be stored successfully on the
725 card and you use the save command later. Only certain key types may be
726 transferred to the card. A sub menu allows you to select on what card
727 to store the key. Note that it is not possible to get that key back
728 from the card - if the card gets broken your secret key will be lost
729 unless you have a backup somewhere.
731 @item bkuptocard @code{file}
732 @opindex keyedit:bkuptocard
733 Restore the given file to a card. This command may be used to restore a
734 backup key (as generated during card initialization) to a new card. In
735 almost all cases this will be the encryption key. You should use this
736 command only with the corresponding public key and make sure that the
737 file given as argument is indeed the backup to restore. You should then
738 select 2 to restore as encryption key. You will first be asked to enter
739 the passphrase of the backup key and then for the Admin PIN of the card.
742 @opindex keyedit:delkey
743 Remove a subkey (secondart key). Note that it is not possible to retract
744 a subkey, once it has been send to the public (i.e. to a keyserver). In
745 that case you better use @code{revkey}.
748 @opindex keyedit:revkey
752 @opindex keyedit:expire
753 Change the key or subkey expiration time. If a subkey is selected, the
754 expiration time of this subkey will be changed. With no selection, the
755 key expiration of the primary key is changed.
758 @opindex keyedit:trust
759 Change the owner trust value for the key. This updates the trust-db
760 immediately and no save is required.
764 @opindex keyedit:disable
765 @opindex keyedit:enable
766 Disable or enable an entire key. A disabled key can not normally be
770 @opindex keyedit:addrevoker
771 Add a designated revoker to the key. This takes one optional argument:
772 "sensitive". If a designated revoker is marked as sensitive, it will
773 not be exported by default (see export-options).
776 @opindex keyedit:passwd
777 Change the passphrase of the secret key.
780 @opindex keyedit:toggle
781 Toggle between public and secret key listing.
784 @opindex keyedit:clean
785 Compact (by removing all signatures except the selfsig) any user ID
786 that is no longer usable (e.g. revoked, or expired). Then, remove any
787 signatures that are not usable by the trust calculations.
788 Specifically, this removes any signature that does not validate, any
789 signature that is superseded by a later signature, revoked signatures,
790 and signatures issued by keys that are not present on the keyring.
793 @opindex keyedit:minimize
794 Make the key as small as possible. This removes all signatures from
795 each user ID except for the most recent self-signature.
798 @opindex keyedit:cross-certify
799 Add cross-certification signatures to signing subkeys that may not
800 currently have them. Cross-certification signatures protect against a
801 subtle attack against signing subkeys. See
802 @option{--require-cross-certification}. All new keys generated have
803 this signature by default, so this option is only useful to bring
804 older keys up to date.
807 @opindex keyedit:save
808 Save all changes to the key rings and quit.
811 @opindex keyedit:quit
812 Quit the program without updating the
817 The listing shows you the key with its secondary keys and all user
818 ids. The primary user id is indicated by a dot, and selected keys or
819 user ids are indicated by an asterisk. The trust
820 value is displayed with the primary key: the first is the assigned owner
821 trust and the second is the calculated trust value. Letters are used for
828 No ownertrust assigned / not yet calculated.
832 calculation has failed; probably due to an expired key.
835 Not enough information for calculation.
838 Never trust this key.
850 @c ******** End Edit-key Options **********
852 @item --sign-key @code{name}
854 Signs a public key with your secret key. This is a shortcut version of
855 the subcommand "sign" from @option{--edit}.
857 @item --lsign-key @code{name}
859 Signs a public key with your secret key but marks it as
860 non-exportable. This is a shortcut version of the subcommand "lsign"
861 from @option{--edit-key}.
866 @c *******************************************
867 @c *************** ****************
868 @c *************** OPTIONS ****************
869 @c *************** ****************
870 @c *******************************************
873 @section Option Summary
875 @command{@gpgname} features a bunch of options to control the exact
876 behaviour and to change the default configuration.
879 * GPG Configuration Options:: How to change the configuration.
880 * GPG Key related Options:: Key related options.
881 * GPG Input and Output:: Input and Output.
882 * OpenPGP Options:: OpenPGP protocol specific options.
883 * Compliance Options:: Compliance options.
884 * GPG Esoteric Options:: Doing things one usually don't want to do.
885 * Deprecated Options:: Deprecated options.
888 Long options can be put in an options file (default
889 "~/.gnupg/gpg.conf"). Short option names will not work - for example,
890 "armor" is a valid option for the options file, while "a" is not. Do not
891 write the 2 dashes, but simply the name of the option and any required
892 arguments. Lines with a hash ('#') as the first non-white-space
893 character are ignored. Commands may be put in this file too, but that is
894 not generally useful as the command will execute automatically with
895 every execution of gpg.
897 Please remember that option parsing stops as soon as a non-option is
898 encountered, you can explicitly stop parsing by using the special option
901 @c *******************************************
902 @c ******** CONFIGURATION OPTIONS **********
903 @c *******************************************
904 @node GPG Configuration Options
905 @subsection How to change the configuration
907 These options are used to change the configuration and are usually found
912 @item --default-key @var{name}
914 Use @var{name} as the default key to sign with. If this option is not
915 used, the default key is the first key found in the secret keyring.
916 Note that @option{-u} or @option{--local-user} overrides this option.
918 @item --default-recipient @var{name}
919 @opindex default-recipient
920 Use @var{name} as default recipient if option @option{--recipient} is
921 not used and don't ask if this is a valid one. @var{name} must be
924 @item --default-recipient-self
925 @opindex default-recipient-self
926 Use the default key as default recipient if option @option{--recipient} is not
927 used and don't ask if this is a valid one. The default key is the first
928 one from the secret keyring or the one set with @option{--default-key}.
930 @item --no-default-recipient
931 @opindex no-default-recipient
932 Reset @option{--default-recipient} and @option{--default-recipient-self}.
936 Give more information during processing. If used
937 twice, the input data is listed in detail.
941 Reset verbose level to 0.
945 Try to be as quiet as possible.
951 Use batch mode. Never ask, do not allow interactive commands.
952 @option{--no-batch} disables this option. This option is commonly
953 used for unattended operations.
955 WARNING: Unattended operation bears a higher risk of being exposed to
956 security attacks. In particular any unattended use of GnuPG which
957 involves the use of secret keys should take care not to provide an
958 decryption oracle. There are several standard pre-cautions against
959 being used as an oracle. For example never return detailed error
960 messages or any diagnostics printed by your software to the remote
961 site. Consult with an expert in case of doubt.
963 Note that even with a filename given on the command line, gpg might
964 still need to read from STDIN (in particular if gpg figures that the
965 input is a detached signature and no data file has been specified).
966 Thus if you do not want to feed data via STDIN, you should connect
967 STDIN to @file{/dev/null}.
972 Make sure that the TTY (terminal) is never used for any output.
973 This option is needed in some cases because GnuPG sometimes prints
974 warnings to the TTY even if @option{--batch} is used.
978 Assume "yes" on most questions.
982 Assume "no" on most questions.
985 @item --list-options @code{parameters}
986 @opindex list-options
987 This is a space or comma delimited string that gives options used when
988 listing keys and signatures (that is, @option{--list-keys},
989 @option{--list-sigs}, @option{--list-public-keys},
990 @option{--list-secret-keys}, and the @option{--edit-key} functions).
991 Options can be prepended with a @option{no-} (after the two dashes) to
992 give the opposite meaning. The options are:
997 @opindex list-options:show-photos
998 Causes @option{--list-keys}, @option{--list-sigs},
999 @option{--list-public-keys}, and @option{--list-secret-keys} to
1000 display any photo IDs attached to the key. Defaults to no. See also
1001 @option{--photo-viewer}. Does not work with @option{--with-colons}:
1002 see @option{--attribute-fd} for the appropriate way to get photo data
1003 for scripts and other frontends.
1006 @opindex list-options:show-usage
1007 Show usage information for keys and subkeys in the standard key
1008 listing. This is a list of letters indicating the allowed usage for a
1009 key (@code{E}=encryption, @code{S}=signing, @code{C}=certification,
1010 @code{A}=authentication). Defaults to no.
1012 @item show-policy-urls
1013 @opindex list-options:show-policy-urls
1014 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
1015 listings. Defaults to no.
1017 @item show-notations
1018 @itemx show-std-notations
1019 @itemx show-user-notations
1020 @opindex list-options:show-notations
1021 @opindex list-options:show-std-notations
1022 @opindex list-options:show-user-notations
1023 Show all, IETF standard, or user-defined signature notations in the
1024 @option{--list-sigs} or @option{--check-sigs} listings. Defaults to no.
1026 @item show-keyserver-urls
1027 @opindex list-options:show-keyserver-urls
1028 Show any preferred keyserver URL in the @option{--list-sigs} or
1029 @option{--check-sigs} listings. Defaults to no.
1031 @item show-uid-validity
1032 @opindex list-options:show-uid-validity
1033 Display the calculated validity of user IDs during key listings.
1036 @item show-unusable-uids
1037 @opindex list-options:show-unusable-uids
1038 Show revoked and expired user IDs in key listings. Defaults to no.
1040 @item show-unusable-subkeys
1041 @opindex list-options:show-unusable-subkeys
1042 Show revoked and expired subkeys in key listings. Defaults to no.
1045 @opindex list-options:show-keyring
1046 Display the keyring name at the head of key listings to show which
1047 keyring a given key resides on. Defaults to no.
1049 @item show-sig-expire
1050 @opindex list-options:show-sig-expire
1051 Show signature expiration dates (if any) during @option{--list-sigs} or
1052 @option{--check-sigs} listings. Defaults to no.
1054 @item show-sig-subpackets
1055 @opindex list-options:show-sig-subpackets
1056 Include signature subpackets in the key listing. This option can take an
1057 optional argument list of the subpackets to list. If no argument is
1058 passed, list all subpackets. Defaults to no. This option is only
1059 meaningful when using @option{--with-colons} along with
1060 @option{--list-sigs} or @option{--check-sigs}.
1064 @item --verify-options @code{parameters}
1065 @opindex verify-options
1066 This is a space or comma delimited string that gives options used when
1067 verifying signatures. Options can be prepended with a `no-' to give
1068 the opposite meaning. The options are:
1073 @opindex verify-options:show-photos
1074 Display any photo IDs present on the key that issued the signature.
1075 Defaults to no. See also @option{--photo-viewer}.
1077 @item show-policy-urls
1078 @opindex verify-options:show-policy-urls
1079 Show policy URLs in the signature being verified. Defaults to no.
1081 @item show-notations
1082 @itemx show-std-notations
1083 @itemx show-user-notations
1084 @opindex verify-options:show-notations
1085 @opindex verify-options:show-std-notations
1086 @opindex verify-options:show-user-notations
1087 Show all, IETF standard, or user-defined signature notations in the
1088 signature being verified. Defaults to IETF standard.
1090 @item show-keyserver-urls
1091 @opindex verify-options:show-keyserver-urls
1092 Show any preferred keyserver URL in the signature being verified.
1095 @item show-uid-validity
1096 @opindex verify-options:show-uid-validity
1097 Display the calculated validity of the user IDs on the key that issued
1098 the signature. Defaults to no.
1100 @item show-unusable-uids
1101 @opindex verify-options:show-unusable-uids
1102 Show revoked and expired user IDs during signature verification.
1105 @item show-primary-uid-only
1106 @opindex verify-options:show-primary-uid-only
1107 Show only the primary user ID during signature verification. That is
1108 all the AKA lines as well as photo Ids are not shown with the signature
1109 verification status.
1112 @opindex verify-options:pka-lookups
1113 Enable PKA lookups to verify sender addresses. Note that PKA is based
1114 on DNS, and so enabling this option may disclose information on when
1115 and what signatures are verified or to whom data is encrypted. This
1116 is similar to the "web bug" described for the auto-key-retrieve
1119 @item pka-trust-increase
1120 @opindex verify-options:pka-trust-increase
1121 Raise the trust in a signature to full if the signature passes PKA
1122 validation. This option is only meaningful if pka-lookups is set.
1125 @item --enable-large-rsa
1126 @itemx --disable-large-rsa
1127 @opindex enable-large-rsa
1128 @opindex disable-large-rsa
1129 With --gen-key and --batch, enable the creation of larger RSA secret
1130 keys than is generally recommended (up to 8192 bits). These large
1131 keys are more expensive to use, and their signatures and
1132 certifications are also larger.
1135 @itemx --disable-dsa2
1136 @opindex enable-dsa2
1137 @opindex disable-dsa2
1138 Enable hash truncation for all DSA keys even for old DSA Keys up to
1139 1024 bit. This is also the default with @option{--openpgp}. Note
1140 that older versions of GnuPG also required this flag to allow the
1141 generation of DSA larger than 1024 bit.
1143 @item --photo-viewer @code{string}
1144 @opindex photo-viewer
1145 This is the command line that should be run to view a photo ID. "%i"
1146 will be expanded to a filename containing the photo. "%I" does the
1147 same, except the file will not be deleted once the viewer exits.
1148 Other flags are "%k" for the key ID, "%K" for the long key ID, "%f"
1149 for the key fingerprint, "%t" for the extension of the image type
1150 (e.g. "jpg"), "%T" for the MIME type of the image (e.g. "image/jpeg"),
1151 "%v" for the single-character calculated validity of the image being
1152 viewed (e.g. "f"), "%V" for the calculated validity as a string (e.g.
1153 "full"), "%U" for a base32 encoded hash of the user ID,
1154 and "%%" for an actual percent sign. If neither %i or %I are present,
1155 then the photo will be supplied to the viewer on standard input.
1157 The default viewer is "xloadimage -fork -quiet -title 'KeyID 0x%k'
1158 STDIN". Note that if your image viewer program is not secure, then
1159 executing it from GnuPG does not make it secure.
1161 @item --exec-path @code{string}
1163 Sets a list of directories to search for photo viewers and keyserver
1164 helpers. If not provided, keyserver helpers use the compiled-in
1165 default directory, and photo viewers use the $PATH environment
1167 Note, that on W32 system this value is ignored when searching for
1170 @item --keyring @code{file}
1172 Add @code{file} to the current list of keyrings. If @code{file} begins
1173 with a tilde and a slash, these are replaced by the $HOME directory. If
1174 the filename does not contain a slash, it is assumed to be in the GnuPG
1175 home directory ("~/.gnupg" if @option{--homedir} or $GNUPGHOME is not
1178 Note that this adds a keyring to the current list. If the intent is to
1179 use the specified keyring alone, use @option{--keyring} along with
1180 @option{--no-default-keyring}.
1182 @item --secret-keyring @code{file}
1183 @opindex secret-keyring
1184 Same as @option{--keyring} but for the secret keyrings.
1186 @item --primary-keyring @code{file}
1187 @opindex primary-keyring
1188 Designate @code{file} as the primary public keyring. This means that
1189 newly imported keys (via @option{--import} or keyserver
1190 @option{--recv-from}) will go to this keyring.
1192 @item --trustdb-name @code{file}
1193 @opindex trustdb-name
1194 Use @code{file} instead of the default trustdb. If @code{file} begins
1195 with a tilde and a slash, these are replaced by the $HOME directory. If
1196 the filename does not contain a slash, it is assumed to be in the GnuPG
1197 home directory (@file{~/.gnupg} if @option{--homedir} or $GNUPGHOME is
1200 @anchor{option --homedir}
1201 @include opt-homedir.texi
1204 @item --pcsc-driver @code{file}
1205 @opindex pcsc-driver
1206 Use @code{file} to access the smartcard reader. The current default is
1207 `libpcsclite.so.1' for GLIBC based systems,
1208 `/System/Library/Frameworks/PCSC.framework/PCSC' for MAC OS X,
1209 `winscard.dll' for Windows and `libpcsclite.so' for other systems.
1211 @item --disable-ccid
1212 @opindex disable-ccid
1213 Disable the integrated support for CCID compliant readers. This
1214 allows falling back to one of the other drivers even if the internal
1215 CCID driver can handle the reader. Note, that CCID support is only
1216 available if libusb was available at build time.
1218 @item --reader-port @code{number_or_string}
1219 @opindex reader-port
1220 This option may be used to specify the port of the card terminal. A
1221 value of 0 refers to the first serial device; add 32768 to access USB
1222 devices. The default is 32768 (first USB device). PC/SC or CCID
1223 readers might need a string here; run the program in verbose mode to get
1224 a list of available readers. The default is then the first reader
1227 @item --display-charset @code{name}
1228 @opindex display-charset
1229 Set the name of the native character set. This is used to convert
1230 some informational strings like user IDs to the proper UTF-8 encoding.
1231 Note that this has nothing to do with the character set of data to be
1232 encrypted or signed; GnuPG does not recode user-supplied data. If
1233 this option is not used, the default character set is determined from
1234 the current locale. A verbosity level of 3 shows the chosen set.
1235 Valid values for @code{name} are:
1240 @opindex display-charset:iso-8859-1
1241 This is the Latin 1 set.
1244 @opindex display-charset:iso-8859-2
1248 @opindex display-charset:iso-8859-15
1249 This is currently an alias for
1253 @opindex display-charset:koi8-r
1254 The usual Russian set (rfc1489).
1257 @opindex display-charset:utf-8
1258 Bypass all translations and assume
1259 that the OS uses native UTF-8 encoding.
1262 @item --utf8-strings
1263 @itemx --no-utf8-strings
1264 @opindex utf8-strings
1265 Assume that command line arguments are given as UTF8 strings. The
1266 default (@option{--no-utf8-strings}) is to assume that arguments are
1267 encoded in the character set as specified by
1268 @option{--display-charset}. These options affect all following
1269 arguments. Both options may be used multiple times.
1271 @anchor{gpg-option --options}
1272 @item --options @code{file}
1274 Read options from @code{file} and do not try to read them from the
1275 default options file in the homedir (see @option{--homedir}). This
1276 option is ignored if used in an options file.
1280 Shortcut for @option{--options /dev/null}. This option is detected
1281 before an attempt to open an option file. Using this option will also
1282 prevent the creation of a @file{~/.gnupg} homedir.
1285 @itemx --compress-level @code{n}
1286 @itemx --bzip2-compress-level @code{n}
1287 @opindex compress-level
1288 @opindex bzip2-compress-level
1289 Set compression level to @code{n} for the ZIP and ZLIB compression
1290 algorithms. The default is to use the default compression level of zlib
1291 (normally 6). @option{--bzip2-compress-level} sets the compression level
1292 for the BZIP2 compression algorithm (defaulting to 6 as well). This is a
1293 different option from @option{--compress-level} since BZIP2 uses a
1294 significant amount of memory for each additional compression level.
1295 @option{-z} sets both. A value of 0 for @code{n} disables compression.
1297 @item --bzip2-decompress-lowmem
1298 @opindex bzip2-decompress-lowmem
1299 Use a different decompression method for BZIP2 compressed files. This
1300 alternate method uses a bit more than half the memory, but also runs
1301 at half the speed. This is useful under extreme low memory
1302 circumstances when the file was originally compressed at a high
1303 @option{--bzip2-compress-level}.
1306 @item --mangle-dos-filenames
1307 @itemx --no-mangle-dos-filenames
1308 @opindex mangle-dos-filenames
1309 @opindex no-mangle-dos-filenames
1310 Older version of Windows cannot handle filenames with more than one
1311 dot. @option{--mangle-dos-filenames} causes GnuPG to replace (rather
1312 than add to) the extension of an output filename to avoid this
1313 problem. This option is off by default and has no effect on non-Windows
1316 @item --ask-cert-level
1317 @itemx --no-ask-cert-level
1318 @opindex ask-cert-level
1319 When making a key signature, prompt for a certification level. If this
1320 option is not specified, the certification level used is set via
1321 @option{--default-cert-level}. See @option{--default-cert-level} for
1322 information on the specific levels and how they are
1323 used. @option{--no-ask-cert-level} disables this option. This option
1326 @item --default-cert-level @code{n}
1327 @opindex default-cert-level
1328 The default to use for the check level when signing a key.
1330 0 means you make no particular claim as to how carefully you verified
1333 1 means you believe the key is owned by the person who claims to own
1334 it but you could not, or did not verify the key at all. This is
1335 useful for a "persona" verification, where you sign the key of a
1338 2 means you did casual verification of the key. For example, this
1339 could mean that you verified the key fingerprint and checked the
1340 user ID on the key against a photo ID.
1342 3 means you did extensive verification of the key. For example, this
1343 could mean that you verified the key fingerprint with the owner of the
1344 key in person, and that you checked, by means of a hard to forge
1345 document with a photo ID (such as a passport) that the name of the key
1346 owner matches the name in the user ID on the key, and finally that you
1347 verified (by exchange of email) that the email address on the key
1348 belongs to the key owner.
1350 Note that the examples given above for levels 2 and 3 are just that:
1351 examples. In the end, it is up to you to decide just what "casual"
1352 and "extensive" mean to you.
1354 This option defaults to 0 (no particular claim).
1356 @item --min-cert-level
1357 @opindex min-cert-level
1358 When building the trust database, treat any signatures with a
1359 certification level below this as invalid. Defaults to 2, which
1360 disregards level 1 signatures. Note that level 0 "no particular
1361 claim" signatures are always accepted.
1363 @item --trusted-key @code{long key ID}
1364 @opindex trusted-key
1365 Assume that the specified key (which must be given
1366 as a full 8 byte key ID) is as trustworthy as one of
1367 your own secret keys. This option is useful if you
1368 don't want to keep your secret keys (or one of them)
1369 online but still want to be able to check the validity of a given
1370 recipient's or signator's key.
1372 @item --trust-model @code{pgp|classic|direct|always|auto}
1373 @opindex trust-model
1374 Set what trust model GnuPG should follow. The models are:
1379 @opindex trust-mode:pgp
1380 This is the Web of Trust combined with trust signatures as used in PGP
1381 5.x and later. This is the default trust model when creating a new
1385 @opindex trust-mode:classic
1386 This is the standard Web of Trust as introduced by PGP 2.
1389 @opindex trust-mode:direct
1390 Key validity is set directly by the user and not calculated via the
1394 @opindex trust-mode:always
1395 Skip key validation and assume that used keys are always fully
1396 valid. You generally won't use this unless you are using some
1397 external validation scheme. This option also suppresses the
1398 "[uncertain]" tag printed with signature checks when there is no
1399 evidence that the user ID is bound to the key. Note that this
1400 trust model still does not allow the use of expired, revoked, or
1404 @opindex trust-mode:auto
1405 Select the trust model depending on whatever the internal trust
1406 database says. This is the default model if such a database already
1410 @item --auto-key-locate @code{parameters}
1411 @itemx --no-auto-key-locate
1412 @opindex auto-key-locate
1413 GnuPG can automatically locate and retrieve keys as needed using this
1414 option. This happens when encrypting to an email address (in the
1415 "user@@example.com" form), and there are no user@@example.com keys on
1416 the local keyring. This option takes any number of the following
1417 mechanisms, in the order they are to be tried:
1422 Locate a key using DNS CERT, as specified in rfc4398.
1425 Locate a key using DNS PKA.
1428 Using DNS Service Discovery, check the domain in question for any LDAP
1429 keyservers to use. If this fails, attempt to locate the key using the
1430 PGP Universal method of checking @samp{ldap://keys.(thedomain)}.
1433 Locate a key using whatever keyserver is defined using the
1434 @option{--keyserver} option.
1437 In addition, a keyserver URL as used in the @option{--keyserver} option
1438 may be used here to query that particular keyserver.
1441 Locate the key using the local keyrings. This mechanism allows the user to
1442 select the order a local key lookup is done. Thus using
1443 @samp{--auto-key-locate local} is identical to
1444 @option{--no-auto-key-locate}.
1447 This flag disables the standard local key lookup, done before any of the
1448 mechanisms defined by the @option{--auto-key-locate} are tried. The
1449 position of this mechanism in the list does not matter. It is not
1450 required if @code{local} is also used.
1453 Clear all defined mechanisms. This is useful to override
1454 mechanisms given in a config file.
1458 @item --keyid-format @code{short|0xshort|long|0xlong}
1459 @opindex keyid-format
1460 Select how to display key IDs. "short" is the traditional 8-character
1461 key ID. "long" is the more accurate (but less convenient)
1462 16-character key ID. Add an "0x" to either to include an "0x" at the
1463 beginning of the key ID, as in 0x99242560. Note that this option is
1464 ignored if the option --with-colons is used.
1466 @item --keyserver @code{name}
1468 Use @code{name} as your keyserver. This is the server that
1469 @option{--recv-keys}, @option{--send-keys}, and @option{--search-keys}
1470 will communicate with to receive keys from, send keys to, and search for
1471 keys on. The format of the @code{name} is a URI:
1472 `scheme:[//]keyservername[:port]' The scheme is the type of keyserver:
1473 "hkp" for the HTTP (or compatible) keyservers, "ldap" for the LDAP
1474 keyservers, or "mailto" for the Graff email keyserver. Note that your
1475 particular installation of GnuPG may have other keyserver types
1476 available as well. Keyserver schemes are case-insensitive. After the
1477 keyserver name, optional keyserver configuration options may be
1478 provided. These are the same as the global @option{--keyserver-options}
1479 from below, but apply only to this particular keyserver.
1481 Most keyservers synchronize with each other, so there is generally no
1482 need to send keys to more than one server. The keyserver
1483 @code{hkp://keys.gnupg.net} uses round robin DNS to give a different
1484 keyserver each time you use it.
1486 @item --keyserver-options @code{name=value1 }
1487 @opindex keyserver-options
1488 This is a space or comma delimited string that gives options for the
1489 keyserver. Options can be prefixed with a `no-' to give the opposite
1490 meaning. Valid import-options or export-options may be used here as
1491 well to apply to importing (@option{--recv-key}) or exporting
1492 (@option{--send-key}) a key from a keyserver. While not all options
1493 are available for all keyserver types, some common options are:
1497 @item include-revoked
1498 When searching for a key with @option{--search-keys}, include keys that
1499 are marked on the keyserver as revoked. Note that not all keyservers
1500 differentiate between revoked and unrevoked keys, and for such
1501 keyservers this option is meaningless. Note also that most keyservers do
1502 not have cryptographic verification of key revocations, and so turning
1503 this option off may result in skipping keys that are incorrectly marked
1506 @item include-disabled
1507 When searching for a key with @option{--search-keys}, include keys that
1508 are marked on the keyserver as disabled. Note that this option is not
1509 used with HKP keyservers.
1511 @item auto-key-retrieve
1512 This option enables the automatic retrieving of keys from a keyserver
1513 when verifying signatures made by keys that are not on the local
1516 Note that this option makes a "web bug" like behavior possible.
1517 Keyserver operators can see which keys you request, so by sending you
1518 a message signed by a brand new key (which you naturally will not have
1519 on your local keyring), the operator can tell both your IP address and
1520 the time when you verified the signature.
1522 @item honor-keyserver-url
1523 When using @option{--refresh-keys}, if the key in question has a preferred
1524 keyserver URL, then use that preferred keyserver to refresh the key
1525 from. In addition, if auto-key-retrieve is set, and the signature
1526 being verified has a preferred keyserver URL, then use that preferred
1527 keyserver to fetch the key from. Defaults to yes.
1529 @item honor-pka-record
1530 If auto-key-retrieve is set, and the signature being verified has a
1531 PKA record, then use the PKA information to fetch the key. Defaults
1534 @item include-subkeys
1535 When receiving a key, include subkeys as potential targets. Note that
1536 this option is not used with HKP keyservers, as they do not support
1537 retrieving keys by subkey id.
1539 @item use-temp-files
1540 On most Unix-like platforms, GnuPG communicates with the keyserver
1541 helper program via pipes, which is the most efficient method. This
1542 option forces GnuPG to use temporary files to communicate. On some
1543 platforms (such as Win32 and RISC OS), this option is always enabled.
1545 @item keep-temp-files
1546 If using `use-temp-files', do not delete the temp files after using
1547 them. This option is useful to learn the keyserver communication
1548 protocol by reading the temporary files.
1551 Tell the keyserver helper program to be more verbose. This option can
1552 be repeated multiple times to increase the verbosity level.
1555 Tell the keyserver helper program how long (in seconds) to try and
1556 perform a keyserver action before giving up. Note that performing
1557 multiple actions at the same time uses this timeout value per action.
1558 For example, when retrieving multiple keys via @option{--recv-keys}, the
1559 timeout applies separately to each key retrieval, and not to the
1560 @option{--recv-keys} command as a whole. Defaults to 30 seconds.
1562 @item http-proxy=@code{value}
1563 Set the proxy to use for HTTP and HKP keyservers. This overrides the
1564 "http_proxy" environment variable, if any.
1568 When retrieving a key via DNS CERT, only accept keys up to this size.
1569 Defaults to 16384 bytes.
1572 Turn on debug output in the keyserver helper program. Note that the
1573 details of debug output depends on which keyserver helper program is
1574 being used, and in turn, on any libraries that the keyserver helper
1575 program uses internally (libcurl, openldap, etc).
1578 Enable certificate checking if the keyserver presents one (for hkps or
1579 ldaps). Defaults to on.
1582 Provide a certificate store to override the system default. Only
1583 necessary if check-cert is enabled, and the keyserver is using a
1584 certificate that is not present in a system default certificate list.
1586 Note that depending on the SSL library that the keyserver helper is
1587 built with, this may actually be a directory or a file.
1591 @item --completes-needed @code{n}
1592 @opindex compliant-needed
1593 Number of completely trusted users to introduce a new
1594 key signer (defaults to 1).
1596 @item --marginals-needed @code{n}
1597 @opindex marginals-needed
1598 Number of marginally trusted users to introduce a new
1599 key signer (defaults to 3)
1601 @item --max-cert-depth @code{n}
1602 @opindex max-cert-depth
1603 Maximum depth of a certification chain (default is 5).
1605 @item --simple-sk-checksum
1606 @opindex simple-sk-checksum
1607 Secret keys are integrity protected by using a SHA-1 checksum. This
1608 method is part of the upcoming enhanced OpenPGP specification but
1609 GnuPG already uses it as a countermeasure against certain attacks.
1610 Old applications don't understand this new format, so this option may
1611 be used to switch back to the old behaviour. Using this option bears
1612 a security risk. Note that using this option only takes effect when
1613 the secret key is encrypted - the simplest way to make this happen is
1614 to change the passphrase on the key (even changing it to the same
1615 value is acceptable).
1617 @item --no-sig-cache
1618 @opindex no-sig-cache
1619 Do not cache the verification status of key signatures.
1620 Caching gives a much better performance in key listings. However, if
1621 you suspect that your public keyring is not save against write
1622 modifications, you can use this option to disable the caching. It
1623 probably does not make sense to disable it because all kind of damage
1624 can be done if someone else has write access to your public keyring.
1626 @item --no-sig-create-check
1627 @opindex no-sig-create-check
1628 This options is obsolete. It has no function.
1630 @item --auto-check-trustdb
1631 @itemx --no-auto-check-trustdb
1632 @opindex auto-check-trustdb
1633 If GnuPG feels that its information about the Web of Trust has to be
1634 updated, it automatically runs the @option{--check-trustdb} command
1635 internally. This may be a time consuming
1636 process. @option{--no-auto-check-trustdb} disables this option.
1639 @itemx --no-use-agent
1641 Try to use the GnuPG-Agent. With this option, GnuPG first tries to
1642 connect to the agent before it asks for a
1643 passphrase. @option{--no-use-agent} disables this option. Note, that
1644 the tool @command{gpg-preset-passphrase}, which comes with GnuPG-2,
1645 cannot be used to preset a passphrase for this version of GnuPG.
1647 @item --gpg-agent-info
1648 @opindex gpg-agent-info
1649 Override the value of the environment variable
1650 @samp{GPG_AGENT_INFO}. This is only used when @option{--use-agent} has
1651 been given. Given that this option is not anymore used by
1652 @command{gpg2}, it should be avoided if possible.
1657 Lock the databases the first time a lock is requested
1658 and do not release the lock until the process
1661 @item --lock-multiple
1662 @opindex lock-multiple
1663 Release the locks every time a lock is no longer
1664 needed. Use this to override a previous @option{--lock-once}
1669 Disable locking entirely. This option should be used only in very
1670 special environments, where it can be assured that only one process
1671 is accessing those files. A bootable floppy with a stand-alone
1672 encryption system will probably use this. Improper usage of this
1673 option may lead to data and key corruption.
1675 @item --exit-on-status-write-error
1676 @opindex exit-on-status-write-error
1677 This option will cause write errors on the status FD to immediately
1678 terminate the process. That should in fact be the default but it never
1679 worked this way and thus we need an option to enable this, so that the
1680 change won't break applications which close their end of a status fd
1681 connected pipe too early. Using this option along with
1682 @option{--enable-progress-filter} may be used to cleanly cancel long
1683 running gpg operations.
1685 @item --limit-card-insert-tries @code{n}
1686 @opindex limit-card-insert-tries
1687 With @code{n} greater than 0 the number of prompts asking to insert a
1688 smartcard gets limited to N-1. Thus with a value of 1 gpg won't at
1689 all ask to insert a card if none has been inserted at startup. This
1690 option is useful in the configuration file in case an application does
1691 not know about the smartcard support and waits ad infinitum for an
1694 @item --no-random-seed-file
1695 @opindex no-random-seed-file
1696 GnuPG uses a file to store its internal random pool over invocations.
1697 This makes random generation faster; however sometimes write operations
1698 are not desired. This option can be used to achieve that with the cost of
1699 slower random generation.
1702 @opindex no-greeting
1703 Suppress the initial copyright message.
1705 @item --no-secmem-warning
1706 @opindex no-secmem-warning
1707 Suppress the warning about "using insecure memory".
1709 @item --no-permission-warning
1710 @opindex permission-warning
1711 Suppress the warning about unsafe file and home directory (@option{--homedir})
1712 permissions. Note that the permission checks that GnuPG performs are
1713 not intended to be authoritative, but rather they simply warn about
1714 certain common permission problems. Do not assume that the lack of a
1715 warning means that your system is secure.
1717 Note that the warning for unsafe @option{--homedir} permissions cannot be
1718 suppressed in the gpg.conf file, as this would allow an attacker to
1719 place an unsafe gpg.conf file in place, and use this file to suppress
1720 warnings about itself. The @option{--homedir} permissions warning may only be
1721 suppressed on the command line.
1723 @item --no-mdc-warning
1724 @opindex no-mdc-warning
1725 Suppress the warning about missing MDC integrity protection.
1727 @item --require-secmem
1728 @itemx --no-require-secmem
1729 @opindex require-secmem
1730 Refuse to run if GnuPG cannot get secure memory. Defaults to no
1731 (i.e. run, but give a warning).
1734 @item --require-cross-certification
1735 @itemx --no-require-cross-certification
1736 @opindex require-cross-certification
1737 When verifying a signature made from a subkey, ensure that the cross
1738 certification "back signature" on the subkey is present and valid. This
1739 protects against a subtle attack against subkeys that can sign.
1740 Defaults to @option{--require-cross-certification} for
1746 Allow the user to do certain nonsensical or "silly" things like
1747 signing an expired or revoked key, or certain potentially incompatible
1748 things like generating unusual key types. This also disables certain
1749 warning messages about potentially incompatible actions. As the name
1750 implies, this option is for experts only. If you don't fully
1751 understand the implications of what it allows you to do, leave this
1752 off. @option{--no-expert} disables this option.
1757 @c *******************************************
1758 @c ******** KEY RELATED OPTIONS ************
1759 @c *******************************************
1760 @node GPG Key related Options
1761 @subsection Key related options
1765 @item --recipient @var{name}
1768 Encrypt for user id @var{name}. If this option or
1769 @option{--hidden-recipient} is not specified, GnuPG asks for the user-id
1770 unless @option{--default-recipient} is given.
1772 @item --hidden-recipient @var{name}
1774 @opindex hidden-recipient
1775 Encrypt for user ID @var{name}, but hide the key ID of this user's
1776 key. This option helps to hide the receiver of the message and is a
1777 limited countermeasure against traffic analysis. If this option or
1778 @option{--recipient} is not specified, GnuPG asks for the user ID unless
1779 @option{--default-recipient} is given.
1781 @item --encrypt-to @code{name}
1783 Same as @option{--recipient} but this one is intended for use in the
1784 options file and may be used with your own user-id as an
1785 "encrypt-to-self". These keys are only used when there are other
1786 recipients given either by use of @option{--recipient} or by the asked
1787 user id. No trust checking is performed for these user ids and even
1788 disabled keys can be used.
1790 @item --hidden-encrypt-to @code{name}
1791 @opindex hidden-encrypt-to
1792 Same as @option{--hidden-recipient} but this one is intended for use in the
1793 options file and may be used with your own user-id as a hidden
1794 "encrypt-to-self". These keys are only used when there are other
1795 recipients given either by use of @option{--recipient} or by the asked user id.
1796 No trust checking is performed for these user ids and even disabled
1799 @item --no-encrypt-to
1800 @opindex no-encrypt-to
1801 Disable the use of all @option{--encrypt-to} and
1802 @option{--hidden-encrypt-to} keys.
1804 @item --group @code{name=value1 }
1806 Sets up a named group, which is similar to aliases in email programs.
1807 Any time the group name is a recipient (@option{-r} or
1808 @option{--recipient}), it will be expanded to the values
1809 specified. Multiple groups with the same name are automatically merged
1810 into a single group.
1812 The values are @code{key IDs} or fingerprints, but any key description
1813 is accepted. Note that a value with spaces in it will be treated as
1814 two different values. Note also there is only one level of expansion
1815 --- you cannot make an group that points to another group. When used
1816 from the command line, it may be necessary to quote the argument to
1817 this option to prevent the shell from treating it as multiple
1820 @item --ungroup @code{name}
1822 Remove a given entry from the @option{--group} list.
1826 Remove all entries from the @option{--group} list.
1828 @item --local-user @var{name}
1831 Use @var{name} as the key to sign with. Note that this option overrides
1832 @option{--default-key}.
1834 @item --try-all-secrets
1835 @opindex try-all-secrets
1836 Don't look at the key ID as stored in the message but try all secret
1837 keys in turn to find the right decryption key. This option forces the
1838 behaviour as used by anonymous recipients (created by using
1839 @option{--throw-keyids} or @option{--hidden-recipient}) and might come
1840 handy in case where an encrypted message contains a bogus key ID.
1845 @c *******************************************
1846 @c ******** INPUT AND OUTPUT ***************
1847 @c *******************************************
1848 @node GPG Input and Output
1849 @subsection Input and Output
1856 Create ASCII armored output. The default is to create the binary
1861 Assume the input data is not in ASCII armored format.
1863 @item --output @var{file}
1864 @itemx -o @var{file}
1866 Write output to @var{file}.
1868 @item --max-output @code{n}
1870 This option sets a limit on the number of bytes that will be generated
1871 when processing a file. Since OpenPGP supports various levels of
1872 compression, it is possible that the plaintext of a given message may be
1873 significantly larger than the original OpenPGP message. While GnuPG
1874 works properly with such messages, there is often a desire to set a
1875 maximum file size that will be generated before processing is forced to
1876 stop by the OS limits. Defaults to 0, which means "no limit".
1878 @item --import-options @code{parameters}
1879 @opindex import-options
1880 This is a space or comma delimited string that gives options for
1881 importing keys. Options can be prepended with a `no-' to give the
1882 opposite meaning. The options are:
1886 @item import-local-sigs
1887 Allow importing key signatures marked as "local". This is not
1888 generally useful unless a shared keyring scheme is being used.
1891 @item keep-ownertrust
1892 Normally possible still existing ownertrust values of a key are
1893 cleared if a key is imported. This is in general desirable so that
1894 a formerly deleted key does not automatically gain an ownertrust
1895 values merely due to import. On the other hand it is sometimes
1896 necessary to re-import a trusted set of keys again but keeping
1897 already assigned ownertrust values. This can be achived by using
1900 @item repair-pks-subkey-bug
1901 During import, attempt to repair the damage caused by the PKS keyserver
1902 bug (pre version 0.9.6) that mangles keys with multiple subkeys. Note
1903 that this cannot completely repair the damaged key as some crucial data
1904 is removed by the keyserver, but it does at least give you back one
1905 subkey. Defaults to no for regular @option{--import} and to yes for
1906 keyserver @option{--recv-keys}.
1909 During import, allow key updates to existing keys, but do not allow
1910 any new keys to be imported. Defaults to no.
1913 After import, compact (remove all signatures except the
1914 self-signature) any user IDs from the new key that are not usable.
1915 Then, remove any signatures from the new key that are not usable.
1916 This includes signatures that were issued by keys that are not present
1917 on the keyring. This option is the same as running the @option{--edit-key}
1918 command "clean" after import. Defaults to no.
1920 @item import-minimal
1921 Import the smallest key possible. This removes all signatures except
1922 the most recent self-signature on each user ID. This option is the
1923 same as running the @option{--edit-key} command "minimize" after import.
1927 @item --export-options @code{parameters}
1928 @opindex export-options
1929 This is a space or comma delimited string that gives options for
1930 exporting keys. Options can be prepended with a `no-' to give the
1931 opposite meaning. The options are:
1935 @item export-local-sigs
1936 Allow exporting key signatures marked as "local". This is not
1937 generally useful unless a shared keyring scheme is being used.
1940 @item export-attributes
1941 Include attribute user IDs (photo IDs) while exporting. This is
1942 useful to export keys if they are going to be used by an OpenPGP
1943 program that does not accept attribute user IDs. Defaults to yes.
1945 @item export-sensitive-revkeys
1946 Include designated revoker information that was marked as
1947 "sensitive". Defaults to no.
1949 @item export-reset-subkey-passwd
1950 When using the @option{--export-secret-subkeys} command, this option resets
1951 the passphrases for all exported subkeys to empty. This is useful
1952 when the exported subkey is to be used on an unattended machine where
1953 a passphrase doesn't necessarily make sense. Defaults to no.
1956 Compact (remove all signatures from) user IDs on the key being
1957 exported if the user IDs are not usable. Also, do not export any
1958 signatures that are not usable. This includes signatures that were
1959 issued by keys that are not present on the keyring. This option is
1960 the same as running the @option{--edit-key} command "clean" before export
1961 except that the local copy of the key is not modified. Defaults to
1964 @item export-minimal
1965 Export the smallest key possible. This removes all signatures except the
1966 most recent self-signature on each user ID. This option is the same as
1967 running the @option{--edit-key} command "minimize" before export except
1968 that the local copy of the key is not modified. Defaults to no.
1972 @opindex with-colons
1973 Print key listings delimited by colons. Note that the output will be
1974 encoded in UTF-8 regardless of any @option{--display-charset} setting. This
1975 format is useful when GnuPG is called from scripts and other programs
1976 as it is easily machine parsed. The details of this format are
1977 documented in the file @file{doc/DETAILS}, which is included in the GnuPG
1978 source distribution.
1980 @item --fixed-list-mode
1981 @opindex fixed-list-mode
1982 Do not merge primary user ID and primary key in @option{--with-colon}
1983 listing mode and print all timestamps as seconds since 1970-01-01.
1985 @item --with-fingerprint
1986 @opindex with-fingerprint
1987 Same as the command @option{--fingerprint} but changes only the format
1988 of the output and may be used together with another command.
1992 @c *******************************************
1993 @c ******** OPENPGP OPTIONS ****************
1994 @c *******************************************
1995 @node OpenPGP Options
1996 @subsection OpenPGP protocol specific options.
2000 @item -t, --textmode
2001 @itemx --no-textmode
2003 Treat input files as text and store them in the OpenPGP canonical text
2004 form with standard "CRLF" line endings. This also sets the necessary
2005 flags to inform the recipient that the encrypted or signed data is text
2006 and may need its line endings converted back to whatever the local
2007 system uses. This option is useful when communicating between two
2008 platforms that have different line ending conventions (UNIX-like to Mac,
2009 Mac to Windows, etc). @option{--no-textmode} disables this option, and
2012 If @option{-t} (but not @option{--textmode}) is used together with
2013 armoring and signing, this enables clearsigned messages. This kludge is
2014 needed for command-line compatibility with command-line versions of PGP;
2015 normally you would use @option{--sign} or @option{--clearsign} to select
2016 the type of the signature.
2018 @item --force-v3-sigs
2019 @itemx --no-force-v3-sigs
2020 @opindex force-v3-sigs
2021 OpenPGP states that an implementation should generate v4 signatures
2022 but PGP versions 5 through 7 only recognize v4 signatures on key
2023 material. This option forces v3 signatures for signatures on data.
2024 Note that this option implies @option{--no-ask-sig-expire}, and unsets
2025 @option{--sig-policy-url}, @option{--sig-notation}, and
2026 @option{--sig-keyserver-url}, as these features cannot be used with v3
2027 signatures. @option{--no-force-v3-sigs} disables this option.
2030 @item --force-v4-certs
2031 @itemx --no-force-v4-certs
2032 @opindex force-v4-certs
2033 Always use v4 key signatures even on v3 keys. This option also
2034 changes the default hash algorithm for v3 RSA keys from MD5 to SHA-1.
2035 @option{--no-force-v4-certs} disables this option.
2039 Force the use of encryption with a modification detection code. This
2040 is always used with the newer ciphers (those with a blocksize greater
2041 than 64 bits), or if all of the recipient keys indicate MDC support in
2042 their feature flags.
2045 @opindex disable-mdc
2046 Disable the use of the modification detection code. Note that by
2047 using this option, the encrypted message becomes vulnerable to a
2048 message modification attack.
2050 @item --personal-cipher-preferences @code{string}
2051 @opindex personal-cipher-preferences
2052 Set the list of personal cipher preferences to @code{string}. Use
2053 @command{@gpgname --version} to get a list of available algorithms,
2054 and use @code{none} to set no preference at all. This allows the user
2055 to safely override the algorithm chosen by the recipient key
2056 preferences, as GPG will only select an algorithm that is usable by
2057 all recipients. The most highly ranked cipher in this list is also
2058 used for the @option{--symmetric} encryption command.
2060 @item --personal-digest-preferences @code{string}
2061 @opindex personal-digest-preferences
2062 Set the list of personal digest preferences to @code{string}. Use
2063 @command{@gpgname --version} to get a list of available algorithms,
2064 and use @code{none} to set no preference at all. This allows the user
2065 to safely override the algorithm chosen by the recipient key
2066 preferences, as GPG will only select an algorithm that is usable by
2067 all recipients. The most highly ranked digest algorithm in this list
2068 is also used when signing without encryption
2069 (e.g. @option{--clearsign} or @option{--sign}).
2071 @item --personal-compress-preferences @code{string}
2072 @opindex personal-compress-preferences
2073 Set the list of personal compression preferences to @code{string}.
2074 Use @command{@gpgname --version} to get a list of available
2075 algorithms, and use @code{none} to set no preference at all. This
2076 allows the user to safely override the algorithm chosen by the
2077 recipient key preferences, as GPG will only select an algorithm that
2078 is usable by all recipients. The most highly ranked compression
2079 algorithm in this list is also used when there are no recipient keys
2080 to consider (e.g. @option{--symmetric}).
2082 @item --s2k-cipher-algo @code{name}
2083 @opindex s2k-cipher-algo
2084 Use @code{name} as the cipher algorithm used to protect secret keys.
2085 The default cipher is @value{DEFSYMENCALGO}. This cipher is also used for
2086 conventional encryption if @option{--personal-cipher-preferences} and
2087 @option{--cipher-algo} is not given.
2089 @item --s2k-digest-algo @code{name}
2090 @opindex s2k-digest-algo
2091 Use @code{name} as the digest algorithm used to mangle the passphrases.
2092 The default algorithm is SHA-1.
2094 @item --s2k-mode @code{n}
2096 Selects how passphrases are mangled. If @code{n} is 0 a plain
2097 passphrase (which is not recommended) will be used, a 1 adds a salt to
2098 the passphrase and a 3 (the default) iterates the whole process a
2099 number of times (see --s2k-count). Unless @option{--rfc1991} is used,
2100 this mode is also used for conventional encryption.
2102 @item --s2k-count @code{n}
2104 Specify how many times the passphrase mangling is repeated. This
2105 value may range between 1024 and 65011712 inclusive. The default is
2106 inquired from gpg-agent. Note that not all values in the
2107 1024-65011712 range are legal and if an illegal value is selected,
2108 GnuPG will round up to the nearest legal value. This option is only
2109 meaningful if @option{--s2k-mode} is 3.
2114 @c ***************************
2115 @c ******* Compliance ********
2116 @c ***************************
2117 @node Compliance Options
2118 @subsection Compliance options
2120 These options control what GnuPG is compliant to. Only one of these
2121 options may be active at a time. Note that the default setting of
2122 this is nearly always the correct one. See the INTEROPERABILITY WITH
2123 OTHER OPENPGP PROGRAMS section below before using one of these
2130 Use standard GnuPG behavior. This is essentially OpenPGP behavior
2131 (see @option{--openpgp}), but with some additional workarounds for common
2132 compatibility problems in different versions of PGP. This is the
2133 default option, so it is not generally needed, but it may be useful to
2134 override a different compliance option in the gpg.conf file.
2138 Reset all packet, cipher and digest options to strict OpenPGP
2139 behavior. Use this option to reset all previous options like
2140 @option{--s2k-*}, @option{--cipher-algo}, @option{--digest-algo} and
2141 @option{--compress-algo} to OpenPGP compliant values. All PGP
2142 workarounds are disabled.
2146 Reset all packet, cipher and digest options to strict RFC-4880
2147 behavior. Note that this is currently the same thing as
2152 Reset all packet, cipher and digest options to strict RFC-2440
2158 Try to be more RFC-1991 (PGP 2.x) compliant. This option is
2159 deprecated will be removed in GnuPG 2.1.
2163 Set up all options to be as PGP 2.x compliant as possible, and warn if
2164 an action is taken (e.g. encrypting to a non-RSA key) that will create
2165 a message that PGP 2.x will not be able to handle. Note that `PGP
2166 2.x' here means `MIT PGP 2.6.2'. There are other versions of PGP 2.x
2167 available, but the MIT release is a good common baseline.
2170 @option{--rfc1991 --disable-mdc --no-force-v4-certs
2171 --escape-from-lines --force-v3-sigs --allow-weak-digest-algos
2172 --cipher-algo IDEA --digest-algo MD5 --compress-algo ZIP}.
2173 It also disables @option{--textmode} when encrypting.
2175 This option is deprecated will be removed in GnuPG 2.1. The reason
2176 for dropping PGP-2 support is that the PGP 2 format is not anymore
2177 considered safe (for example due to the use of the broken MD5 algorithm).
2178 Note that the decryption of PGP-2 created messages will continue to work.
2183 Set up all options to be as PGP 6 compliant as possible. This
2184 restricts you to the ciphers IDEA (if the IDEA plugin is installed),
2185 3DES, and CAST5, the hashes MD5, SHA1 and RIPEMD160, and the
2186 compression algorithms none and ZIP. This also disables
2187 --throw-keyids, and making signatures with signing subkeys as PGP 6
2188 does not understand signatures made by signing subkeys.
2190 This option implies @option{--disable-mdc --escape-from-lines
2195 Set up all options to be as PGP 7 compliant as possible. This is
2196 identical to @option{--pgp6} except that MDCs are not disabled, and the
2197 list of allowable ciphers is expanded to add AES128, AES192, AES256, and
2202 Set up all options to be as PGP 8 compliant as possible. PGP 8 is a lot
2203 closer to the OpenPGP standard than previous versions of PGP, so all
2204 this does is disable @option{--throw-keyids} and set
2205 @option{--escape-from-lines}. All algorithms are allowed except for the
2206 SHA224, SHA384, and SHA512 digests.
2211 @c *******************************************
2212 @c ******** ESOTERIC OPTIONS ***************
2213 @c *******************************************
2214 @node GPG Esoteric Options
2215 @subsection Doing things one usually doesn't want to do.
2222 Don't make any changes (this is not completely implemented).
2226 Changes the behaviour of some commands. This is like @option{--dry-run} but
2227 different in some cases. The semantic of this command may be extended in
2228 the future. Currently it only skips the actual decryption pass and
2229 therefore enables a fast listing of the encryption keys.
2232 @itemx --interactive
2233 @opindex interactive
2234 Prompt before overwriting any files.
2236 @item --debug-level @var{level}
2237 @opindex debug-level
2238 Select the debug level for investigating problems. @var{level} may be
2239 a numeric value or by a keyword:
2243 No debugging at all. A value of less than 1 may be used instead of
2246 Some basic debug messages. A value between 1 and 2 may be used
2247 instead of the keyword.
2249 More verbose debug messages. A value between 3 and 5 may be used
2250 instead of the keyword.
2252 Even more detailed messages. A value between 6 and 8 may be used
2253 instead of the keyword.
2255 All of the debug messages you can get. A value greater than 8 may be
2256 used instead of the keyword. The creation of hash tracing files is
2257 only enabled if the keyword is used.
2260 How these messages are mapped to the actual debugging flags is not
2261 specified and may change with newer releases of this program. They are
2262 however carefully selected to best aid in debugging.
2264 @item --debug @var{flags}
2266 Set debugging flags. All flags are or-ed and @var{flags} may
2267 be given in C syntax (e.g. 0x0042).
2271 Set all useful debugging flags.
2273 @item --debug-ccid-driver
2274 @opindex debug-ccid-driver
2275 Enable debug output from the included CCID driver for smartcards.
2276 Note that this option is only available on some system.
2278 @item --faked-system-time @var{epoch}
2279 @opindex faked-system-time
2280 This option is only useful for testing; it sets the system time back or
2281 forth to @var{epoch} which is the number of seconds elapsed since the year
2282 1970. Alternatively @var{epoch} may be given as a full ISO time string
2283 (e.g. "20070924T154812").
2285 @item --enable-progress-filter
2286 @opindex enable-progress-filter
2287 Enable certain PROGRESS status outputs. This option allows frontends
2288 to display a progress indicator while gpg is processing larger files.
2289 There is a slight performance overhead using it.
2291 @item --status-fd @code{n}
2293 Write special status strings to the file descriptor @code{n}.
2294 See the file DETAILS in the documentation for a listing of them.
2296 @item --status-file @code{file}
2297 @opindex status-file
2298 Same as @option{--status-fd}, except the status data is written to file
2301 @item --logger-fd @code{n}
2303 Write log output to file descriptor @code{n} and not to STDERR.
2305 @item --log-file @code{file}
2306 @itemx --logger-file @code{file}
2308 Same as @option{--logger-fd}, except the logger data is written to file
2309 @code{file}. Note that @option{--log-file} is only implemented for
2312 @item --attribute-fd @code{n}
2313 @opindex attribute-fd
2314 Write attribute subpackets to the file descriptor @code{n}. This is most
2315 useful for use with @option{--status-fd}, since the status messages are
2316 needed to separate out the various subpackets from the stream delivered
2317 to the file descriptor.
2319 @item --attribute-file @code{file}
2320 @opindex attribute-file
2321 Same as @option{--attribute-fd}, except the attribute data is written to
2324 @item --comment @code{string}
2325 @itemx --no-comments
2327 Use @code{string} as a comment string in clear text signatures and ASCII
2328 armored messages or keys (see @option{--armor}). The default behavior is
2329 not to use a comment string. @option{--comment} may be repeated multiple
2330 times to get multiple comment strings. @option{--no-comments} removes
2331 all comments. It is a good idea to keep the length of a single comment
2332 below 60 characters to avoid problems with mail programs wrapping such
2333 lines. Note that comment lines, like all other header lines, are not
2334 protected by the signature.
2336 @item --emit-version
2337 @itemx --no-emit-version
2338 @opindex emit-version
2339 Force inclusion of the version string in ASCII armored output. If
2340 given once only the name of the program and the major number is
2341 emitted, given twice the minor is also emitted, given triple
2342 the micro is added, and given quad an operating system identification
2343 is also emitted. @option{--no-emit-version} (default) disables the version
2346 @item --sig-notation @code{name=value}
2347 @itemx --cert-notation @code{name=value}
2348 @itemx -N, --set-notation @code{name=value}
2349 @opindex sig-notation
2350 @opindex cert-notation
2351 @opindex set-notation
2352 Put the name value pair into the signature as notation data.
2353 @code{name} must consist only of printable characters or spaces, and
2354 must contain a '@@' character in the form keyname@@domain.example.com
2355 (substituting the appropriate keyname and domain name, of course). This
2356 is to help prevent pollution of the IETF reserved notation
2357 namespace. The @option{--expert} flag overrides the '@@'
2358 check. @code{value} may be any printable string; it will be encoded in
2359 UTF8, so you should check that your @option{--display-charset} is set
2360 correctly. If you prefix @code{name} with an exclamation mark (!), the
2361 notation data will be flagged as critical
2362 (rfc4880:5.2.3.16). @option{--sig-notation} sets a notation for data
2363 signatures. @option{--cert-notation} sets a notation for key signatures
2364 (certifications). @option{--set-notation} sets both.
2366 There are special codes that may be used in notation names. "%k" will
2367 be expanded into the key ID of the key being signed, "%K" into the
2368 long key ID of the key being signed, "%f" into the fingerprint of the
2369 key being signed, "%s" into the key ID of the key making the
2370 signature, "%S" into the long key ID of the key making the signature,
2371 "%g" into the fingerprint of the key making the signature (which might
2372 be a subkey), "%p" into the fingerprint of the primary key of the key
2373 making the signature, "%c" into the signature count from the OpenPGP
2374 smartcard, and "%%" results in a single "%". %k, %K, and %f are only
2375 meaningful when making a key signature (certification), and %c is only
2376 meaningful when using the OpenPGP smartcard.
2378 @item --sig-policy-url @code{string}
2379 @itemx --cert-policy-url @code{string}
2380 @itemx --set-policy-url @code{string}
2381 @opindex sig-policy-url
2382 @opindex cert-policy-url
2383 @opindex set-policy-url
2384 Use @code{string} as a Policy URL for signatures (rfc4880:5.2.3.20). If
2385 you prefix it with an exclamation mark (!), the policy URL packet will
2386 be flagged as critical. @option{--sig-policy-url} sets a policy url for
2387 data signatures. @option{--cert-policy-url} sets a policy url for key
2388 signatures (certifications). @option{--set-policy-url} sets both.
2390 The same %-expandos used for notation data are available here as well.
2392 @item --sig-keyserver-url @code{string}
2393 @opindex sig-keyserver-url
2394 Use @code{string} as a preferred keyserver URL for data signatures. If
2395 you prefix it with an exclamation mark (!), the keyserver URL packet
2396 will be flagged as critical.
2398 The same %-expandos used for notation data are available here as well.
2400 @item --set-filename @code{string}
2401 @opindex set-filename
2402 Use @code{string} as the filename which is stored inside messages.
2403 This overrides the default, which is to use the actual filename of the
2404 file being encrypted.
2406 @item --for-your-eyes-only
2407 @itemx --no-for-your-eyes-only
2408 @opindex for-your-eyes-only
2409 Set the `for your eyes only' flag in the message. This causes GnuPG to
2410 refuse to save the file unless the @option{--output} option is given,
2411 and PGP to use a "secure viewer" with a claimed Tempest-resistant font
2412 to display the message. This option overrides @option{--set-filename}.
2413 @option{--no-for-your-eyes-only} disables this option.
2415 @item --use-embedded-filename
2416 @itemx --no-use-embedded-filename
2417 @opindex use-embedded-filename
2418 Try to create a file with a name as embedded in the data. This can be
2419 a dangerous option as it enables overwriting files. Defaults to no.
2421 @item --cipher-algo @code{name}
2422 @opindex cipher-algo
2423 Use @code{name} as cipher algorithm. Running the program with the
2424 command @option{--version} yields a list of supported algorithms. If
2425 this is not used the cipher algorithm is selected from the preferences
2426 stored with the key. In general, you do not want to use this option as
2427 it allows you to violate the OpenPGP standard.
2428 @option{--personal-cipher-preferences} is the safe way to accomplish the
2431 @item --digest-algo @code{name}
2432 @opindex digest-algo
2433 Use @code{name} as the message digest algorithm. Running the program
2434 with the command @option{--version} yields a list of supported algorithms. In
2435 general, you do not want to use this option as it allows you to
2436 violate the OpenPGP standard. @option{--personal-digest-preferences} is the
2437 safe way to accomplish the same thing.
2439 @item --compress-algo @code{name}
2440 @opindex compress-algo
2441 Use compression algorithm @code{name}. "zlib" is RFC-1950 ZLIB
2442 compression. "zip" is RFC-1951 ZIP compression which is used by PGP.
2443 "bzip2" is a more modern compression scheme that can compress some
2444 things better than zip or zlib, but at the cost of more memory used
2445 during compression and decompression. "uncompressed" or "none"
2446 disables compression. If this option is not used, the default
2447 behavior is to examine the recipient key preferences to see which
2448 algorithms the recipient supports. If all else fails, ZIP is used for
2449 maximum compatibility.
2451 ZLIB may give better compression results than ZIP, as the compression
2452 window size is not limited to 8k. BZIP2 may give even better
2453 compression results than that, but will use a significantly larger
2454 amount of memory while compressing and decompressing. This may be
2455 significant in low memory situations. Note, however, that PGP (all
2456 versions) only supports ZIP compression. Using any algorithm other
2457 than ZIP or "none" will make the message unreadable with PGP. In
2458 general, you do not want to use this option as it allows you to
2459 violate the OpenPGP standard. @option{--personal-compress-preferences} is the
2460 safe way to accomplish the same thing.
2462 @item --cert-digest-algo @code{name}
2463 @opindex cert-digest-algo
2464 Use @code{name} as the message digest algorithm used when signing a
2465 key. Running the program with the command @option{--version} yields a
2466 list of supported algorithms. Be aware that if you choose an algorithm
2467 that GnuPG supports but other OpenPGP implementations do not, then some
2468 users will not be able to use the key signatures you make, or quite
2469 possibly your entire key.
2471 @item --disable-cipher-algo @code{name}
2472 @opindex disable-cipher-algo
2473 Never allow the use of @code{name} as cipher algorithm.
2474 The given name will not be checked so that a later loaded algorithm
2475 will still get disabled.
2477 @item --disable-pubkey-algo @code{name}
2478 @opindex disable-pubkey-algo
2479 Never allow the use of @code{name} as public key algorithm.
2480 The given name will not be checked so that a later loaded algorithm
2481 will still get disabled.
2483 @item --throw-keyids
2484 @itemx --no-throw-keyids
2485 @opindex throw-keyids
2486 Do not put the recipient key IDs into encrypted messages. This helps to
2487 hide the receivers of the message and is a limited countermeasure
2488 against traffic analysis.@footnote{Using a little social engineering
2489 anyone who is able to decrypt the message can check whether one of the
2490 other recipients is the one he suspects.} On the receiving side, it may
2491 slow down the decryption process because all available secret keys must
2492 be tried. @option{--no-throw-keyids} disables this option. This option
2493 is essentially the same as using @option{--hidden-recipient} for all
2496 @item --not-dash-escaped
2497 @opindex not-dash-escaped
2498 This option changes the behavior of cleartext signatures
2499 so that they can be used for patch files. You should not
2500 send such an armored file via email because all spaces
2501 and line endings are hashed too. You can not use this
2502 option for data which has 5 dashes at the beginning of a
2503 line, patch files don't have this. A special armor header
2504 line tells GnuPG about this cleartext signature option.
2506 @item --escape-from-lines
2507 @itemx --no-escape-from-lines
2508 @opindex escape-from-lines
2509 Because some mailers change lines starting with "From " to ">From " it
2510 is good to handle such lines in a special way when creating cleartext
2511 signatures to prevent the mail system from breaking the signature. Note
2512 that all other PGP versions do it this way too. Enabled by
2513 default. @option{--no-escape-from-lines} disables this option.
2515 @item --passphrase-repeat @code{n}
2516 @opindex passphrase-repeat
2517 Specify how many times @command{@gpgname} will request a new
2518 passphrase be repeated. This is useful for helping memorize a
2519 passphrase. Defaults to 1 repetition.
2521 @item --passphrase-fd @code{n}
2522 @opindex passphrase-fd
2523 Read the passphrase from file descriptor @code{n}. Only the first line
2524 will be read from file descriptor @code{n}. If you use 0 for @code{n},
2525 the passphrase will be read from STDIN. This can only be used if only
2526 one passphrase is supplied.
2528 @item --passphrase-file @code{file}
2529 @opindex passphrase-file
2530 Read the passphrase from file @code{file}. Only the first line will
2531 be read from file @code{file}. This can only be used if only one
2532 passphrase is supplied. Obviously, a passphrase stored in a file is
2533 of questionable security if other users can read this file. Don't use
2534 this option if you can avoid it.
2536 @item --passphrase @code{string}
2538 Use @code{string} as the passphrase. This can only be used if only one
2539 passphrase is supplied. Obviously, this is of very questionable
2540 security on a multi-user system. Don't use this option if you can
2543 @item --command-fd @code{n}
2545 This is a replacement for the deprecated shared-memory IPC mode.
2546 If this option is enabled, user input on questions is not expected
2547 from the TTY but from the given file descriptor. It should be used
2548 together with @option{--status-fd}. See the file doc/DETAILS in the source
2549 distribution for details on how to use it.
2551 @item --command-file @code{file}
2552 @opindex command-file
2553 Same as @option{--command-fd}, except the commands are read out of file
2556 @item --allow-non-selfsigned-uid
2557 @itemx --no-allow-non-selfsigned-uid
2558 @opindex allow-non-selfsigned-uid
2559 Allow the import and use of keys with user IDs which are not
2560 self-signed. This is not recommended, as a non self-signed user ID is
2561 trivial to forge. @option{--no-allow-non-selfsigned-uid} disables.
2563 @item --allow-freeform-uid
2564 @opindex allow-freeform-uid
2565 Disable all checks on the form of the user ID while generating a new
2566 one. This option should only be used in very special environments as
2567 it does not ensure the de-facto standard format of user IDs.
2569 @item --ignore-time-conflict
2570 @opindex ignore-time-conflict
2571 GnuPG normally checks that the timestamps associated with keys and
2572 signatures have plausible values. However, sometimes a signature
2573 seems to be older than the key due to clock problems. This option
2574 makes these checks just a warning. See also @option{--ignore-valid-from} for
2575 timestamp issues on subkeys.
2577 @item --ignore-valid-from
2578 @opindex ignore-valid-from
2579 GnuPG normally does not select and use subkeys created in the future.
2580 This option allows the use of such keys and thus exhibits the
2581 pre-1.0.7 behaviour. You should not use this option unless there
2582 is some clock problem. See also @option{--ignore-time-conflict} for timestamp
2583 issues with signatures.
2585 @item --ignore-crc-error
2586 @opindex ignore-crc-error
2587 The ASCII armor used by OpenPGP is protected by a CRC checksum against
2588 transmission errors. Occasionally the CRC gets mangled somewhere on
2589 the transmission channel but the actual content (which is protected by
2590 the OpenPGP protocol anyway) is still okay. This option allows GnuPG
2591 to ignore CRC errors.
2593 @item --ignore-mdc-error
2594 @opindex ignore-mdc-error
2595 This option changes a MDC integrity protection failure into a warning.
2596 This can be useful if a message is partially corrupt, but it is
2597 necessary to get as much data as possible out of the corrupt message.
2598 However, be aware that a MDC protection failure may also mean that the
2599 message was tampered with intentionally by an attacker.
2601 @item --allow-weak-digest-algos
2602 @opindex allow-weak-digest-algos
2603 Signatures made with known-weak digest algorithms are normally
2604 rejected with an ``invalid digest algorithm'' message. This option
2605 allows the verification of signatures made with such weak algorithms.
2606 MD5 is the only digest algorithm considered weak by default. See also
2607 @option{--weak-digest} to reject other digest algorithms.
2609 @item --weak-digest @code{name}
2610 @opindex weak-digest
2611 Treat the specified digest algorithm as weak. Signatures made over
2612 weak digests algorithms are normally rejected. This option can be
2613 supplied multiple times if multiple algorithms should be considered
2614 weak. See also @option{--allow-weak-digest-algos} to disable
2615 rejection of weak digests. MD5 is always considered weak, and does
2616 not need to be listed explicitly.
2619 @item --no-default-keyring
2620 @opindex no-default-keyring
2621 Do not add the default keyrings to the list of keyrings. Note that
2622 GnuPG will not operate without any keyrings, so if you use this option
2623 and do not provide alternate keyrings via @option{--keyring} or
2624 @option{--secret-keyring}, then GnuPG will still use the default public or
2628 @opindex skip-verify
2629 Skip the signature verification step. This may be
2630 used to make the decryption faster if the signature
2631 verification is not needed.
2633 @item --with-key-data
2634 @opindex with-key-data
2635 Print key listings delimited by colons (like @option{--with-colons}) and
2636 print the public key data.
2638 @item --fast-list-mode
2639 @opindex fast-list-mode
2640 Changes the output of the list commands to work faster; this is achieved
2641 by leaving some parts empty. Some applications don't need the user ID
2642 and the trust information given in the listings. By using this options
2643 they can get a faster listing. The exact behaviour of this option may
2644 change in future versions. If you are missing some information, don't
2649 This is not for normal use. Use the source to see for what it might be useful.
2651 @item --set-filesize
2652 @opindex set-filesize
2653 This is not for normal use. Use the source to see for what it might be useful.
2655 @item --show-session-key
2656 @opindex show-session-key
2657 Display the session key used for one message. See
2658 @option{--override-session-key} for the counterpart of this option.
2660 We think that Key Escrow is a Bad Thing; however the user should have
2661 the freedom to decide whether to go to prison or to reveal the content
2662 of one specific message without compromising all messages ever
2663 encrypted for one secret key. DON'T USE IT UNLESS YOU ARE REALLY
2666 @item --override-session-key @code{string}
2667 @opindex override-session-key
2668 Don't use the public key but the session key @code{string}. The format
2669 of this string is the same as the one printed by
2670 @option{--show-session-key}. This option is normally not used but comes
2671 handy in case someone forces you to reveal the content of an encrypted
2672 message; using this option you can do this without handing out the
2675 @item --ask-sig-expire
2676 @itemx --no-ask-sig-expire
2677 @opindex ask-sig-expire
2678 When making a data signature, prompt for an expiration time. If this
2679 option is not specified, the expiration time set via
2680 @option{--default-sig-expire} is used. @option{--no-ask-sig-expire}
2681 disables this option.
2683 @item --default-sig-expire
2684 @opindex default-sig-expire
2685 The default expiration time to use for signature expiration. Valid
2686 values are "0" for no expiration, a number followed by the letter d
2687 (for days), w (for weeks), m (for months), or y (for years) (for
2688 example "2m" for two months, or "5y" for five years), or an absolute
2689 date in the form YYYY-MM-DD. Defaults to "0".
2691 @item --ask-cert-expire
2692 @itemx --no-ask-cert-expire
2693 @opindex ask-cert-expire
2694 When making a key signature, prompt for an expiration time. If this
2695 option is not specified, the expiration time set via
2696 @option{--default-cert-expire} is used. @option{--no-ask-cert-expire}
2697 disables this option.
2699 @item --default-cert-expire
2700 @opindex default-cert-expire
2701 The default expiration time to use for key signature expiration.
2702 Valid values are "0" for no expiration, a number followed by the
2703 letter d (for days), w (for weeks), m (for months), or y (for years)
2704 (for example "2m" for two months, or "5y" for five years), or an
2705 absolute date in the form YYYY-MM-DD. Defaults to "0".
2707 @item --allow-secret-key-import
2708 @opindex allow-secret-key-import
2709 This is an obsolete option and is not used anywhere.
2711 @item --allow-multiple-messages
2712 @item --no-allow-multiple-messages
2713 @opindex allow-multiple-messages
2714 Allow processing of multiple OpenPGP messages contained in a single file
2715 or stream. Some programs that call GPG are not prepared to deal with
2716 multiple messages being processed together, so this option defaults to
2717 no. Note that versions of GPG prior to 1.4.7 always allowed multiple
2720 Warning: Do not use this option unless you need it as a temporary
2724 @item --enable-special-filenames
2725 @opindex enable-special-filenames
2726 This options enables a mode in which filenames of the form
2727 @file{-&n}, where n is a non-negative decimal number,
2728 refer to the file descriptor n and not to a file with that name.
2730 @item --no-expensive-trust-checks
2731 @opindex no-expensive-trust-checks
2732 Experimental use only.
2734 @item --preserve-permissions
2735 @opindex preserve-permissions
2736 Don't change the permissions of a secret keyring back to user
2737 read/write only. Use this option only if you really know what you are doing.
2739 @item --default-preference-list @code{string}
2740 @opindex default-preference-list
2741 Set the list of default preferences to @code{string}. This preference
2742 list is used for new keys and becomes the default for "setpref" in the
2745 @item --default-keyserver-url @code{name}
2746 @opindex default-keyserver-url
2747 Set the default keyserver URL to @code{name}. This keyserver will be
2748 used as the keyserver URL when writing a new self-signature on a key,
2749 which includes key generation and changing preferences.
2752 @opindex list-config
2753 Display various internal configuration parameters of GnuPG. This option
2754 is intended for external programs that call GnuPG to perform tasks, and
2755 is thus not generally useful. See the file @file{doc/DETAILS} in the
2756 source distribution for the details of which configuration items may be
2757 listed. @option{--list-config} is only usable with
2758 @option{--with-colons} set.
2760 @item --gpgconf-list
2761 @opindex gpgconf-list
2762 This command is similar to @option{--list-config} but in general only
2763 internally used by the @command{gpgconf} tool.
2765 @item --gpgconf-test
2766 @opindex gpgconf-test
2767 This is more or less dummy action. However it parses the configuration
2768 file and returns with failure if the configuration file would prevent
2769 @command{gpg} from startup. Thus it may be used to run a syntax check
2770 on the configuration file.
2774 @c *******************************
2775 @c ******* Deprecated ************
2776 @c *******************************
2777 @node Deprecated Options
2778 @subsection Deprecated options
2782 @item --load-extension @code{name}
2783 @opindex load-extension
2784 Load an extension module. If @code{name} does not contain a slash it is
2785 searched for in the directory configured when GnuPG was built
2786 (generally "/usr/local/lib/gnupg"). Extensions are not generally
2787 useful anymore, and the use of this option is deprecated.
2790 @itemx --no-show-photos
2791 @opindex show-photos
2792 Causes @option{--list-keys}, @option{--list-sigs},
2793 @option{--list-public-keys}, @option{--list-secret-keys}, and verifying
2794 a signature to also display the photo ID attached to the key, if
2795 any. See also @option{--photo-viewer}. These options are deprecated. Use
2796 @option{--list-options [no-]show-photos} and/or @option{--verify-options
2797 [no-]show-photos} instead.
2799 @item --show-keyring
2800 @opindex show-keyring
2801 Display the keyring name at the head of key listings to show which
2802 keyring a given key resides on. This option is deprecated: use
2803 @option{--list-options [no-]show-keyring} instead.
2805 @item --ctapi-driver @code{file}
2806 @opindex ctapi-driver
2807 Use @code{file} to access the smartcard reader. The current default
2808 is `libtowitoko.so'. Note that the use of this interface is
2809 deprecated; it may be removed in future releases.
2811 @item --always-trust
2812 @opindex always-trust
2813 Identical to @option{--trust-model always}. This option is deprecated.
2815 @item --show-notation
2816 @itemx --no-show-notation
2817 @opindex show-notation
2818 Show signature notations in the @option{--list-sigs} or @option{--check-sigs} listings
2819 as well as when verifying a signature with a notation in it. These
2820 options are deprecated. Use @option{--list-options [no-]show-notation}
2821 and/or @option{--verify-options [no-]show-notation} instead.
2823 @item --show-policy-url
2824 @itemx --no-show-policy-url
2825 @opindex show-policy-url
2826 Show policy URLs in the @option{--list-sigs} or @option{--check-sigs}
2827 listings as well as when verifying a signature with a policy URL in
2828 it. These options are deprecated. Use @option{--list-options
2829 [no-]show-policy-url} and/or @option{--verify-options
2830 [no-]show-policy-url} instead.
2836 @c *******************************************
2837 @c *************** ****************
2838 @c *************** FILES ****************
2839 @c *************** ****************
2840 @c *******************************************
2842 @node GPG Configuration
2843 @section Configuration files
2845 There are a few configuration files to control certain aspects of
2846 @command{@gpgname}'s operation. Unless noted, they are expected in the
2847 current home directory (@pxref{option --homedir}).
2853 This is the standard configuration file read by @command{@gpgname} on
2854 startup. It may contain any valid long option; the leading two dashes
2855 may not be entered and the option may not be abbreviated. This default
2856 name may be changed on the command line (@pxref{gpg-option --options}).
2857 You should backup this file.
2862 Note that on larger installations, it is useful to put predefined files
2863 into the directory @file{/etc/skel/.gnupg/} so that newly created users
2864 start up with a working configuration.
2866 For internal purposes @command{@gpgname} creates and maintains a few other
2867 files; They all live in in the current home directory (@pxref{option
2868 --homedir}). Only the @command{@gpgname} may modify these files.
2872 @item ~/.gnupg/pubring.gpg
2873 The public keyring. You should backup this file.
2875 @item ~/.gnupg/pubring.gpg.lock
2876 The lock file for the public keyring.
2878 @item ~/.gnupg/pubring.kbx
2879 @itemx ~/.gnupg/pubring.kbx.lock
2880 A public keyring and its lock file used by GnuPG versions >= 2.
2881 It is ignored by GnuPG 1.x
2883 @item ~/.gnupg/secring.gpg
2884 The secret keyring. You should backup this file.
2886 @item ~/.gnupg/trustdb.gpg
2887 The trust database. There is no need to backup this file; it is better
2888 to backup the ownertrust values (@pxref{option --export-ownertrust}).
2890 @item ~/.gnupg/trustdb.gpg.lock
2891 The lock file for the trust database.
2893 @item ~/.gnupg/random_seed
2894 A file used to preserve the state of the internal random pool.
2896 @item ~/.gnupg/secring.gpg.lock
2897 The lock file for the secret keyring.
2899 @item ~/.gnupg/openpgp-revocs.d/
2900 This is the directory where gpg stores pre-generated revocation
2901 certificates. The file name corresponds to the OpenPGP fingerprint of
2902 the respective key. It is suggested to backup those certificates and
2903 if the primary private key is not stored on the disk to move them to
2904 an external storage device. Anyone who can access theses files is
2905 able to revoke the corresponding key. You may want to print them out.
2906 You should backup all files in this directory and take care to keep
2907 this backup closed away.
2909 @item /usr[/local]/share/gnupg/options.skel
2910 The skeleton options file.
2912 @item /usr[/local]/lib/gnupg/
2913 Default location for extensions.
2918 Operation is further controlled by a few environment variables:
2923 Used to locate the default home directory.
2926 If set directory used instead of "~/.gnupg".
2928 @item GPG_AGENT_INFO
2929 Used to locate the gpg-agent.
2930 This is only honored when @option{--use-agent} is set.
2932 The value consists of 3 colon delimited fields: The first is the path
2933 to the Unix Domain Socket, the second the PID of the gpg-agent and the
2934 protocol version which should be set to 1. When starting the gpg-agent
2935 as described in its documentation, this variable is set to the correct
2936 value. The option @option{--gpg-agent-info} can be used to override it.
2938 @item PINENTRY_USER_DATA
2939 This value is passed via gpg-agent to pinentry. It is useful to convey
2940 extra information to a custom pinentry.
2944 Used to size some displays to the full size of the screen.
2948 Apart from its use by GNU, it is used in the W32 version to override the
2949 language selection done through the Registry. If used and set to a
2950 valid and available language name (@var{langid}), the file with the
2951 translation is loaded from
2953 @code{@var{gpgdir}/gnupg.nls/@var{langid}.mo}. Here @var{gpgdir} is the
2954 directory out of which the gpg binary has been loaded. If it can't be
2955 loaded the Registry is tried and as last resort the native Windows
2956 locale system is used.
2961 @c *******************************************
2962 @c *************** ****************
2963 @c *************** EXAMPLES ****************
2964 @c *************** ****************
2965 @c *******************************************
2972 @item gpg -se -r @code{Bob} @code{file}
2973 sign and encrypt for user Bob
2975 @item gpg --clearsign @code{file}
2976 make a clear text signature
2978 @item gpg -sb @code{file}
2979 make a detached signature
2981 @item gpg -u 0x12345678 -sb @code{file}
2982 make a detached signature with the key 0x12345678
2984 @item gpg --list-keys @code{user_ID}
2987 @item gpg --fingerprint @code{user_ID}
2990 @item gpg --verify @code{pgpfile}
2991 @itemx gpg --verify @code{sigfile}
2992 Verify the signature of the file but do not output the data. The
2993 second form is used for detached signatures, where @code{sigfile}
2994 is the detached signature (either ASCII armored or binary) and
2995 are the signed data; if this is not given, the name of
2996 the file holding the signed data is constructed by cutting off the
2997 extension (".asc" or ".sig") of @code{sigfile} or by asking the
2998 user for the filename.
3002 @c *******************************************
3003 @c *************** ****************
3004 @c *************** USER ID ****************
3005 @c *************** ****************
3006 @c *******************************************
3007 @mansect how to specify a user id
3009 @include specify-user-id.texi
3012 @mansect return value
3013 @chapheading RETURN VALUE
3015 The program returns 0 if everything was fine, 1 if at least
3016 a signature was bad, and other error codes for fatal errors.
3019 @chapheading WARNINGS
3021 Use a *good* password for your user account and a *good* passphrase
3022 to protect your secret key. This passphrase is the weakest part of the
3023 whole system. Programs to do dictionary attacks on your secret keyring
3024 are very easy to write and so you should protect your "~/.gnupg/"
3025 directory very well.
3027 Keep in mind that, if this program is used over a network (telnet), it
3028 is *very* easy to spy out your passphrase!
3030 If you are going to verify detached signatures, make sure that the
3031 program knows about it; either give both filenames on the command line
3032 or use @samp{-} to specify STDIN.
3034 @mansect interoperability
3035 @chapheading INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS
3037 GnuPG tries to be a very flexible implementation of the OpenPGP
3038 standard. In particular, GnuPG implements many of the optional parts
3039 of the standard, such as the SHA-512 hash, and the ZLIB and BZIP2
3040 compression algorithms. It is important to be aware that not all
3041 OpenPGP programs implement these optional algorithms and that by
3042 forcing their use via the @option{--cipher-algo},
3043 @option{--digest-algo}, @option{--cert-digest-algo}, or
3044 @option{--compress-algo} options in GnuPG, it is possible to create a
3045 perfectly valid OpenPGP message, but one that cannot be read by the
3048 There are dozens of variations of OpenPGP programs available, and each
3049 supports a slightly different subset of these optional algorithms.
3050 For example, until recently, no (unhacked) version of PGP supported
3051 the BLOWFISH cipher algorithm. A message using BLOWFISH simply could
3052 not be read by a PGP user. By default, GnuPG uses the standard
3053 OpenPGP preferences system that will always do the right thing and
3054 create messages that are usable by all recipients, regardless of which
3055 OpenPGP program they use. Only override this safe default if you
3056 really know what you are doing.
3058 If you absolutely must override the safe default, or if the preferences
3059 on a given key are invalid for some reason, you are far better off using
3060 the @option{--pgp6}, @option{--pgp7}, or @option{--pgp8} options. These
3061 options are safe as they do not force any particular algorithms in
3062 violation of OpenPGP, but rather reduce the available algorithms to a
3068 On older systems this program should be installed as setuid(root). This
3069 is necessary to lock memory pages. Locking memory pages prevents the
3070 operating system from writing memory pages (which may contain
3071 passphrases or other sensitive material) to disk. If you get no
3072 warning message about insecure memory your operating system supports
3073 locking without being root. The program drops root privileges as soon
3074 as locked memory is allocated.
3076 Note also that some systems (especially laptops) have the ability to
3077 ``suspend to disk'' (also known as ``safe sleep'' or ``hibernate'').
3078 This writes all memory to disk before going into a low power or even
3079 powered off mode. Unless measures are taken in the operating system
3080 to protect the saved memory, passphrases or other sensitive material
3081 may be recoverable from it later.
3083 Before you report a bug you should first search the mailing list
3084 archives for similar problems and second check whether such a bug has
3085 already been reported to our bug tracker at http://bugs.gnupg.org .
3087 @c *******************************************
3088 @c *************** **************
3089 @c *************** UNATTENDED **************
3090 @c *************** **************
3091 @c *******************************************
3093 @node Unattended Usage of GPG
3094 @section Unattended Usage
3096 @command{gpg} is often used as a backend engine by other software. To help
3097 with this a machine interface has been defined to have an unambiguous
3098 way to do this. The options @option{--status-fd} and @option{--batch}
3099 are almost always required for this.
3102 * Unattended GPG key generation:: Unattended key generation
3106 @node Unattended GPG key generation
3107 @subsection Unattended key generation
3109 The command @option{--gen-key} may be used along with the option
3110 @option{--batch} for unattended key generation. The parameters are
3111 either read from stdin or given as a file on the command line.
3112 The format of the parameter file is as follows:
3115 @item Text only, line length is limited to about 1000 characters.
3116 @item UTF-8 encoding must be used to specify non-ASCII characters.
3117 @item Empty lines are ignored.
3118 @item Leading and trailing while space is ignored.
3119 @item A hash sign as the first non white space character indicates
3121 @item Control statements are indicated by a leading percent sign, the
3122 arguments are separated by white space from the keyword.
3123 @item Parameters are specified by a keyword, followed by a colon. Arguments
3124 are separated by white space.
3126 The first parameter must be @samp{Key-Type}; control statements may be
3129 The order of the parameters does not matter except for @samp{Key-Type}
3130 which must be the first parameter. The parameters are only used for
3131 the generated keyblock (primary and subkeys); parameters from previous
3132 sets are not used. Some syntactically checks may be performed.
3134 Key generation takes place when either the end of the parameter file
3135 is reached, the next @samp{Key-Type} parameter is encountered or at the
3136 control statement @samp{%commit} is encountered.
3144 @item %echo @var{text}
3145 Print @var{text} as diagnostic.
3148 Suppress actual key generation (useful for syntax checking).
3151 Perform the key generation. Note that an implicit commit is done at
3152 the next @asis{Key-Type} parameter.
3154 @item %pubring @var{filename}
3155 @itemx %secring @var{filename}
3156 Do not write the key to the default or commandline given keyring but
3157 to @var{filename}. This must be given before the first commit to take
3158 place, duplicate specification of the same filename is ignored, the
3159 last filename before a commit is used. The filename is used until a
3160 new filename is used (at commit points) and all keys are written to
3161 that file. If a new filename is given, this file is created (and
3162 overwrites an existing one). For GnuPG versions prior to 2.1, both
3163 control statements must be given. For GnuPG 2.1 and later
3164 @samp{%secring} is a no-op.
3166 @item %ask-passphrase
3167 @itemx %no-ask-passphrase
3168 Enable (or disable) a mode where the command @option{passphrase} is
3169 ignored and instead the usual passphrase dialog is used. This does
3170 not make sense for batch key generation; however the unattended key
3171 generation feature is also used by GUIs and this feature relinquishes
3172 the GUI from implementing its own passphrase entry code. These are
3173 global control statements and affect all future key genrations.
3175 @item %no-protection
3176 Since GnuPG version 2.1 it is not anymore possible to specify a
3177 passphrase for unattended key generation. The passphrase command is
3178 simply ignored and @samp{%ask-passpharse} is thus implicitly enabled.
3179 Using this option allows the creation of keys without any passphrase
3180 protection. This option is mainly intended for regression tests.
3182 @item %transient-key
3183 If given the keys are created using a faster and a somewhat less
3184 secure random number generator. This option may be used for keys
3185 which are only used for a short time and do not require full
3186 cryptographic strength. It takes only effect if used together with
3187 the control statement @samp{%no-protection}.
3196 @item Key-Type: @var{algo}
3197 Starts a new parameter block by giving the type of the primary
3198 key. The algorithm must be capable of signing. This is a required
3199 parameter. @var{algo} may either be an OpenPGP algorithm number or a
3200 string with the algorithm name. The special value @samp{default} may
3201 be used for @var{algo} to create the default key type; in this case a
3202 @samp{Key-Usage} shall not be given and @samp{default} also be used
3203 for @samp{Subkey-Type}.
3205 @item Key-Length: @var{nbits}
3206 The requested length of the generated key in bits. The default is
3207 returned by running the command @samp{gpg2 --gpgconf-list}.
3209 @item Key-Grip: @var{hexstring}
3210 This is optional and used to generate a CSR or certificate for an
3211 already existing key. Key-Length will be ignored when given.
3213 @item Key-Usage: @var{usage-list}
3214 Space or comma delimited list of key usages. Allowed values are
3215 @samp{encrypt}, @samp{sign}, and @samp{auth}. This is used to
3216 generate the key flags. Please make sure that the algorithm is
3217 capable of this usage. Note that OpenPGP requires that all primary
3218 keys are capable of certification, so no matter what usage is given
3219 here, the @samp{cert} flag will be on. If no @samp{Key-Usage} is
3220 specified and the @samp{Key-Type} is not @samp{default}, all allowed
3221 usages for that particular algorithm are used; if it is not given but
3222 @samp{default} is used the usage will be @samp{sign}.
3224 @item Subkey-Type: @var{algo}
3225 This generates a secondary key (subkey). Currently only one subkey
3226 can be handled. See also @samp{Key-Type} above.
3228 @item Subkey-Length: @var{nbits}
3229 Length of the secondary key (subkey) in bits. The default is returned
3230 by running the command @samp{gpg2 --gpgconf-list}".
3232 @item Subkey-Usage: @var{usage-list}
3233 Key usage lists for a subkey; similar to @samp{Key-Usage}.
3235 @item Passphrase: @var{string}
3236 If you want to specify a passphrase for the secret key,
3237 enter it here. Default is not to use any passphrase.
3239 @item Name-Real: @var{name}
3240 @itemx Name-Comment: @var{comment}
3241 @itemx Name-Email: @var{email}
3242 The three parts of a user name. Remember to use UTF-8 encoding here.
3243 If you don't give any of them, no user ID is created.
3245 @item Expire-Date: @var{iso-date}|(@var{number}[d|w|m|y])
3246 Set the expiration date for the key (and the subkey). It may either
3247 be entered in ISO date format (e.g. "20000815T145012") or as number of
3248 days, weeks, month or years after the creation date. The special
3249 notation "seconds=N" is also allowed to specify a number of seconds
3250 since creation. Without a letter days are assumed. Note that there
3251 is no check done on the overflow of the type used by OpenPGP for
3252 timestamps. Thus you better make sure that the given value make
3253 sense. Although OpenPGP works with time intervals, GnuPG uses an
3254 absolute value internally and thus the last year we can represent is
3257 @item Creation-Date: @var{iso-date}
3258 Set the creation date of the key as stored in the key information and
3259 which is also part of the fingerprint calculation. Either a date like
3260 "1986-04-26" or a full timestamp like "19860426T042640" may be used.
3261 The time is considered to be UTC. The special notation "seconds=N"
3262 may be used to directly specify a the number of seconds since Epoch
3263 (Unix time). If it is not given the current time is used.
3265 @item Preferences: @var{string}
3266 Set the cipher, hash, and compression preference values for this key.
3267 This expects the same type of string as the sub-command @samp{setpref}
3268 in the @option{--edit-key} menu.
3270 @item Revoker: @var{algo}:@var{fpr} [sensitive]
3271 Add a designated revoker to the generated key. Algo is the public key
3272 algorithm of the designated revoker (i.e. RSA=1, DSA=17, etc.)
3273 @var{fpr} is the fingerprint of the designated revoker. The optional
3274 @samp{sensitive} flag marks the designated revoker as sensitive
3275 information. Only v4 keys may be designated revokers.
3277 @item Keyserver: @var{string}
3278 This is an optional parameter that specifies the preferred keyserver
3281 @item Handle: @var{string}
3282 This is an optional parameter only used with the status lines
3283 KEY_CREATED and KEY_NOT_CREATED. @var{string} may be up to 100
3284 characters and should not contain spaces. It is useful for batch key
3285 generation to associate a key parameter block with a status line.
3290 Here is an example on how to create a key:
3293 %echo Generating a basic OpenPGP key
3298 Name-Real: Joe Tester
3299 Name-Comment: with stupid passphrase
3300 Name-Email: joe@@foo.bar
3305 # Do a commit here, so that we can later print "done" :-)
3309 $ gpg2 --batch --gen-key foo
3311 $ gpg2 --no-default-keyring --secret-keyring ./foo.sec \
3312 --keyring ./foo.pub --list-secret-keys
3313 /home/wk/work/gnupg-stable/scratch/foo.sec
3314 ------------------------------------------
3315 sec 1024D/915A878D 2000-03-09 Joe Tester (with stupid passphrase) <joe@@foo.bar>
3316 ssb 1024g/8F70E2C0 2000-03-09
3321 If you want to create a key with the default algorithms you would use
3324 %echo Generating a default key
3326 Subkey-Type: default
3327 Name-Real: Joe Tester
3328 Name-Comment: with stupid passphrase
3329 Name-Email: joe@@foo.bar
3334 # Do a commit here, so that we can later print "done" :-)
3346 @include see-also-note.texi