1GPG(1)                       GNU Privacy Guard 2.2                      GPG(1)
2
3
4

NAME

6       gpg - OpenPGP encryption and signing tool
7

SYNOPSIS

9       gpg [--homedir dir] [--options file] [options] command [args]
10
11
12
13

DESCRIPTION

15       gpg  is the OpenPGP part of the GNU Privacy Guard (GnuPG). It is a tool
16       to provide digital encryption and signing services  using  the  OpenPGP
17       standard.  gpg  features  complete key management and all the bells and
18       whistles you would expect from a full OpenPGP implementation.
19
20       There are two main versions of GnuPG: GnuPG 1.x and GnuPG  2.x.   GnuPG
21       2.x  supports modern encryption algorithms and thus should be preferred
22       over GnuPG 1.x.  You only need  to  use  GnuPG  1.x  if  your  platform
23       doesn't  support  GnuPG 2.x, or you need support for some features that
24       GnuPG 2.x has deprecated, e.g.,  decrypting  data  created  with  PGP-2
25       keys.
26
27       If  you  are  looking for version 1 of GnuPG, you may find that version
28       installed under the name gpg1.
29
30
31
32
33
34
35

RETURN VALUE

37       The program returns 0 if there are no severe errors, 1 if  at  least  a
38       signature was bad, and other error codes for fatal errors.
39
40       Note  that  signature verification requires exact knowledge of what has
41       been signed and by whom it has been signed.  Using only the return code
42       is  thus not an appropriate way to verify a signature by a script.  Ei‐
43       ther make proper use or the status codes or use the gpgv tool which has
44       been designed to make signature verification easy for scripts.
45
46

WARNINGS

48       Use  a good password for your user account and make sure that all secu‐
49       rity issues are always fixed on your  machine.   Also  employ  diligent
50       physical protection to your machine.  Consider to use a good passphrase
51       as a last resort protection to your secret key in the case your machine
52       gets  stolen.   It  is  important that your secret key is never leaked.
53       Using an easy to carry around token or smartcard with the secret key is
54       often a advisable.
55
56       If you are going to verify detached signatures, make sure that the pro‐
57       gram knows about it; either give both filenames on the command line  or
58       use ‘-’ to specify STDIN.
59
60       For  scripted  or  other unattended use of gpg make sure to use the ma‐
61       chine-parseable interface and not the default interface  which  is  in‐
62       tended  for direct use by humans.  The machine-parseable interface pro‐
63       vides a stable and well documented API independent of the locale or fu‐
64       ture  changes of gpg.  To enable this interface use the options --with-
65       colons and --status-fd.  For certain operations the option --command-fd
66       may  come  handy too.  See this man page and the file ‘DETAILS’ for the
67       specification of the interface.  Note that the GnuPG ``info'' pages  as
68       well as the PDF version of the GnuPG manual features a chapter on unat‐
69       tended use of GnuPG.  As an alternative the library GPGME can  be  used
70       as a high-level abstraction on top of that interface.
71
72

INTEROPERABILITY

74       GnuPG  tries  to be a very flexible implementation of the OpenPGP stan‐
75       dard. In particular, GnuPG implements many of the optional parts of the
76       standard,  such as the SHA-512 hash, and the ZLIB and BZIP2 compression
77       algorithms. It is important to be aware that not all  OpenPGP  programs
78       implement  these  optional algorithms and that by forcing their use via
79       the --cipher-algo, --digest-algo,  --cert-digest-algo,  or  --compress-
80       algo  options  in  GnuPG,  it  is  possible to create a perfectly valid
81       OpenPGP message, but one that cannot be read by the intended recipient.
82
83       There are dozens of variations of OpenPGP programs available, and  each
84       supports a slightly different subset of these optional algorithms.  For
85       example, until recently, no (unhacked) version  of  PGP  supported  the
86       BLOWFISH cipher algorithm. A message using BLOWFISH simply could not be
87       read by a PGP user. By default, GnuPG uses the standard OpenPGP prefer‐
88       ences  system  that  will always do the right thing and create messages
89       that are usable by all recipients, regardless of which OpenPGP  program
90       they  use.  Only override this safe default if you really know what you
91       are doing.
92
93       If you absolutely must override the safe default, or if the preferences
94       on  a given key are invalid for some reason, you are far better off us‐
95       ing the --pgp6, --pgp7, or --pgp8 options. These options  are  safe  as
96       they  do  not  force any particular algorithms in violation of OpenPGP,
97       but rather reduce the available algorithms to a "PGP-safe" list.
98
99

COMMANDS

