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

NAME

6       gpg2 - OpenPGP encryption and signing tool
7

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

36       The program returns 0 if everything was fine, 1 if at least a signature
37       was bad, and other error codes for fatal errors.
38
39

WARNINGS

41       Use  a *good* password for your user account and a *good* passphrase to
42       protect your secret key. This passphrase is the  weakest  part  of  the
43       whole  system. Programs to do dictionary attacks on your secret keyring
44       are very easy to write and  so  you  should  protect  your  "~/.gnupg/"
45       directory very well.
46
47       Keep  in mind that, if this program is used over a network (telnet), it
48       is *very* easy to spy out your passphrase!
49
50       If you are going to verify detached signatures, make sure that the pro‐
51       gram  knows about it; either give both filenames on the command line or
52       use '-' to specify STDIN.
53
54       For scripted or other unattended use  of  gpg  make  sure  to  use  the
55       machine-parseable  interface  and  not  the  default interface which is
56       intended for direct use by  humans.   The  machine-parseable  interface
57       provides  a stable and well documented API independent of the locale or
58       future changes of gpg.   To  enable  this  interface  use  the  options
59       --with-colons  and  --status-fd.   For  certain  operations  the option
60       --command-fd may come handy too.   See  this  man  page  and  the  file
61DETAILS’  for the specification of the interface.  Note that the GnuPG
62       ``info'' pages as well as the PDF version of the GnuPG manual  features
63       a  chapter  on  unattended use of GnuPG.  As an alternative the library
64       GPGME can be used as a high-level abstraction on top of that interface.
65
66

INTEROPERABILITY

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

COMMANDS

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

OPTIONS

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

EXAMPLES

3411       gpg -se -r Bob file
3412              sign and encrypt for user Bob
3413
3414
3415       gpg --clear-sign file
3416              make a cleartext signature
3417
3418
3419       gpg -sb file
3420              make a detached signature
3421
3422
3423       gpg -u 0x12345678 -sb file
3424              make a detached signature with the key 0x12345678
3425
3426
3427       gpg --list-keys user_ID
3428              show keys
3429
3430
3431       gpg --fingerprint user_ID
3432              show fingerprint
3433
3434
3435       gpg --verify pgpfile
3436       gpg --verify sigfile [datafile]
3437              Verify the signature of the file but  do  not  output  the  data
3438              unless  requested.   The second form is used for detached signa‐
3439              tures, where sigfile is the  detached  signature  (either  ASCII
3440              armored  or binary) and datafile are the signed data; if this is
3441              not given, the name of the file holding the signed data is  con‐
3442              structed by cutting off the extension (".asc" or ".sig") of sig‐
3443              file or by asking the user for  the  filename.   If  the  option
3444              --output  is  also  used  the signed data is written to the file
3445              specified by that option; use - to write the signed data to std‐
3446              out.
3447

HOW TO SPECIFY A USER ID

