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

NAME

6       gpg - OpenPGP encryption and signing tool
7

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

WARNINGS

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

INTEROPERABILITY

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

COMMANDS

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

OPTIONS

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

EXAMPLES

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

HOW TO SPECIFY A USER ID

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

FILTER EXPRESSIONS

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

TRUST VALUES

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

FILES

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

BUGS

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

SEE ALSO

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