1GPG(1)                       GNU Privacy Guard 2.3                      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|16|30 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.   The  special  level  16 uses a quality level of 1 and
580              outputs an endless stream of hex-encoded  octets.   The  special
581              level 30 outputs random as 30 zBase-32 characters.
582
583
584       --gen-prime mode bits
585              Use the source, Luke :-). The output format is subject to change
586              with ant release.
587
588
589
590       --enarmor
591       --dearmor
592              Pack or unpack an arbitrary input into/from an OpenPGP ASCII ar‐
593              mor.   This  is  a GnuPG extension to OpenPGP and in general not
594              very useful.  The --dearmor command can also be used to  dearmor
595              PEM armors.
596
597
598       --unwrap
599              This  command  is  similar to --decrypt with the change that the
600              output is not the usual plaintext but the original message  with
601              the  decryption  layer  removed.   Thus  the  output  will be an
602              OpenPGP data structure which often means a signed  OpenPGP  mes‐
603              sage.   Note  that this command may or may not remove a compres‐
604              sion layer which is often found beneath the encryption layer.
605
606
607       --tofu-policy {auto|good|unknown|bad|ask} keys
608              Set the TOFU policy for all the  bindings  associated  with  the
609              specified  keys.   For more information about the meaning of the
610              policies, see: [trust-model-tofu].  The keys  may  be  specified
611              either by their fingerprint (preferred) or their keyid.
612
613
614
615   How to manage your keys
616
617
618       This section explains the main commands for key management.
619
620
621
622       --quick-generate-key user-id [algo [usage [expire]]]
623       --quick-gen-key
624              This  is  a  simple  command to generate a standard key with one
625              user id.  In contrast to --generate-key the key is generated di‐
626              rectly  without  the  need to answer a bunch of prompts.  Unless
627              the option --yes is given, the key creation will be canceled  if
628              the given user id already exists in the keyring.
629
630              If  invoked  directly on the console without any special options
631              an answer to a ``Continue?'' style confirmation  prompt  is  re‐
632              quired.   In  case  the  user id already exists in the keyring a
633              second prompt to force the creation of the key will show up.
634
635              If algo or usage are given, only the primary key is created  and
636              no  prompts  are shown.  To specify an expiration date but still
637              create a primary and  subkey  use  ``default''  or  ``future-de‐
638              fault''  for  algo and ``default'' for usage.  For a description
639              of these optional arguments  see  the  command  --quick-add-key.
640              The  usage  accepts also the value ``cert'' which can be used to
641              create a certification only primary key; the  default  is  to  a
642              create certification and signing key.
643
644              The  expire  argument  can be used to specify an expiration date
645              for the key.  Several formats are supported;  commonly  the  ISO
646              formats ``YYYY-MM-DD'' or ``YYYYMMDDThhmmss'' are used.  To make
647              the key expire in N seconds, N days, N weeks,  N  months,  or  N
648              years  use  ``seconds=N'', ``Nd'', ``Nw'', ``Nm'', or ``Ny'' re‐
649              spectively.  Not specifying a value, or using ``-'' results in a
650              key  expiring  in  a  reasonable  default  interval.  The values
651              ``never'', ``none'' can be used for no expiration date.
652
653              If this command is used with --batch, --pinentry-mode  has  been
654              set   to   loopback,   and   one   of   the  passphrase  options
655              (--passphrase, --passphrase-fd, or --passphrase-file)  is  used,
656              the  supplied  passphrase  is used for the new key and the agent
657              does not ask for it.  To create a  key  without  any  protection
658              --passphrase '' may be used.
659
660              To  create  an  OpenPGP  key from the keys available on the cur‐
661              rently inserted smartcard, the special string  ``card''  can  be
662              used for algo.  If the card features an encryption and a signing
663              key, gpg will figure them out and creates an  OpenPGP  key  con‐
664              sisting  of  the  usual  primary key and one subkey.  This works
665              only with certain smartcards.  Note that the interactive --full-
666              gen-key command allows to do the same but with greater flexibil‐
667              ity in the selection of the smartcard keys.
668
669              Note that it is possible to create a primary key  and  a  subkey
670              using  non-default  algorithms by using ``default'' and changing
671              the default parameters using the option --default-new-key-algo.
672
673
674       --quick-set-expire fpr expire [*|subfprs]
675              With two arguments given, directly set the  expiration  time  of
676              the  primary key identified by fpr to expire.  To remove the ex‐
677              piration time 0 can be used.  With three arguments and the third
678              given as an asterisk, the expiration time of all non-revoked and
679              not yet expired subkeys are set to expire.  With more  than  two
680              arguments and a list of fingerprints given for subfprs, all non-
681              revoked subkeys matching these fingerprints are set to expire.
682
683
684
685       --quick-add-key fpr [algo [usage [expire]]]
686              Directly add a subkey to the key identified by  the  fingerprint
687              fpr.   Without  the  optional  arguments an encryption subkey is
688              added.  If any of the arguments are given a more specific subkey
689              is added.
690
691              algo may be any of the supported algorithms or curve names given
692              in the format as used by key listings.  To use the default algo‐
693              rithm  the  string  ``default'' or ``-'' can be used.  Supported
694              algorithms   are   ``rsa'',   ``dsa'',   ``elg'',   ``ed25519'',
695              ``cv25519'',  and  other  ECC  curves.   For  example the string
696              ``rsa'' adds an RSA key with the default key  length;  a  string
697              ``rsa4096''  requests  that  the  key  length is 4096 bits.  The
698              string ``future-default'' is an alias for  the  algorithm  which
699              will  likely  be used as default algorithm in future versions of
700              gpg.  To list the supported ECC curves the command  gpg  --with-
701              colons --list-config curve can be used.
702
703              Depending  on the given algo the subkey may either be an encryp‐
704              tion subkey or a signing subkey.  If an algorithm is capable  of
705              signing  and  encryption  and  such a subkey is desired, a usage
706              string must be given.  This  string  is  either  ``default''  or
707              ``-''  to  keep  the default or a comma delimited list (or space
708              delimited list) of keywords:  ``sign''  for  a  signing  subkey,
709              ``auth''  for  an authentication subkey, and ``encr'' for an en‐
710              cryption subkey (``encrypt'' can be used as alias for ``encr'').
711              The valid combinations depend on the algorithm.
712
713              The  expire  argument  can be used to specify an expiration date
714              for the key.  Several formats are supported;  commonly  the  ISO
715              formats ``YYYY-MM-DD'' or ``YYYYMMDDThhmmss'' are used.  To make
716              the key expire in N seconds, N days, N weeks,  N  months,  or  N
717              years  use  ``seconds=N'', ``Nd'', ``Nw'', ``Nm'', or ``Ny'' re‐
718              spectively.  Not specifying a value, or using ``-'' results in a
719              key  expiring  in  a  reasonable  default  interval.  The values
720              ``never'', ``none'' can be used for no expiration date.
721
722
723       --generate-key
724       --gen-key
725              Generate a new key pair using the  current  default  parameters.
726              This  is  the standard command to create a new key.  In addition
727              to the key a revocation certificate is created and stored in the
728openpgp-revocs.d’ directory below the GnuPG home directory.
729
730
731       --full-generate-key
732       --full-gen-key
733              Generate  a  new key pair with dialogs for all options.  This is
734              an extended version of --generate-key.
735
736              There is also a feature which allows you to create keys in batch
737              mode.  See  the  manual section ``Unattended key generation'' on
738              how to use this.
739
740
741
742       --generate-revocation name
743       --gen-revoke name
744              Generate a revocation certificate for the complete key.  To only
745              revoke a subkey or a key signature, use the --edit command.
746
747              This  command  merely creates the revocation certificate so that
748              it can be used to revoke the key if that is ever needed.  To ac‐
749              tually  revoke a key the created revocation certificate needs to
750              be merged with the key to revoke.  This is done by importing the
751              revocation certificate using the --import command.  Then the re‐
752              voked key needs to be published, which is best done  by  sending
753              the  key  to  a  keyserver (command --send-key) and by exporting
754              (--export) it to a file which is then send to frequent  communi‐
755              cation partners.
756
757
758
759       --generate-designated-revocation name
760       --desig-revoke name
761              Generate a designated revocation certificate for a key. This al‐
762              lows a user (with the permission of  the  keyholder)  to  revoke
763              someone else's key.
764
765
766
767       --edit-key
768              Present  a  menu which enables you to do most of the key manage‐
769              ment related tasks.  It expects the specification of  a  key  on
770              the command line.
771
772
773
774              uid n  Toggle  selection of user ID or photographic user ID with
775                     index n.  Use * to select all and 0 to deselect all.
776
777
778              key n  Toggle selection of subkey with index n or key ID n.  Use
779                     * to select all and 0 to deselect all.
780
781
782              sign   Make  a  signature on key of user name. If the key is not
783                     yet signed by the default user (or the users  given  with
784                     -u),  the  program  displays  the  information of the key
785                     again, together with its fingerprint and asks whether  it
786                     should be signed. This question is repeated for all users
787                     specified with -u.
788
789
790              lsign  Same as "sign" but the signature  is  marked  as  non-ex‐
791                     portable and will therefore never be used by others. This
792                     may be used to make keys valid only in the local environ‐
793                     ment.
794
795
796              nrsign Same as "sign" but the signature is marked as non-revoca‐
797                     ble and can therefore never be revoked.
798
799
800              tsign  Make a trust signature. This is a signature that combines
801                     the  notions of certification (like a regular signature),
802                     and trust (like the "trust"  command).  It  is  generally
803                     only  useful in distinct communities or groups.  For more
804                     information please read the sections ``Trust  Signature''
805                     and ``Regular Expression'' in RFC-4880.
806
807              Note  that "l" (for local / non-exportable), "nr" (for non-revo‐
808              cable, and "t" (for trust) may be freely mixed and  prefixed  to
809              "sign" to create a signature of any type desired.
810
811       If  the  option  --only-sign-text-ids  is  specified, then any non-text
812       based user ids (e.g., photo IDs) will not be selected for signing.
813
814
815
816              delsig Delete a signature. Note that it is not possible  to  re‐
817                     tract  a  signature,  once it has been send to the public
818                     (i.e. to a keyserver).   In  that  case  you  better  use
819                     revsig.
820
821
822              revsig Revoke  a  signature.  For every signature which has been
823                     generated by one of the secret keys, GnuPG asks whether a
824                     revocation certificate should be generated.
825
826
827              check  Check  the signatures on all selected user IDs.  With the
828                     extra option selfsig only self-signatures are shown.
829
830
831              adduid Create an additional user ID.
832
833
834              addphoto
835                     Create a photographic user ID. This  will  prompt  for  a
836                     JPEG  file  that  will be embedded into the user ID. Note
837                     that a very large JPEG will make for a  very  large  key.
838                     Also  note  that some programs will display your JPEG un‐
839                     changed (GnuPG), and some programs will scale it  to  fit
840                     in a dialog box (PGP).
841
842
843              showphoto
844                     Display the selected photographic user ID.
845
846
847              deluid Delete  a  user ID or photographic user ID.  Note that it
848                     is not possible to retract a user id, once  it  has  been
849                     send  to  the public (i.e. to a keyserver).  In that case
850                     you better use revuid.
851
852
853              revuid Revoke a user ID or photographic user ID.
854
855
856              primary
857                     Flag the current user id as the primary one, removes  the
858                     primary user id flag from all other user ids and sets the
859                     timestamp of  all  affected  self-signatures  one  second
860                     ahead. Note that setting a photo user ID as primary makes
861                     it primary over other photo user IDs, and setting a regu‐
862                     lar  user ID as primary makes it primary over other regu‐
863                     lar user IDs.
864
865
866              keyserver
867                     Set a preferred keyserver for the specified  user  ID(s).
868                     This allows other users to know where you prefer they get
869                     your key from. See  --keyserver-options  honor-keyserver-
870                     url  for  more  on  how  this  works.  Setting a value of
871                     "none" removes an existing preferred keyserver.
872
873
874              notation
875                     Set a name=value notation for the specified  user  ID(s).
876                     See --cert-notation for more on how this works. Setting a
877                     value of "none" removes all notations, setting a notation
878                     prefixed with a minus sign (-) removes that notation, and
879                     setting a notation name  (without  the  =value)  prefixed
880                     with a minus sign removes all notations with that name.
881
882
883              pref   List  preferences  from  the selected user ID. This shows
884                     the actual preferences,  without  including  any  implied
885                     preferences.
886
887
888              showpref
889                     More  verbose  preferences  listing for the selected user
890                     ID. This shows the preferences in effect by including the
891                     implied preferences of 3DES (cipher), SHA-1 (digest), and
892                     Uncompressed (compression) if they are  not  already  in‐
893                     cluded in the preference list. In addition, the preferred
894                     keyserver and signature notations (if any) are shown.
895
896
897              setpref string
898                     Set the list of user ID preferences to string for all (or
899                     just  the selected) user IDs. Calling setpref with no ar‐
900                     guments sets the preference list to the  default  (either
901                     built-in or set via --default-preference-list), and call‐
902                     ing setpref with "none" as the  argument  sets  an  empty
903                     preference  list.  Use  gpg  --version  to  get a list of
904                     available algorithms. Note that while you can change  the
905                     preferences  on  an  attribute  user ID (aka "photo ID"),
906                     GnuPG does not select keys  via  attribute  user  IDs  so
907                     these  preferences  will not be used by GnuPG.  Note that
908                     an unattended version of this  command  is  available  as
909                     --quick-update-pref.
910
911                     When  setting preferences, you should list the algorithms
912                     in the order which you'd like to see them used by someone
913                     else when encrypting a message to your key.  If you don't
914                     include 3DES, it will be automatically added at the  end.
915                     Note that there are many factors that go into choosing an
916                     algorithm (for example, your key may not be the only  re‐
917                     cipient),  and  so  the  remote OpenPGP application being
918                     used to send to you may or may not follow your exact cho‐
919                     sen  order  for  a given message.  It will, however, only
920                     choose an algorithm that is  present  on  the  preference
921                     list of every recipient key.  See also the INTEROPERABIL‐
922                     ITY WITH OTHER OPENPGP PROGRAMS section below.
923
924
925              addkey Add a subkey to this key.
926
927
928              addcardkey
929                     Generate a subkey on a card and add it to this key.
930
931
932              keytocard
933                     Transfer the selected secret subkey (or the  primary  key
934                     if  no  subkey has been selected) to a smartcard. The se‐
935                     cret key in the keyring will be replaced by a stub if the
936                     key  could be stored successfully on the card and you use
937                     the save command later. Only certain  key  types  may  be
938                     transferred  to the card. A sub menu allows you to select
939                     on what card to store the key. Note that it is not possi‐
940                     ble to get that key back from the card - if the card gets
941                     broken your secret key will be lost  unless  you  have  a
942                     backup somewhere.
943
944
945              bkuptocard file
946                     Restore  the  given  file  to a card. This command may be
947                     used to restore a backup key (as  generated  during  card
948                     initialization)  to  a new card. In almost all cases this
949                     will be the encryption key. You should use  this  command
950                     only with the corresponding public key and make sure that
951                     the file given as argument is indeed the  backup  to  re‐
952                     store.  You should then select 2 to restore as encryption
953                     key.  You will first be asked to enter the passphrase  of
954                     the backup key and then for the Admin PIN of the card.
955
956
957              keytotpm
958                     Transfer  the  selected secret subkey (or the primary key
959                     if no subkey has been selected) to TPM form.  The  secret
960                     key  in the keyring will be replaced by the TPM represen‐
961                     tation of that key, which can only be read by the partic‐
962                     ular  TPM  that  created  it  (so the keyfile now becomes
963                     locked to the laptop containing the TPM).   Only  certain
964                     key types may be transferred to the TPM (all TPM 2.0 sys‐
965                     tems are mandated to have the rsa2048 and nistp256  algo‐
966                     rithms  but  newer TPMs may have more). Note that the key
967                     itself is not transferred into the TPM, merely  encrypted
968                     by  the  TPM  in-place, so if the keyfile is deleted, the
969                     key will be lost.  Once transferred  to  TPM  representa‐
970                     tion, the key file can never be converted back to non-TPM
971                     form and the key will die  when  the  TPM  does,  so  you
972                     should  first  have a backup on secure offline storage of
973                     the actual secret key file before conversion.  It is  es‐
974                     sential  to  use the physical system TPM that you have rw
975                     permission   on   the   TPM   resource   manager   device
976                     (/dev/tpmrm0).   Usually  this means you must be a member
977                     of the tss group.
978
979
980              delkey Remove a subkey (secondary key). Note that it is not pos‐
981                     sible  to  retract a subkey, once it has been send to the
982                     public (i.e. to a keyserver).  In that  case  you  better
983                     use  revkey.  Also note that this only deletes the public
984                     part of a key.
985
986
987              revkey Revoke a subkey.
988
989
990              expire Change the key or subkey expiration time. If a subkey  is
991                     selected,  the  expiration  time  of  this subkey will be
992                     changed. With no selection, the  key  expiration  of  the
993                     primary key is changed.
994
995
996              trust  Change  the  owner  trust value for the key. This updates
997                     the trust-db immediately and no save is required.
998
999
1000              disable
1001              enable Disable or enable an entire key. A disabled key  can  not
1002                     normally be used for encryption.
1003
1004
1005              addrevoker
1006                     Add  a  designated revoker to the key. This takes one op‐
1007                     tional argument: "sensitive". If a designated revoker  is
1008                     marked  as  sensitive, it will not be exported by default
1009                     (see export-options).
1010
1011
1012              passwd Change the passphrase of the secret key.
1013
1014
1015              toggle This is dummy command which exists only for backward com‐
1016                     patibility.
1017
1018
1019              clean  Compact  (by  removing all signatures except the selfsig)
1020                     any user ID that is no longer usable  (e.g.  revoked,  or
1021                     expired). Then, remove any signatures that are not usable
1022                     by the trust calculations.   Specifically,  this  removes
1023                     any  signature that does not validate, any signature that
1024                     is superseded by a later signature,  revoked  signatures,
1025                     and signatures issued by keys that are not present on the
1026                     keyring.
1027
1028
1029              minimize
1030                     Make the key as small as possible. This removes all  sig‐
1031                     natures  from  each  user  ID  except for the most recent
1032                     self-signature.
1033
1034
1035              change-usage
1036                     Change the usage flags (capabilities) of the primary  key
1037                     or  of  subkeys.   These usage flags (e.g. Certify, Sign,
1038                     Authenticate,  Encrypt)  are  set  during  key  creation.
1039                     Sometimes  it is useful to have the opportunity to change
1040                     them (for example to add Authenticate)  after  they  have
1041                     been  created.  Please take care when doing this; the al‐
1042                     lowed usage flags depend on the key algorithm.
1043
1044
1045              cross-certify
1046                     Add cross-certification  signatures  to  signing  subkeys
1047                     that  may  not  currently  have them. Cross-certification
1048                     signatures protect against a subtle attack against  sign‐
1049                     ing  subkeys. See --require-cross-certification.  All new
1050                     keys generated have this signature by  default,  so  this
1051                     command is only useful to bring older keys up to date.
1052
1053
1054              save   Save all changes to the keyring and quit.
1055
1056
1057              quit   Quit the program without updating the keyring.
1058
1059              The  listing  shows  you the key with its secondary keys and all
1060              user IDs.  The primary user ID is indicated by a  dot,  and  se‐
1061              lected keys or user IDs are indicated by an asterisk.  The trust
1062              value is displayed with the primary key: "trust" is the assigned
1063              owner  trust  and  "validity"  is the calculated validity of the
1064              key.  Validity values are also displayed for all user IDs.   For
1065              possible values of trust, see: [trust-values].
1066
1067
1068       --sign-key name
1069              Signs a public key with your secret key. This is a shortcut ver‐
1070              sion of the subcommand "sign" from --edit-key.
1071
1072
1073       --lsign-key name
1074              Signs a public key with your secret key but marks it as  non-ex‐
1075              portable.  This  is a shortcut version of the subcommand "lsign"
1076              from --edit-key.
1077
1078
1079       --quick-sign-key fpr [names]
1080       --quick-lsign-key fpr [names]
1081              Directly sign a key from the passphrase without any further user
1082              interaction.   The  fpr must be the verified primary fingerprint
1083              of a key in the local keyring. If no names are given, all useful
1084              user  ids  are  signed;  with given [names] only useful user ids
1085              matching one of these names are signed.  By  default,  or  if  a
1086              name  is prefixed with a '*', a case insensitive substring match
1087              is used.  If a name is prefixed with a '=' a case sensitive  ex‐
1088              act match is done.
1089
1090              The  command  --quick-lsign-key  marks the signatures as non-ex‐
1091              portable.  If such a non-exportable signature already exists the
1092              --quick-sign-key  turns  it into a exportable signature.  If you
1093              need to update an existing signature,  for  example  to  add  or
1094              change  notation  data, you need to use the option --force-sign-
1095              key.
1096
1097              This command uses reasonable defaults and thus does not  provide
1098              the  full  flexibility of the "sign" subcommand from --edit-key.
1099              Its intended use is to help unattended key signing by  utilizing
1100              a list of verified fingerprints.
1101
1102
1103       --quick-add-uid user-id new-user-id
1104              This command adds a new user id to an existing key.  In contrast
1105              to the interactive sub-command adduid  of  --edit-key  the  new-
1106              user-id  is  added verbatim with only leading and trailing white
1107              space removed, it is expected to be UTF-8 encoded, and no checks
1108              on its form are applied.
1109
1110
1111       --quick-revoke-uid user-id user-id-to-revoke
1112              This command revokes a user ID on an existing key.  It cannot be
1113              used to revoke the last user ID on key (some non-revoked user ID
1114              must  remain),  with  revocation  reason  ``User ID is no longer
1115              valid''.  If you want to specify a different revocation  reason,
1116              or  to  supply supplementary revocation text, you should use the
1117              interactive sub-command revuid of --edit-key.
1118
1119
1120       --quick-revoke-sig fpr signing-fpr [names]
1121              This command revokes the key signatures made by signing-fpr from
1122              the key specified by the fingerprint fpr.  With names given only
1123              the signatures on user ids of the key matching any of the  given
1124              names  are affected (see --quick-sign-key).  If a revocation al‐
1125              ready exists a notice is printed instead of creating a new revo‐
1126              cation; no error is returned in this case.  Note that key signa‐
1127              ture revocations may be superseded by a newer key signature  and
1128              in turn again revoked.
1129
1130
1131       --quick-set-primary-uid user-id primary-user-id
1132              This  command sets or updates the primary user ID flag on an ex‐
1133              isting key.  user-id specifies the key and  primary-user-id  the
1134              user ID which shall be flagged as the primary user ID.  The pri‐
1135              mary user ID flag is removed from all other  user  ids  and  the
1136              timestamp  of  all  affected  self-signatures  is set one second
1137              ahead.
1138
1139
1140       --quick-update-pref user-id
1141              This command updates the preference list of the key to the  cur‐
1142              rent default value (either built-in or set via --default-prefer‐
1143              ence-list).  This is the unattended version of  of  using  "set‐
1144              pref"  in  the --key-edit menu without giving a list.  Note that
1145              you can show the preferences in a key listing by  using  --list-
1146              options  show-pref  or  --list-options  show-pref-verbose.   You
1147              should also re-distribute updated keys to your peers.
1148
1149
1150       --change-passphrase user-id
1151       --passwd user-id
1152              Change the passphrase of the secret key belonging  to  the  cer‐
1153              tificate  specified as user-id.  This is a shortcut for the sub-
1154              command passwd of the --edit-key menu.  When using together with
1155              the   option   --dry-run  this  will  not  actually  change  the
1156              passphrase but check that the current passphrase is correct.
1157
1158

OPTIONS

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

EXAMPLES

3795       gpg -se -r Bob file
3796              sign and encrypt for user Bob
3797
3798
3799       gpg --clear-sign file
3800              make a cleartext signature
3801
3802
3803       gpg -sb file
3804              make a detached signature
3805
3806
3807       gpg -u 0x12345678 -sb file
3808              make a detached signature with the key 0x12345678
3809
3810
3811       gpg --list-keys user_ID
3812              show keys
3813
3814
3815       gpg --fingerprint user_ID
3816              show fingerprint
3817
3818
3819       gpg --verify pgpfile
3820       gpg --verify sigfile [datafile]
3821              Verify  the signature of the file but do not output the data un‐
3822              less requested.  The second form is  used  for  detached  signa‐
3823              tures, where sigfile is the detached signature (either ASCII ar‐
3824              mored or binary) and datafile are the signed data;  if  this  is
3825              not  given, the name of the file holding the signed data is con‐
3826              structed by cutting off the extension (".asc" or ".sig") of sig‐
3827              file  or  by  asking  the  user for the filename.  If the option
3828              --output is also used the signed data is  written  to  the  file
3829              specified by that option; use - to write the signed data to std‐
3830              out.
3831

HOW TO SPECIFY A USER ID

3833       There are different ways to specify a user ID to GnuPG.  Some  of  them
3834       are only valid for gpg others are only good for gpgsm.  Here is the en‐
3835       tire list of ways to specify a key:
3836
3837
3838
3839       By key Id.
3840              This format is deduced from the length of  the  string  and  its
3841              content or 0x prefix. The key Id of an X.509 certificate are the
3842              low 64 bits of its SHA-1 fingerprint.  The use  of  key  Ids  is
3843              just  a  shortcut,  for all automated processing the fingerprint
3844              should be used.
3845
3846              When using gpg an exclamation mark (!) may be appended to  force
3847              using  the specified primary or secondary key and not to try and
3848              calculate which primary or secondary key to use.
3849
3850              The last four lines of the example give the key ID in their long
3851              form as internally used by the OpenPGP protocol. You can see the
3852              long key ID using the option --with-colons.
3853
3854         234567C4
3855         0F34E556E
3856         01347A56A
3857         0xAB123456
3858
3859         234AABBCC34567C4
3860         0F323456784E56EAB
3861         01AB3FED1347A5612
3862         0x234AABBCC34567C4
3863
3864
3865
3866
3867       By fingerprint.
3868              This format is deduced from the length of  the  string  and  its
3869              content  or  the 0x prefix.  Note, that only the 20 byte version
3870              fingerprint is available with gpgsm (i.e. the SHA-1 hash of  the
3871              certificate).
3872
3873              When  using gpg an exclamation mark (!) may be appended to force
3874              using the specified primary or secondary key and not to try  and
3875              calculate which primary or secondary key to use.
3876
3877              The  best  way  to specify a key Id is by using the fingerprint.
3878              This avoids any ambiguities in case that  there  are  duplicated
3879              key IDs.
3880
3881         1234343434343434C434343434343434
3882         123434343434343C3434343434343734349A3434
3883         0E12343434343434343434EAB3484343434343434
3884         0xE12343434343434343434EAB3484343434343434
3885
3886
3887       gpgsm  also  accepts colons between each pair of hexadecimal digits be‐
3888       cause this is the de-facto standard on how  to  present  X.509  finger‐
3889       prints.   gpg  also allows the use of the space separated SHA-1 finger‐
3890       print as printed by the key listing commands.
3891
3892
3893       By exact match on OpenPGP user ID.
3894              This is denoted by a leading equal sign. It does not make  sense
3895              for X.509 certificates.
3896
3897         =Heinrich Heine <heinrichh@uni-duesseldorf.de>
3898
3899
3900       By exact match on an email address.
3901              This  is  indicated  by enclosing the email address in the usual
3902              way with left and right angles.
3903
3904         <heinrichh@uni-duesseldorf.de>
3905
3906
3907
3908       By partial match on an email address.
3909              This is indicated by prefixing the  search  string  with  an  @.
3910              This uses a substring search but considers only the mail address
3911              (i.e. inside the angle brackets).
3912
3913         @heinrichh
3914
3915
3916       By exact match on the subject's DN.
3917              This is indicated by a leading slash, directly followed  by  the
3918              RFC-2253 encoded DN of the subject.  Note that you can't use the
3919              string printed by gpgsm --list-keys because that  one  has  been
3920              reordered and modified for better readability; use --with-colons
3921              to print the raw (but standard escaped) RFC-2253 string.
3922
3923         /CN=Heinrich Heine,O=Poets,L=Paris,C=FR
3924
3925
3926       By exact match on the issuer's DN.
3927              This is indicated by a leading hash mark, directly followed by a
3928              slash  and  then directly followed by the RFC-2253 encoded DN of
3929              the issuer.  This should return the Root  cert  of  the  issuer.
3930              See note above.
3931
3932         #/CN=Root Cert,O=Poets,L=Paris,C=FR
3933
3934
3935
3936       By exact match on serial number and issuer's DN.
3937              This  is  indicated  by a hash mark, followed by the hexadecimal
3938              representation of the serial number, then followed  by  a  slash
3939              and the RFC-2253 encoded DN of the issuer. See note above.
3940
3941         #4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
3942
3943
3944       By keygrip.
3945              This  is indicated by an ampersand followed by the 40 hex digits
3946              of a keygrip.  gpgsm prints the keygrip when using  the  command
3947              --dump-cert.
3948
3949         &D75F22C3F86E355877348498CDC92BD21010A480
3950
3951
3952
3953       By substring match.
3954              This is the default mode but applications may want to explicitly
3955              indicate this by putting the asterisk in front.   Match  is  not
3956              case sensitive.
3957
3958         Heine
3959         *Heine
3960
3961
3962       . and + prefixes
3963              These prefixes are reserved for looking up mails anchored at the
3964              end and for a word search mode.  They are  not  yet  implemented
3965              and using them is undefined.
3966
3967
3968              Please  note  that we have reused the hash mark identifier which
3969              was used in old GnuPG versions to indicate the so called  local-
3970              id.  It is not anymore used and there should be no conflict when
3971              used with X.509 stuff.
3972
3973              Using the RFC-2253 format of DNs has the drawback that it is not
3974              possible  to  map them back to the original encoding, however we
3975              don't have to do this because our key database stores  this  en‐
3976              coding as meta data.
3977
3978

FILTER EXPRESSIONS

3980       The  options  --import-filter  and --export-filter use expressions with
3981       this syntax (square brackets indicate an optional part and curly braces
3982       a repetition, white space between the elements are allowed):
3983
3984                  [lc] {[{flag}] PROPNAME op VALUE [lc]}
3985
3986       The  name  of a property (PROPNAME) may only consist of letters, digits
3987       and underscores.  The description for the filter type  describes  which
3988       properties  are defined.  If an undefined property is used it evaluates
3989       to the empty string.  Unless otherwise noted, the VALUE must always  be
3990       given  and  may not be the empty string.  No quoting is defined for the
3991       value, thus the value may not contain the strings && or ||,  which  are
3992       used  as  logical connection operators.  The flag -- can be used to re‐
3993       move this restriction.
3994
3995       Numerical values are computed as long int; standard C notation applies.
3996       lc  is  the logical connection operator; either && for a conjunction or
3997       || for a disjunction.  A conjunction is assumed at the begin of an  ex‐
3998       pression.   Conjunctions  have higher precedence than disjunctions.  If
3999       VALUE starts with one of the characters used in any op  a  space  after
4000       the op is required.
4001
4002
4003       The supported operators (op) are:
4004
4005
4006
4007       =~     Substring must match.
4008
4009
4010       !~     Substring must not match.
4011
4012
4013       =      The full string must match.
4014
4015
4016       <>     The full string must not match.
4017
4018
4019       ==     The numerical value must match.
4020
4021
4022       !=     The numerical value must not match.
4023
4024
4025       <=     The numerical value of the field must be LE than the value.
4026
4027
4028       <      The numerical value of the field must be LT than the value.
4029
4030
4031       >      The numerical value of the field must be GT than the value.
4032
4033
4034       >=     The numerical value of the field must be GE than the value.
4035
4036
4037       -le    The  string  value  of  the field must be less or equal than the
4038              value.
4039
4040
4041       -lt    The string value of the field must be less than the value.
4042
4043
4044       -gt    The string value of the field must be greater than the value.
4045
4046
4047       -ge    The string value of the field must be greater or equal than  the
4048              value.
4049
4050
4051       -n     True if value is not empty (no value allowed).
4052
4053
4054       -z     True if value is empty (no value allowed).
4055
4056
4057       -t     Alias for "PROPNAME != 0" (no value allowed).
4058
4059
4060       -f     Alias for "PROPNAME == 0" (no value allowed).
4061
4062
4063       Values for flag must be space separated.  The supported flags are:
4064
4065
4066       --     VALUE spans to the end of the expression.
4067
4068       -c     The string match in this part is done case-sensitive.
4069
4070       -t     Leading and trailing spaces are not removed from VALUE.  The op‐
4071              tional single space after op is here required.
4072
4073       The filter options concatenate several specifications for a  filter  of
4074       the same type.  For example the four options in this example:
4075
4076                 --import-filter keep-uid="uid =~ Alfa"
4077                 --import-filter keep-uid="&& uid !~ Test"
4078                 --import-filter keep-uid="|| uid =~ Alpha"
4079                 --import-filter keep-uid="uid !~ Test"
4080
4081
4082       which is equivalent to
4083
4084                 --import-filter \
4085                  keep-uid="uid =~ Alfa" && uid !~ Test" || uid =~ Alpha" && "uid !~ Test"
4086
4087       imports  only  the  user  ids of a key containing the strings "Alfa" or
4088       "Alpha" but not the string "test".
4089
4090

TRUST VALUES

4092       Trust values are used to indicate ownertrust and validity of  keys  and
4093       user IDs.  They are displayed with letters or strings:
4094
4095
4096
4097       -
4098       unknown
4099              No ownertrust assigned / not yet calculated.
4100
4101
4102       e
4103       expired
4104
4105              Trust calculation has failed; probably due to an expired key.
4106
4107
4108       q
4109       undefined, undef
4110              Not enough information for calculation.
4111
4112
4113       n
4114       never  Never trust this key.
4115
4116
4117       m
4118       marginal
4119              Marginally trusted.
4120
4121
4122       f
4123       full   Fully trusted.
4124
4125
4126       u
4127       ultimate
4128              Ultimately trusted.
4129
4130
4131       r
4132       revoked
4133              For validity only: the key or the user ID has been revoked.
4134
4135
4136       ?
4137       err    The program encountered an unknown trust value.
4138
4139

FILES

4141       There are a few configuration files to control certain aspects of gpg's
4142       operation. Unless noted, they are expected in the current  home  direc‐
4143       tory (see: [option --homedir]).
4144
4145
4146
4147       gpg.conf
4148              This  is the standard configuration file read by gpg on startup.
4149              It may contain any valid long option; the leading two dashes may
4150              not  be entered and the option may not be abbreviated.  This de‐
4151              fault name may be changed on the command line (see:  [gpg-option
4152              --options]).  You should backup this file.
4153
4154
4155       common.conf
4156              This  is  an optional configuration file read by gpg on startup.
4157              It may contain options pertaining to all  components  of  GnuPG.
4158              Its current main use is for the "use-keyboxd" option.
4159
4160
4161       Note that on larger installations, it is useful to put predefined files
4162       into the directory ‘/etc/skel/.gnupg’ so that newly created users start
4163       up  with  a  working  configuration.  For existing users a small helper
4164       script is provided to create these files (see: [addgnupghome]).
4165
4166       For internal purposes gpg creates and maintains a few other files; They
4167       all live in the current home directory (see: [option --homedir]).  Only
4168       the gpg program may modify these files.
4169
4170
4171
4172       ~/.gnupg
4173              This is the default home directory which is used if neither  the
4174              environment  variable  GNUPGHOME  nor  the  option  --homedir is
4175              given.
4176
4177
4178       ~/.gnupg/pubring.gpg
4179              The public keyring using a legacy  format.   You  should  backup
4180              this file.
4181
4182              If  this  file  is not available, gpg defaults to the new keybox
4183              format and creates a file ‘pubring.kbx’ unless that file already
4184              exists  in  which  case  that file will also be used for OpenPGP
4185              keys.
4186
4187              Note that in the case that both files, ‘pubring.gpg’  and  ‘pub‐
4188              ring.kbx’  exists but the latter has no OpenPGP keys, the legacy
4189              file ‘pubring.gpg’ will be used.  Take care: GnuPG versions  be‐
4190              fore  2.1 will always use the file ‘pubring.gpg’ because they do
4191              not know about the new keybox format. In the case that you  have
4192              to  use  GnuPG 1.4 to decrypt archived data you should keep this
4193              file.
4194
4195
4196       ~/.gnupg/pubring.gpg.lock
4197              The lock file for the public keyring.
4198
4199
4200       ~/.gnupg/pubring.kbx
4201              The public keyring using the new keybox format.   This  file  is
4202              shared  with gpgsm.  You should backup this file.  See above for
4203              the relation between this file and it predecessor.
4204
4205              To convert an existing ‘pubring.gpg’ file to the keybox  format,
4206              you  first  backup  the  ownertrust  values,  then  rename ‘pub‐
4207              ring.gpg’ to ‘publickeys.backup’, so it won’t be  recognized  by
4208              any  GnuPG  version,  run  import,  and finally restore the own‐
4209              ertrust values:
4210
4211         $ cd ~/.gnupg
4212         $ gpg --export-ownertrust >otrust.lst
4213         $ mv pubring.gpg publickeys.backup
4214         $ gpg --import-options restore --import publickeys.backup
4215         $ gpg --import-ownertrust otrust.lst
4216
4217
4218       ~/.gnupg/pubring.kbx.lock
4219              The lock file for ‘pubring.kbx’.
4220
4221
4222       ~/.gnupg/secring.gpg
4223              The legacy secret keyring as used by GnuPG versions before  2.1.
4224              It  is not used by GnuPG 2.1 and later.  You may want to keep it
4225              in case you have to use GnuPG 1.4 to decrypt archived data.
4226
4227
4228       ~/.gnupg/secring.gpg.lock
4229              The lock file for the legacy secret keyring.
4230
4231
4232       ~/.gnupg/.gpg-v21-migrated
4233              File indicating that a migration to GnuPG 2.1 has been done.
4234
4235
4236       ~/.gnupg/trustdb.gpg
4237              The trust database.  There is no need to backup this file; it is
4238              better  to  backup the ownertrust values (see: [option --export-
4239              ownertrust]).
4240
4241
4242       ~/.gnupg/trustdb.gpg.lock
4243              The lock file for the trust database.
4244
4245
4246       ~/.gnupg/random_seed
4247              A file used to preserve the state of the internal random pool.
4248
4249
4250       ~/.gnupg/openpgp-revocs.d/
4251              This is the directory where gpg stores pre-generated  revocation
4252              certificates.   The file name corresponds to the OpenPGP finger‐
4253              print of the respective key.  It is suggested  to  backup  those
4254              certificates and if the primary private key is not stored on the
4255              disk to move them to an external storage device.  Anyone who can
4256              access these files is able to revoke the corresponding key.  You
4257              may want to print them out.  You should backup all files in this
4258              directory and take care to keep this backup closed away.
4259
4260
4261       Operation is further controlled by a few environment variables:
4262
4263
4264
4265       HOME   Used to locate the default home directory.
4266
4267
4268       GNUPGHOME
4269              If set directory used instead of "~/.gnupg".
4270
4271
4272       GPG_AGENT_INFO
4273              This  variable is obsolete; it was used by GnuPG versions before
4274              2.1.
4275
4276
4277       PINENTRY_USER_DATA
4278              This value is passed via gpg-agent to pinentry.  It is useful to
4279              convey extra information to a custom pinentry.
4280
4281
4282       COLUMNS
4283       LINES  Used to size some displays to the full size of the screen.
4284
4285
4286       LANGUAGE
4287              Apart  from  its  use  by  GNU, it is used in the W32 version to
4288              override the language selection done through the  Registry.   If
4289              used  and  set  to a valid and available language name (langid),
4290              the   file    with    the    translation    is    loaded    from
4291              gpgdir/gnupg.nls/langid.mo.  Here gpgdir is the directory out of
4292              which the gpg binary has been loaded.  If it can't be loaded the
4293              Registry  is  tried and as last resort the native Windows locale
4294              system is used.
4295
4296
4297       GNUPG_BUILD_ROOT
4298              This variable is only used by the regression  test  suite  as  a
4299              helper  under operating systems without proper support to figure
4300              out the name of a process' text file.
4301
4302
4303       GNUPG_EXEC_DEBUG_FLAGS
4304              This variable allows to enable diagnostics for  process  manage‐
4305              ment.   A numeric decimal value is expected.  Bit 0 enables gen‐
4306              eral diagnostics, bit 1 enables certain warnings on Windows.
4307
4308
4309       When calling the gpg-agent component gpg sends  a  set  of  environment
4310       variables to gpg-agent.  The names of these variables can be listed us‐
4311       ing the command:
4312
4313           gpg-connect-agent 'getinfo std_env_names' /bye | awk '$1=="D" {print $2}'
4314
4315
4316
4317
4318

BUGS

4320       On older systems this program should be installed as setuid(root). This
4321       is  necessary  to  lock memory pages. Locking memory pages prevents the
4322       operating  system  from  writing  memory  pages  (which   may   contain
4323       passphrases or other sensitive material) to disk. If you get no warning
4324       message about insecure memory your operating  system  supports  locking
4325       without being root. The program drops root privileges as soon as locked
4326       memory is allocated.
4327
4328       Note also that some systems (especially laptops) have  the  ability  to
4329       ``suspend  to  disk''  (also known as ``safe sleep'' or ``hibernate'').
4330       This writes all memory to disk before going into a low  power  or  even
4331       powered off mode.  Unless measures are taken in the operating system to
4332       protect the saved memory, passphrases or other sensitive  material  may
4333       be recoverable from it later.
4334
4335       Before  you  report  a bug you should first search the mailing list ar‐
4336       chives for similar problems and second check whether such a bug has al‐
4337       ready been reported to our bug tracker at https://bugs.gnupg.org.
4338
4339
4340

SEE ALSO

4342       gpgv(1), gpgsm(1), gpg-agent(1)
4343
4344       The full documentation for this tool is maintained as a Texinfo manual.
4345       If GnuPG and the info program are properly installed at your site,  the
4346       command
4347
4348         info gnupg
4349
4350       should  give  you access to the complete manual including a menu struc‐
4351       ture and an index.
4352
4353
4354
4355GnuPG 2.4.0                       2022-12-16                            GPG(1)
Impressum