3449       There  are  different ways to specify a user ID to GnuPG.  Some of them
3450       are only valid for gpg others are only good for  gpgsm.   Here  is  the
3451       entire list of ways to specify a key:
3452
3453
3454
3455       By key Id.
3456              This  format  is  deduced  from the length of the string and its
3457              content or 0x prefix. The key Id of an X.509 certificate are the
3458              low  64  bits  of  its SHA-1 fingerprint.  The use of key Ids is
3459              just a shortcut, for all automated  processing  the  fingerprint
3460              should be used.
3461
3462              When  using gpg an exclamation mark (!) may be appended to force
3463              using the specified primary or secondary key and not to try  and
3464              calculate which primary or secondary key to use.
3465
3466              The last four lines of the example give the key ID in their long
3467              form as internally used by the OpenPGP protocol. You can see the
3468              long key ID using the option --with-colons.
3469
3470         234567C4
3471         0F34E556E
3472         01347A56A
3473         0xAB123456
3474
3475         234AABBCC34567C4
3476         0F323456784E56EAB
3477         01AB3FED1347A5612
3478         0x234AABBCC34567C4
3479
3480
3481
3482
3483       By fingerprint.
3484              This  format  is  deduced  from the length of the string and its
3485              content or the 0x prefix.  Note, that only the 20  byte  version
3486              fingerprint  is available with gpgsm (i.e. the SHA-1 hash of the
3487              certificate).
3488
3489              When using gpg an exclamation mark (!) may be appended to  force
3490              using  the specified primary or secondary key and not to try and
3491              calculate which primary or secondary key to use.
3492
3493              The best way to specify a key Id is by  using  the  fingerprint.
3494              This  avoids  any  ambiguities in case that there are duplicated
3495              key IDs.
3496
3497         1234343434343434C434343434343434
3498         123434343434343C3434343434343734349A3434
3499         0E12343434343434343434EAB3484343434343434
3500         0xE12343434343434343434EAB3484343434343434
3501
3502
3503       gpgsm also accepts colons  between  each  pair  of  hexadecimal  digits
3504       because  this  is the de-facto standard on how to present X.509 finger‐
3505       prints.  gpg also allows the use of the space separated  SHA-1  finger‐
3506       print as printed by the key listing commands.
3507
3508
3509       By exact match on OpenPGP user ID.
3510              This  is denoted by a leading equal sign. It does not make sense
3511              for X.509 certificates.
3512
3513         =Heinrich Heine <heinrichh@uni-duesseldorf.de>
3514
3515
3516       By exact match on an email address.
3517              This is indicated by enclosing the email address  in  the  usual
3518              way with left and right angles.
3519
3520         <heinrichh@uni-duesseldorf.de>
3521
3522
3523
3524       By partial match on an email address.
3525              This  is  indicated  by  prefixing  the search string with an @.
3526              This uses a substring search but considers only the mail address
3527              (i.e. inside the angle brackets).
3528
3529         @heinrichh
3530
3531
3532       By exact match on the subject's DN.
3533              This  is  indicated by a leading slash, directly followed by the
3534              RFC-2253 encoded DN of the subject.  Note that you can't use the
3535              string  printed  by  gpgsm --list-keys because that one has been
3536              reordered and modified for better readability; use --with-colons
3537              to print the raw (but standard escaped) RFC-2253 string.
3538
3539         /CN=Heinrich Heine,O=Poets,L=Paris,C=FR
3540
3541
3542       By exact match on the issuer's DN.
3543              This is indicated by a leading hash mark, directly followed by a
3544              slash and then directly followed by the RFC-2253 encoded  DN  of
3545              the  issuer.   This  should  return the Root cert of the issuer.
3546              See note above.
3547
3548         #/CN=Root Cert,O=Poets,L=Paris,C=FR
3549
3550
3551
3552       By exact match on serial number and issuer's DN.
3553              This is indicated by a hash mark, followed  by  the  hexadecimal
3554              representation  of  the  serial number, then followed by a slash
3555              and the RFC-2253 encoded DN of the issuer. See note above.
3556
3557         #4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
3558
3559
3560       By keygrip.
3561              This is indicated by an ampersand followed by the 40 hex  digits
3562              of  a  keygrip.  gpgsm prints the keygrip when using the command
3563              --dump-cert.
3564
3565         &D75F22C3F86E355877348498CDC92BD21010A480
3566
3567
3568
3569       By substring match.
3570              This is the default mode but applications may want to explicitly
3571              indicate  this  by  putting the asterisk in front.  Match is not
3572              case sensitive.
3573
3574         Heine
3575         *Heine
3576
3577
3578       . and + prefixes
3579              These prefixes are reserved for looking up mails anchored at the
3580              end  and  for  a word search mode.  They are not yet implemented
3581              and using them is undefined.
3582
3583
3584              Please note that we have reused the hash mark  identifier  which
3585              was  used in old GnuPG versions to indicate the so called local-
3586              id.  It is not anymore used and there should be no conflict when
3587              used with X.509 stuff.
3588
3589              Using the RFC-2253 format of DNs has the drawback that it is not
3590              possible to map them back to the original encoding,  however  we
3591              don't  have  to  do  this  because  our key database stores this
3592              encoding as meta data.
3593
3594

FILTER EXPRESSIONS