101       Commands are not distinguished from options except for  the  fact  that
102       only  one  command  is allowed.  Generally speaking, irrelevant options
103       are silently ignored, and may not be checked for correctness.
104
105       gpg may be run with no commands. In this case it will print  a  warning
106       perform  a  reasonable action depending on the type of file it is given
107       as input (an encrypted message is decrypted, a signature is verified, a
108       file containing keys is listed, etc.).
109
110       If  you  run  into any problems, please add the option --verbose to the
111       invocation to see more diagnostics.
112
113
114
115
116
117
118   Commands not specific to the function
119
120
121
122       --version
123              Print the program version and licensing information.  Note  that
124              you cannot abbreviate this command.
125
126
127       --help
128       -h     Print  a  usage message summarizing the most useful command-line
129              options.  Note that you cannot arbitrarily abbreviate this  com‐
130              mand (though you can use its short form -h).
131
132
133       --warranty
134              Print warranty information.
135
136
137       --dump-options
138              Print  a  list of all available options and commands.  Note that
139              you cannot abbreviate this command.
140
141   Commands to select the type of operation
142
143
144
145
146
147       --sign
148       -s     Sign a message. This command may be combined with --encrypt  (to
149              sign  and encrypt a message), --symmetric (to sign and symmetri‐
150              cally encrypt a message), or both --encrypt and --symmetric  (to
151              sign  and encrypt a message that can be decrypted using a secret
152              key or a passphrase).  The signing key is chosen by  default  or
153              can  be  set explicitly using the --local-user and --default-key
154              options.
155
156
157       --clear-sign
158       --clearsign
159              Make a cleartext signature.  The content in a  cleartext  signa‐
160              ture  is readable without any special software. OpenPGP software
161              is only needed to verify the  signature.   cleartext  signatures
162              may  modify end-of-line whitespace for platform independence and
163              are not intended to be reversible.  The signing key is chosen by
164              default  or  can  be  set  explicitly using the --local-user and
165              --default-key options.
166
167
168
169       --detach-sign
170       -b     Make a detached signature.
171
172
173       --encrypt
174       -e     Encrypt data to one or more public keys.  This  command  may  be
175              combined  with --sign (to sign and encrypt a message), --symmet‐
176              ric (to encrypt a message that can be decrypted using  a  secret
177              key  or a passphrase), or --sign and --symmetric together (for a
178              signed message that can be decrypted using a  secret  key  or  a
179              passphrase).  --recipient and related options specify which pub‐
180              lic keys to use for encryption.
181
182
183       --symmetric
184       -c     Encrypt with a symmetric cipher using a passphrase. The  default
185              symmetric  cipher  used  is  AES-128, but may be chosen with the
186              --cipher-algo option. This command may be combined  with  --sign
187              (for  a  signed  and symmetrically encrypted message), --encrypt
188              (for a message that may be decrypted  via  a  secret  key  or  a
189              passphrase), or --sign and --encrypt together (for a signed mes‐
190              sage that may be decrypted via a secret key  or  a  passphrase).
191              gpg  caches the passphrase used for symmetric encryption so that
192              a decrypt operation may not require that the user needs to enter
193              the  passphrase.   The  option  --no-symkey-cache can be used to
194              disable this feature.
195
196
197       --store
198              Store only (make a simple literal data packet).
199
200
201       --decrypt
202       -d     Decrypt the file given on the command line (or STDIN if no  file
203              is specified) and write it to STDOUT (or the file specified with
204              --output). If the decrypted file is  signed,  the  signature  is
205              also  verified. This command differs from the default operation,
206              as it never writes to the filename which is included in the file
207              and it rejects files that don't begin with an encrypted message.
208
209
210       --verify
211              Assume  that  the  first argument is a signed file and verify it
212              without generating any output.  With no arguments, the signature
213              packet  is  read from STDIN.  If only one argument is given, the
214              specified file is expected to include a complete signature.
215
216              With more than one argument, the first argument should specify a
217              file  with  a  detached signature and the remaining files should
218              contain the signed data. To read the signed data from STDIN, use
219              ‘-’  as  the  second filename.  For security reasons, a detached
220              signature will not read the signed material from  STDIN  if  not
221              explicitly specified.
222
223              Note:  If  the option --batch is not used, gpg may assume that a
224              single argument is a file with a detached signature, and it will
225              try  to find a matching data file by stripping certain suffixes.
226              Using this historical feature to verify a detached signature  is
227              strongly  discouraged;  you  should always specify the data file
228              explicitly.
229
230              Note: When verifying a cleartext signature,  gpg  verifies  only
231              what  makes  up the cleartext signed data and not any extra data
232              outside of the cleartext signature or the header lines  directly
233              following the dash marker line.  The option --output may be used
234              to write out the actual signed data, but there  are  other  pit‐
235              falls with this format as well.  It is suggested to avoid clear‐
236              text signatures in favor of detached signatures.
237
238              Note: Sometimes the use of the gpgv tool is  easier  than  using
239              the full-fledged gpg with this option.  gpgv is designed to com‐
240              pare signed data against a list of trusted keys and returns with
241              success only for a good signature.  It has its own manual page.
242
243
244
245       --multifile
246              This  modifies  certain  other commands to accept multiple files
247              for processing on the command line or read from STDIN with  each
248              filename  on  a  separate line. This allows for many files to be
249              processed at once. --multifile may currently be used along  with
250              --verify, --encrypt, and --decrypt. Note that --multifile --ver‐
251              ify may not be used with detached signatures.
252
253
254       --verify-files
255              Identical to --multifile --verify.
256
257
258       --encrypt-files
259              Identical to --multifile --encrypt.
260
261
262       --decrypt-files
263              Identical to --multifile --decrypt.
264
265
266       --list-keys
267       -k
268       --list-public-keys
269              List the specified keys.  If no keys  are  specified,  then  all
270              keys from the configured public keyrings are listed.
271
272              Never  use  the  output of this command in scripts or other pro‐
273              grams.  The output is intended only for humans and its format is
274              likely  to change.  The --with-colons option emits the output in
275              a stable, machine-parseable format, which is intended for use by
276              scripts and other programs.
277
278
279       --list-secret-keys
280       -K     List  the specified secret keys.  If no keys are specified, then
281              all known secret keys are listed.  A # after  the  initial  tags
282              sec  or ssb means that the secret key or subkey is currently not
283              usable.  We also say that this key has been taken  offline  (for
284              example, a primary key can be taken offline by exporting the key
285              using the command --export-secret-subkeys).   A  >  after  these
286              tags  indicate  that the key is stored on a smartcard.  See also
287              --list-keys.
288
289
290       --check-signatures
291       --check-sigs
292              Same as --list-keys, but the key  signatures  are  verified  and
293              listed  too.   Note  that for performance reasons the revocation
294              status of a signing key is not shown.  This command has the same
295              effect as using --list-keys with --with-sig-check.
296
297              The  status  of the verification is indicated by a flag directly
298              following the "sig" tag (and thus before the flags described be‐
299              low.   A  "!" indicates that the signature has been successfully
300              verified, a "-" denotes a bad signature and a "%" is used if  an
301              error  occurred  while  checking  the signature (e.g. a non sup‐
302              ported algorithm).  Signatures  where  the  public  key  is  not
303              available  are  not  listed;  to  see  their  keyids the command
304              --list-sigs can be used.
305
306              For each signature listed, there are several  flags  in  between
307              the  signature  status  flag  and keyid.  These flags give addi‐
308              tional information about  each  key  signature.   From  left  to
309              right, they are the numbers 1-3 for certificate check level (see
310              --ask-cert-level), "L" for a local or  non-exportable  signature
311              (see  --lsign-key),  "R"  for  a nonRevocable signature (see the
312              --edit-key command "nrsign"), "P" for a signature that  contains
313              a  policy  URL (see --cert-policy-url), "N" for a signature that
314              contains a notation (see --cert-notation), "X"  for  an  eXpired
315              signature  (see  --ask-cert-expire),  and the numbers 1-9 or "T"
316              for 10 and above to indicate trust  signature  levels  (see  the
317              --edit-key command "tsign").
318
319
320
321       --locate-keys
322       --locate-external-keys
323              Locate the keys given as arguments.  This command basically uses
324              the same algorithm as used when locating keys for encryption and
325              may  thus be used to see what keys gpg might use.  In particular
326              external methods as defined by --auto-key-locate are used to lo‐
327              cate  a  key if the arguments comain valid mail addresses.  Only
328              public keys are listed.
329
330              The variant --locate-external-keys does not consider  a  locally
331              existing  key and can thus be used to force the refresh of a key
332              via the defined external methods.  If a fingerprint is given and
333              and   the  methods  defined  by  --auto-key-locate  define  LDAP
334              servers, the key is fetched from these resources;  defined  non-
335              LDAP keyservers are skipped.
336
337
338
339       --show-keys
340              This commands takes OpenPGP keys as input and prints information
341              about them in the same way the command --list-keys does for  lo‐
342              cally  stored  key.  In addition the list options show-unusable-
343              uids, show-unusable-subkeys, show-notations and show-policy-urls
344              are  also enabled.  As usual for automated processing, this com‐
345              mand should be combined with the option --with-colons.
346
347
348       --fingerprint
349              List all keys (or the specified ones) along with  their  finger‐
350              prints.  This is the same output as --list-keys but with the ad‐
351              ditional output of a line with the fingerprint. May also be com‐
352              bined  with --check-signatures.  If this command is given twice,
353              the fingerprints of all secondary keys  are  listed  too.   This
354              command also forces pretty printing of fingerprints if the keyid
355              format has been set to "none".
356
357
358       --list-packets
359              List only the sequence of packets.  This command is only  useful
360              for  debugging.   When used with option --verbose the actual MPI
361              values are dumped and not only their  lengths.   Note  that  the
362              output of this command may change with new releases.
363
364
365
366       --edit-card
367       --card-edit
368              Present  a  menu to work with a smartcard. The subcommand "help"
369              provides an overview on available commands. For a  detailed  de‐
370              scription,  please see the Card HOWTO at https://gnupg.org/docu
371              mentation/howtos.html#GnuPG-cardHOWTO .
372
373
374       --card-status
375              Show the content of the smart card.
376
377
378       --change-pin
379              Present a menu to allow changing the PIN of  a  smartcard.  This
380              functionality  is also available as the subcommand "passwd" with
381              the --edit-card command.
382
383
384       --delete-keys name
385              Remove key from the public keyring. In batch mode  either  --yes
386              is required or the key must be specified by fingerprint. This is
387              a safeguard against accidental deletion of  multiple  keys.   If
388              the  exclamation  mark  syntax is used with the fingerprint of a
389              subkey only that subkey is deleted; if the exclamation  mark  is
390              used  with  the fingerprint of the primary key the entire public
391              key is deleted.
392
393
394       --delete-secret-keys name
395              Remove key from the secret keyring. In batch mode the  key  must
396              be  specified  by  fingerprint.  The option --yes can be used to
397              advise gpg-agent not to request a confirmation.  This extra pre-
398              caution  is  done  because gpg can't be sure that the secret key
399              (as controlled by gpg-agent) is only used for the given  OpenPGP
400              public  key.   If  the  exclamation mark syntax is used with the
401              fingerprint of a subkey only the secret part of that  subkey  is
402              deleted; if the exclamation mark is used with the fingerprint of
403              the primary key only the secret  part  of  the  primary  key  is
404              deleted.
405
406
407
408       --delete-secret-and-public-key name
409              Same as --delete-key, but if a secret key exists, it will be re‐
410              moved first. In batch mode the key must be specified by  finger‐
411              print.   The option --yes can be used to advise gpg-agent not to
412              request a confirmation.
413
414
415       --export
416              Either export all keys from all keyrings  (default  keyring  and
417              those  registered via option --keyring), or if at least one name
418              is given, those of the given name. The exported keys are written
419              to  STDOUT  or  to the file given with option --output.  Use to‐
420              gether with --armor to mail those keys.
421
422
423       --send-keys keyIDs
424              Similar to --export but sends the keys to a keyserver.   Finger‐
425              prints may be used instead of key IDs.  Don't send your complete
426              keyring to a keyserver --- select only those keys which are  new
427              or changed by you.  If no keyIDs are given, gpg does nothing.
428
429              Take  care: Keyservers are by design write only systems and thus
430              it is not possible to ever delete keys once they have been  send
431              to a keyserver.
432
433
434
435       --export-secret-keys
436       --export-secret-subkeys
437              Same  as --export, but exports the secret keys instead.  The ex‐
438              ported keys are written to STDOUT or to the file given with  op‐
439              tion --output.  This command is often used along with the option
440              --armor to allow for easy printing of the key for paper  backup;
441              however the external tool paperkey does a better job of creating
442              backups on paper.  Note that exporting a secret key can be a se‐
443              curity risk if the exported keys are sent over an insecure chan‐
444              nel.
445
446              The second form of the command has the special property to  ren‐
447              der  the  secret  part of the primary key useless; this is a GNU
448              extension to OpenPGP and other implementations can  not  be  ex‐
449              pected  to  successfully import such a key.  Its intended use is
450              in generating a full key with an additional signing subkey on  a
451              dedicated  machine.   This  command then exports the key without
452              the primary key to the main machine.
453
454              GnuPG may ask you to enter the passphrase for the key.  This  is
455              required,  because  the internal protection method of the secret
456              key is different from the one specified by the OpenPGP protocol.
457
458
459       --export-ssh-key
460              This command is used to export a key in the OpenSSH  public  key
461              format.   It  requires the specification of one key by the usual
462              means and exports the latest valid subkey which has an authenti‐
463              cation  capability  to  STDOUT  or to the file given with option
464              --output.  That output can directly be added  to  ssh's  ‘autho‐
465              rized_key’ file.
466
467              By  specifying the key to export using a key ID or a fingerprint
468              suffixed with an exclamation mark (!), a specific subkey or  the
469              primary  key  can  be exported.  This does not even require that
470              the key has the authentication capability flag set.
471
472
473       --import
474       --fast-import
475              Import/merge keys. This adds the given keys to the keyring.  The
476              fast version is currently just a synonym.
477
478              There  are  a  few  other options which control how this command
479              works.  Most notable here is the --import-options merge-only op‐
480              tion which does not insert new keys but does only the merging of
481              new signatures, user-IDs and subkeys.
482
483
484       --receive-keys keyIDs
485       --recv-keys keyIDs
486              Import the keys with the given keyIDs from a keyserver.
487
488
489       --refresh-keys
490              Request updates from a keyserver for keys that already exist  on
491              the  local  keyring.  This is useful for updating a key with the
492              latest signatures, user IDs, etc. Calling this with no arguments
493              will refresh the entire keyring.
494
495
496       --search-keys names
497              Search  the  keyserver for the given names. Multiple names given
498              here will be joined together to create the search string for the
499              keyserver.  Note that keyservers search for names in a different
500              and simpler way than gpg does.  The best choice is to use a mail
501              address.   Due  to  data privacy reasons keyservers may even not
502              even allow searching by user id or mail  address  and  thus  may
503              only  return results when being used with the --recv-key command
504              to search by key fingerprint or keyid.
505
506
507       --fetch-keys URIs
508              Retrieve keys located at the specified URIs. Note that different
509              installations  of  GnuPG  may support different protocols (HTTP,
510              FTP, LDAP, etc.).  When using HTTPS  the  system  provided  root
511              certificates are used by this command.
512
513
514       --update-trustdb
515              Do  trust  database  maintenance. This command iterates over all
516              keys and builds the Web of Trust. This is an interactive command
517              because it may have to ask for the "ownertrust" values for keys.
518              The user has to give an estimation of how  far  she  trusts  the
519              owner  of  the  displayed  key to correctly certify (sign) other
520              keys. GnuPG only asks for the ownertrust value if it has not yet
521              been  assigned to a key. Using the --edit-key menu, the assigned
522              value can be changed at any time.
523
524
525       --check-trustdb
526              Do trust database maintenance  without  user  interaction.  From
527              time  to time the trust database must be updated so that expired
528              keys or signatures and the resulting changes in the Web of Trust
529              can  be tracked. Normally, GnuPG will calculate when this is re‐
530              quired and do it automatically unless --no-auto-check-trustdb is
531              set. This command can be used to force a trust database check at
532              any time. The processing  is  identical  to  that  of  --update-
533              trustdb but it skips keys with a not yet defined "ownertrust".
534
535              For  use  with cron jobs, this command can be used together with
536              --batch in which case the trust database check is done only if a
537              check  is  needed. To force a run even in batch mode add the op‐
538              tion --yes.
539
540
541
542       --export-ownertrust
543              Send the ownertrust values to STDOUT. This is useful for  backup
544              purposes  as  these  values are the only ones which can't be re-
545              created from a corrupted trustdb.  Example:
546                  gpg --export-ownertrust > otrust.txt
547
548
549
550       --import-ownertrust
551              Update the trustdb with the ownertrust values  stored  in  files
552              (or  STDIN  if  not given); existing values will be overwritten.
553              In case of a severely damaged trustdb and if you have  a  recent
554              backup of the ownertrust values (e.g. in the file ‘otrust.txt’),
555              you may re-create the trustdb using these commands:
556                  cd ~/.gnupg
557                  rm trustdb.gpg
558                  gpg --import-ownertrust < otrust.txt
559
560
561
562       --rebuild-keydb-caches
563              When updating from version 1.0.6 to 1.0.7 this command should be
564              used  to  create  signature  caches  in the keyring. It might be
565              handy in other situations too.
566
567
568       --print-md algo
569       --print-mds
570              Print message digest of algorithm algo for all  given  files  or
571              STDIN.   With the second form (or a deprecated "*" for algo) di‐
572              gests for all available algorithms are printed.
573
574
575       --gen-random 0|1|2 count
576              Emit count random bytes of the given quality level 0, 1 or 2. If
577              count  is not given or zero, an endless sequence of random bytes
578              will be emitted.  If used with --armor the output will be base64
579              encoded.   PLEASE,  don't  use this command unless you know what
580              you are doing; it may remove precious entropy from the system!
581
582
583       --gen-prime mode bits
584              Use the source, Luke :-). The output format is subject to change
585              with ant release.
586
587
588
589       --enarmor
590       --dearmor
591              Pack or unpack an arbitrary input into/from an OpenPGP ASCII ar‐
592              mor.  This is a GnuPG extension to OpenPGP and  in  general  not
593              very useful.
594
595
596       --unwrap
597              This  command  is  similar to --decrypt with the change that the
598              output is not the usual plaintext but the original message  with
599              the  decryption  layer  removed.   Thus  the  output  will be an
600              OpenPGP data structure which often means a signed  OpenPGP  mes‐
601              sage.   Note  that this command may or may not remove a compres‐
602              sion layer which is often found beneath the encryption layer.
603
604
605       --tofu-policy {auto|good|unknown|bad|ask} keys
606              Set the TOFU policy for all the  bindings  associated  with  the
607              specified  keys.   For more information about the meaning of the
608              policies, see: [trust-model-tofu].  The keys  may  be  specified
609              either by their fingerprint (preferred) or their keyid.
610
611
612
613   How to manage your keys
614
615
616       This section explains the main commands for key management.
617
618
619
620       --quick-generate-key user-id [algo [usage [expire]]]
621       --quick-gen-key
622              This  is  a  simple  command to generate a standard key with one
623              user id.  In contrast to --generate-key the key is generated di‐
624              rectly  without  the  need to answer a bunch of prompts.  Unless
625              the option --yes is given, the key creation will be canceled  if
626              the given user id already exists in the keyring.
627
628              If  invoked  directly on the console without any special options
629              an answer to a ``Continue?'' style confirmation  prompt  is  re‐
630              quired.   In  case  the  user id already exists in the keyring a
631              second prompt to force the creation of the key will show up.
632
633              If algo or usage are given, only the primary key is created  and
634              no  prompts  are shown.  To specify an expiration date but still
635              create a primary and  subkey  use  ``default''  or  ``future-de‐
636              fault''  for  algo and ``default'' for usage.  For a description
637              of these optional arguments  see  the  command  --quick-add-key.
638              The  usage  accepts also the value ``cert'' which can be used to
639              create a certification only primary key; the  default  is  to  a
640              create certification and signing key.
641
642              The  expire  argument  can be used to specify an expiration date
643              for the key.  Several formats are supported;  commonly  the  ISO
644              formats ``YYYY-MM-DD'' or ``YYYYMMDDThhmmss'' are used.  To make
645              the key expire in N seconds, N days, N weeks,  N  months,  or  N
646              years  use  ``seconds=N'', ``Nd'', ``Nw'', ``Nm'', or ``Ny'' re‐
647              spectively.  Not specifying a value, or using ``-'' results in a
648              key  expiring  in  a  reasonable  default  interval.  The values
649              ``never'', ``none'' can be used for no expiration date.
650
651              If this command is used with --batch, --pinentry-mode  has  been
652              set   to   loopback,   and   one   of   the  passphrase  options
653              (--passphrase, --passphrase-fd, or --passphrase-file)  is  used,
654              the  supplied  passphrase  is used for the new key and the agent
655              does not ask for it.  To create a  key  without  any  protection
656              --passphrase '' may be used.
657
658              To  create  an  OpenPGP  key from the keys available on the cur‐
659              rently inserted smartcard, the special string  ``card''  can  be
660              used for algo.  If the card features an encryption and a signing
661              key, gpg will figure them out and creates an  OpenPGP  key  con‐
662              sisting  of  the  usual  primary key and one subkey.  This works
663              only with certain smartcards.  Note that the interactive --full-
664              gen-key command allows to do the same but with greater flexibil‐
665              ity in the selection of the smartcard keys.
666
667              Note that it is possible to create a primary key  and  a  subkey
668              using  non-default  algorithms by using ``default'' and changing
669              the default parameters using the option --default-new-key-algo.
670
671
672       --quick-set-expire fpr expire [*|subfprs]
673              With two arguments given, directly set the  expiration  time  of
674              the  primary key identified by fpr to expire.  To remove the ex‐
675              piration time 0 can be used.  With three arguments and the third
676              given as an asterisk, the expiration time of all non-revoked and
677              not yet expired subkeys are set to expire.  With more  than  two
678              arguments and a list of fingerprints given for subfprs, all non-
679              revoked subkeys matching these fingerprints are set to expire.
680
681
682
683       --quick-add-key fpr [algo [usage [expire]]]
684              Directly add a subkey to the key identified by  the  fingerprint
685              fpr.   Without  the  optional  arguments an encryption subkey is
686              added.  If any of the arguments are given a more specific subkey
687              is added.
688
689              algo may be any of the supported algorithms or curve names given
690              in the format as used by key listings.  To use the default algo‐
691              rithm  the  string  ``default'' or ``-'' can be used.  Supported
692              algorithms   are   ``rsa'',   ``dsa'',   ``elg'',   ``ed25519'',
693              ``cv25519'',  and  other  ECC  curves.   For  example the string
694              ``rsa'' adds an RSA key with the default key  length;  a  string
695              ``rsa4096''  requests  that  the  key  length is 4096 bits.  The
696              string ``future-default'' is an alias for  the  algorithm  which
697              will  likely  be used as default algorithm in future versions of
698              gpg.  To list the supported ECC curves the command  gpg  --with-
699              colons --list-config curve can be used.
700
701              Depending  on the given algo the subkey may either be an encryp‐
702              tion subkey or a signing subkey.  If an algorithm is capable  of
703              signing  and  encryption  and  such a subkey is desired, a usage
704              string must be given.  This  string  is  either  ``default''  or
705              ``-''  to  keep  the default or a comma delimited list (or space
706              delimited list) of keywords:  ``sign''  for  a  signing  subkey,
707              ``auth''  for  an authentication subkey, and ``encr'' for an en‐
708              cryption subkey (``encrypt'' can be used as alias for ``encr'').
709              The valid combinations depend on the algorithm.
710
711              The  expire  argument  can be used to specify an expiration date
712              for the key.  Several formats are supported;  commonly  the  ISO
713              formats ``YYYY-MM-DD'' or ``YYYYMMDDThhmmss'' are used.  To make
714              the key expire in N seconds, N days, N weeks,  N  months,  or  N
715              years  use  ``seconds=N'', ``Nd'', ``Nw'', ``Nm'', or ``Ny'' re‐
716              spectively.  Not specifying a value, or using ``-'' results in a
717              key  expiring  in  a  reasonable  default  interval.  The values
718              ``never'', ``none'' can be used for no expiration date.
719
720
721       --generate-key
722       --gen-key
723              Generate a new key pair using the  current  default  parameters.
724              This  is  the standard command to create a new key.  In addition
725              to the key a revocation certificate is created and stored in the
726openpgp-revocs.d’ directory below the GnuPG home directory.
727
728
729       --full-generate-key
730       --full-gen-key
731              Generate  a  new key pair with dialogs for all options.  This is
732              an extended version of --generate-key.
733
734              There is also a feature which allows you to create keys in batch
735              mode.  See  the  manual section ``Unattended key generation'' on
736              how to use this.
737
738
739
740       --generate-revocation name
741       --gen-revoke name
742              Generate a revocation certificate for the complete key.  To only
743              revoke a subkey or a key signature, use the --edit command.
744
745              This  command  merely creates the revocation certificate so that
746              it can be used to revoke the key if that is ever needed.  To ac‐
747              tually  revoke a key the created revocation certificate needs to
748              be merged with the key to revoke.  This is done by importing the
749              revocation certificate using the --import command.  Then the re‐
750              voked key needs to be published, which is best done  by  sending
751              the  key  to  a  keyserver (command --send-key) and by exporting
752              (--export) it to a file which is then send to frequent  communi‐
753              cation partners.
754
755
756
757       --generate-designated-revocation name
758       --desig-revoke name
759              Generate a designated revocation certificate for a key. This al‐
760              lows a user (with the permission of  the  keyholder)  to  revoke
761              someone else's key.
762
763
764
765       --edit-key
766              Present  a  menu which enables you to do most of the key manage‐
767              ment related tasks.  It expects the specification of  a  key  on
768              the command line.
769
770
771
772              uid n  Toggle  selection of user ID or photographic user ID with
773                     index n.  Use * to select all and 0 to deselect all.
774
775
776              key n  Toggle selection of subkey with index n or key ID n.  Use
777                     * to select all and 0 to deselect all.
778
779
780              sign   Make  a  signature on key of user name. If the key is not
781                     yet signed by the default user (or the users  given  with
782                     -u),  the  program  displays  the  information of the key
783                     again, together with its fingerprint and asks whether  it
784                     should be signed. This question is repeated for all users
785                     specified with -u.
786
787
788              lsign  Same as "sign" but the signature  is  marked  as  non-ex‐
789                     portable and will therefore never be used by others. This
790                     may be used to make keys valid only in the local environ‐
791                     ment.
792
793
794              nrsign Same as "sign" but the signature is marked as non-revoca‐
795                     ble and can therefore never be revoked.
796
797
798              tsign  Make a trust signature. This is a signature that combines
799                     the  notions of certification (like a regular signature),
800                     and trust (like the "trust"  command).  It  is  generally
801                     only  useful in distinct communities or groups.  For more
802                     information please read the sections ``Trust  Signature''
803                     and ``Regular Expression'' in RFC-4880.
804
805              Note  that "l" (for local / non-exportable), "nr" (for non-revo‐
806              cable, and "t" (for trust) may be freely mixed and  prefixed  to
807              "sign" to create a signature of any type desired.
808
809       If  the  option  --only-sign-text-ids  is  specified, then any non-text
810       based user ids (e.g., photo IDs) will not be selected for signing.
811
812
813
814              delsig Delete a signature. Note that it is not possible  to  re‐
815                     tract  a  signature,  once it has been send to the public
816                     (i.e. to a keyserver).   In  that  case  you  better  use
817                     revsig.
818
819
820              revsig Revoke  a  signature.  For every signature which has been
821                     generated by one of the secret keys, GnuPG asks whether a
822                     revocation certificate should be generated.
823
824
825              check  Check  the signatures on all selected user IDs.  With the
826                     extra option selfsig only self-signatures are shown.
827
828
829              adduid Create an additional user ID.
830
831
832              addphoto
833                     Create a photographic user ID. This  will  prompt  for  a
834                     JPEG  file  that  will be embedded into the user ID. Note
835                     that a very large JPEG will make for a  very  large  key.
836                     Also  note  that some programs will display your JPEG un‐
837                     changed (GnuPG), and some programs will scale it  to  fit
838                     in a dialog box (PGP).
839
840
841              showphoto
842                     Display the selected photographic user ID.
843
844
845              deluid Delete  a  user ID or photographic user ID.  Note that it
846                     is not possible to retract a user id, once  it  has  been
847                     send  to  the public (i.e. to a keyserver).  In that case
848                     you better use revuid.
849
850
851              revuid Revoke a user ID or photographic user ID.
852
853
854              primary
855                     Flag the current user id as the primary one, removes  the
856                     primary user id flag from all other user ids and sets the
857                     timestamp of  all  affected  self-signatures  one  second
858                     ahead. Note that setting a photo user ID as primary makes
859                     it primary over other photo user IDs, and setting a regu‐
860                     lar  user ID as primary makes it primary over other regu‐
861                     lar user IDs.
862
863
864              keyserver
865                     Set a preferred keyserver for the specified  user  ID(s).
866                     This allows other users to know where you prefer they get
867                     your key from. See  --keyserver-options  honor-keyserver-
868                     url  for  more  on  how  this  works.  Setting a value of
869                     "none" removes an existing preferred keyserver.
870
871
872              notation
873                     Set a name=value notation for the specified  user  ID(s).
874                     See --cert-notation for more on how this works. Setting a
875                     value of "none" removes all notations, setting a notation
876                     prefixed with a minus sign (-) removes that notation, and
877                     setting a notation name  (without  the  =value)  prefixed
878                     with a minus sign removes all notations with that name.
879
880
881              pref   List  preferences  from  the selected user ID. This shows
882                     the actual preferences,  without  including  any  implied
883                     preferences.
884
885
886              showpref
887                     More  verbose  preferences  listing for the selected user
888                     ID. This shows the preferences in effect by including the
889                     implied preferences of 3DES (cipher), SHA-1 (digest), and
890                     Uncompressed (compression) if they are  not  already  in‐
891                     cluded in the preference list. In addition, the preferred
892                     keyserver and signature notations (if any) are shown.
893
894
895              setpref string
896                     Set the list of user ID preferences to string for all (or
897                     just  the selected) user IDs. Calling setpref with no ar‐
898                     guments sets the preference list to the  default  (either
899                     built-in or set via --default-preference-list), and call‐
900                     ing setpref with "none" as the  argument  sets  an  empty
901                     preference  list.  Use  gpg  --version  to  get a list of
902                     available algorithms. Note that while you can change  the
903                     preferences  on  an  attribute  user ID (aka "photo ID"),
904                     GnuPG does not select keys  via  attribute  user  IDs  so
905                     these preferences will not be used by GnuPG.
906
907                     When  setting preferences, you should list the algorithms
908                     in the order which you'd like to see them used by someone
909                     else when encrypting a message to your key.  If you don't
910                     include 3DES, it will be automatically added at the  end.
911                     Note that there are many factors that go into choosing an
912                     algorithm (for example, your key may not be the only  re‐
913                     cipient),  and  so  the  remote OpenPGP application being
914                     used to send to you may or may not follow your exact cho‐
915                     sen  order  for  a given message.  It will, however, only
916                     choose an algorithm that is  present  on  the  preference
917                     list of every recipient key.  See also the INTEROPERABIL‐
918                     ITY WITH OTHER OPENPGP PROGRAMS section below.
919
920
921              addkey Add a subkey to this key.
922
923
924              addcardkey
925                     Generate a subkey on a card and add it to this key.
926
927
928              keytocard
929                     Transfer the selected secret subkey (or the  primary  key
930                     if  no  subkey has been selected) to a smartcard. The se‐
931                     cret key in the keyring will be replaced by a stub if the
932                     key  could be stored successfully on the card and you use
933                     the save command later. Only certain  key  types  may  be
934                     transferred  to the card. A sub menu allows you to select
935                     on what card to store the key. Note that it is not possi‐
936                     ble to get that key back from the card - if the card gets
937                     broken your secret key will be lost  unless  you  have  a
938                     backup somewhere.
939
940
941              bkuptocard file
942                     Restore  the  given  file  to a card. This command may be
943                     used to restore a backup key (as  generated  during  card
944                     initialization)  to  a new card. In almost all cases this
945                     will be the encryption key. You should use  this  command
946                     only with the corresponding public key and make sure that
947                     the file given as argument is indeed the  backup  to  re‐
948                     store.  You should then select 2 to restore as encryption
949                     key.  You will first be asked to enter the passphrase  of
950                     the backup key and then for the Admin PIN of the card.
951
952
953              keytotpm
954                     Transfer  the  selected secret subkey (or the primary key
955                     if no subkey has been selected) to TPM form.  The  secret
956                     key  in the keyring will be replaced by the TPM represen‐
957                     tation of that key, which can only be read by the partic‐
958                     ular  TPM  that  created  it  (so the keyfile now becomes
959                     locked to the laptop containing the TPM).   Only  certain
960                     key types may be transferred to the TPM (all TPM 2.0 sys‐
961                     tems are mandated to have the rsa2048 and nistp256  algo‐
962                     rithms  but  newer TPMs may have more). Note that the key
963                     itself is not transferred into the TPM, merely  encrypted
964                     by  the  TPM  in-place, so if the keyfile is deleted, the
965                     key will be lost.  Once transferred  to  TPM  representa‐
966                     tion, the key file can never be converted back to non-TPM
967                     form and the key will die  when  the  TPM  does,  so  you
968                     should  first  have a backup on secure offline storage of
969                     the actual secret key file before conversion.  It is  es‐
970                     sential  to  use the physical system TPM that you have rw
971                     permission   on   the   TPM   resource   manager   device
972                     (/dev/tpmrm0).   Usually  this means you must be a member
973                     of the tss group.
974
975
976              delkey Remove a subkey (secondary key). Note that it is not pos‐
977                     sible  to  retract a subkey, once it has been send to the
978                     public (i.e. to a keyserver).  In that  case  you  better
979                     use  revkey.  Also note that this only deletes the public
980                     part of a key.
981
982
983              revkey Revoke a subkey.
984
985
986              expire Change the key or subkey expiration time. If a subkey  is
987                     selected,  the  expiration  time  of  this subkey will be
988                     changed. With no selection, the  key  expiration  of  the
989                     primary key is changed.
990
991
992              trust  Change  the  owner  trust value for the key. This updates
993                     the trust-db immediately and no save is required.
994
995
996              disable
997              enable Disable or enable an entire key. A disabled key  can  not
998                     normally be used for encryption.
999
1000
1001              addrevoker
1002                     Add  a  designated revoker to the key. This takes one op‐
1003                     tional argument: "sensitive". If a designated revoker  is
1004                     marked  as  sensitive, it will not be exported by default
1005                     (see export-options).
1006
1007
1008              passwd Change the passphrase of the secret key.
1009
1010
1011              toggle This is dummy command which exists only for backward com‐
1012                     patibility.
1013
1014
1015              clean  Compact  (by  removing all signatures except the selfsig)
1016                     any user ID that is no longer usable  (e.g.  revoked,  or
1017                     expired). Then, remove any signatures that are not usable
1018                     by the trust calculations.   Specifically,  this  removes
1019                     any  signature that does not validate, any signature that
1020                     is superseded by a later signature,  revoked  signatures,
1021                     and signatures issued by keys that are not present on the
1022                     keyring.
1023
1024
1025              minimize
1026                     Make the key as small as possible. This removes all  sig‐
1027                     natures  from  each  user  ID  except for the most recent
1028                     self-signature.
1029
1030
1031              change-usage
1032                     Change the usage flags (capabilities) of the primary  key
1033                     or  of  subkeys.   These usage flags (e.g. Certify, Sign,
1034                     Authenticate,  Encrypt)  are  set  during  key  creation.
1035                     Sometimes  it is useful to have the opportunity to change
1036                     them (for example to add Authenticate)  after  they  have
1037                     been  created.  Please take care when doing this; the al‐
1038                     lowed usage flags depend on the key algorithm.
1039
1040
1041              cross-certify
1042                     Add cross-certification  signatures  to  signing  subkeys
1043                     that  may  not  currently  have them. Cross-certification
1044                     signatures protect against a subtle attack against  sign‐
1045                     ing  subkeys. See --require-cross-certification.  All new
1046                     keys generated have this signature by  default,  so  this
1047                     command is only useful to bring older keys up to date.
1048
1049
1050              save   Save all changes to the keyring and quit.
1051
1052
1053              quit   Quit the program without updating the keyring.
1054
1055              The  listing  shows  you the key with its secondary keys and all
1056              user IDs.  The primary user ID is indicated by a  dot,  and  se‐
1057              lected keys or user IDs are indicated by an asterisk.  The trust
1058              value is displayed with the primary key: "trust" is the assigned
1059              owner  trust  and  "validity"  is the calculated validity of the
1060              key.  Validity values are also displayed for all user IDs.   For
1061              possible values of trust, see: [trust-values].
1062
1063
1064       --sign-key name
1065              Signs a public key with your secret key. This is a shortcut ver‐
1066              sion of the subcommand "sign" from --edit-key.
1067
1068
1069       --lsign-key name
1070              Signs a public key with your secret key but marks it as  non-ex‐
1071              portable.  This  is a shortcut version of the subcommand "lsign"
1072              from --edit-key.
1073
1074
1075       --quick-sign-key fpr [names]
1076       --quick-lsign-key fpr [names]
1077              Directly sign a key from the passphrase without any further user
1078              interaction.   The  fpr must be the verified primary fingerprint
1079              of a key in the local keyring. If no names are given, all useful
1080              user  ids  are  signed;  with given [names] only useful user ids
1081              matching one of these names are signed.  By  default,  or  if  a
1082              name  is prefixed with a '*', a case insensitive substring match
1083              is used.  If a name is prefixed with a '=' a case sensitive  ex‐
1084              act match is done.
1085
1086              The  command  --quick-lsign-key  marks the signatures as non-ex‐
1087              portable.  If such a non-exportable signature already exists the
1088              --quick-sign-key  turns  it into a exportable signature.  If you
1089              need to update an existing signature,  for  example  to  add  or
1090              change  notation  data, you need to use the option --force-sign-
1091              key.
1092
1093              This command uses reasonable defaults and thus does not  provide
1094              the  full  flexibility of the "sign" subcommand from --edit-key.
1095              Its intended use is to help unattended key signing by  utilizing
1096              a list of verified fingerprints.
1097
1098
1099       --quick-add-uid user-id new-user-id
1100              This command adds a new user id to an existing key.  In contrast
1101              to the interactive sub-command adduid  of  --edit-key  the  new-
1102              user-id  is  added verbatim with only leading and trailing white
1103              space removed, it is expected to be UTF-8 encoded, and no checks
1104              on its form are applied.
1105
1106
1107       --quick-revoke-uid user-id user-id-to-revoke
1108              This command revokes a user ID on an existing key.  It cannot be
1109              used to revoke the last user ID on key (some non-revoked user ID
1110              must  remain),  with  revocation  reason  ``User ID is no longer
1111              valid''.  If you want to specify a different revocation  reason,
1112              or  to  supply supplementary revocation text, you should use the
1113              interactive sub-command revuid of --edit-key.
1114
1115
1116       --quick-revoke-sig fpr signing-fpr [names]
1117              This command revokes the key signatures made by signing-fpr from
1118              the key specified by the fingerprint fpr.  With names given only
1119              the signatures on user ids of the key matching any of the  given
1120              names  are affected (see --quick-sign-key).  If a revocation al‐
1121              ready exists a notice is printed instead of creating a new revo‐
1122              cation; no error is returned in this case.  Note that key signa‐
1123              ture revocations may be superseded by a newer key signature  and
1124              in turn again revoked.
1125
1126
1127       --quick-set-primary-uid user-id primary-user-id
1128              This  command sets or updates the primary user ID flag on an ex‐
1129              isting key.  user-id specifies the key and  primary-user-id  the
1130              user ID which shall be flagged as the primary user ID.  The pri‐
1131              mary user ID flag is removed from all other  user  ids  and  the
1132              timestamp  of  all  affected  self-signatures  is set one second
1133              ahead.
1134
1135
1136
1137       --change-passphrase user-id
1138       --passwd user-id
1139              Change the passphrase of the secret key belonging  to  the  cer‐
1140              tificate  specified as user-id.  This is a shortcut for the sub-
1141              command passwd of the --edit-key menu.  When using together with
1142              the   option   --dry-run  this  will  not  actually  change  the
1143              passphrase but check that the current passphrase is correct.
1144
1145

OPTIONS

1147       gpg features a bunch of options to control the exact behaviour  and  to
1148       change the default configuration.
1149
1150
1151       Long    options    can   be   put   in   an   options   file   (default
1152       "~/.gnupg/gpg.conf"). Short option names will not work -  for  example,
1153       "armor"  is  a  valid option for the options file, while "a" is not. Do
1154       not write the 2 dashes, but simply the name of the option and  any  re‐
1155       quired  arguments. Lines with a hash ('#') as the first non-white-space
1156       character are ignored. Commands may be put in this file too,  but  that
1157       is  not generally useful as the command will execute automatically with
1158       every execution of gpg.
1159
1160       Please remember that option parsing stops as soon as  a  non-option  is
1161       encountered,  you  can explicitly stop parsing by using the special op‐
1162       tion --.
1163
1164
1165
1166   How to change the configuration
1167
1168
1169       These options are used to change the configuration and most of them are
1170       usually found in the option file.
1171
1172
1173
1174       --default-key name
1175              Use  name as the default key to sign with. If this option is not
1176              used, the default key is the  first  key  found  in  the  secret
1177              keyring.   Note  that  -u or --local-user overrides this option.
1178              This option may be given multiple times.  In this case, the last
1179              key for which a secret key is available is used.  If there is no
1180              secret key available for any of the specified values, GnuPG will
1181              not  emit an error message but continue as if this option wasn't
1182              given.
1183
1184
1185       --default-recipient name
1186              Use name as default recipient if option --recipient is not  used
1187              and don't ask if this is a valid one. name must be non-empty.
1188
1189
1190       --default-recipient-self
1191              Use  the  default key as default recipient if option --recipient
1192              is not used and don't ask if this is a valid  one.  The  default
1193              key is the first one from the secret keyring or the one set with
1194              --default-key.
1195
1196
1197       --no-default-recipient
1198              Reset --default-recipient and --default-recipient-self.   Should
1199              not be used in an option file.
1200
1201
1202       -v, --verbose
1203              Give  more information during processing. If used twice, the in‐
1204              put data is listed in detail.
1205
1206
1207       --no-verbose
1208              Reset verbose level to 0.  Should not be used in an option file.
1209
1210
1211       -q, --quiet
1212              Try to be as quiet as possible.  Should not be used in an option
1213              file.
1214
1215
1216       --batch
1217       --no-batch
1218              Use  batch  mode.  Never ask, do not allow interactive commands.
1219              --no-batch disables this option.  Note that even with a filename
1220              given  on  the  command  line, gpg might still need to read from
1221              STDIN (in particular if gpg figures that the input is a detached
1222              signature  and no data file has been specified).  Thus if you do
1223              not want to feed data via STDIN, you  should  connect  STDIN  to
1224/dev/null’.
1225
1226              It  is  highly recommended to use this option along with the op‐
1227              tions --status-fd and --with-colons for any  unattended  use  of
1228              gpg.  Should not be used in an option file.
1229
1230
1231       --no-tty
1232              Make  sure that the TTY (terminal) is never used for any output.
1233              This option is needed in  some  cases  because  GnuPG  sometimes
1234              prints warnings to the TTY even if --batch is used.
1235
1236
1237       --yes  Assume "yes" on most questions.  Should not be used in an option
1238              file.
1239
1240
1241       --no   Assume "no" on most questions.  Should not be used in an  option
1242              file.
1243
1244
1245
1246       --list-options parameters
1247              This  is  a  space  or comma delimited string that gives options
1248              used when listing keys and  signatures  (that  is,  --list-keys,
1249              --check-signatures,  --list-public-keys, --list-secret-keys, and
1250              the --edit-key functions).  Options can be prepended with a  no-
1251              (after  the  two  dashes) to give the opposite meaning.  The op‐
1252              tions are:
1253
1254
1255
1256              show-photos
1257                     Causes  --list-keys,  --check-signatures,  --list-public-
1258                     keys, and --list-secret-keys to display any photo IDs at‐
1259                     tached to the key.  Defaults to  no.  See  also  --photo-
1260                     viewer.   Does  not work with --with-colons: see --attri‐
1261                     bute-fd for the appropriate way to  get  photo  data  for
1262                     scripts and other frontends.
1263
1264
1265              show-usage
1266                     Show  usage information for keys and subkeys in the stan‐
1267                     dard key listing.  This is a list of  letters  indicating
1268                     the  allowed  usage  for  a key (E=encryption, S=signing,
1269                     C=certification, A=authentication).  Defaults to yes.
1270
1271
1272              show-policy-urls
1273                     Show policy URLs  in  the   --check-signatures  listings.
1274                     Defaults to no.
1275
1276
1277              show-notations
1278              show-std-notations
1279              show-user-notations
1280                     Show  all, IETF standard, or user-defined signature nota‐
1281                     tions in the --check-signatures listings. Defaults to no.
1282
1283
1284              show-keyserver-urls
1285                     Show any preferred keyserver URL  in  the  --check-signa‐
1286                     tures listings. Defaults to no.
1287
1288
1289              show-uid-validity
1290                     Display  the  calculated  validity of user IDs during key
1291                     listings.  Defaults to yes.
1292
1293
1294              show-unusable-uids
1295                     Show revoked and expired user IDs in  key  listings.  De‐
1296                     faults to no.
1297
1298
1299              show-unusable-subkeys
1300                     Show  revoked  and  expired  subkeys in key listings. De‐
1301                     faults to no.
1302
1303
1304              show-keyring
1305                     Display the keyring name at the head of key  listings  to
1306                     show  which  keyring  a given key resides on. Defaults to
1307                     no.
1308
1309
1310              show-sig-expire
1311                     Show signature expiration dates (if any) during  --check-
1312                     signatures listings. Defaults to no.
1313
1314
1315              show-sig-subpackets
1316                     Include signature subpackets in the key listing. This op‐
1317                     tion can take an optional argument list of the subpackets
1318                     to  list.  If no argument is passed, list all subpackets.
1319                     Defaults to no. This option is only meaningful when using
1320                     --with-colons along with --check-signatures.
1321
1322
1323              show-only-fpr-mbox
1324                     For  each  user-id  which  has a valid mail address print
1325                     only the fingerprint followed by the mail address.
1326
1327
1328              sort-sigs
1329                     With --list-sigs and --check-sigs sort the signatures  by
1330                     keyID  and  creation  time  to make it easier to view the
1331                     history of these signatures.  The self-signature is  also
1332                     listed before other signatures. Defaults to yes.
1333
1334
1335
1336       --verify-options parameters
1337              This  is  a  space  or comma delimited string that gives options
1338              used when verifying signatures. Options can be prepended with  a
1339              `no-' to give the opposite meaning. The options are:
1340
1341
1342
1343              show-photos
1344                     Display  any photo IDs present on the key that issued the
1345                     signature.  Defaults to no. See also --photo-viewer.
1346
1347
1348              show-policy-urls
1349                     Show policy URLs in the  signature  being  verified.  De‐
1350                     faults to yes.
1351
1352
1353              show-notations
1354              show-std-notations
1355              show-user-notations
1356                     Show  all, IETF standard, or user-defined signature nota‐
1357                     tions in the signature being verified. Defaults  to  IETF
1358                     standard.
1359
1360
1361              show-keyserver-urls
1362                     Show  any  preferred keyserver URL in the signature being
1363                     verified.  Defaults to yes.
1364
1365
1366              show-uid-validity
1367                     Display the calculated validity of the user  IDs  on  the
1368                     key that issued the signature. Defaults to yes.
1369
1370
1371              show-unusable-uids
1372                     Show  revoked and expired user IDs during signature veri‐
1373                     fication.  Defaults to no.
1374
1375
1376              show-primary-uid-only
1377                     Show only the primary user ID during signature  verifica‐
1378                     tion.  That is all the AKA lines as well as photo Ids are
1379                     not shown with the signature verification status.
1380
1381
1382
1383       --enable-large-rsa
1384       --disable-large-rsa
1385              With --generate-key and --batch, enable the creation of RSA  se‐
1386              cret  keys as large as 8192 bit.  Note: 8192 bit is more than is
1387              generally recommended.  These large keys don't significantly im‐
1388              prove  security,  but  they are more expensive to use, and their
1389              signatures and certifications are larger.  This option  is  only
1390              available if the binary was build with large-secmem support.
1391
1392
1393       --enable-dsa2
1394       --disable-dsa2
1395              Enable hash truncation for all DSA keys even for old DSA Keys up
1396              to 1024 bit.  This is also the  default  with  --openpgp.   Note
1397              that  older  versions  of GnuPG also required this flag to allow
1398              the generation of DSA larger than 1024 bit.
1399
1400
1401       --photo-viewer string
1402              This is the command line that should be run to view a photo  ID.
1403              "%i"  will  be expanded to a filename containing the photo. "%I"
1404              does the same, except the file will  not  be  deleted  once  the
1405              viewer exits.  Other flags are "%k" for the key ID, "%K" for the
1406              long key ID, "%f" for the key fingerprint, "%t" for  the  exten‐
1407              sion  of  the image type (e.g. "jpg"), "%T" for the MIME type of
1408              the image (e.g. "image/jpeg"),  "%v"  for  the  single-character
1409              calculated  validity  of the image being viewed (e.g. "f"), "%V"
1410              for the calculated validity as a string (e.g.  "full"), "%U" for
1411              a  base32  encoded  hash  of the user ID, and "%%" for an actual
1412              percent sign. If neither %i or %I are present,  then  the  photo
1413              will be supplied to the viewer on standard input.
1414
1415              On  Unix  the  default  viewer is xloadimage -fork -quiet -title
1416              'KeyID 0x%k' STDIN with a  fallback  to  display  -title  'KeyID
1417              0x%k'  %i  and finally to xdg-open %i.  On Windows !ShellExecute
1418              400 %i is used; here the command is a meta command to  use  that
1419              API  call  followed by a wait time in milliseconds which is used
1420              to give the viewer time to read the temporary image file  before
1421              gpg deletes it again.  Note that if your image viewer program is
1422              not secure, then executing it from gpg does not make it secure.
1423
1424
1425       --exec-path string
1426              Sets a list of directories to search for photo  viewers  If  not
1427              provided photo viewers use the PATH environment variable.
1428
1429
1430       --keyring file
1431              Add  file to the current list of keyrings. If file begins with a
1432              tilde and a slash, these are replaced by the $HOME directory. If
1433              the  filename  does  not contain a slash, it is assumed to be in
1434              the  GnuPG  home  directory  ("~/.gnupg"  unless  --homedir   or
1435              $GNUPGHOME is used).
1436
1437              Note that this adds a keyring to the current list. If the intent
1438              is to use the specified keyring alone, use --keyring along  with
1439              --no-default-keyring.
1440
1441              If  the  option  --no-keyring  has been used no keyrings will be
1442              used at all.
1443
1444              Note that if the option use-keyboxd is enabled in ‘common.conf’,
1445              no  keyrings  are used at all and keys are all maintained by the
1446              keyboxd process in its own database.
1447
1448
1449       --primary-keyring file
1450              This is a varian of --keyring and designates file as the primary
1451              public  keyring.  This means that newly imported keys (via --im‐
1452              port or keyserver --recv-from) will go to this keyring.
1453
1454
1455
1456       --secret-keyring file
1457              This is an obsolete option and ignored.   All  secret  keys  are
1458              stored in the ‘private-keys-v1.d’ directory below the GnuPG home
1459              directory.
1460
1461
1462       --trustdb-name file
1463              Use file instead of the default trustdb. If file begins  with  a
1464              tilde and a slash, these are replaced by the $HOME directory. If
1465              the filename does not contain a slash, it is assumed  to  be  in
1466              the  GnuPG home directory (‘~/.gnupg’ if --homedir or $GNUPGHOME
1467              is not used).
1468
1469
1470       --homedir dir
1471              Set the name of the home directory to dir. If this option is not
1472              used,  the  home  directory  defaults to ‘~/.gnupg’.  It is only
1473              recognized when given on the command line.   It  also  overrides
1474              any  home  directory  stated  through  the  environment variable
1475GNUPGHOME’ or (on Windows systems) by means of the Registry en‐
1476              try HKCU\Software\GNU\GnuPG:HomeDir.
1477
1478              On Windows systems it is possible to install GnuPG as a portable
1479              application.  In this case only this command line option is con‐
1480              sidered, all other ways to set a home directory are ignored.
1481
1482              To install GnuPG as a portable application under Windows, create
1483              an empty file named ‘gpgconf.ctl’ in the same directory  as  the
1484              tool  ‘gpgconf.exe’.   The root of the installation is then that
1485              directory; or, if ‘gpgconf.exe’ has been installed directly  be‐
1486              low  a  directory  named  ‘bin’, its parent directory.  You also
1487              need to make sure that the following directories exist  and  are
1488              writable:     ‘ROOT/home’     for    the    GnuPG    home    and
1489ROOT/var/cache/gnupg’ for internal cache files.
1490
1491
1492
1493       --display-charset name
1494              Set the name of the native character set. This is used  to  con‐
1495              vert  some  informational  strings  like  user IDs to the proper
1496              UTF-8 encoding.  Note that this has nothing to do with the char‐
1497              acter  set of data to be encrypted or signed; GnuPG does not re‐
1498              code user-supplied data. If this option is not used, the default
1499              character set is determined from the current locale. A verbosity
1500              level of 3 shows the chosen set.  This option should not be used
1501              on Windows.  Valid values for name are:
1502
1503
1504
1505              iso-8859-1
1506                     This is the Latin 1 set.
1507
1508
1509              iso-8859-2
1510                     The Latin 2 set.
1511
1512
1513              iso-8859-15
1514                     This is currently an alias for the Latin 1 set.
1515
1516
1517              koi8-r The usual Russian set (RFC-1489).
1518
1519
1520              utf-8  Bypass  all  translations and assume that the OS uses na‐
1521                     tive UTF-8 encoding.
1522
1523
1524       --utf8-strings
1525       --no-utf8-strings
1526              Assume that command line arguments are given as  UTF-8  strings.
1527              The  default (--no-utf8-strings) is to assume that arguments are
1528              encoded in the character set as specified by  --display-charset.
1529              These  options  affect all following arguments. Both options may
1530              be used multiple times.  This option should not be  used  in  an
1531              option file.
1532
1533              This  option  has no effect on Windows.  There the internal used
1534              UTF-8 encoding is translated for console input and output.   The
1535              command line arguments are expected as Unicode and translated to
1536              UTF-8.  Thus when calling this program from another,  make  sure
1537              to use the Unicode version of CreateProcess.
1538
1539
1540
1541       --options file
1542              Read  options from file and do not try to read them from the de‐
1543              fault options file in the homedir (see --homedir).  This  option
1544              is ignored if used in an options file.
1545
1546
1547       --no-options
1548              Shortcut for --options /dev/null. This option is detected before
1549              an attempt to open an option file.  Using this option will  also
1550              prevent the creation of a ‘~/.gnupg’ homedir.
1551
1552
1553       -z n
1554       --compress-level n
1555       --bzip2-compress-level n
1556              Set  compression level to n for the ZIP and ZLIB compression al‐
1557              gorithms. The default is to use the default compression level of
1558              zlib  (normally  6). --bzip2-compress-level sets the compression
1559              level for the BZIP2 compression algorithm (defaulting  to  6  as
1560              well).  This  is  a different option from --compress-level since
1561              BZIP2 uses a significant amount of memory  for  each  additional
1562              compression  level.   -z  sets both. A value of 0 for n disables
1563              compression.
1564
1565
1566       --bzip2-decompress-lowmem
1567              Use a different decompression method for BZIP2 compressed files.
1568              This  alternate method uses a bit more than half the memory, but
1569              also runs at half the speed. This is useful  under  extreme  low
1570              memory  circumstances when the file was originally compressed at
1571              a high --bzip2-compress-level.
1572
1573
1574
1575       --mangle-dos-filenames
1576       --no-mangle-dos-filenames
1577              Older version of Windows cannot handle filenames with more  than
1578              one  dot. --mangle-dos-filenames causes GnuPG to replace (rather
1579              than add to) the extension of an output filename to  avoid  this
1580              problem. This option is off by default and has no effect on non-
1581              Windows platforms.
1582
1583
1584       --ask-cert-level
1585       --no-ask-cert-level
1586              When making a key signature, prompt for a  certification  level.
1587              If this option is not specified, the certification level used is
1588              set via --default-cert-level. See --default-cert-level  for  in‐
1589              formation  on  the  specific levels and how they are used. --no-
1590              ask-cert-level disables this option. This option defaults to no.
1591
1592
1593       --default-cert-level n
1594              The default to use for the check level when signing a key.
1595
1596              0 means you make no particular claim as  to  how  carefully  you
1597              verified the key.
1598
1599              1 means you believe the key is owned by the person who claims to
1600              own it but you could not, or did not verify the key at all. This
1601              is  useful  for a "persona" verification, where you sign the key
1602              of a pseudonymous user.
1603
1604              2 means you did casual verification of  the  key.  For  example,
1605              this  could  mean  that  you  verified  the  key fingerprint and
1606              checked the user ID on the key against a photo ID.
1607
1608              3 means you did extensive verification of the key. For  example,
1609              this  could  mean that you verified the key fingerprint with the
1610              owner of the key in person, and that you checked, by means of  a
1611              hard to forge document with a photo ID (such as a passport) that
1612              the name of the key owner matches the name in the user ID on the
1613              key,  and  finally that you verified (by exchange of email) that
1614              the email address on the key belongs to the key owner.
1615
1616              Note that the examples given above for levels 2 and 3  are  just
1617              that:  examples. In the end, it is up to you to decide just what
1618              "casual" and "extensive" mean to you.
1619
1620              This option defaults to 0 (no particular claim).
1621
1622
1623       --min-cert-level
1624              When building the trust database, treat any  signatures  with  a
1625              certification  level below this as invalid. Defaults to 2, which
1626              disregards level 1 signatures. Note that level 0 "no  particular
1627              claim" signatures are always accepted.
1628
1629
1630       --trusted-key long key ID or fingerprint
1631              Assume  that the specified key (which should be given as finger‐
1632              print) is as trustworthy as one of your own  secret  keys.  This
1633              option  is useful if you don't want to keep your secret keys (or
1634              one of them) online but still want to be able to check  the  va‐
1635              lidity  of  a given recipient's or signator's key.  If the given
1636              key is not locally available but an LDAP keyserver is configured
1637              the missing key is imported from that server.
1638
1639
1640       --trust-model {pgp|classic|tofu|tofu+pgp|direct|always|auto}
1641              Set what trust model GnuPG should follow. The models are:
1642
1643
1644
1645              pgp    This  is  the Web of Trust combined with trust signatures
1646                     as used in PGP 5.x and later. This is the  default  trust
1647                     model when creating a new trust database.
1648
1649
1650              classic
1651                     This is the standard Web of Trust as introduced by PGP 2.
1652
1653
1654              tofu
1655
1656                     TOFU stands for Trust On First Use.  In this trust model,
1657                     the first time a key is seen, it is memorized.  If  later
1658                     another key with a user id with the same email address is
1659                     seen, both keys are marked as suspect.  In that case, the
1660                     next time either is used, a warning is displayed describ‐
1661                     ing the conflict, why it might have occurred (either  the
1662                     user generated a new key and failed to cross sign the old
1663                     and new keys, the key is forgery, or a  man-in-the-middle
1664                     attack  is  being attempted), and the user is prompted to
1665                     manually confirm the validity of the key in question.
1666
1667                     Because a potential attacker is able to control the email
1668                     address and thereby circumvent the conflict detection al‐
1669                     gorithm by using an email address that is similar in  ap‐
1670                     pearance  to  a trusted email address, whenever a message
1671                     is verified, statistics  about  the  number  of  messages
1672                     signed  with  the key are shown.  In this way, a user can
1673                     easily identify attacks using fake keys for regular  cor‐
1674                     respondents.
1675
1676                     When compared with the Web of Trust, TOFU offers signifi‐
1677                     cantly weaker security guarantees.  In  particular,  TOFU
1678                     only  helps ensure consistency (that is, that the binding
1679                     between a key and email address doesn't change).  A major
1680                     advantage  of TOFU is that it requires little maintenance
1681                     to use correctly.  To use the web of trust properly,  you
1682                     need  to actively sign keys and mark users as trusted in‐
1683                     troducers.  This is a time-consuming process and  anecdo‐
1684                     tal  evidence suggests that even security-conscious users
1685                     rarely take the time to do this  thoroughly  and  instead
1686                     rely on an ad-hoc TOFU process.
1687
1688                     In  the TOFU model, policies are associated with bindings
1689                     between keys and email  addresses  (which  are  extracted
1690                     from  user ids and normalized).  There are five policies,
1691                     which can be set manually using the --tofu-policy option.
1692                     The  default  policy can be set using the --tofu-default-
1693                     policy option.
1694
1695                     The TOFU policies are: auto, good, unknown, bad and  ask.
1696                     The  auto policy is used by default (unless overridden by
1697                     --tofu-default-policy) and marks a binding as  marginally
1698                     trusted.  The good, unknown and bad policies mark a bind‐
1699                     ing as fully trusted, as having unknown trust or as  hav‐
1700                     ing  trust  never,  respectively.   The unknown policy is
1701                     useful for just using TOFU to detect  conflicts,  but  to
1702                     never assign positive trust to a binding.  The final pol‐
1703                     icy, ask prompts  the  user  to  indicate  the  binding's
1704                     trust.  If batch mode is enabled (or input is inappropri‐
1705                     ate in the context), then the user is  not  prompted  and
1706                     the undefined trust level is returned.
1707
1708
1709              tofu+pgp
1710                     This  trust  model  combines  TOFU with the Web of Trust.
1711                     This is done by computing the trust level for each  model
1712                     and  then  taking the maximum trust level where the trust
1713                     levels are ordered as follows: unknown < undefined < mar‐
1714                     ginal < fully < ultimate < expired < never.
1715
1716                     By  setting --tofu-default-policy=unknown, this model can
1717                     be used to implement the web of trust  with  TOFU's  con‐
1718                     flict  detection algorithm, but without its assignment of
1719                     positive  trust  values,  which  some  security-conscious
1720                     users don't like.
1721
1722
1723              direct Key  validity  is set directly by the user and not calcu‐
1724                     lated via the Web of Trust.  This model is  solely  based
1725                     on  the key and does not distinguish user IDs.  Note that
1726                     when changing to another trust model the trust values as‐
1727                     signed  to  a key are transformed into ownertrust values,
1728                     which also indicate how you trust the owner of the key to
1729                     sign other keys.
1730
1731
1732              always Skip  key validation and assume that used keys are always
1733                     fully valid. You generally won't use this unless you  are
1734                     using  some  external validation scheme. This option also
1735                     suppresses the "[uncertain]" tag printed  with  signature
1736                     checks  when  there  is  no  evidence that the user ID is
1737                     bound to the key.  Note that this trust model still  does
1738                     not allow the use of expired, revoked, or disabled keys.
1739
1740
1741              auto   Select the trust model depending on whatever the internal
1742                     trust database says. This is the default model if such  a
1743                     database already exists.  Note that a tofu trust model is
1744                     not considered here and must be enabled explicitly.
1745
1746
1747
1748       --auto-key-locate mechanisms
1749       --no-auto-key-locate
1750              GnuPG can automatically locate and retrieve keys as needed using
1751              this  option.   This happens when encrypting to an email address
1752              (in the "user@example.com" form), and there are  no  "user@exam‐
1753              ple.com"  keys on the local keyring.  This option takes any num‐
1754              ber of the mechanisms listed below, in the order they are to  be
1755              tried.  Instead of listing the mechanisms as comma delimited ar‐
1756              guments, the option may also be given several times to add  more
1757              mechanism.   The  option  --no-auto-key-locate  or the mechanism
1758              "clear" resets the list.  The default is "local,wkd".
1759
1760
1761
1762              cert   Locate a key using DNS CERT, as specified in RFC-4398.
1763
1764
1765              dane   Locate a key using DANE, as specified in draft-ietf-dane-
1766                     openpgpkey-05.txt.
1767
1768
1769              wkd    Locate a key using the Web Key Directory protocol.
1770
1771
1772              ldap   Using DNS Service Discovery, check the domain in question
1773                     for any LDAP keyservers to use.  If this  fails,  attempt
1774                     to  locate  the  key  using  the  PGP Universal method of
1775                     checking ‘ldap://keys.(thedomain)’.
1776
1777
1778              ntds   Locate the key using the Active Directory (Windows only).
1779                     This  method  also  allows to search by fingerprint using
1780                     the command --locate-external-key.
1781
1782
1783              keyserver
1784                     Locate a key using a keyserver.  This method also  allows
1785                     to  search  by fingerprint using the command --locate-ex‐
1786                     ternal-key if any of the configured keyservers is an LDAP
1787                     server.
1788
1789
1790              keyserver-URL
1791                     In  addition, a keyserver URL as used in the dirmngr con‐
1792                     figuration may be used here to query that particular key‐
1793                     server.  This method also allows to search by fingerprint
1794                     using the command --locate-external-key if the URL speci‐
1795                     fies an LDAP server.
1796
1797
1798              local  Locate  the key using the local keyrings.  This mechanism
1799                     allows the user to select the order a local key lookup is
1800                     done.   Thus using ‘--auto-key-locate local’ is identical
1801                     to --no-auto-key-locate.
1802
1803
1804              nodefault
1805                     This flag disables the standard local  key  lookup,  done
1806                     before  any  of the mechanisms defined by the --auto-key-
1807                     locate are tried.  The position of this mechanism in  the
1808                     list  does  not  matter.   It is not required if local is
1809                     also used.
1810
1811
1812              clear  Clear all defined mechanisms.  This is useful to override
1813                     mechanisms given in a config file.  Note that a nodefault
1814                     in mechanisms will also be cleared unless it is given af‐
1815                     ter the clear.
1816
1817
1818
1819
1820       --auto-key-import
1821       --no-auto-key-import
1822              This  is an offline mechanism to get a missing key for signature
1823              verification and for later encryption to this key.  If this  op‐
1824              tion  is  enabled and a signature includes an embedded key, that
1825              key is used to verify the signature and on verification  success
1826              the key is imported. The default is --no-auto-key-import.
1827
1828              On  the  sender  (signing)  site  the option --include-key-block
1829              needs to be used to put the public part of the  signing  key  as
1830              “Key Block subpacket” into the signature.
1831
1832
1833       --auto-key-retrieve
1834       --no-auto-key-retrieve
1835              These options enable or disable the automatic retrieving of keys
1836              from a keyserver when verifying signatures made by keys that are
1837              not  on  the  local  keyring.   The default is --no-auto-key-re‐
1838              trieve.
1839
1840              The order of methods tried to lookup the key is:
1841
1842              1. If the option --auto-key-import is set and the signatures in‐
1843              cludes an embedded key, that key is used to verify the signature
1844              and on verification success that key is imported.
1845
1846              2. If a preferred keyserver is specified in  the  signature  and
1847              the  option  honor-keyserver-url is active (which is not the de‐
1848              fault), that keyserver is tried.  Note that the creator  of  the
1849              signature  uses  the  option  --sig-keyserver-url to specify the
1850              preferred keyserver for data signatures.
1851
1852              3. If the  signature  has  the  Signer's  UID  set  (e.g.  using
1853              --sender while creating the signature) a Web Key Directory (WKD)
1854              lookup is done.  This is the default configuration  but  can  be
1855              disabled by removing WKD from the auto-key-locate list or by us‐
1856              ing the option --disable-signer-uid.
1857
1858              4. If any keyserver is configured and the Issuer Fingerprint  is
1859              part  of the signature (since GnuPG 2.1.16), the configured key‐
1860              servers are tried.
1861
1862              Note that this option makes a "web bug" like behavior  possible.
1863              Keyserver  or Web Key Directory operators can see which keys you
1864              request, so by sending you a message signed by a brand  new  key
1865              (which  you  naturally will not have on your local keyring), the
1866              operator can tell both your IP address and  the  time  when  you
1867              verified the signature.
1868
1869
1870       --keyid-format {none|short|0xshort|long|0xlong}
1871              Select  how to display key IDs.  "none" does not show the key ID
1872              at all but shows the fingerprint in a separate line.  "short" is
1873              the traditional 8-character key ID.  "long" is the more accurate
1874              (but less convenient) 16-character key ID.  Add an "0x"  to  ei‐
1875              ther  to  include  an "0x" at the beginning of the key ID, as in
1876              0x99242560.  Note that this option  is  ignored  if  the  option
1877              --with-colons is used.
1878
1879
1880       --keyserver name
1881              This option is deprecated - please use the --keyserver in ‘dirm‐
1882              ngr.conf’ instead.
1883
1884              Use name as your keyserver. This is the server  that  --receive-
1885              keys,  --send-keys,  and  --search-keys will communicate with to
1886              receive keys from, send keys to, and search  for  keys  on.  The
1887              format  of  the name is a URI: `scheme:[//]keyservername[:port]'
1888              The scheme is the type of keyserver: "hkp"/"hkps" for  the  HTTP
1889              (or  compatible)  keyservers or "ldap"/"ldaps" for the LDAP key‐
1890              servers.  Note that your particular installation  of  GnuPG  may
1891              have  other keyserver types available as well. Keyserver schemes
1892              are case-insensitive.
1893
1894              Most keyservers synchronize with each other, so there is  gener‐
1895              ally no need to send keys to more than one server. The keyserver
1896              hkp://keys.gnupg.net uses round robin DNS to  give  a  different
1897              keyserver each time you use it.
1898
1899
1900       --keyserver-options {name=value}
1901              This is a space or comma delimited string that gives options for
1902              the keyserver. Options can be prefixed with a `no-' to give  the
1903              opposite  meaning. Valid import-options or export-options may be
1904              used here as well to apply to importing (--recv-key) or  export‐
1905              ing  (--send-key)  a key from a keyserver. While not all options
1906              are available for all keyserver types, some common options are:
1907
1908
1909
1910              include-revoked
1911                     When searching for a key with --search-keys, include keys
1912                     that  are  marked  on the keyserver as revoked. Note that
1913                     not all keyservers differentiate between revoked and  un‐
1914                     revoked  keys,  and  for  such  keyservers this option is
1915                     meaningless. Note also that most keyservers do  not  have
1916                     cryptographic  verification  of  key  revocations, and so
1917                     turning this option off may result in skipping keys  that
1918                     are incorrectly marked as revoked.
1919
1920
1921              include-disabled
1922                     When searching for a key with --search-keys, include keys
1923                     that are marked on the keyserver as disabled.  Note  that
1924                     this option is not used with HKP keyservers.
1925
1926
1927              auto-key-retrieve
1928                     This  is  an  obsolete  alias for the option auto-key-re‐
1929                     trieve.  Please do not use it; it will be removed in  fu‐
1930                     ture versions..
1931
1932
1933              honor-keyserver-url
1934                     When  using  --refresh-keys, if the key in question has a
1935                     preferred keyserver URL, then  use  that  preferred  key‐
1936                     server to refresh the key from. In addition, if auto-key-
1937                     retrieve is set, and the signature being verified  has  a
1938                     preferred  keyserver  URL,  then  use that preferred key‐
1939                     server to fetch the key from. Note that this  option  in‐
1940                     troduces a "web bug": The creator of the key can see when
1941                     the keys is refreshed.  Thus this option is  not  enabled
1942                     by default.
1943
1944
1945              include-subkeys
1946                     When  receiving  a key, include subkeys as potential tar‐
1947                     gets. Note that this option is not  used  with  HKP  key‐
1948                     servers, as they do not support retrieving keys by subkey
1949                     id.
1950
1951
1952              timeout
1953              http-proxy=value
1954              verbose
1955              debug
1956              check-cert
1957
1958              ca-cert-file
1959                     These options have no more function since GnuPG 2.1.  Use
1960                     the dirmngr configuration options instead.
1961
1962
1963       The  default list of options is: "self-sigs-only, import-clean, repair-
1964       keys, repair-pks-subkey-bug, export-attributes". However, if the actual
1965       used  source  is  an  LDAP server "no-self-sigs-only" is assumed unless
1966       "self-sigs-only" has been explictly configured.
1967
1968
1969
1970       --completes-needed n
1971              Number of completely trusted users to introduce a new key signer
1972              (defaults to 1).
1973
1974
1975       --marginals-needed n
1976              Number of marginally trusted users to introduce a new key signer
1977              (defaults to 3)
1978
1979
1980       --tofu-default-policy {auto|good|unknown|bad|ask}
1981              The default TOFU policy (defaults to auto).  For  more  informa‐
1982              tion about the meaning of this option, see: [trust-model-tofu].
1983
1984
1985       --max-cert-depth n
1986              Maximum depth of a certification chain (default is 5).
1987
1988
1989       --no-sig-cache
1990              Do not cache the verification status of key signatures.  Caching
1991              gives a much better performance in key listings. However, if you
1992              suspect that your public keyring is not safe against write modi‐
1993              fications, you can use this option to disable  the  caching.  It
1994              probably  does  not make sense to disable it because all kind of
1995              damage can be done if someone else has write access to your pub‐
1996              lic keyring.
1997
1998
1999       --auto-check-trustdb
2000       --no-auto-check-trustdb
2001              If  GnuPG  feels that its information about the Web of Trust has
2002              to be updated, it automatically runs the --check-trustdb command
2003              internally.   This  may  be a time consuming process. --no-auto-
2004              check-trustdb disables this option.
2005
2006
2007       --use-agent
2008       --no-use-agent
2009              This is dummy option. gpg always requires the agent.
2010
2011
2012       --gpg-agent-info
2013              This is dummy option. It has no effect when used with gpg.
2014
2015
2016
2017       --agent-program file
2018              Specify an agent program to be used for secret  key  operations.
2019              The  default value is determined by running gpgconf with the op‐
2020              tion --list-dirs.  Note that the pipe symbol (|) is used  for  a
2021              regression  test suite hack and may thus not be used in the file
2022              name.
2023
2024
2025       --dirmngr-program file
2026              Specify a dirmngr program to be used for keyserver access.   The
2027              default value is ‘/usr/bin/dirmngr’.
2028
2029
2030       --disable-dirmngr
2031              Entirely disable the use of the Dirmngr.
2032
2033
2034       --no-autostart
2035              Do not start the gpg-agent or the dirmngr if it has not yet been
2036              started and its service is required.  This option is mostly use‐
2037              ful on machines where the connection to gpg-agent has been redi‐
2038              rected to another machines.  If dirmngr is required on  the  re‐
2039              mote  machine, it may be started manually using gpgconf --launch
2040              dirmngr.
2041
2042
2043       --lock-once
2044              Lock the databases the first time a lock is requested and do not
2045              release the lock until the process terminates.
2046
2047
2048       --lock-multiple
2049              Release  the  locks  every  time a lock is no longer needed. Use
2050              this to override a previous --lock-once from a config file.
2051
2052
2053       --lock-never
2054              Disable locking entirely. This option should  be  used  only  in
2055              very special environments, where it can be assured that only one
2056              process is accessing those  files.  A  bootable  floppy  with  a
2057              stand-alone  encryption  system will probably use this. Improper
2058              usage of this option may lead to data and key corruption.
2059
2060
2061       --exit-on-status-write-error
2062              This option will cause write errors on the status FD to  immedi‐
2063              ately  terminate the process. That should in fact be the default
2064              but it never worked this way and thus we need an option  to  en‐
2065              able  this,  so  that  the change won't break applications which
2066              close their end of a status fd connected pipe too  early.  Using
2067              this  option  along with --enable-progress-filter may be used to
2068              cleanly cancel long running gpg operations.
2069
2070
2071       --limit-card-insert-tries n
2072              With n greater than 0 the number of prompts asking to  insert  a
2073              smartcard  gets limited to N-1. Thus with a value of 1 gpg won't
2074              at all ask to insert  a  card  if  none  has  been  inserted  at
2075              startup. This option is useful in the configuration file in case
2076              an application does not know about  the  smartcard  support  and
2077              waits ad infinitum for an inserted card.
2078
2079
2080       --no-random-seed-file
2081              GnuPG uses a file to store its internal random pool over invoca‐
2082              tions.  This makes random generation faster;  however  sometimes
2083              write  operations  are  not  desired. This option can be used to
2084              achieve that with the cost of slower random generation.
2085
2086
2087       --no-greeting
2088              Suppress the initial copyright message.
2089
2090
2091       --no-secmem-warning
2092              Suppress the warning about "using insecure memory".
2093
2094
2095       --no-permission-warning
2096              Suppress the  warning  about  unsafe  file  and  home  directory
2097              (--homedir)  permissions.  Note  that the permission checks that
2098              GnuPG performs are not intended to be authoritative, but  rather
2099              they  simply  warn  about certain common permission problems. Do
2100              not assume that the lack of a warning means that your system  is
2101              secure.
2102
2103              Note that the warning for unsafe --homedir permissions cannot be
2104              suppressed in the gpg.conf file, as this would allow an attacker
2105              to  place an unsafe gpg.conf file in place, and use this file to
2106              suppress warnings about itself. The --homedir permissions  warn‐
2107              ing may only be suppressed on the command line.
2108
2109
2110       --require-secmem
2111       --no-require-secmem
2112              Refuse  to run if GnuPG cannot get secure memory. Defaults to no
2113              (i.e. run, but give a warning).
2114
2115
2116
2117       --require-cross-certification
2118       --no-require-cross-certification
2119              When verifying a signature made from a subkey, ensure  that  the
2120              cross  certification  "back  signature" on the subkey is present
2121              and valid.  This protects against a subtle attack  against  sub‐
2122              keys  that  can sign.  Defaults to --require-cross-certification
2123              for gpg.
2124
2125
2126       --expert
2127       --no-expert
2128              Allow the user to do certain nonsensical or "silly" things  like
2129              signing an expired or revoked key, or certain potentially incom‐
2130              patible things like generating unusual key types. This also dis‐
2131              ables  certain  warning  messages about potentially incompatible
2132              actions. As the name implies, this option is for  experts  only.
2133              If you don't fully understand the implications of what it allows
2134              you to do, leave this off. --no-expert disables this option.
2135
2136
2137   Key related options
2138
2139
2140
2141
2142       --recipient name
2143       -r     Encrypt for user id name. If this option  or  --hidden-recipient
2144              is  not  specified, GnuPG asks for the user-id unless --default-
2145              recipient is given.
2146
2147
2148       --hidden-recipient name
2149       -R     Encrypt for user ID name, but hide the key  ID  of  this  user's
2150              key.  This  option helps to hide the receiver of the message and
2151              is a limited countermeasure against traffic  analysis.  If  this
2152              option  or --recipient is not specified, GnuPG asks for the user
2153              ID unless --default-recipient is given.
2154
2155
2156       --recipient-file file
2157       -f     This option is similar to --recipient except that it encrypts to
2158              a key stored in the given file.  file must be the name of a file
2159              containing exactly one key.  gpg assumes that the  key  in  this
2160              file is fully valid.
2161
2162
2163       --hidden-recipient-file file
2164       -F     This  option is similar to --hidden-recipient except that it en‐
2165              crypts to a key stored in the given file.  file must be the name
2166              of  a file containing exactly one key.  gpg assumes that the key
2167              in this file is fully valid.
2168
2169
2170       --encrypt-to name
2171              Same as --recipient but this one is intended for use in the  op‐
2172              tions file and may be used with your own user-id as an "encrypt-
2173              to-self". These keys are only used when there are other  recipi‐
2174              ents given either by use of --recipient or by the asked user id.
2175              No trust checking is performed for these user ids and even  dis‐
2176              abled keys can be used.
2177
2178
2179       --hidden-encrypt-to name
2180              Same  as  --hidden-recipient but this one is intended for use in
2181              the options file and may be used with your own user-id as a hid‐
2182              den  "encrypt-to-self".  These keys are only used when there are
2183              other recipients given either by use of --recipient  or  by  the
2184              asked  user  id.   No trust checking is performed for these user
2185              ids and even disabled keys can be used.
2186
2187
2188       --no-encrypt-to
2189              Disable the use  of  all  --encrypt-to  and  --hidden-encrypt-to
2190              keys.
2191
2192
2193       --group {name=value}
2194              Sets up a named group, which is similar to aliases in email pro‐
2195              grams.  Any time the group name is a recipient (-r or  --recipi‐
2196              ent),  it  will  be  expanded  to the values specified. Multiple
2197              groups with the same name are automatically merged into a single
2198              group.
2199
2200              The  values are key IDs or fingerprints, but any key description
2201              is accepted. Note that a value with spaces in it will be treated
2202              as  two  different  values. Note also there is only one level of
2203              expansion --- you cannot make an group that  points  to  another
2204              group.  When  used from the command line, it may be necessary to
2205              quote the argument to this option  to  prevent  the  shell  from
2206              treating it as multiple arguments.
2207
2208
2209       --ungroup name
2210              Remove a given entry from the --group list.
2211
2212
2213       --no-groups
2214              Remove all entries from the --group list.
2215
2216
2217       --local-user name
2218       -u     Use  name  as  the key to sign with. Note that this option over‐
2219              rides --default-key.
2220
2221
2222       --sender mbox
2223              This option has two purposes.  mbox must either  be  a  complete
2224              user  ID  containing  a proper mail address or just a plain mail
2225              address.  The option can be given multiple times.
2226
2227              When creating a signature this  option  tells  gpg  the  signing
2228              key's user id used to make the signature and embeds that user ID
2229              into the created signature (using OpenPGP's ``Signer's User ID''
2230              subpacket).   If  the  option is given multiple times a suitable
2231              user ID is picked.  However, if the signing  key  was  specified
2232              directly  by  using  a mail address (i.e. not by using a finger‐
2233              print or key ID) this option is used and the mail address is em‐
2234              bedded in the created signature.
2235
2236              When verifying a signature mbox is used to restrict the informa‐
2237              tion printed by the TOFU code to matching user IDs.  If the  op‐
2238              tion  is  used and the signature contains a ``Signer's User ID''
2239              subpacket that information is  is  also  used  to  restrict  the
2240              printed  information.   Note  that GnuPG considers only the mail
2241              address part of a User ID.
2242
2243              If this option or the said  subpacket  is  available  the  TRUST
2244              lines  as  printed  by option status-fd correspond to the corre‐
2245              sponding User ID; if no User ID is known  the  TRUST  lines  are
2246              computed  directly  on  the  key and do not give any information
2247              about the User ID.  In the latter case it his highly recommended
2248              to  scripts  and  other frontends to evaluate the VALIDSIG line,
2249              retrieve the key and print all User IDs along with their  valid‐
2250              ity (trust) information.
2251
2252
2253
2254       --try-secret-key name
2255              For  hidden  recipients  GPG  needs  to know the keys to use for
2256              trial decryption.  The key  set  with  --default-key  is  always
2257              tried  first, but this is often not sufficient.  This option al‐
2258              lows setting more keys to be used  for  trial  decryption.   Al‐
2259              though  any  valid user-id specification may be used for name it
2260              makes sense to use at least the long keyid to avoid ambiguities.
2261              Note that gpg-agent might pop up a pinentry for a lot keys to do
2262              the trial decryption.  If you want to stop all further trial de‐
2263              cryption  you  may use close-window button instead of the cancel
2264              button.
2265
2266
2267       --try-all-secrets
2268              Don't look at the key ID as stored in the message  but  try  all
2269              secret  keys  in turn to find the right decryption key. This op‐
2270              tion forces the behaviour as used by anonymous recipients  (cre‐
2271              ated  by  using  --throw-keyids or --hidden-recipient) and might
2272              come handy in case where an encrypted message contains  a  bogus
2273              key ID.
2274
2275
2276       --skip-hidden-recipients
2277       --no-skip-hidden-recipients
2278              During  decryption  skip  all anonymous recipients.  This option
2279              helps in the case that people use the hidden recipients  feature
2280              to  hide  their own encrypt-to key from others.  If one has many
2281              secret keys this may lead to a major annoyance because all  keys
2282              are  tried in turn to decrypt something which was not really in‐
2283              tended for it.  The drawback of this option is that it  is  cur‐
2284              rently  not  possible  to  decrypt a message which includes real
2285              anonymous recipients.
2286
2287
2288
2289   Input and Output
2290
2291
2292
2293
2294       --armor
2295       -a     Create ASCII armored output.  The default is to create  the  bi‐
2296              nary OpenPGP format.
2297
2298
2299       --no-armor
2300              Assume the input data is not in ASCII armored format.
2301
2302
2303       --output file
2304       -o file
2305              Write output to file.  To write to stdout use - as the filename.
2306
2307
2308       --max-output n
2309              This  option  sets  a  limit on the number of bytes that will be
2310              generated when processing a file. Since OpenPGP supports various
2311              levels  of  compression,  it is possible that the plaintext of a
2312              given message may be  significantly  larger  than  the  original
2313              OpenPGP  message. While GnuPG works properly with such messages,
2314              there is often a desire to set a maximum file size that will  be
2315              generated  before processing is forced to stop by the OS limits.
2316              Defaults to 0, which means "no limit".
2317
2318
2319       --chunk-size n
2320              The AEAD encryption mode encrypts the data in chunks so  that  a
2321              receiving side can check for transmission errors or tampering at
2322              the end of each chunk and does not need to delay this until  all
2323              data  has  been received.  The used chunk size is 2^n byte.  The
2324              lowest allowed value for n is 6 (64 byte) and the largest is the
2325              default of 22 which creates chunks not larger than 4 MiB.
2326
2327
2328       --input-size-hint n
2329              This  option  can be used to tell GPG the size of the input data
2330              in bytes.  n must be a positive base-10 number.  This option  is
2331              only  useful if the input is not taken from a file.  GPG may use
2332              this hint to optimize its buffer  allocation  strategy.   It  is
2333              also  used  by  the  --status-fd  line ``PROGRESS'' to provide a
2334              value for ``total'' if that is not available by other means.
2335
2336
2337       --key-origin string[,url]
2338              gpg can track the origin of a key. Certain origins  are  implic‐
2339              itly  known  (e.g. keyserver, web key directory) and set.  For a
2340              standard import the origin of the keys imported can be set  with
2341              this option.  To list the possible values use "help" for string.
2342              Some origins can store an optional url argument.  That  URL  can
2343              appended to string after a comma.
2344
2345
2346       --import-options parameters
2347              This is a space or comma delimited string that gives options for
2348              importing keys. Options can be prepended with a  `no-'  to  give
2349              the opposite meaning. The options are:
2350
2351
2352
2353              import-local-sigs
2354                     Allow importing key signatures marked as "local". This is
2355                     not generally useful unless a shared  keyring  scheme  is
2356                     being used.  Defaults to no.
2357
2358
2359              keep-ownertrust
2360                     Normally  possible  still existing ownertrust values of a
2361                     key are cleared if a key is imported.  This is in general
2362                     desirable  so  that a formerly deleted key does not auto‐
2363                     matically gain an ownertrust values merely due to import.
2364                     On  the other hand it is sometimes necessary to re-import
2365                     a trusted set of keys again but keeping already  assigned
2366                     ownertrust  values.   This  can be achieved by using this
2367                     option.
2368
2369
2370              repair-pks-subkey-bug
2371                     During import, attempt to repair the damage caused by the
2372                     PKS  keyserver  bug (pre version 0.9.6) that mangles keys
2373                     with multiple subkeys. Note that this  cannot  completely
2374                     repair the damaged key as some crucial data is removed by
2375                     the keyserver, but it does at least  give  you  back  one
2376                     subkey.  Defaults  to  no for regular --import and to yes
2377                     for keyserver --receive-keys.
2378
2379
2380              import-show
2381              show-only
2382                     Show a listing of the key as imported right before it  is
2383                     stored.   This  can be combined with the option --dry-run
2384                     to only look at keys; the option show-only is a  shortcut
2385                     for this combination.  The command --show-keys is another
2386                     shortcut for this.  Note that suffixes like '#' for "sec"
2387                     and "sbb" lines may or may not be printed.
2388
2389
2390              import-export
2391                     Run the entire import code but instead of storing the key
2392                     to the local keyring write it to the output.  The  export
2393                     option  export-dane  affect  the output.  This option can
2394                     for example be used to remove all invalid  parts  from  a
2395                     key without the need to store it.
2396
2397
2398              merge-only
2399                     During import, allow key updates to existing keys, but do
2400                     not allow any new keys to be imported. Defaults to no.
2401
2402
2403              import-clean
2404                     After import, compact (remove all signatures  except  the
2405                     self-signature)  any  user  IDs from the new key that are
2406                     not usable.  Then, remove any signatures from the new key
2407                     that  are not usable.  This includes signatures that were
2408                     issued by keys that are not present on the keyring.  This
2409                     option  is  the  same  as  running the --edit-key command
2410                     "clean" after import. Defaults to no.
2411
2412
2413              self-sigs-only
2414                     Accept only self-signatures while importing a  key.   All
2415                     other  key  signatures  are  skipped  at  an early import
2416                     stage.  This option can be used with keyserver-options to
2417                     mitigate  attempts  to  flood a key with bogus signatures
2418                     from a keyserver.  The drawback is that all  other  valid
2419                     key  signatures, as required by the Web of Trust are also
2420                     not imported.  Note that when  using  this  option  along
2421                     with  import-clean it suppresses the final clean step af‐
2422                     ter merging the imported key into the existing key.
2423
2424
2425              repair-keys
2426                     After import, fix various problems with  the  keys.   For
2427                     example,  this  reorders signatures, and strips duplicate
2428                     signatures.  Defaults to yes.
2429
2430
2431              bulk-import
2432                     When  used  the  keyboxd  (option  use-keyboxd  in  ‘com‐
2433                     mon.conf’) does the import within a single transaction.
2434
2435
2436              import-minimal
2437                     Import the smallest key possible. This removes all signa‐
2438                     tures except the most recent self-signature on each  user
2439                     ID.  This  option  is  the same as running the --edit-key
2440                     command "minimize" after import.  Defaults to no.
2441
2442
2443              restore
2444              import-restore
2445                     Import in key restore mode.  This imports all data  which
2446                     is  usually  skipped  during  import; including all GnuPG
2447                     specific data.  All other contradicting options are over‐
2448                     ridden.
2449
2450
2451       --import-filter {name=expr}
2452       --export-filter {name=expr}
2453              These  options  define an import/export filter which are applied
2454              to the  imported/exported  keyblock  right  before  it  will  be
2455              stored/written.   name  defines  the type of filter to use, expr
2456              the expression to evaluate.  The  option  can  be  used  several
2457              times which then appends more expression to the same name.
2458
2459
2460              The available filter types are:
2461
2462
2463
2464              keep-uid
2465                     This  filter will keep a user id packet and its dependent
2466                     packets in the keyblock if the  expression  evaluates  to
2467                     true.
2468
2469
2470              drop-subkey
2471                     This  filter  drops the selected subkeys.  Currently only
2472                     implemented for --export-filter.
2473
2474
2475              drop-sig
2476                     This filter drops the selected  key  signatures  on  user
2477                     ids.  Self-signatures are not considered.  Currently only
2478                     implemented for --import-filter.
2479
2480
2481       For the syntax of the expression see the chapter "FILTER  EXPRESSIONS".
2482       The property names for the expressions depend on the actual filter type
2483       and are indicated in the following table.
2484
2485       The available properties are:
2486
2487
2488
2489              uid    A string with the user id.  (keep-uid)
2490
2491
2492              mbox   The addr-spec part of a user id with mailbox or the empty
2493                     string.  (keep-uid)
2494
2495
2496              key_algo
2497                     A number with the public key algorithm of a key or subkey
2498                     packet.  (drop-subkey)
2499
2500
2501              key_created
2502              key_created_d
2503                     The first is the timestamp a public key or subkey  packet
2504                     was  created.  The second is the same but given as an ISO
2505                     string, e.g. "2016-08-17". (drop-subkey)
2506
2507
2508              fpr    The hexified fingerprint of the current subkey or primary
2509                     key.  (drop-subkey)
2510
2511
2512              primary
2513                     Boolean  indicating  whether  the  user id is the primary
2514                     one.  (keep-uid)
2515
2516
2517              expired
2518                     Boolean indicating whether a user id  (keep-uid),  a  key
2519                     (drop-subkey), or a signature (drop-sig) expired.
2520
2521
2522              revoked
2523                     Boolean  indicating whether a user id (keep-uid) or a key
2524                     (drop-subkey) has been revoked.
2525
2526
2527              disabled
2528                     Boolean indicating whether a  primary  key  is  disabled.
2529                     (not used)
2530
2531
2532              secret Boolean  indicating  whether  a key or subkey is a secret
2533                     one.  (drop-subkey)
2534
2535
2536              usage  A string indicating the usage flags for the subkey,  from
2537                     the sequence ``ecsa?''.  For example, a subkey capable of
2538                     just signing and authentication would be an  exact  match
2539                     for ``sa''. (drop-subkey)
2540
2541
2542              sig_created
2543              sig_created_d
2544                     The  first  is  the timestamp a signature packet was cre‐
2545                     ated.  The second is the same but given as  an  ISO  date
2546                     string, e.g. "2016-08-17". (drop-sig)
2547
2548
2549              sig_algo
2550                     A  number  with  the  public key algorithm of a signature
2551                     packet. (drop-sig)
2552
2553
2554              sig_digest_algo
2555                     A number with the digest algorithm of a signature packet.
2556                     (drop-sig)
2557
2558
2559
2560       --export-options parameters
2561              This is a space or comma delimited string that gives options for
2562              exporting keys.  Options can be prepended with a `no-'  to  give
2563              the opposite meaning.  The options are:
2564
2565
2566
2567              export-local-sigs
2568                     Allow exporting key signatures marked as "local". This is
2569                     not generally useful unless a shared  keyring  scheme  is
2570                     being used.  Defaults to no.
2571
2572
2573              export-attributes
2574                     Include  attribute  user IDs (photo IDs) while exporting.
2575                     Not including attribute user IDs is useful to export keys
2576                     that are going to be used by an OpenPGP program that does
2577                     not accept attribute user IDs.  Defaults to yes.
2578
2579
2580              export-sensitive-revkeys
2581                     Include designated revoker information that was marked as
2582                     "sensitive". Defaults to no.
2583
2584
2585
2586              backup
2587              export-backup
2588                     Export  for  use as a backup.  The exported data includes
2589                     all data which is needed to restore the key or keys later
2590                     with  GnuPG.   The format is basically the OpenPGP format
2591                     but enhanced with GnuPG specific data.  All other contra‐
2592                     dicting options are overridden.
2593
2594
2595              export-clean
2596                     Compact  (remove all signatures from) user IDs on the key
2597                     being exported if the user IDs are not usable.  Also,  do
2598                     not  export  any signatures that are not usable. This in‐
2599                     cludes signatures that were issued by keys that  are  not
2600                     present  on  the keyring. This option is the same as run‐
2601                     ning the --edit-key command "clean" before export  except
2602                     that  the local copy of the key is not modified. Defaults
2603                     to no.
2604
2605
2606              export-minimal
2607                     Export the smallest key possible. This removes all signa‐
2608                     tures  except the most recent self-signature on each user
2609                     ID. This option is the same  as  running  the  --edit-key
2610                     command  "minimize"  before  export except that the local
2611                     copy of the key is not modified. Defaults to no.
2612
2613
2614              export-dane
2615                     Instead of outputting the  key  material  output  OpenPGP
2616                     DANE  records  suitable  to  put into DNS zone files.  An
2617                     ORIGIN line is printed before each record  to  allow  di‐
2618                     verting the records to the corresponding zone file.
2619
2620
2621
2622       --with-colons
2623              Print  key  listings  delimited  by colons. Note that the output
2624              will be encoded in UTF-8  regardless  of  any  --display-charset
2625              setting. This format is useful when GnuPG is called from scripts
2626              and other programs as it is easily machine parsed.  The  details
2627              of  this  format are documented in the file ‘doc/DETAILS’, which
2628              is included in the GnuPG source distribution.
2629
2630
2631       --fixed-list-mode
2632              Do not merge primary user ID and  primary  key  in  --with-colon
2633              listing   mode   and  print  all  timestamps  as  seconds  since
2634              1970-01-01.  Since GnuPG 2.0.10, this mode is  always  used  and
2635              thus this option is obsolete; it does not harm to use it though.
2636
2637
2638       --legacy-list-mode
2639              Revert  to  the pre-2.1 public key list mode.  This only affects
2640              the human readable output and not the  machine  interface  (i.e.
2641              --with-colons).   Note  that  the  legacy format does not convey
2642              suitable information for elliptic curves.
2643
2644
2645       --with-fingerprint
2646              Same as the command --fingerprint but changes only the format of
2647              the output and may be used together with another command.
2648
2649
2650       --with-subkey-fingerprint
2651              If  a  fingerprint  is  printed for the primary key, this option
2652              forces printing of the fingerprint for all subkeys.  This  could
2653              also  be  achieved  by using the --with-fingerprint twice but by
2654              using this option along with keyid-format "none" a compact  fin‐
2655              gerprint is printed.
2656
2657
2658       --with-icao-spelling
2659              Print  the  ICAO  spelling of the fingerprint in addition to the
2660              hex digits.
2661
2662
2663       --with-keygrip
2664              Include the keygrip in the key listings.  In --with-colons  mode
2665              this is implicitly enable for secret keys.
2666
2667
2668       --with-key-origin
2669              Include  the locally held information on the origin and last up‐
2670              date of a key in a key listing.  In --with-colons mode  this  is
2671              always  printed.   This data is currently experimental and shall
2672              not be considered part of the stable API.
2673
2674
2675       --with-wkd-hash
2676              Print a Web Key Directory identifier along with each user ID  in
2677              key listings.  This is an experimental feature and semantics may
2678              change.
2679
2680
2681       --with-secret
2682              Include info about the presence of a secret key  in  public  key
2683              listings done with --with-colons.
2684
2685
2686   OpenPGP protocol specific options
2687
2688
2689
2690
2691       -t, --textmode
2692       --no-textmode
2693              Treat  input files as text and store them in the OpenPGP canoni‐
2694              cal text form with standard "CRLF" line endings. This also  sets
2695              the  necessary  flags to inform the recipient that the encrypted
2696              or signed data is text and may need its line  endings  converted
2697              back  to  whatever  the local system uses. This option is useful
2698              when communicating between two  platforms  that  have  different
2699              line ending conventions (UNIX-like to Mac, Mac to Windows, etc).
2700              --no-textmode disables this option, and is the default.
2701
2702
2703       --force-v3-sigs
2704       --no-force-v3-sigs
2705
2706       --force-v4-certs
2707       --no-force-v4-certs
2708              These options are obsolete and have no effect since GnuPG 2.1.
2709
2710
2711       --force-aead
2712              Force the use of AEAD encryption over MDC encryption.  AEAD is a
2713              modern  and  faster  way to do authenticated encryption than the
2714              old MDC method.  See also options --aead-algo and --chunk-size.
2715
2716
2717       --force-mdc
2718       --disable-mdc
2719              These options are obsolete and have no effect since GnuPG 2.2.8.
2720              The MDC is always used unless the keys indicate that an AEAD al‐
2721              gorithm can be used in which case AEAD is used.   But  note:  If
2722              the  creation  of  a legacy non-MDC message is exceptionally re‐
2723              quired, the option --rfc2440 allows for this.
2724
2725
2726       --disable-signer-uid
2727              By default the user ID of the signing key  is  embedded  in  the
2728              data  signature.  As of now this is only done if the signing key
2729              has been specified with local-user using a mail address, or with
2730              sender.   This information can be helpful for verifier to locate
2731              the key; see option --auto-key-retrieve.
2732
2733
2734       --include-key-block
2735       --no-include-key-block
2736              This option is used to embed the actual signing key into a  data
2737              signature.   The  embedded key is stripped down to a single user
2738              id and includes only the signing subkey used to create the  sig‐
2739              nature  as  well as as valid encryption subkeys.  All other info
2740              is removed from the key to keep it and thus the signature small.
2741              This option is the OpenPGP counterpart to the gpgsm option --in‐
2742              clude-certs and allows the recipient of a signed message to  re‐
2743              ply encrypted to the sender without using any online directories
2744              to lookup the key.  The default is --no-include-key-block.   See
2745              also the option --auto-key-import.
2746
2747
2748       --personal-cipher-preferences string
2749              Set  the list of personal cipher preferences to string.  Use gpg
2750              --version to get a list of available algorithms, and use none to
2751              set  no preference at all.  This allows the user to safely over‐
2752              ride the algorithm chosen by the recipient key  preferences,  as
2753              GPG  will only select an algorithm that is usable by all recipi‐
2754              ents.  The most highly ranked cipher in this list is  also  used
2755              for the --symmetric encryption command.
2756
2757
2758       --personal-aead-preferences string
2759              Set  the  list  of personal AEAD preferences to string.  Use gpg
2760              --version to get a list of available algorithms, and use none to
2761              set  no preference at all.  This allows the user to safely over‐
2762              ride the algorithm chosen by the recipient key  preferences,  as
2763              GPG  will only select an algorithm that is usable by all recipi‐
2764              ents.  The most highly ranked cipher in this list is  also  used
2765              for the --symmetric encryption command.
2766
2767
2768       --personal-digest-preferences string
2769              Set  the list of personal digest preferences to string.  Use gpg
2770              --version to get a list of available algorithms, and use none to
2771              set  no preference at all.  This allows the user to safely over‐
2772              ride the algorithm chosen by the recipient key  preferences,  as
2773              GPG  will only select an algorithm that is usable by all recipi‐
2774              ents.  The most highly ranked digest algorithm in this  list  is
2775              also  used when signing without encryption (e.g. --clear-sign or
2776              --sign).
2777
2778
2779       --personal-compress-preferences string
2780              Set the list of personal compression preferences to string.  Use
2781              gpg  --version  to  get  a list of available algorithms, and use
2782              none to set no preference at  all.   This  allows  the  user  to
2783              safely  override the algorithm chosen by the recipient key pref‐
2784              erences, as GPG will only select an algorithm that is usable  by
2785              all recipients.  The most highly ranked compression algorithm in
2786              this list is also used when there are no recipient keys to  con‐
2787              sider (e.g. --symmetric).
2788
2789
2790       --s2k-cipher-algo name
2791              Use name as the cipher algorithm for symmetric encryption with a
2792              passphrase if  --personal-cipher-preferences  and  --cipher-algo
2793              are not given.  The default is AES-128.
2794
2795
2796       --s2k-digest-algo name
2797              Use  name as the digest algorithm used to mangle the passphrases
2798              for symmetric encryption.  The default is SHA-1.
2799
2800
2801       --s2k-mode n
2802              Selects how passphrases for symmetric encryption are mangled. If
2803              n  is 0 a plain passphrase (which is in general not recommended)
2804              will be used, a 1 adds a salt (which should not be used) to  the
2805              passphrase  and  a  3 (the default) iterates the whole process a
2806              number of times (see --s2k-count).
2807
2808
2809       --s2k-count n
2810              Specify how many times the passphrases  mangling  for  symmetric
2811              encryption  is  repeated.  This value may range between 1024 and
2812              65011712 inclusive.  The default  is  inquired  from  gpg-agent.
2813              Note  that  not  all values in the 1024-65011712 range are legal
2814              and if an illegal value is selected, GnuPG will round up to  the
2815              nearest  legal  value.  This option is only meaningful if --s2k-
2816              mode is set to the default of 3.
2817
2818
2819
2820   Compliance options
2821
2822
2823       These options control what GnuPG is compliant to. Only one of these op‐
2824       tions may be active at a time. Note that the default setting of this is
2825       nearly always the correct one.  See  the  INTEROPERABILITY  WITH  OTHER
2826       OPENPGP PROGRAMS section below before using one of these options.
2827
2828
2829
2830       --gnupg
2831              Use  standard GnuPG behavior. This is essentially OpenPGP behav‐
2832              ior (see --openpgp), but with extension from the proposed update
2833              to  OpenPGP and with some additional workarounds for common com‐
2834              patibility problems in different versions of PGP.  This  is  the
2835              default  option,  so  it  is not generally needed, but it may be
2836              useful to override a different compliance option in the gpg.conf
2837              file.
2838
2839
2840       --openpgp
2841              Reset  all  packet,  cipher and digest options to strict OpenPGP
2842              behavior.  This option  implies  --allow-old-cipher-algos.   Use
2843              this  option  to  reset all previous options like --s2k-*, --ci‐
2844              pher-algo, --digest-algo and --compress-algo to OpenPGP  compli‐
2845              ant values. All PGP workarounds are disabled.
2846
2847
2848       --rfc4880
2849              Reset  all  packet, cipher and digest options to strict RFC-4880
2850              behavior.  This option implies  --allow-old-cipher-algos.   Note
2851              that this is currently the same thing as --openpgp.
2852
2853
2854       --rfc4880bis
2855              Reset  all packet, cipher and digest options to strict according
2856              to the proposed updates of RFC-4880.
2857
2858
2859       --rfc2440
2860              Reset all packet, cipher and digest options to  strict  RFC-2440
2861              behavior.  Note that by using this option encryption packets are
2862              created in a legacy mode without MDC protection.  This  is  dan‐
2863              gerous  and  should thus only be used for experiments.  This op‐
2864              tion implies --allow-old-cipher-algos.  See  also  option  --ig‐
2865              nore-mdc-error.
2866
2867
2868       --pgp6 This option is obsolete; it is handled as an alias for --pgp7
2869
2870
2871       --pgp7 Set  up  all  options to be as PGP 7 compliant as possible. This
2872              allowed the ciphers IDEA, 3DES,  CAST5,AES128,  AES192,  AES256,
2873              and  TWOFISH.,  the hashes MD5, SHA1 and RIPEMD160, and the com‐
2874              pression algorithms none and ZIP.  This option implies --escape-
2875              from-lines and disables --throw-keyids,
2876
2877
2878       --pgp8 Set  up  all options to be as PGP 8 compliant as possible. PGP 8
2879              is a lot closer to the OpenPGP standard than  previous  versions
2880              of PGP, so all this does is disable --throw-keyids and set --es‐
2881              cape-from-lines.  All algorithms  are  allowed  except  for  the
2882              SHA224, SHA384, and SHA512 digests.
2883
2884
2885       --compliance string
2886              This  option  can  be  used instead of one of the options above.
2887              Valid values for string are the above option names (without  the
2888              double  dash) and possibly others as shown when using "help" for
2889              value.
2890
2891
2892   Doing things one usually doesn't want to do
2893
2894
2895
2896
2897       -n
2898       --dry-run
2899              Don't make any changes (this is not completely implemented).
2900
2901
2902       --list-only
2903              Changes the behaviour of some commands. This is  like  --dry-run
2904              but  different in some cases. The semantic of this option may be
2905              extended in the future. Currently it only skips the  actual  de‐
2906              cryption  pass  and  therefore enables a fast listing of the en‐
2907              cryption keys.
2908
2909
2910       -i
2911       --interactive
2912              Prompt before overwriting any files.
2913
2914
2915       --debug-level level
2916              Select the debug level for investigating problems. level may  be
2917              a numeric value or by a keyword:
2918
2919
2920              none   No  debugging at all.  A value of less than 1 may be used
2921                     instead of the keyword.
2922
2923              basic  Some basic debug messages.  A value between 1 and  2  may
2924                     be used instead of the keyword.
2925
2926              advanced
2927                     More verbose debug messages.  A value between 3 and 5 may
2928                     be used instead of the keyword.
2929
2930              expert Even more detailed messages.  A value between 6 and 8 may
2931                     be used instead of the keyword.
2932
2933              guru   All  of  the  debug messages you can get. A value greater
2934                     than 8 may be used instead of the keyword.  The  creation
2935                     of  hash  tracing files is only enabled if the keyword is
2936                     used.
2937
2938       How these messages are mapped to the  actual  debugging  flags  is  not
2939       specified  and may change with newer releases of this program. They are
2940       however carefully selected to best aid in debugging.
2941
2942
2943       --debug flags
2944              Set debug flags.  All flags are or-ed and flags may be given  in
2945              C  syntax  (e.g.  0x0042)  or  as a comma separated list of flag
2946              names.  To get a list of all supported  flags  the  single  word
2947              "help" can be used. This option is only useful for debugging and
2948              the behavior may change at any time without notice.
2949
2950
2951       --debug-all
2952              Set all useful debugging flags.
2953
2954
2955       --debug-iolbf
2956              Set stdout into line buffered mode.  This option is only honored
2957              when given on the command line.
2958
2959
2960       --debug-set-iobuf-size n
2961              Change  the  buffer  size  of the IOBUFs to n kilobyte.  Using 0
2962              prints the current size.  Note well: This is a  maintainer  only
2963              option  and  may  thus be changed or removed at any time without
2964              notice.
2965
2966
2967       --debug-allow-large-chunks
2968              To facilitate software tests and experiments this option  allows
2969              to specify a limit of up to 4 EiB (--chunk-size 62).
2970
2971
2972       --faked-system-time epoch
2973              This  option is only useful for testing; it sets the system time
2974              back or forth to epoch which is the number  of  seconds  elapsed
2975              since the year 1970.  Alternatively epoch may be given as a full
2976              ISO time string (e.g. "20070924T154812").
2977
2978              If you suffix epoch with an exclamation  mark  (!),  the  system
2979              time will appear to be frozen at the specified time.
2980
2981
2982       --full-timestrings
2983              Change  the format of printed creation and expiration times from
2984              just the date to the date and time.  This is in general not use‐
2985              ful  and  the  same  information  is anyway available in --with-
2986              colons mode.  These longer strings are  also  not  well  aligned
2987              with other printed data.
2988
2989
2990       --enable-progress-filter
2991              Enable  certain  PROGRESS  status  outputs.  This  option allows
2992              frontends to display a progress indicator while gpg is  process‐
2993              ing  larger files.  There is a slight performance overhead using
2994              it.
2995
2996
2997       --status-fd n
2998              Write special status strings to the file descriptor n.  See  the
2999              file DETAILS in the documentation for a listing of them.
3000
3001
3002       --status-file file
3003              Same  as  --status-fd, except the status data is written to file
3004              file.
3005
3006
3007       --logger-fd n
3008              Write log output to file descriptor n and not to STDERR.
3009
3010
3011       --log-file file
3012       --logger-file file
3013              Same as --logger-fd, except the logger data is written  to  file
3014              file.  Use ‘socket://’ to log to s socket.
3015
3016
3017       --attribute-fd n
3018              Write  attribute  subpackets  to  the file descriptor n. This is
3019              most useful for use with --status-fd, since the status  messages
3020              are  needed  to  separate  out  the  various subpackets from the
3021              stream delivered to the file descriptor.
3022
3023
3024       --attribute-file file
3025              Same as --attribute-fd, except the attribute data is written  to
3026              file file.
3027
3028
3029       --comment string
3030       --no-comments
3031              Use string as a comment string in cleartext signatures and ASCII
3032              armored messages or keys (see --armor). The default behavior  is
3033              not  to use a comment string. --comment may be repeated multiple
3034              times to get multiple comment strings. --no-comments removes all
3035              comments.  It is a good idea to keep the length of a single com‐
3036              ment below 60 characters to avoid problems  with  mail  programs
3037              wrapping  such  lines.   Note that comment lines, like all other
3038              header lines, are not protected by the signature.
3039
3040
3041       --emit-version
3042       --no-emit-version
3043              Force inclusion of the version string in ASCII  armored  output.
3044              If  given once only the name of the program and the major number
3045              is emitted, given twice the minor is also emitted, given  thrice
3046              the  micro  is  added,  and given four times an operating system
3047              identification is  also  emitted.   --no-emit-version  (default)
3048              disables the version line.
3049
3050
3051       --sig-notation {name=value}
3052       --cert-notation {name=value}
3053       -N, --set-notation {name=value}
3054              Put  the  name  value  pair into the signature as notation data.
3055              name must consist only of printable characters  or  spaces,  and
3056              must  contain  a  '@' character in the form keyname@domain.exam‐
3057              ple.com (substituting the appropriate keyname and  domain  name,
3058              of  course).   This is to help prevent pollution of the IETF re‐
3059              served notation namespace. The --expert flag overrides  the  '@'
3060              check.  value may be any printable string; it will be encoded in
3061              UTF-8, so you should check that your  --display-charset  is  set
3062              correctly.  If you prefix name with an exclamation mark (!), the
3063              notation data will be flagged  as  critical  (rfc4880:5.2.3.16).
3064              --sig-notation sets a notation for data signatures. --cert-nota‐
3065              tion sets a notation for key signatures (certifications). --set-
3066              notation sets both.
3067
3068              There are special codes that may be used in notation names. "%k"
3069              will be expanded into the key ID of the key being  signed,  "%K"
3070              into the long key ID of the key being signed, "%f" into the fin‐
3071              gerprint of the key being signed, "%s" into the key  ID  of  the
3072              key  making  the signature, "%S" into the long key ID of the key
3073              making the signature, "%g" into the fingerprint of the key  mak‐
3074              ing  the signature (which might be a subkey), "%p" into the fin‐
3075              gerprint of the primary key of the  key  making  the  signature,
3076              "%c"  into  the  signature count from the OpenPGP smartcard, and
3077              "%%" results in a single "%". %k, %K, and %f are only meaningful
3078              when  making  a  key  signature  (certification), and %c is only
3079              meaningful when using the OpenPGP smartcard.
3080
3081
3082       --known-notation name
3083              Adds name to a list of known critical signature notations.   The
3084              effect  of  this  is  that  gpg will not mark a signature with a
3085              critical signature notation of that name as bad.  Note that  gpg
3086              already  knows  by default about a few critical signatures nota‐
3087              tion names.
3088
3089
3090       --sig-policy-url string
3091       --cert-policy-url string
3092       --set-policy-url string
3093              Use string as a Policy URL  for  signatures  (rfc4880:5.2.3.20).
3094              If  you  prefix  it with an exclamation mark (!), the policy URL
3095              packet will be flagged as critical. --sig-policy-url sets a pol‐
3096              icy url for data signatures. --cert-policy-url sets a policy url
3097              for key signatures (certifications). --set-policy-url sets both.
3098
3099              The same %-expandos used for notation data are available here as
3100              well.
3101
3102
3103       --sig-keyserver-url string
3104              Use  string as a preferred keyserver URL for data signatures. If
3105              you prefix it with an exclamation mark (!),  the  keyserver  URL
3106              packet will be flagged as critical.
3107
3108              The same %-expandos used for notation data are available here as
3109              well.
3110
3111
3112       --set-filename string
3113              Use string as the filename  which  is  stored  inside  messages.
3114              This  overrides the default, which is to use the actual filename
3115              of the file being encrypted.  Using the empty string for  string
3116              effectively removes the filename from the output.
3117
3118
3119       --for-your-eyes-only
3120       --no-for-your-eyes-only
3121              Set  the  `for  your eyes only' flag in the message. This causes
3122              GnuPG to refuse to save the file unless the --output  option  is
3123              given,  and PGP to use a "secure viewer" with a claimed Tempest-
3124              resistant font to display the  message.  This  option  overrides
3125              --set-filename.  --no-for-your-eyes-only disables this option.
3126
3127
3128       --use-embedded-filename
3129       --no-use-embedded-filename
3130              Try  to  create a file with a name as embedded in the data. This
3131              can be a dangerous option as it enables overwriting files.   De‐
3132              faults  to no.  Note that the option --output overrides this op‐
3133              tion.
3134
3135
3136       --cipher-algo name
3137              Use name as cipher algorithm. Running the program with the  com‐
3138              mand --version yields a list of supported algorithms. If this is
3139              not used the cipher algorithm is selected from  the  preferences
3140              stored with the key. In general, you do not want to use this op‐
3141              tion as it allows you to violate the OpenPGP standard.  The  op‐
3142              tion --personal-cipher-preferences is the safe way to accomplish
3143              the same thing.
3144
3145
3146       --aead-algo name
3147              Specify that the AEAD algorithm name is to  be  used.   This  is
3148              useful  for  symmetric  encryption  where  no key preference are
3149              available to select the AEAD algorithm.  Running gpg with option
3150              --version  shows the available AEAD algorithms.  In general, you
3151              do not want to use this option as it allows you to  violate  the
3152              OpenPGP standard.  The option --personal-aead-preferences is the
3153              safe way to accomplish the same thing.
3154
3155
3156       --digest-algo name
3157              Use name as the message digest algorithm.  Running  the  program
3158              with  the  command  --version  yields  a list of supported algo‐
3159              rithms. In general, you do not want to use this option as it al‐
3160              lows  you  to  violate  the OpenPGP standard.  The option --per‐
3161              sonal-digest-preferences is the safe way to accomplish the  same
3162              thing.
3163
3164
3165       --compress-algo name
3166              Use compression algorithm name. "zlib" is RFC-1950 ZLIB compres‐
3167              sion. "zip" is RFC-1951 ZIP compression which is  used  by  PGP.
3168              "bzip2"  is  a  more modern compression scheme that can compress
3169              some things better than zip or zlib, but at  the  cost  of  more
3170              memory used during compression and decompression. "uncompressed"
3171              or "none" disables compression. If this option is not used,  the
3172              default  behavior is to examine the recipient key preferences to
3173              see which algorithms the recipient supports. If all else  fails,
3174              ZIP is used for maximum compatibility.
3175
3176              ZLIB  may  give better compression results than ZIP, as the com‐
3177              pression window size is not limited to 8k. BZIP2 may  give  even
3178              better  compression  results  than that, but will use a signifi‐
3179              cantly larger amount of memory while compressing and decompress‐
3180              ing.  This  may  be  significant in low memory situations. Note,
3181              however, that PGP (all versions) only supports ZIP  compression.
3182              Using  any algorithm other than ZIP or "none" will make the mes‐
3183              sage unreadable with PGP. In general, you do  not  want  to  use
3184              this  option  as  it allows you to violate the OpenPGP standard.
3185              The option --personal-compress-preferences is the  safe  way  to
3186              accomplish the same thing.
3187
3188
3189       --cert-digest-algo name
3190              Use  name  as  the  message digest algorithm used when signing a
3191              key. Running the program with the  command  --version  yields  a
3192              list  of  supported  algorithms.  Be aware that if you choose an
3193              algorithm that GnuPG supports but other OpenPGP  implementations
3194              do  not,  then some users will not be able to use the key signa‐
3195              tures you make, or quite possibly your entire  key.   Note  also
3196              that  a  public key algorithm must be compatible with the speci‐
3197              fied digest algorithm; thus selecting an arbitrary digest  algo‐
3198              rithm  may  result in error messages from lower crypto layers or
3199              lead to security flaws.
3200
3201
3202
3203       --disable-cipher-algo name
3204              Never allow the use of name as cipher algorithm.  The given name
3205              will  not be checked so that a later loaded algorithm will still
3206              get disabled.
3207
3208
3209       --disable-pubkey-algo name
3210              Never allow the use of name as public key algorithm.  The  given
3211              name  will  not be checked so that a later loaded algorithm will
3212              still get disabled.
3213
3214
3215       --throw-keyids
3216       --no-throw-keyids
3217              Do not put the recipient key IDs into encrypted  messages.  This
3218              helps  to  hide  the  receivers  of the message and is a limited
3219              countermeasure against traffic analysis. ([Using a little social
3220              engineering  anyone who is able to decrypt the message can check
3221              whether one of the other recipients is the  one  he  suspects.])
3222              On  the  receiving side, it may slow down the decryption process
3223              because all available secret keys must  be  tried.   --no-throw-
3224              keyids disables this option. This option is essentially the same
3225              as using --hidden-recipient for all recipients.
3226
3227
3228       --not-dash-escaped
3229              This option changes the behavior of cleartext signatures so that
3230              they  can  be  used for patch files. You should not send such an
3231              armored file via email because all spaces and line  endings  are
3232              hashed  too.  You  can  not use this option for data which has 5
3233              dashes at the beginning of a line, patch files don't have  this.
3234              A  special  armor  header  line tells GnuPG about this cleartext
3235              signature option.
3236
3237
3238       --escape-from-lines
3239       --no-escape-from-lines
3240              Because some mailers change  lines  starting  with  "From  "  to
3241              ">From  "  it is good to handle such lines in a special way when
3242              creating cleartext signatures to prevent the  mail  system  from
3243              breaking  the  signature. Note that all other PGP versions do it
3244              this way too.  Enabled by default.  --no-escape-from-lines  dis‐
3245              ables this option.
3246
3247
3248       --passphrase-repeat n
3249              Specify  how many times gpg will request a new passphrase be re‐
3250              peated.  This is useful for helping memorize a passphrase.   De‐
3251              faults  to  1  repetition;  can  be  set  to  0  to  disable any
3252              passphrase repetition.  Note that a n greater than 1 will pop up
3253              the pinentry window n+1 times even if a modern pinentry with two
3254              entry fields is used.
3255
3256
3257       --passphrase-fd n
3258              Read the passphrase from file descriptor n. Only the first  line
3259              will  be  read  from  file descriptor n. If you use 0 for n, the
3260              passphrase will be read from STDIN. This can  only  be  used  if
3261              only one passphrase is supplied.
3262
3263              Note  that since Version 2.0 this passphrase is only used if the
3264              option --batch has  also  been  given.  Since  Version  2.1  the
3265              --pinentry-mode also needs to be set to loopback.
3266
3267
3268       --passphrase-file file
3269              Read  the passphrase from file file. Only the first line will be
3270              read from  file  file.  This  can  only  be  used  if  only  one
3271              passphrase is supplied. Obviously, a passphrase stored in a file
3272              is of questionable security if other users can read  this  file.
3273              Don't use this option if you can avoid it.
3274
3275              Note  that since Version 2.0 this passphrase is only used if the
3276              option --batch has  also  been  given.  Since  Version  2.1  the
3277              --pinentry-mode also needs to be set to loopback.
3278
3279
3280       --passphrase string
3281              Use  string as the passphrase. This can only be used if only one
3282              passphrase is supplied. Obviously, this is of very  questionable
3283              security  on  a  multi-user system. Don't use this option if you
3284              can avoid it.
3285
3286              Note that since Version 2.0 this passphrase is only used if  the
3287              option  --batch  has  also  been  given.  Since  Version 2.1 the
3288              --pinentry-mode also needs to be set to loopback.
3289
3290
3291       --pinentry-mode mode
3292              Set the pinentry mode to mode.  Allowed values for mode are:
3293
3294              default
3295                     Use the default of the agent, which is ask.
3296
3297              ask    Force the use of the Pinentry.
3298
3299              cancel Emulate use of Pinentry's cancel button.
3300
3301              error  Return a Pinentry error (``No Pinentry'').
3302
3303              loopback
3304                     Redirect Pinentry queries to the caller.   Note  that  in
3305                     contrast to Pinentry the user is not prompted again if he
3306                     enters a bad password.
3307
3308
3309       --no-symkey-cache
3310              Disable the passphrase cache used for symmetrical  en-  and  de‐
3311              cryption.   This  cache  is  based  on the message specific salt
3312              value (cf. --s2k-mode).
3313
3314
3315       --request-origin origin
3316              Tell gpg to assume that the operation ultimately  originated  at
3317              origin.   Depending  on  the origin certain restrictions are ap‐
3318              plied and the Pinentry may include an extra note on the  origin.
3319              Supported values for origin are: local which is the default, re‐
3320              mote to indicate a remote origin or browser for an operation re‐
3321              quested by a web browser.
3322
3323
3324       --command-fd n
3325              This is a replacement for the deprecated shared-memory IPC mode.
3326              If this option is enabled, user input on questions  is  not  ex‐
3327              pected  from  the  TTY  but  from  the given file descriptor. It
3328              should be used together with --status-fd. See the  file  doc/DE‐
3329              TAILS in the source distribution for details on how to use it.
3330
3331
3332       --command-file file
3333              Same  as  --command-fd, except the commands are read out of file
3334              file
3335
3336
3337       --allow-non-selfsigned-uid
3338       --no-allow-non-selfsigned-uid
3339              Allow the import and use of keys with user  IDs  which  are  not
3340              self-signed.  This is not recommended, as a non self-signed user
3341              ID is trivial to forge. --no-allow-non-selfsigned-uid disables.
3342
3343
3344       --allow-freeform-uid
3345              Disable all checks on the form of the user ID while generating a
3346              new  one.  This option should only be used in very special envi‐
3347              ronments as it does not ensure the de-facto standard  format  of
3348              user IDs.
3349
3350
3351       --ignore-time-conflict
3352              GnuPG  normally  checks that the timestamps associated with keys
3353              and signatures have plausible values. However, sometimes a  sig‐
3354              nature  seems  to  be  older than the key due to clock problems.
3355              This option makes these checks just a warning.  See  also  --ig‐
3356              nore-valid-from for timestamp issues on subkeys.
3357
3358
3359       --ignore-valid-from
3360              GnuPG  normally  does  not select and use subkeys created in the
3361              future.  This option allows the use of such keys  and  thus  ex‐
3362              hibits  the  pre-1.0.7 behaviour. You should not use this option
3363              unless there is some clock problem. See also  --ignore-time-con‐
3364              flict for timestamp issues with signatures.
3365
3366
3367       --ignore-crc-error
3368              The  ASCII  armor used by OpenPGP is protected by a CRC checksum
3369              against transmission errors. Occasionally the CRC  gets  mangled
3370              somewhere  on  the  transmission  channel but the actual content
3371              (which is protected by the OpenPGP  protocol  anyway)  is  still
3372              okay. This option allows GnuPG to ignore CRC errors.
3373
3374
3375       --ignore-mdc-error
3376              This  option  changes  a MDC integrity protection failure into a
3377              warning.  It is required to decrypt old messages which  did  not
3378              use  an  MDC.   It  may also be useful if a message is partially
3379              garbled, but it is necessary to get as much data as possible out
3380              of  that garbled message.  Be aware that a missing or failed MDC
3381              can be an indication of an attack.  Use with great caution;  see
3382              also option --rfc2440.
3383
3384
3385       --allow-old-cipher-algos
3386              Old cipher algorithms like 3DES, IDEA, or CAST5 encrypt data us‐
3387              ing blocks of 64 bits; modern algorithms use blocks of  128  bit
3388              instead.   To avoid certain attack on these old algorithms it is
3389              suggested not to encrypt more than 150  MiByte  using  the  same
3390              key.  For this reason gpg does not allow the use of 64 bit block
3391              size algorithms for encryption unless this option is specified.
3392
3393
3394       --allow-weak-digest-algos
3395              Signatures made with known-weak digest algorithms  are  normally
3396              rejected with an ``invalid digest algorithm'' message.  This op‐
3397              tion allows the verification of signatures made with  such  weak
3398              algorithms.  MD5 is the only digest algorithm considered weak by
3399              default.  See also --weak-digest to reject  other  digest  algo‐
3400              rithms.
3401
3402
3403       --weak-digest name
3404              Treat  the  specified digest algorithm as weak.  Signatures made
3405              over weak digests algorithms are normally rejected. This  option
3406              can  be supplied multiple times if multiple algorithms should be
3407              considered weak.  See also --allow-weak-digest-algos to  disable
3408              rejection  of  weak digests.  MD5 is always considered weak, and
3409              does not need to be listed explicitly.
3410
3411
3412       --allow-weak-key-signatures
3413              To avoid a minor risk of collision attacks  on  third-party  key
3414              signatures made using SHA-1, those key signatures are considered
3415              invalid.  This options allows to override this restriction.
3416
3417
3418       --no-default-keyring
3419              Do not add the default keyring to the  list  of  keyrings.  Note
3420              that  GnuPG  needs  for almost all operations a keyring. Thus if
3421              you use this option and do not provide  alternate  keyrings  via
3422              --keyring, then GnuPG will still use the default keyring.
3423
3424              Note that if the option use-keyboxd is enabled in ‘common.conf’,
3425              no keyrings are used at all and keys are all maintained  by  the
3426              keyboxd process in its own database.
3427
3428
3429       --no-keyring
3430              Do  not  use any keyring at all.  This overrides the default and
3431              all options which specify keyrings.
3432
3433
3434       --skip-verify
3435              Skip the signature verification step. This may be used  to  make
3436              the  decryption  faster  if  the  signature  verification is not
3437              needed.
3438
3439
3440       --with-key-data
3441              Print key listings delimited by colons (like --with-colons)  and
3442              print the public key data.
3443
3444
3445       --list-signatures
3446       --list-sigs
3447              Same  as  --list-keys,  but the signatures are listed too.  This
3448              command has the same effect as using  --list-keys  with  --with-
3449              sig-list.   Note  that in contrast to --check-signatures the key
3450              signatures are not verified.  This command can be used to create
3451              a  list  of signing keys missing in the local keyring; for exam‐
3452              ple:
3453
3454               gpg --list-sigs --with-colons USERID | \
3455                 awk -F: '$1=="sig" && $2=="?" {if($13){print $13}else{print $5}}'
3456
3457
3458       --fast-list-mode
3459              Changes the output of the list commands to work faster; this  is
3460              achieved  by  leaving  some parts empty. Some applications don't
3461              need the user ID and the trust information given  in  the  list‐
3462              ings.  By  using this options they can get a faster listing. The
3463              exact behaviour of this option may change  in  future  versions.
3464              If you are missing some information, don't use this option.
3465
3466
3467       --no-literal
3468              This  is  not  for normal use. Use the source to see for what it
3469              might be useful.
3470
3471
3472       --set-filesize
3473              This is not for normal use. Use the source to see  for  what  it
3474              might be useful.
3475
3476
3477       --show-session-key
3478              Display  the  session  key used for one message. See --override-
3479              session-key for the counterpart of this option.
3480
3481              We think that Key Escrow is a Bad Thing; however the user should
3482              have  the freedom to decide whether to go to prison or to reveal
3483              the content of one specific  message  without  compromising  all
3484              messages ever encrypted for one secret key.
3485
3486              You can also use this option if you receive an encrypted message
3487              which is abusive or offensive, to prove to the administrators of
3488              the messaging system that the ciphertext transmitted corresponds
3489              to an inappropriate plaintext so they can  take  action  against
3490              the offending user.
3491
3492
3493       --override-session-key string
3494       --override-session-key-fd fd
3495              Don't  use  the public key but the session key string respective
3496              the session key taken from the first line  read  from  file  de‐
3497              scriptor  fd.   The format of this string is the same as the one
3498              printed by --show-session-key. This option is normally not  used
3499              but comes handy in case someone forces you to reveal the content
3500              of an encrypted message; using this option you can do this with‐
3501              out handing out the secret key.  Note that using --override-ses‐
3502              sion-key may reveal the session key to all local users  via  the
3503              global process table.  Often it is useful to combine this option
3504              with --no-keyring.
3505
3506
3507       --ask-sig-expire
3508       --no-ask-sig-expire
3509              When making a data signature, prompt for an expiration time.  If
3510              this  option is not specified, the expiration time set via --de‐
3511              fault-sig-expire is used. --no-ask-sig-expire disables this  op‐
3512              tion.
3513
3514
3515       --default-sig-expire
3516              The  default  expiration  time  to use for signature expiration.
3517              Valid values are "0" for no expiration, a number followed by the
3518              letter  d  (for  days), w (for weeks), m (for months), or y (for
3519              years) (for example "2m"  for  two  months,  or  "5y"  for  five
3520              years),  or an absolute date in the form YYYY-MM-DD. Defaults to
3521              "0".
3522
3523
3524       --ask-cert-expire
3525       --no-ask-cert-expire
3526              When making a key signature, prompt for an expiration  time.  If
3527              this  option is not specified, the expiration time set via --de‐
3528              fault-cert-expire is used.  --no-ask-cert-expire  disables  this
3529              option.
3530
3531
3532       --default-cert-expire
3533              The default expiration time to use for key signature expiration.
3534              Valid values are "0" for no expiration, a number followed by the
3535              letter  d  (for  days), w (for weeks), m (for months), or y (for
3536              years) (for example "2m"  for  two  months,  or  "5y"  for  five
3537              years),  or an absolute date in the form YYYY-MM-DD. Defaults to
3538              "0".
3539
3540
3541       --default-new-key-algo string
3542              This option can be used to change the default algorithms for key
3543              generation.  The string is similar to the arguments required for
3544              the command --quick-add-key but slightly different.  For example
3545              the  current  default  of  "rsa2048/cert,sign+rsa2048/encr"  (or
3546              "rsa3072") can be changed to the value of what we currently call
3547              future  default, which is "ed25519/cert,sign+cv25519/encr".  You
3548              need to consult the source code to learn the details.  Note that
3549              the advanced key generation commands can always be used to spec‐
3550              ify a key algorithm directly.
3551
3552
3553       --no-auto-trust-new-key
3554              When creating a new key the ownertrust of the new key is set  to
3555              ultimate.  This option disables this and the user needs to manu‐
3556              ally assign an ownertrust value.
3557
3558
3559       --force-sign-key
3560              This option modifies the behaviour of the commands --quick-sign-
3561              key,  --quick-lsign-key,  and the "sign" sub-commands of --edit-
3562              key by forcing the creation of a key signature, even if one  al‐
3563              ready exists.
3564
3565
3566       --allow-secret-key-import
3567              This is an obsolete option and is not used anywhere.
3568
3569
3570       --allow-multiple-messages
3571
3572       --no-allow-multiple-messages
3573              These are obsolete options; they have no more effect since GnuPG
3574              2.2.8.
3575
3576
3577       --enable-special-filenames
3578              This option enables a mode in which filenames of the form ‘-&n’,
3579              where  n is a non-negative decimal number, refer to the file de‐
3580              scriptor n and not to a file with that name.
3581
3582
3583       --no-expensive-trust-checks
3584              Experimental use only.
3585
3586
3587       --preserve-permissions
3588              Don't change the permissions of a secret keyring  back  to  user
3589              read/write  only.  Use  this option only if you really know what
3590              you are doing.
3591
3592
3593       --default-preference-list string
3594              Set the list of default preferences to string.  This  preference
3595              list  is used for new keys and becomes the default for "setpref"
3596              in the --edit-key menu.
3597
3598
3599       --default-keyserver-url name
3600              Set the default keyserver URL to name. This  keyserver  will  be
3601              used as the keyserver URL when writing a new self-signature on a
3602              key, which includes key generation and changing preferences.
3603
3604
3605       --list-config
3606              Display various internal configuration parameters of GnuPG. This
3607              option is intended for external programs that call GnuPG to per‐
3608              form tasks, and is thus  not  generally  useful.  See  the  file
3609doc/DETAILS’  in  the  source  distribution  for the details of
3610              which configuration items may be listed. --list-config  is  only
3611              usable with --with-colons set.
3612
3613
3614       --list-gcrypt-config
3615              Display various internal configuration parameters of Libgcrypt.
3616
3617
3618       --gpgconf-list
3619              This command is similar to --list-config but in general only in‐
3620              ternally used by the gpgconf tool.
3621
3622
3623       --gpgconf-test
3624              This is more or less dummy action.  However it parses  the  con‐
3625              figuration  file  and  returns with failure if the configuration
3626              file would prevent gpg from startup.  Thus it may be used to run
3627              a syntax check on the configuration file.
3628
3629
3630
3631       --chuid uid
3632              Change the current user to uid which may either be a number or a
3633              name.  This can be used from the root account to run gpg for an‐
3634              other  user.   If  uid is not the current UID a standard PATH is
3635              set and the envvar GNUPGHOME is unset.  To override  the  latter
3636              the  option  --homedir can be used.  This option has only an ef‐
3637              fect when used on the command line.  This option  has  currently
3638              no effect at all on Windows.
3639
3640
3641   Deprecated options
3642
3643
3644
3645
3646       --show-photos
3647       --no-show-photos
3648              Causes   --list-keys,   --list-signatures,   --list-public-keys,
3649              --list-secret-keys, and verifying a signature  to  also  display
3650              the  photo  ID  attached  to  the key, if any. See also --photo-
3651              viewer.  These  options  are  deprecated.   Use   --list-options
3652              [no-]show-photos  and/or  --verify-options  [no-]show-photos in‐
3653              stead.
3654
3655
3656       --show-keyring
3657              Display the keyring name at the head of  key  listings  to  show
3658              which keyring a given key resides on. This option is deprecated:
3659              use --list-options [no-]show-keyring instead.
3660
3661
3662       --always-trust
3663              Identical to --trust-model always. This option is deprecated.
3664
3665
3666       --show-notation
3667       --no-show-notation
3668              Show signature notations in the  --list-signatures  or  --check-
3669              signatures listings as well as when verifying a signature with a
3670              notation in it. These options are deprecated. Use --list-options
3671              [no-]show-notation  and/or  --verify-options  [no-]show-notation
3672              instead.
3673
3674
3675       --show-policy-url
3676       --no-show-policy-url
3677              Show policy URLs in the --list-signatures or  --check-signatures
3678              listings as well as when verifying a signature with a policy URL
3679              in  it.  These  options  are  deprecated.   Use   --list-options
3680              [no-]show-policy-url  and/or  --verify-options [no-]show-policy-
3681              url instead.
3682
3683
3684

EXAMPLES

3686       gpg -se -r Bob file
3687              sign and encrypt for user Bob
3688
3689
3690       gpg --clear-sign file
3691              make a cleartext signature
3692
3693
3694       gpg -sb file
3695              make a detached signature
3696
3697
3698       gpg -u 0x12345678 -sb file
3699              make a detached signature with the key 0x12345678
3700
3701
3702       gpg --list-keys user_ID
3703              show keys
3704
3705
3706       gpg --fingerprint user_ID
3707              show fingerprint
3708
3709
3710       gpg --verify pgpfile
3711       gpg --verify sigfile [datafile]
3712              Verify the signature of the file but do not output the data  un‐
3713              less  requested.   The  second  form is used for detached signa‐
3714              tures, where sigfile is the detached signature (either ASCII ar‐
3715              mored  or  binary)  and datafile are the signed data; if this is
3716              not given, the name of the file holding the signed data is  con‐
3717              structed by cutting off the extension (".asc" or ".sig") of sig‐
3718              file or by asking the user for  the  filename.   If  the  option
3719              --output  is  also  used  the signed data is written to the file
3720              specified by that option; use - to write the signed data to std‐
3721              out.
3722

HOW TO SPECIFY A USER ID

3724       There  are  different ways to specify a user ID to GnuPG.  Some of them
3725       are only valid for gpg others are only good for gpgsm.  Here is the en‐
3726       tire list of ways to specify a key:
3727
3728
3729
3730       By key Id.
3731              This  format  is  deduced  from the length of the string and its
3732              content or 0x prefix. The key Id of an X.509 certificate are the
3733              low  64  bits  of  its SHA-1 fingerprint.  The use of key Ids is
3734              just a shortcut, for all automated  processing  the  fingerprint
3735              should be used.
3736
3737              When  using gpg an exclamation mark (!) may be appended to force
3738              using the specified primary or secondary key and not to try  and
3739              calculate which primary or secondary key to use.
3740
3741              The last four lines of the example give the key ID in their long
3742              form as internally used by the OpenPGP protocol. You can see the
3743              long key ID using the option --with-colons.
3744
3745         234567C4
3746         0F34E556E
3747         01347A56A
3748         0xAB123456
3749
3750         234AABBCC34567C4
3751         0F323456784E56EAB
3752         01AB3FED1347A5612
3753         0x234AABBCC34567C4
3754
3755
3756
3757
3758       By fingerprint.
3759              This  format  is  deduced  from the length of the string and its
3760              content or the 0x prefix.  Note, that only the 20  byte  version
3761              fingerprint  is available with gpgsm (i.e. the SHA-1 hash of the
3762              certificate).
3763
3764              When using gpg an exclamation mark (!) may be appended to  force
3765              using  the specified primary or secondary key and not to try and
3766              calculate which primary or secondary key to use.
3767
3768              The best way to specify a key Id is by  using  the  fingerprint.
3769              This  avoids  any  ambiguities in case that there are duplicated
3770              key IDs.
3771
3772         1234343434343434C434343434343434
3773         123434343434343C3434343434343734349A3434
3774         0E12343434343434343434EAB3484343434343434
3775         0xE12343434343434343434EAB3484343434343434
3776
3777
3778       gpgsm also accepts colons between each pair of hexadecimal  digits  be‐
3779       cause  this  is  the  de-facto standard on how to present X.509 finger‐
3780       prints.  gpg also allows the use of the space separated  SHA-1  finger‐
3781       print as printed by the key listing commands.
3782
3783
3784       By exact match on OpenPGP user ID.
3785              This  is denoted by a leading equal sign. It does not make sense
3786              for X.509 certificates.
3787
3788         =Heinrich Heine <heinrichh@uni-duesseldorf.de>
3789
3790
3791       By exact match on an email address.
3792              This is indicated by enclosing the email address  in  the  usual
3793              way with left and right angles.
3794
3795         <heinrichh@uni-duesseldorf.de>
3796
3797
3798
3799       By partial match on an email address.
3800              This  is  indicated  by  prefixing  the search string with an @.
3801              This uses a substring search but considers only the mail address
3802              (i.e. inside the angle brackets).
3803
3804         @heinrichh
3805
3806
3807       By exact match on the subject's DN.
3808              This  is  indicated by a leading slash, directly followed by the
3809              RFC-2253 encoded DN of the subject.  Note that you can't use the
3810              string  printed  by  gpgsm --list-keys because that one has been
3811              reordered and modified for better readability; use --with-colons
3812              to print the raw (but standard escaped) RFC-2253 string.
3813
3814         /CN=Heinrich Heine,O=Poets,L=Paris,C=FR
3815
3816
3817       By exact match on the issuer's DN.
3818              This is indicated by a leading hash mark, directly followed by a
3819              slash and then directly followed by the RFC-2253 encoded  DN  of
3820              the  issuer.   This  should  return the Root cert of the issuer.
3821              See note above.
3822
3823         #/CN=Root Cert,O=Poets,L=Paris,C=FR
3824
3825
3826
3827       By exact match on serial number and issuer's DN.
3828              This is indicated by a hash mark, followed  by  the  hexadecimal
3829              representation  of  the  serial number, then followed by a slash
3830              and the RFC-2253 encoded DN of the issuer. See note above.
3831
3832         #4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
3833
3834
3835       By keygrip.
3836              This is indicated by an ampersand followed by the 40 hex  digits
3837              of  a  keygrip.  gpgsm prints the keygrip when using the command
3838              --dump-cert.
3839
3840         &D75F22C3F86E355877348498CDC92BD21010A480
3841
3842
3843
3844       By substring match.
3845              This is the default mode but applications may want to explicitly
3846              indicate  this  by  putting the asterisk in front.  Match is not
3847              case sensitive.
3848
3849         Heine
3850         *Heine
3851
3852
3853       . and + prefixes
3854              These prefixes are reserved for looking up mails anchored at the
3855              end  and  for  a word search mode.  They are not yet implemented
3856              and using them is undefined.
3857
3858
3859              Please note that we have reused the hash mark  identifier  which
3860              was  used in old GnuPG versions to indicate the so called local-
3861              id.  It is not anymore used and there should be no conflict when
3862              used with X.509 stuff.
3863
3864              Using the RFC-2253 format of DNs has the drawback that it is not
3865              possible to map them back to the original encoding,  however  we
3866              don't  have  to do this because our key database stores this en‐
3867              coding as meta data.
3868
3869

FILTER EXPRESSIONS

3871       The options --import-filter and --export-filter  use  expressions  with
3872       this syntax (square brackets indicate an optional part and curly braces
3873       a repetition, white space between the elements are allowed):
3874
3875                  [lc] {[{flag}] PROPNAME op VALUE [lc]}
3876
3877       The name of a property (PROPNAME) may only consist of  letters,  digits
3878       and  underscores.   The description for the filter type describes which
3879       properties are defined.  If an undefined property is used it  evaluates
3880       to  the empty string.  Unless otherwise noted, the VALUE must always be
3881       given and may not be the empty string.  No quoting is defined  for  the
3882       value,  thus  the value may not contain the strings && or ||, which are
3883       used as logical connection operators.  The flag -- can be used  to  re‐
3884       move this restriction.
3885
3886       Numerical values are computed as long int; standard C notation applies.
3887       lc is the logical connection operator; either && for a  conjunction  or
3888       ||  for a disjunction.  A conjunction is assumed at the begin of an ex‐
3889       pression.  Conjunctions have higher precedence than  disjunctions.   If
3890       VALUE  starts  with  one of the characters used in any op a space after
3891       the op is required.
3892
3893
3894       The supported operators (op) are:
3895
3896
3897
3898       =~     Substring must match.
3899
3900
3901       !~     Substring must not match.
3902
3903
3904       =      The full string must match.
3905
3906
3907       <>     The full string must not match.
3908
3909
3910       ==     The numerical value must match.
3911
3912
3913       !=     The numerical value must not match.
3914
3915
3916       <=     The numerical value of the field must be LE than the value.
3917
3918
3919       <      The numerical value of the field must be LT than the value.
3920
3921
3922       >      The numerical value of the field must be GT than the value.
3923
3924
3925       >=     The numerical value of the field must be GE than the value.
3926
3927
3928       -le    The string value of the field must be less  or  equal  than  the
3929              value.
3930
3931
3932       -lt    The string value of the field must be less than the value.
3933
3934
3935       -gt    The string value of the field must be greater than the value.
3936
3937
3938       -ge    The  string value of the field must be greater or equal than the
3939              value.
3940
3941
3942       -n     True if value is not empty (no value allowed).
3943
3944
3945       -z     True if value is empty (no value allowed).
3946
3947
3948       -t     Alias for "PROPNAME != 0" (no value allowed).
3949
3950
3951       -f     Alias for "PROPNAME == 0" (no value allowed).
3952
3953
3954       Values for flag must be space separated.  The supported flags are:
3955
3956
3957       --     VALUE spans to the end of the expression.
3958
3959       -c     The string match in this part is done case-sensitive.
3960
3961       -t     Leading and trailing spaces are not removed from VALUE.  The op‐
3962              tional single space after op is here required.
3963
3964       The  filter  options concatenate several specifications for a filter of
3965       the same type.  For example the four options in this example:
3966
3967                 --import-filter keep-uid="uid =~ Alfa"
3968                 --import-filter keep-uid="&& uid !~ Test"
3969                 --import-filter keep-uid="|| uid =~ Alpha"
3970                 --import-filter keep-uid="uid !~ Test"
3971
3972
3973       which is equivalent to
3974
3975                 --import-filter \
3976                  keep-uid="uid =~ Alfa" && uid !~ Test" || uid =~ Alpha" && "uid !~ Test"
3977
3978       imports only the user ids of a key containing  the  strings  "Alfa"  or
3979       "Alpha" but not the string "test".
3980
3981

TRUST VALUES

3983       Trust  values  are used to indicate ownertrust and validity of keys and
3984       user IDs.  They are displayed with letters or strings:
3985
3986
3987
3988       -
3989       unknown
3990              No ownertrust assigned / not yet calculated.
3991
3992
3993       e
3994       expired
3995
3996              Trust calculation has failed; probably due to an expired key.
3997
3998
3999       q
4000       undefined, undef
4001              Not enough information for calculation.
4002
4003
4004       n
4005       never  Never trust this key.
4006
4007
4008       m
4009       marginal
4010              Marginally trusted.
4011
4012
4013       f
4014       full   Fully trusted.
4015
4016
4017       u
4018       ultimate
4019              Ultimately trusted.
4020
4021
4022       r
4023       revoked
4024              For validity only: the key or the user ID has been revoked.
4025
4026
4027       ?
4028       err    The program encountered an unknown trust value.
4029
4030

FILES

4032       There are a few configuration files to control certain aspects of gpg's
4033       operation.  Unless  noted, they are expected in the current home direc‐
4034       tory (see: [option --homedir]).
4035
4036
4037
4038       gpg.conf
4039              This is the standard configuration file read by gpg on  startup.
4040              It may contain any valid long option; the leading two dashes may
4041              not be entered and the option may not be abbreviated.  This  de‐
4042              fault  name may be changed on the command line (see: [gpg-option
4043              --options]).  You should backup this file.
4044
4045
4046       common.conf
4047              This is an optional configuration file read by gpg  on  startup.
4048              It  may  contain  options pertaining to all components of GnuPG.
4049              Its current main use is for the "use-keyboxd" option.
4050
4051
4052       Note that on larger installations, it is useful to put predefined files
4053       into the directory ‘/etc/skel/.gnupg’ so that newly created users start
4054       up with a working configuration.  For existing  users  a  small  helper
4055       script is provided to create these files (see: [addgnupghome]).
4056
4057       For internal purposes gpg creates and maintains a few other files; They
4058       all live in the current home directory (see: [option --homedir]).  Only
4059       the gpg program may modify these files.
4060
4061
4062
4063       ~/.gnupg
4064              This  is the default home directory which is used if neither the
4065              environment variable  GNUPGHOME  nor  the  option  --homedir  is
4066              given.
4067
4068
4069       ~/.gnupg/pubring.gpg
4070              The  public  keyring  using  a legacy format.  You should backup
4071              this file.
4072
4073              If this file is not available, gpg defaults to  the  new  keybox
4074              format and creates a file ‘pubring.kbx’ unless that file already
4075              exists in which case that file will also  be  used  for  OpenPGP
4076              keys.
4077
4078              Note  that  in the case that both files, ‘pubring.gpg’ and ‘pub‐
4079              ring.kbx’ exists but the latter has no OpenPGP keys, the  legacy
4080              file  ‘pubring.gpg’ will be used.  Take care: GnuPG versions be‐
4081              fore 2.1 will always use the file ‘pubring.gpg’ because they  do
4082              not  know about the new keybox format. In the case that you have
4083              to use GnuPG 1.4 to decrypt archived data you should  keep  this
4084              file.
4085
4086
4087       ~/.gnupg/pubring.gpg.lock
4088              The lock file for the public keyring.
4089
4090
4091       ~/.gnupg/pubring.kbx
4092              The  public  keyring  using the new keybox format.  This file is
4093              shared with gpgsm.  You should backup this file.  See above  for
4094              the relation between this file and it predecessor.
4095
4096              To  convert an existing ‘pubring.gpg’ file to the keybox format,
4097              you first  backup  the  ownertrust  values,  then  rename  ‘pub‐
4098              ring.gpg’  to  ‘publickeys.backup’, so it won’t be recognized by
4099              any GnuPG version, run import,  and  finally  restore  the  own‐
4100              ertrust values:
4101
4102         $ cd ~/.gnupg
4103         $ gpg --export-ownertrust >otrust.lst
4104         $ mv pubring.gpg publickeys.backup
4105         $ gpg --import-options restore --import publickeys.backups
4106         $ gpg --import-ownertrust otrust.lst
4107
4108
4109       ~/.gnupg/pubring.kbx.lock
4110              The lock file for ‘pubring.kbx’.
4111
4112
4113       ~/.gnupg/secring.gpg
4114              The  legacy secret keyring as used by GnuPG versions before 2.1.
4115              It is not used by GnuPG 2.1 and later.  You may want to keep  it
4116              in case you have to use GnuPG 1.4 to decrypt archived data.
4117
4118
4119       ~/.gnupg/secring.gpg.lock
4120              The lock file for the legacy secret keyring.
4121
4122
4123       ~/.gnupg/.gpg-v21-migrated
4124              File indicating that a migration to GnuPG 2.1 has been done.
4125
4126
4127       ~/.gnupg/trustdb.gpg
4128              The trust database.  There is no need to backup this file; it is
4129              better to backup the ownertrust values (see:  [option  --export-
4130              ownertrust]).
4131
4132
4133       ~/.gnupg/trustdb.gpg.lock
4134              The lock file for the trust database.
4135
4136
4137       ~/.gnupg/random_seed
4138              A file used to preserve the state of the internal random pool.
4139
4140
4141       ~/.gnupg/openpgp-revocs.d/
4142              This  is the directory where gpg stores pre-generated revocation
4143              certificates.  The file name corresponds to the OpenPGP  finger‐
4144              print  of  the  respective key.  It is suggested to backup those
4145              certificates and if the primary private key is not stored on the
4146              disk to move them to an external storage device.  Anyone who can
4147              access these files is able to revoke the corresponding key.  You
4148              may want to print them out.  You should backup all files in this
4149              directory and take care to keep this backup closed away.
4150
4151
4152       Operation is further controlled by a few environment variables:
4153
4154
4155
4156       HOME   Used to locate the default home directory.
4157
4158
4159       GNUPGHOME
4160              If set directory used instead of "~/.gnupg".
4161
4162
4163       GPG_AGENT_INFO
4164              This variable is obsolete; it was used by GnuPG versions  before
4165              2.1.
4166
4167
4168       PINENTRY_USER_DATA
4169              This value is passed via gpg-agent to pinentry.  It is useful to
4170              convey extra information to a custom pinentry.
4171
4172
4173       COLUMNS
4174       LINES  Used to size some displays to the full size of the screen.
4175
4176
4177       LANGUAGE
4178              Apart from its use by GNU, it is used  in  the  W32  version  to
4179              override  the  language selection done through the Registry.  If
4180              used and set to a valid and available  language  name  (langid),
4181              the    file    with    the    translation    is    loaded   from
4182              gpgdir/gnupg.nls/langid.mo.  Here gpgdir is the directory out of
4183              which the gpg binary has been loaded.  If it can't be loaded the
4184              Registry is tried and as last resort the native  Windows  locale
4185              system is used.
4186
4187
4188       GNUPG_BUILD_ROOT
4189              This  variable  is  only  used by the regression test suite as a
4190              helper under operating systems without proper support to  figure
4191              out the name of a process' text file.
4192
4193
4194       When  calling  the  gpg-agent  component gpg sends a set of environment
4195       variables to gpg-agent.  The names of these variables can be listed us‐
4196       ing the command:
4197
4198           gpg-connect-agent 'getinfo std_env_names' /bye | awk '$1=="D" {print $2}'
4199
4200
4201
4202
4203

BUGS

4205       On older systems this program should be installed as setuid(root). This
4206       is necessary to lock memory pages. Locking memory  pages  prevents  the
4207       operating   system   from  writing  memory  pages  (which  may  contain
4208       passphrases or other sensitive material) to disk. If you get no warning
4209       message  about  insecure  memory your operating system supports locking
4210       without being root. The program drops root privileges as soon as locked
4211       memory is allocated.
4212
4213       Note  also  that  some systems (especially laptops) have the ability to
4214       ``suspend to disk'' (also known as ``safe  sleep''  or  ``hibernate'').
4215       This  writes  all  memory to disk before going into a low power or even
4216       powered off mode.  Unless measures are taken in the operating system to
4217       protect  the  saved memory, passphrases or other sensitive material may
4218       be recoverable from it later.
4219
4220       Before you report a bug you should first search the  mailing  list  ar‐
4221       chives for similar problems and second check whether such a bug has al‐
4222       ready been reported to our bug tracker at https://bugs.gnupg.org.
4223
4224
4225

SEE ALSO

4227       gpgv(1), gpgsm(1), gpg-agent(1)
4228
4229       The full documentation for this tool is maintained as a Texinfo manual.
4230       If  GnuPG and the info program are properly installed at your site, the
4231       command
4232
4233         info gnupg
4234
4235       should give you access to the complete manual including a  menu  struc‐
4236       ture and an index.
4237
4238
4239
4240GnuPG 2.3.3                       2021-10-06                            GPG(1)
Impressum