3596       The options --import-filter and --export-filter  use  expressions  with
3597       this syntax (square brackets indicate an optional part and curly braces
3598       a repetition, white space between the elements are allowed):
3599
3600                  [lc] {[{flag}] PROPNAME op VALUE [lc]}
3601
3602       The name of a property (PROPNAME) may only consist of  letters,  digits
3603       and  underscores.   The description for the filter type describes which
3604       properties are defined.  If an undefined property is used it  evaluates
3605       to  the empty string.  Unless otherwise noted, the VALUE must always be
3606       given and may not be the empty string.  No quoting is defined  for  the
3607       value,  thus  the value may not contain the strings && or ||, which are
3608       used as logical connection operators.  The  flag  --  can  be  used  to
3609       remove this restriction.
3610
3611       Numerical values are computed as long int; standard C notation applies.
3612       lc is the logical connection operator; either && for a  conjunction  or
3613       ||  for  a  disjunction.   A  conjunction is assumed at the begin of an
3614       expression.  Conjunctions have higher precedence than disjunctions.  If
3615       VALUE  starts  with  one of the characters used in any op a space after
3616       the op is required.
3617
3618
3619       The supported operators (op) are:
3620
3621
3622
3623       =~     Substring must match.
3624
3625
3626       !~     Substring must not match.
3627
3628
3629       =      The full string must match.
3630
3631
3632       <>     The full string must not match.
3633
3634
3635       ==     The numerical value must match.
3636
3637
3638       !=     The numerical value must not match.
3639
3640
3641       <=     The numerical value of the field must be LE than the value.
3642
3643
3644       <      The numerical value of the field must be LT than the value.
3645
3646
3647       >      The numerical value of the field must be GT than the value.
3648
3649
3650       >=     The numerical value of the field must be GE than the value.
3651
3652
3653       -le    The string value of the field must be less  or  equal  than  the
3654              value.
3655
3656
3657       -lt    The string value of the field must be less than the value.
3658
3659
3660       -gt    The string value of the field must be greater than the value.
3661
3662
3663       -ge    The  string value of the field must be greater or equal than the
3664              value.
3665
3666
3667       -n     True if value is not empty (no value allowed).
3668
3669
3670       -z     True if value is empty (no value allowed).
3671
3672
3673       -t     Alias for "PROPNAME != 0" (no value allowed).
3674
3675
3676       -f     Alias for "PROPNAME == 0" (no value allowed).
3677
3678
3679       Values for flag must be space separated.  The supported flags are:
3680
3681
3682       --     VALUE spans to the end of the expression.
3683
3684       -c     The string match in this part is done case-sensitive.
3685
3686       The filter options concatenate several specifications for a  filter  of
3687       the same type.  For example the four options in this example:
3688
3689                 --import-option keep-uid="uid =~ Alfa"
3690                 --import-option keep-uid="&& uid !~ Test"
3691                 --import-option keep-uid="|| uid =~ Alpha"
3692                 --import-option keep-uid="uid !~ Test"
3693
3694
3695       which is equivalent to
3696
3697                 --import-option \
3698                  keep-uid="uid =~ Alfa" && uid !~ Test" || uid =~ Alpha" && "uid !~ Test"
3699
3700       imports  only  the  user  ids of a key containing the strings "Alfa" or
3701       "Alpha" but not the string "test".
3702
3703

TRUST VALUES

3705       Trust values are used to indicate ownertrust and validity of  keys  and
3706       user IDs.  They are displayed with letters or strings:
3707
3708
3709
3710       -
3711       unknown
3712              No ownertrust assigned / not yet calculated.
3713
3714
3715       e
3716       expired
3717
3718              Trust calculation has failed; probably due to an expired key.
3719
3720
3721       q
3722       undefined, undef
3723              Not enough information for calculation.
3724
3725
3726       n
3727       never  Never trust this key.
3728
3729
3730       m
3731       marginal
3732              Marginally trusted.
3733
3734
3735       f
3736       full   Fully trusted.
3737
3738
3739       u
3740       ultimate
3741              Ultimately trusted.
3742
3743
3744       r
3745       revoked
3746              For validity only: the key or the user ID has been revoked.
3747
3748
3749       ?
3750       err    The program encountered an unknown trust value.
3751
3752

FILES

3754       There  are  a  few  configuration  files  to control certain aspects of
3755       gpg2's operation. Unless noted, they are expected in the  current  home
3756       directory (see: [option --homedir]).
3757
3758
3759
3760       gpg.conf
3761              This is the standard configuration file read by gpg2 on startup.
3762              It may contain any valid long option; the leading two dashes may
3763              not  be  entered  and  the  option may not be abbreviated.  This
3764              default name may be changed on  the  command  line  (see:  [gpg-
3765              option --options]).  You should backup this file.
3766
3767
3768       Note that on larger installations, it is useful to put predefined files
3769       into the directory ‘/etc/skel/.gnupg’ so that newly created users start
3770       up  with  a  working  configuration.  For existing users a small helper
3771       script is provided to create these files (see: [addgnupghome]).
3772
3773       For internal purposes gpg2 creates and maintains  a  few  other  files;
3774       They  all live in the current home directory (see: [option --homedir]).
3775       Only the gpg2 program may modify these files.
3776
3777
3778
3779       ~/.gnupg
3780              This is the default home directory which is used if neither  the
3781              environment  variable  GNUPGHOME  nor  the  option  --homedir is
3782              given.
3783
3784
3785       ~/.gnupg/pubring.gpg
3786              The public keyring.  You should backup this file.
3787
3788
3789       ~/.gnupg/pubring.gpg.lock
3790              The lock file for the public keyring.
3791
3792
3793       ~/.gnupg/pubring.kbx
3794              The public keyring using  a  different  format.   This  file  is
3795              shared with gpgsm.  You should backup this file.
3796
3797
3798       ~/.gnupg/pubring.kbx.lock
3799              The lock file for ‘pubring.kbx’.
3800
3801
3802       ~/.gnupg/secring.gpg
3803              A  secret  keyring  as used by GnuPG versions before 2.1.  It is
3804              not used by GnuPG 2.1 and later.
3805
3806
3807       ~/.gnupg/secring.gpg.lock
3808              The lock file for the secret keyring.
3809
3810
3811       ~/.gnupg/.gpg-v21-migrated
3812              File indicating that a migration to GnuPG 2.1 has been done.
3813
3814
3815       ~/.gnupg/trustdb.gpg
3816              The trust database.  There is no need to backup this file; it is
3817              better  to  backup the ownertrust values (see: [option --export-
3818              ownertrust]).
3819
3820
3821       ~/.gnupg/trustdb.gpg.lock
3822              The lock file for the trust database.
3823
3824
3825       ~/.gnupg/random_seed
3826              A file used to preserve the state of the internal random pool.
3827
3828
3829       ~/.gnupg/openpgp-revocs.d/
3830              This is the directory where gpg stores pre-generated  revocation
3831              certificates.   The file name corresponds to the OpenPGP finger‐
3832              print of the respective key.  It is suggested  to  backup  those
3833              certificates and if the primary private key is not stored on the
3834              disk to move them to an external storage device.  Anyone who can
3835              access  theses  files  is  able to revoke the corresponding key.
3836              You may want to print them out.  You should backup all files  in
3837              this directory and take care to keep this backup closed away.
3838
3839
3840       Operation is further controlled by a few environment variables:
3841
3842
3843
3844       HOME   Used to locate the default home directory.
3845
3846
3847       GNUPGHOME
3848              If set directory used instead of "~/.gnupg".
3849
3850
3851       GPG_AGENT_INFO
3852              This  variable is obsolete; it was used by GnuPG versions before
3853              2.1.
3854
3855
3856       PINENTRY_USER_DATA
3857              This value is passed via gpg-agent to pinentry.  It is useful to
3858              convey extra information to a custom pinentry.
3859
3860
3861       COLUMNS
3862       LINES  Used to size some displays to the full size of the screen.
3863
3864
3865       LANGUAGE
3866              Apart  from  its  use  by  GNU, it is used in the W32 version to
3867              override the language selection done through the  Registry.   If
3868              used  and  set  to a valid and available language name (langid),
3869              the   file    with    the    translation    is    loaded    from
3870              gpgdir/gnupg.nls/langid.mo.  Here gpgdir is the directory out of
3871              which the gpg binary has been loaded.  If it can't be loaded the
3872              Registry  is  tried and as last resort the native Windows locale
3873              system is used.
3874
3875
3876       When calling the gpg-agent component gpg2 sends a  set  of  environment
3877       variables  to  gpg-agent.   The  names of these variables can be listed
3878       using the command:
3879
3880           gpg-connect-agent 'getinfo std_env_names' /bye | awk '$1=="D" {print $2}'
3881
3882
3883
3884
3885

BUGS

3887       On older systems this program should be installed as setuid(root). This
3888       is  necessary  to  lock memory pages. Locking memory pages prevents the
3889       operating  system  from  writing  memory  pages  (which   may   contain
3890       passphrases or other sensitive material) to disk. If you get no warning
3891       message about insecure memory your operating  system  supports  locking
3892       without being root. The program drops root privileges as soon as locked
3893       memory is allocated.
3894
3895       Note also that some systems (especially laptops) have  the  ability  to
3896       ``suspend  to  disk''  (also known as ``safe sleep'' or ``hibernate'').
3897       This writes all memory to disk before going into a low  power  or  even
3898       powered off mode.  Unless measures are taken in the operating system to
3899       protect the saved memory, passphrases or other sensitive  material  may
3900       be recoverable from it later.
3901
3902       Before  you  report  a bug you should first search the mailing list ar‐
3903       chives for similar problems and second check whether  such  a  bug  has
3904       already been reported to our bug tracker at https://bugs.gnupg.org.
3905
3906
3907

SEE ALSO

3909       gpgv(1), gpgsm(1), gpg-agent(1)
3910
3911       The full documentation for this tool is maintained as a Texinfo manual.
3912       If GnuPG and the info program are properly installed at your site,  the
3913       command
3914
3915         info gnupg
3916
3917       should  give  you access to the complete manual including a menu struc‐
3918       ture and an index.
3919
3920
3921
3922GnuPG 2.2.13                      2019-02-11                           GPG2(1)
Impressum