1GPG(1) GNU Privacy Guard 2.4 GPG(1)
2
3
4
6 gpg - OpenPGP encryption and signing tool
7
9 gpg [--homedir dir] [--options file] [options] command [args]
10
11
12
13
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
37 The program returns 0 if there are no severe errors, 1 if at least a
38 signature was bad, and other error codes for fatal errors.
39
40 Note that signature verification requires exact knowledge of what has
41 been signed and by whom it has been signed. Using only the return code
42 is thus not an appropriate way to verify a signature by a script. Ei‐
43 ther make proper use or the status codes or use the gpgv tool which has
44 been designed to make signature verification easy for scripts.
45
46
48 Use a good password for your user account and make sure that all secu‐
49 rity issues are always fixed on your machine. Also employ diligent
50 physical protection to your machine. Consider to use a good passphrase
51 as a last resort protection to your secret key in the case your machine
52 gets stolen. It is important that your secret key is never leaked.
53 Using an easy to carry around token or smartcard with the secret key is
54 often a advisable.
55
56 If you are going to verify detached signatures, make sure that the pro‐
57 gram knows about it; either give both filenames on the command line or
58 use ‘-’ to specify STDIN.
59
60 For scripted or other unattended use of gpg make sure to use the ma‐
61 chine-parseable interface and not the default interface which is in‐
62 tended for direct use by humans. The machine-parseable interface pro‐
63 vides a stable and well documented API independent of the locale or fu‐
64 ture changes of gpg. To enable this interface use the options --with-
65 colons and --status-fd. For certain operations the option --command-fd
66 may come handy too. See this man page and the file ‘DETAILS’ for the
67 specification of the interface. Note that the GnuPG ``info'' pages as
68 well as the PDF version of the GnuPG manual features a chapter on unat‐
69 tended use of GnuPG. As an alternative the library GPGME can be used
70 as a high-level abstraction on top of that interface.
71
72
74 GnuPG tries to be a very flexible implementation of the OpenPGP stan‐
75 dard. In particular, GnuPG implements many of the optional parts of the
76 standard, such as the SHA-512 hash, and the ZLIB and BZIP2 compression
77 algorithms. It is important to be aware that not all OpenPGP programs
78 implement these optional algorithms and that by forcing their use via
79 the --cipher-algo, --digest-algo, --cert-digest-algo, or --compress-
80 algo options in GnuPG, it is possible to create a perfectly valid
81 OpenPGP message, but one that cannot be read by the intended recipient.
82
83 There are dozens of variations of OpenPGP programs available, and each
84 supports a slightly different subset of these optional algorithms. For
85 example, until recently, no (unhacked) version of PGP supported the
86 BLOWFISH cipher algorithm. A message using BLOWFISH simply could not be
87 read by a PGP user. By default, GnuPG uses the standard OpenPGP prefer‐
88 ences system that will always do the right thing and create messages
89 that are usable by all recipients, regardless of which OpenPGP program
90 they use. Only override this safe default if you really know what you
91 are doing.
92
93 If you absolutely must override the safe default, or if the preferences
94 on a given key are invalid for some reason, you are far better off us‐
95 ing the --pgp6, --pgp7, or --pgp8 options. These options are safe as
96 they do not force any particular algorithms in violation of OpenPGP,
97 but rather reduce the available algorithms to a "PGP-safe" list.
98
99
101 Commands are not distinguished from options except for the fact that
102 only one command is allowed. Generally speaking, irrelevant options
103 are silently ignored, and may not be checked for correctness.
104
105 gpg may be run with no commands. In this case it will print a warning
106 perform a reasonable action depending on the type of file it is given
107 as input (an encrypted message is decrypted, a signature is verified, a
108 file containing keys is listed, etc.).
109
110 If you run into any problems, please add the option --verbose to the
111 invocation to see more diagnostics.
112
113
114
115
116
117
118 Commands not specific to the function
119
120
121
122 --version
123 Print the program version and licensing information. Note that
124 you cannot abbreviate this command.
125
126
127 --help
128 -h Print a usage message summarizing the most useful command-line
129 options. Note that you cannot arbitrarily abbreviate this com‐
130 mand (though you can use its short form -h).
131
132
133 --warranty
134 Print warranty information.
135
136
137 --dump-options
138 Print a list of all available options and commands. Note that
139 you cannot abbreviate this command.
140
141 Commands to select the type of operation
142
143
144
145
146
147 --sign
148 -s Sign a message. This command may be combined with --encrypt (to
149 sign and encrypt a message), --symmetric (to sign and symmetri‐
150 cally encrypt a message), or both --encrypt and --symmetric (to
151 sign and encrypt a message that can be decrypted using a secret
152 key or a passphrase). The signing key is chosen by default or
153 can be set explicitly using the --local-user and --default-key
154 options.
155
156
157 --clear-sign
158 --clearsign
159 Make a cleartext signature. The content in a cleartext signa‐
160 ture is readable without any special software. OpenPGP software
161 is only needed to verify the signature. cleartext signatures
162 may modify end-of-line whitespace for platform independence and
163 are not intended to be reversible. The signing key is chosen by
164 default or can be set explicitly using the --local-user and
165 --default-key options.
166
167
168
169 --detach-sign
170 -b Make a detached signature.
171
172
173 --encrypt
174 -e Encrypt data to one or more public keys. This command may be
175 combined with --sign (to sign and encrypt a message), --symmet‐
176 ric (to encrypt a message that can be decrypted using a secret
177 key or a passphrase), or --sign and --symmetric together (for a
178 signed message that can be decrypted using a secret key or a
179 passphrase). --recipient and related options specify which pub‐
180 lic keys to use for encryption.
181
182
183 --symmetric
184 -c Encrypt with a symmetric cipher using a passphrase. The default
185 symmetric cipher used is AES-128, but may be chosen with the
186 --cipher-algo option. This command may be combined with --sign
187 (for a signed and symmetrically encrypted message), --encrypt
188 (for a message that may be decrypted via a secret key or a
189 passphrase), or --sign and --encrypt together (for a signed mes‐
190 sage that may be decrypted via a secret key or a passphrase).
191 gpg caches the passphrase used for symmetric encryption so that
192 a decrypt operation may not require that the user needs to enter
193 the passphrase. The option --no-symkey-cache can be used to
194 disable this feature.
195
196
197 --store
198 Store only (make a simple literal data packet).
199
200
201 --decrypt
202 -d Decrypt the file given on the command line (or STDIN if no file
203 is specified) and write it to STDOUT (or the file specified with
204 --output). If the decrypted file is signed, the signature is
205 also verified. This command differs from the default operation,
206 as it never writes to the filename which is included in the file
207 and it rejects files that don't begin with an encrypted message.
208
209
210 --verify
211 Assume that the first argument is a signed file and verify it
212 without generating any output. With no arguments, the signature
213 packet is read from STDIN. If only one argument is given, the
214 specified file is expected to include a complete signature.
215
216 With more than one argument, the first argument should specify a
217 file with a detached signature and the remaining files should
218 contain the signed data. To read the signed data from STDIN, use
219 ‘-’ as the second filename. For security reasons, a detached
220 signature will not read the signed material from STDIN if not
221 explicitly specified.
222
223 Note: If the option --batch is not used, gpg may assume that a
224 single argument is a file with a detached signature, and it will
225 try to find a matching data file by stripping certain suffixes.
226 Using this historical feature to verify a detached signature is
227 strongly discouraged; you should always specify the data file
228 explicitly.
229
230 Note: When verifying a cleartext signature, gpg verifies only
231 what makes up the cleartext signed data and not any extra data
232 outside of the cleartext signature or the header lines directly
233 following the dash marker line. The option --output may be used
234 to write out the actual signed data, but there are other pit‐
235 falls with this format as well. It is suggested to avoid clear‐
236 text signatures in favor of detached signatures.
237
238 Note: To check whether a file was signed by a certain key the
239 option --assert-signer can be used. As an alternative the gpgv
240 tool can be used. gpgv is designed to compare signed data
241 against a list of trusted keys and returns with success only for
242 a good signature. It has its own manual page.
243
244
245
246 --multifile
247 This modifies certain other commands to accept multiple files
248 for processing on the command line or read from STDIN with each
249 filename on a separate line. This allows for many files to be
250 processed at once. --multifile may currently be used along with
251 --verify, --encrypt, and --decrypt. Note that --multifile --ver‐
252 ify may not be used with detached signatures.
253
254
255 --verify-files
256 Identical to --multifile --verify.
257
258
259 --encrypt-files
260 Identical to --multifile --encrypt.
261
262
263 --decrypt-files
264 Identical to --multifile --decrypt.
265
266
267 --list-keys
268 -k
269 --list-public-keys
270 List the specified keys. If no keys are specified, then all
271 keys from the configured public keyrings are listed.
272
273 Never use the output of this command in scripts or other pro‐
274 grams. The output is intended only for humans and its format is
275 likely to change. The --with-colons option emits the output in
276 a stable, machine-parseable format, which is intended for use by
277 scripts and other programs.
278
279
280 --list-secret-keys
281 -K List the specified secret keys. If no keys are specified, then
282 all known secret keys are listed. A # after the initial tags
283 sec or ssb means that the secret key or subkey is currently not
284 usable. We also say that this key has been taken offline (for
285 example, a primary key can be taken offline by exporting the key
286 using the command --export-secret-subkeys). A > after these
287 tags indicate that the key is stored on a smartcard. See also
288 --list-keys.
289
290
291 --check-signatures
292 --check-sigs
293 Same as --list-keys, but the key signatures are verified and
294 listed too. Note that for performance reasons the revocation
295 status of a signing key is not shown. This command has the same
296 effect as using --list-keys with --with-sig-check.
297
298 The status of the verification is indicated by a flag directly
299 following the "sig" tag (and thus before the flags described be‐
300 low. A "!" indicates that the signature has been successfully
301 verified, a "-" denotes a bad signature and a "%" is used if an
302 error occurred while checking the signature (e.g. a non sup‐
303 ported algorithm). Signatures where the public key is not
304 available are not listed; to see their keyids the command
305 --list-sigs can be used.
306
307 For each signature listed, there are several flags in between
308 the signature status flag and keyid. These flags give addi‐
309 tional information about each key signature. From left to
310 right, they are the numbers 1-3 for certificate check level (see
311 --ask-cert-level), "L" for a local or non-exportable signature
312 (see --lsign-key), "R" for a nonRevocable signature (see the
313 --edit-key command "nrsign"), "P" for a signature that contains
314 a policy URL (see --cert-policy-url), "N" for a signature that
315 contains a notation (see --cert-notation), "X" for an eXpired
316 signature (see --ask-cert-expire), and the numbers 1-9 or "T"
317 for 10 and above to indicate trust signature levels (see the
318 --edit-key command "tsign").
319
320
321
322 --locate-keys
323 --locate-external-keys
324 Locate the keys given as arguments. This command basically uses
325 the same algorithm as used when locating keys for encryption and
326 may thus be used to see what keys gpg might use. In particular
327 external methods as defined by --auto-key-locate are used to lo‐
328 cate a key if the arguments comain valid mail addresses. Only
329 public keys are listed.
330
331 The variant --locate-external-keys does not consider a locally
332 existing key and can thus be used to force the refresh of a key
333 via the defined external methods. If a fingerprint is given and
334 and the methods defined by --auto-key-locate define LDAP
335 servers, the key is fetched from these resources; defined non-
336 LDAP keyservers are skipped.
337
338
339
340 --show-keys
341 This commands takes OpenPGP keys as input and prints information
342 about them in the same way the command --list-keys does for lo‐
343 cally stored key. In addition the list options show-unusable-
344 uids, show-unusable-subkeys, show-notations and show-policy-urls
345 are also enabled. As usual for automated processing, this com‐
346 mand should be combined with the option --with-colons.
347
348
349 --fingerprint
350 List all keys (or the specified ones) along with their finger‐
351 prints. This is the same output as --list-keys but with the ad‐
352 ditional output of a line with the fingerprint. May also be com‐
353 bined with --check-signatures. If this command is given twice,
354 the fingerprints of all secondary keys are listed too. This
355 command also forces pretty printing of fingerprints if the keyid
356 format has been set to "none".
357
358
359 --list-packets
360 List only the sequence of packets. This command is only useful
361 for debugging. When used with option --verbose the actual MPI
362 values are dumped and not only their lengths. Note that the
363 output of this command may change with new releases.
364
365
366
367 --edit-card
368 --card-edit
369 Present a menu to work with a smartcard. The subcommand "help"
370 provides an overview on available commands. For a detailed de‐
371 scription, please see the Card HOWTO at https://gnupg.org/docu‐
372 mentation/howtos.html#GnuPG-cardHOWTO . Please note that the
373 command "openpgp" can be used to switch to the OpenPGP applica‐
374 tion of cards which by default are presenting another applica‐
375 tion (e.g. PIV).
376
377
378 --card-status
379 Show the content of the smart card.
380
381
382 --change-pin
383 Present a menu to allow changing the PIN of a smartcard. This
384 functionality is also available as the subcommand "passwd" with
385 the --edit-card command.
386
387
388 --delete-keys name
389 Remove key from the public keyring. In batch mode either --yes
390 is required or the key must be specified by fingerprint. This is
391 a safeguard against accidental deletion of multiple keys. If
392 the exclamation mark syntax is used with the fingerprint of a
393 subkey only that subkey is deleted; if the exclamation mark is
394 used with the fingerprint of the primary key the entire public
395 key is deleted.
396
397
398 --delete-secret-keys name
399 Remove key from the secret keyring. In batch mode the key must
400 be specified by fingerprint. The option --yes can be used to
401 advise gpg-agent not to request a confirmation. This extra pre-
402 caution is done because gpg can't be sure that the secret key
403 (as controlled by gpg-agent) is only used for the given OpenPGP
404 public key. If the exclamation mark syntax is used with the
405 fingerprint of a subkey only the secret part of that subkey is
406 deleted; if the exclamation mark is used with the fingerprint of
407 the primary key only the secret part of the primary key is
408 deleted.
409
410
411
412 --delete-secret-and-public-key name
413 Same as --delete-key, but if a secret key exists, it will be re‐
414 moved first. In batch mode the key must be specified by finger‐
415 print. The option --yes can be used to advise gpg-agent not to
416 request a confirmation.
417
418
419 --export
420 Either export all keys from all keyrings (default keyring and
421 those registered via option --keyring), or if at least one name
422 is given, those of the given name. The exported keys are written
423 to STDOUT or to the file given with option --output. Use to‐
424 gether with --armor to mail those keys.
425
426
427 --send-keys keyIDs
428 Similar to --export but sends the keys to a keyserver. Finger‐
429 prints may be used instead of key IDs. Don't send your complete
430 keyring to a keyserver --- select only those keys which are new
431 or changed by you. If no keyIDs are given, gpg does nothing.
432
433 Take care: Keyservers are by design write only systems and thus
434 it is not possible to ever delete keys once they have been send
435 to a keyserver.
436
437
438
439 --export-secret-keys
440 --export-secret-subkeys
441 Same as --export, but exports the secret keys instead. The ex‐
442 ported keys are written to STDOUT or to the file given with op‐
443 tion --output. This command is often used along with the option
444 --armor to allow for easy printing of the key for paper backup;
445 however the external tool paperkey does a better job of creating
446 backups on paper. Note that exporting a secret key can be a se‐
447 curity risk if the exported keys are sent over an insecure chan‐
448 nel.
449
450 The second form of the command has the special property to ren‐
451 der the secret part of the primary key useless; this is a GNU
452 extension to OpenPGP and other implementations can not be ex‐
453 pected to successfully import such a key. Its intended use is
454 in generating a full key with an additional signing subkey on a
455 dedicated machine. This command then exports the key without
456 the primary key to the main machine.
457
458 GnuPG may ask you to enter the passphrase for the key. This is
459 required, because the internal protection method of the secret
460 key is different from the one specified by the OpenPGP protocol.
461
462
463 --export-ssh-key
464 This command is used to export a key in the OpenSSH public key
465 format. It requires the specification of one key by the usual
466 means and exports the latest valid subkey which has an authenti‐
467 cation capability to STDOUT or to the file given with option
468 --output. That output can directly be added to ssh's ‘autho‐
469 rized_key’ file.
470
471 By specifying the key to export using a key ID or a fingerprint
472 suffixed with an exclamation mark (!), a specific subkey or the
473 primary key can be exported. This does not even require that
474 the key has the authentication capability flag set.
475
476
477 --import
478 --fast-import
479 Import/merge keys. This adds the given keys to the keyring. The
480 fast version is currently just a synonym.
481
482 There are a few other options which control how this command
483 works. Most notable here is the --import-options merge-only op‐
484 tion which does not insert new keys but does only the merging of
485 new signatures, user-IDs and subkeys.
486
487
488 --receive-keys keyIDs
489 --recv-keys keyIDs
490 Import the keys with the given keyIDs from a keyserver.
491
492
493 --refresh-keys
494 Request updates from a keyserver for keys that already exist on
495 the local keyring. This is useful for updating a key with the
496 latest signatures, user IDs, etc. Calling this with no arguments
497 will refresh the entire keyring.
498
499
500 --search-keys names
501 Search the keyserver for the given names. Multiple names given
502 here will be joined together to create the search string for the
503 keyserver. Note that keyservers search for names in a different
504 and simpler way than gpg does. The best choice is to use a mail
505 address. Due to data privacy reasons keyservers may even not
506 even allow searching by user id or mail address and thus may
507 only return results when being used with the --recv-key command
508 to search by key fingerprint or keyid.
509
510
511 --fetch-keys URIs
512 Retrieve keys located at the specified URIs. Note that different
513 installations of GnuPG may support different protocols (HTTP,
514 FTP, LDAP, etc.). When using HTTPS the system provided root
515 certificates are used by this command.
516
517
518 --update-trustdb
519 Do trust database maintenance. This command iterates over all
520 keys and builds the Web of Trust. This is an interactive command
521 because it may have to ask for the "ownertrust" values for keys.
522 The user has to give an estimation of how far she trusts the
523 owner of the displayed key to correctly certify (sign) other
524 keys. GnuPG only asks for the ownertrust value if it has not yet
525 been assigned to a key. Using the --edit-key menu, the assigned
526 value can be changed at any time.
527
528
529 --check-trustdb
530 Do trust database maintenance without user interaction. From
531 time to time the trust database must be updated so that expired
532 keys or signatures and the resulting changes in the Web of Trust
533 can be tracked. Normally, GnuPG will calculate when this is re‐
534 quired and do it automatically unless --no-auto-check-trustdb is
535 set. This command can be used to force a trust database check at
536 any time. The processing is identical to that of --update-
537 trustdb but it skips keys with a not yet defined "ownertrust".
538
539 For use with cron jobs, this command can be used together with
540 --batch in which case the trust database check is done only if a
541 check is needed. To force a run even in batch mode add the op‐
542 tion --yes.
543
544
545
546 --export-ownertrust
547 Send the ownertrust values to STDOUT. This is useful for backup
548 purposes as these values are the only ones which can't be re-
549 created from a corrupted trustdb. Example:
550 gpg --export-ownertrust > otrust.txt
551
552
553
554 --import-ownertrust
555 Update the trustdb with the ownertrust values stored in files
556 (or STDIN if not given); existing values will be overwritten.
557 In case of a severely damaged trustdb and if you have a recent
558 backup of the ownertrust values (e.g. in the file ‘otrust.txt’),
559 you may re-create the trustdb using these commands:
560 cd ~/.gnupg
561 rm trustdb.gpg
562 gpg --import-ownertrust < otrust.txt
563
564
565
566 --rebuild-keydb-caches
567 When updating from version 1.0.6 to 1.0.7 this command should be
568 used to create signature caches in the keyring. It might be
569 handy in other situations too.
570
571
572 --print-md algo
573 --print-mds
574 Print message digest of algorithm algo for all given files or
575 STDIN. With the second form (or a deprecated "*" for algo) di‐
576 gests for all available algorithms are printed.
577
578
579 --gen-random 0|1|2|16|30 count
580 Emit count random bytes of the given quality level 0, 1 or 2. If
581 count is not given or zero, an endless sequence of random bytes
582 will be emitted. If used with --armor the output will be base64
583 encoded. The special level 16 uses a quality level of 1 and
584 outputs an endless stream of hex-encoded octets. The special
585 level 30 outputs random as 30 zBase-32 characters.
586
587
588 --gen-prime mode bits
589 Use the source, Luke :-). The output format is subject to change
590 with any release.
591
592
593
594 --enarmor
595 --dearmor
596 Pack or unpack an arbitrary input into/from an OpenPGP ASCII ar‐
597 mor. This is a GnuPG extension to OpenPGP and in general not
598 very useful. The --dearmor command can also be used to dearmor
599 PEM armors.
600
601
602 --unwrap
603 This command is similar to --decrypt with the difference that
604 the output is not the usual plaintext but the original message
605 with the encryption layer removed. Thus the output will be an
606 OpenPGP data structure which often means a signed OpenPGP mes‐
607 sage. Note that this option may or may not remove a compression
608 layer which is often found beneath the encryption layer.
609
610
611 --tofu-policy {auto|good|unknown|bad|ask} keys
612 Set the TOFU policy for all the bindings associated with the
613 specified keys. For more information about the meaning of the
614 policies, see: [trust-model-tofu]. The keys may be specified
615 either by their fingerprint (preferred) or their keyid.
616
617
618
619 How to manage your keys
620
621
622 This section explains the main commands for key management.
623
624
625
626 --quick-generate-key user-id [algo [usage [expire]]]
627 --quick-gen-key
628 This is a simple command to generate a standard key with one
629 user id. In contrast to --generate-key the key is generated di‐
630 rectly without the need to answer a bunch of prompts. Unless
631 the option --yes is given, the key creation will be canceled if
632 the given user id already exists in the keyring.
633
634 If invoked directly on the console without any special options
635 an answer to a ``Continue?'' style confirmation prompt is re‐
636 quired. In case the user id already exists in the keyring a
637 second prompt to force the creation of the key will show up.
638
639 If algo or usage are given, only the primary key is created and
640 no prompts are shown. To specify an expiration date but still
641 create a primary and subkey use ``default'' or ``future-de‐
642 fault'' for algo and ``default'' for usage. For a description
643 of these optional arguments see the command --quick-add-key.
644 The usage accepts also the value ``cert'' which can be used to
645 create a certification only primary key; the default is to a
646 create certification and signing key.
647
648 The expire argument can be used to specify an expiration date
649 for the key. Several formats are supported; commonly the ISO
650 formats ``YYYY-MM-DD'' or ``YYYYMMDDThhmmss'' are used. To make
651 the key expire in N seconds, N days, N weeks, N months, or N
652 years use ``seconds=N'', ``Nd'', ``Nw'', ``Nm'', or ``Ny'' re‐
653 spectively. Not specifying a value, or using ``-'' results in a
654 key expiring in a reasonable default interval. The values
655 ``never'', ``none'' can be used for no expiration date.
656
657 If this command is used with --batch, --pinentry-mode has been
658 set to loopback, and one of the passphrase options
659 (--passphrase, --passphrase-fd, or --passphrase-file) is used,
660 the supplied passphrase is used for the new key and the agent
661 does not ask for it. To create a key without any protection
662 --passphrase '' may be used.
663
664 To create an OpenPGP key from the keys available on the cur‐
665 rently inserted smartcard, the special string ``card'' can be
666 used for algo. If the card features an encryption and a signing
667 key, gpg will figure them out and creates an OpenPGP key con‐
668 sisting of the usual primary key and one subkey. This works
669 only with certain smartcards. Note that the interactive --full-
670 gen-key command allows to do the same but with greater flexibil‐
671 ity in the selection of the smartcard keys.
672
673 Note that it is possible to create a primary key and a subkey
674 using non-default algorithms by using ``default'' and changing
675 the default parameters using the option --default-new-key-algo.
676
677
678 --quick-set-expire fpr expire [*|subfprs]
679 With two arguments given, directly set the expiration time of
680 the primary key identified by fpr to expire. To remove the ex‐
681 piration time 0 can be used. With three arguments and the third
682 given as an asterisk, the expiration time of all non-revoked and
683 not yet expired subkeys are set to expire. With more than two
684 arguments and a list of fingerprints given for subfprs, all non-
685 revoked subkeys matching these fingerprints are set to expire.
686
687
688
689 --quick-add-key fpr [algo [usage [expire]]]
690 Directly add a subkey to the key identified by the fingerprint
691 fpr. Without the optional arguments an encryption subkey is
692 added. If any of the arguments are given a more specific subkey
693 is added.
694
695 algo may be any of the supported algorithms or curve names given
696 in the format as used by key listings. To use the default algo‐
697 rithm the string ``default'' or ``-'' can be used. Supported
698 algorithms are ``rsa'', ``dsa'', ``elg'', ``ed25519'',
699 ``cv25519'', and other ECC curves. For example the string
700 ``rsa'' adds an RSA key with the default key length; a string
701 ``rsa4096'' requests that the key length is 4096 bits. The
702 string ``future-default'' is an alias for the algorithm which
703 will likely be used as default algorithm in future versions of
704 gpg. To list the supported ECC curves the command gpg --with-
705 colons --list-config curve can be used.
706
707 Depending on the given algo the subkey may either be an encryp‐
708 tion subkey or a signing subkey. If an algorithm is capable of
709 signing and encryption and such a subkey is desired, a usage
710 string must be given. This string is either ``default'' or
711 ``-'' to keep the default or a comma delimited list (or space
712 delimited list) of keywords: ``sign'' for a signing subkey,
713 ``auth'' for an authentication subkey, and ``encr'' for an en‐
714 cryption subkey (``encrypt'' can be used as alias for ``encr'').
715 The valid combinations depend on the algorithm.
716
717 The expire argument can be used to specify an expiration date
718 for the key. Several formats are supported; commonly the ISO
719 formats ``YYYY-MM-DD'' or ``YYYYMMDDThhmmss'' are used. To make
720 the key expire in N seconds, N days, N weeks, N months, or N
721 years use ``seconds=N'', ``Nd'', ``Nw'', ``Nm'', or ``Ny'' re‐
722 spectively. Not specifying a value, or using ``-'' results in a
723 key expiring in a reasonable default interval. The values
724 ``never'', ``none'' can be used for no expiration date.
725
726
727 --quick-add-adsk fpr adskfpr
728 Directly add an Additional Decryption Subkey to the key identi‐
729 fied by the fingerprint fpr. adskfpr is the fingerprint of an‐
730 other key's encryption subkey. A subkey is commonly used here
731 because by default a primary key has no encryption capability.
732 Use the option --with-subkey-fingerprint with a list command to
733 display the subkey fingerprints.
734
735
736 --generate-key
737 --gen-key
738 Generate a new key pair using the current default parameters.
739 This is the standard command to create a new key. In addition
740 to the key a revocation certificate is created and stored in the
741 ‘openpgp-revocs.d’ directory below the GnuPG home directory.
742
743
744 --full-generate-key
745 --full-gen-key
746 Generate a new key pair with dialogs for all options. This is
747 an extended version of --generate-key.
748
749 There is also a feature which allows you to create keys in batch
750 mode. See the manual section ``Unattended key generation'' on
751 how to use this.
752
753
754
755 --generate-revocation name
756 --gen-revoke name
757 Generate a revocation certificate for the complete key. To only
758 revoke a subkey or a key signature, use the --edit command.
759
760 This command merely creates the revocation certificate so that
761 it can be used to revoke the key if that is ever needed. To ac‐
762 tually revoke a key the created revocation certificate needs to
763 be merged with the key to revoke. This is done by importing the
764 revocation certificate using the --import command. Then the re‐
765 voked key needs to be published, which is best done by sending
766 the key to a keyserver (command --send-key) and by exporting
767 (--export) it to a file which is then send to frequent communi‐
768 cation partners.
769
770
771
772 --generate-designated-revocation name
773 --desig-revoke name
774 Generate a designated revocation certificate for a key. This al‐
775 lows a user (with the permission of the keyholder) to revoke
776 someone else's key.
777
778
779
780 --edit-key
781 Present a menu which enables you to do most of the key manage‐
782 ment related tasks. It expects the specification of a key on
783 the command line.
784
785
786
787 uid n Toggle selection of user ID or photographic user ID with
788 index n. Use * to select all and 0 to deselect all.
789
790
791 key n Toggle selection of subkey with index n or key ID n. Use
792 * to select all and 0 to deselect all.
793
794
795 sign Make a signature on key of user name. If the key is not
796 yet signed by the default user (or the users given with
797 -u), the program displays the information of the key
798 again, together with its fingerprint and asks whether it
799 should be signed. This question is repeated for all users
800 specified with -u.
801
802
803 lsign Same as "sign" but the signature is marked as non-ex‐
804 portable and will therefore never be used by others. This
805 may be used to make keys valid only in the local environ‐
806 ment.
807
808
809 nrsign Same as "sign" but the signature is marked as non-revoca‐
810 ble and can therefore never be revoked.
811
812
813 tsign Make a trust signature. This is a signature that combines
814 the notions of certification (like a regular signature),
815 and trust (like the "trust" command). It is generally
816 useful in distinct communities or groups to implement the
817 concept of a Trusted Introducer. For more information
818 please read the sections ``Trust Signature'' and ``Regu‐
819 lar Expression'' in RFC-4880.
820
821 Note that "l" (for local / non-exportable), "nr" (for non-revo‐
822 cable, and "t" (for trust) may be freely mixed and prefixed to
823 "sign" to create a signature of any type desired.
824
825 If the option --only-sign-text-ids is specified, then any non-text
826 based user ids (e.g., photo IDs) will not be selected for signing.
827
828
829
830 delsig Delete a signature. Note that it is not possible to re‐
831 tract a signature, once it has been send to the public
832 (i.e. to a keyserver). In that case you better use
833 revsig.
834
835
836 revsig Revoke a signature. For every signature which has been
837 generated by one of the secret keys, GnuPG asks whether a
838 revocation certificate should be generated.
839
840
841 check Check the signatures on all selected user IDs. With the
842 extra option selfsig only self-signatures are shown.
843
844
845 adduid Create an additional user ID.
846
847
848 addphoto
849 Create a photographic user ID. This will prompt for a
850 JPEG file that will be embedded into the user ID. Note
851 that a very large JPEG will make for a very large key.
852 Also note that some programs will display your JPEG un‐
853 changed (GnuPG), and some programs will scale it to fit
854 in a dialog box (PGP).
855
856
857 showphoto
858 Display the selected photographic user ID.
859
860
861 deluid Delete a user ID or photographic user ID. Note that it
862 is not possible to retract a user id, once it has been
863 send to the public (i.e. to a keyserver). In that case
864 you better use revuid.
865
866
867 revuid Revoke a user ID or photographic user ID.
868
869
870 primary
871 Flag the current user id as the primary one, removes the
872 primary user id flag from all other user ids and sets the
873 timestamp of all affected self-signatures one second
874 ahead. Note that setting a photo user ID as primary makes
875 it primary over other photo user IDs, and setting a regu‐
876 lar user ID as primary makes it primary over other regu‐
877 lar user IDs.
878
879
880 keyserver
881 Set a preferred keyserver for the specified user ID(s).
882 This allows other users to know where you prefer they get
883 your key from. See --keyserver-options honor-keyserver-
884 url for more on how this works. Setting a value of
885 "none" removes an existing preferred keyserver.
886
887
888 notation
889 Set a name=value notation for the specified user ID(s).
890 See --cert-notation for more on how this works. Setting a
891 value of "none" removes all notations, setting a notation
892 prefixed with a minus sign (-) removes that notation, and
893 setting a notation name (without the =value) prefixed
894 with a minus sign removes all notations with that name.
895
896
897 pref List preferences from the selected user ID. This shows
898 the actual preferences, without including any implied
899 preferences.
900
901
902 showpref
903 More verbose preferences listing for the selected user
904 ID. This shows the preferences in effect by including the
905 implied preferences of 3DES (cipher), SHA-1 (digest), and
906 Uncompressed (compression) if they are not already in‐
907 cluded in the preference list. In addition, the preferred
908 keyserver and signature notations (if any) are shown.
909
910
911 setpref string
912 Set the list of user ID preferences to string for all (or
913 just the selected) user IDs. Calling setpref with no ar‐
914 guments sets the preference list to the default (either
915 built-in or set via --default-preference-list), and call‐
916 ing setpref with "none" as the argument sets an empty
917 preference list. Use gpg --version to get a list of
918 available algorithms. Note that while you can change the
919 preferences on an attribute user ID (aka "photo ID"),
920 GnuPG does not select keys via attribute user IDs so
921 these preferences will not be used by GnuPG. Note that
922 an unattended version of this command is available as
923 --quick-update-pref.
924
925 When setting preferences, you should list the algorithms
926 in the order which you'd like to see them used by someone
927 else when encrypting a message to your key. If you don't
928 include 3DES, it will be automatically added at the end.
929 Note that there are many factors that go into choosing an
930 algorithm (for example, your key may not be the only re‐
931 cipient), and so the remote OpenPGP application being
932 used to send to you may or may not follow your exact cho‐
933 sen order for a given message. It will, however, only
934 choose an algorithm that is present on the preference
935 list of every recipient key. See also the INTEROPERABIL‐
936 ITY WITH OTHER OPENPGP PROGRAMS section below.
937
938
939 addkey Add a subkey to this key.
940
941
942 addcardkey
943 Generate a subkey on a card and add it to this key.
944
945
946 keytocard
947 Transfer the selected secret subkey (or the primary key
948 if no subkey has been selected) to a smartcard. The se‐
949 cret key in the keyring will be replaced by a stub if the
950 key could be stored successfully on the card and you use
951 the save command later. Only certain key types may be
952 transferred to the card. A sub menu allows you to select
953 on what card to store the key. Note that it is not possi‐
954 ble to get that key back from the card - if the card gets
955 broken your secret key will be lost unless you have a
956 backup somewhere.
957
958
959 bkuptocard file
960 Restore the given file to a card. This command may be
961 used to restore a backup key (as generated during card
962 initialization) to a new card. In almost all cases this
963 will be the encryption key. You should use this command
964 only with the corresponding public key and make sure that
965 the file given as argument is indeed the backup to re‐
966 store. You should then select 2 to restore as encryption
967 key. You will first be asked to enter the passphrase of
968 the backup key and then for the Admin PIN of the card.
969
970
971 keytotpm
972 Transfer the selected secret subkey (or the primary key
973 if no subkey has been selected) to TPM form. The secret
974 key in the keyring will be replaced by the TPM represen‐
975 tation of that key, which can only be read by the partic‐
976 ular TPM that created it (so the keyfile now becomes
977 locked to the laptop containing the TPM). Only certain
978 key types may be transferred to the TPM (all TPM 2.0 sys‐
979 tems are mandated to have the rsa2048 and nistp256 algo‐
980 rithms but newer TPMs may have more). Note that the key
981 itself is not transferred into the TPM, merely encrypted
982 by the TPM in-place, so if the keyfile is deleted, the
983 key will be lost. Once transferred to TPM representa‐
984 tion, the key file can never be converted back to non-TPM
985 form and the key will die when the TPM does, so you
986 should first have a backup on secure offline storage of
987 the actual secret key file before conversion. It is es‐
988 sential to use the physical system TPM that you have rw
989 permission on the TPM resource manager device
990 (/dev/tpmrm0). Usually this means you must be a member
991 of the tss group.
992
993
994 delkey Remove a subkey (secondary key). Note that it is not pos‐
995 sible to retract a subkey, once it has been send to the
996 public (i.e. to a keyserver). In that case you better
997 use revkey. Also note that this only deletes the public
998 part of a key.
999
1000
1001 revkey Revoke a subkey.
1002
1003
1004 expire Change the key or subkey expiration time. If a subkey is
1005 selected, the expiration time of this subkey will be
1006 changed. With no selection, the key expiration of the
1007 primary key is changed.
1008
1009
1010 trust Change the owner trust value for the key. This updates
1011 the trust-db immediately and no save is required.
1012
1013
1014 disable
1015 enable Disable or enable an entire key. A disabled key can not
1016 normally be used for encryption.
1017
1018
1019 addrevoker
1020 Add a designated revoker to the key. This takes one op‐
1021 tional argument: "sensitive". If a designated revoker is
1022 marked as sensitive, it will not be exported by default
1023 (see export-options).
1024
1025
1026 addadsk
1027 Add an Additional Decryption Subkey. The user is asked
1028 to enter the fingerprint of another encryption subkey.
1029 Note that the exact fingerprint of another key's encryp‐
1030 tion subkey needs to be entered. This is because com‐
1031 monly the primary key has no encryption capability. Use
1032 the option --with-subkey-fingerprint with a list command
1033 to display the subkey fingerprints.
1034
1035
1036 passwd Change the passphrase of the secret key.
1037
1038
1039 toggle This is dummy command which exists only for backward com‐
1040 patibility.
1041
1042
1043 clean Compact (by removing all signatures except the selfsig)
1044 any user ID that is no longer usable (e.g. revoked, or
1045 expired). Then, remove any signatures that are not usable
1046 by the trust calculations. Specifically, this removes
1047 any signature that does not validate, any signature that
1048 is superseded by a later signature, revoked signatures,
1049 and signatures issued by keys that are not present on the
1050 keyring.
1051
1052
1053 minimize
1054 Make the key as small as possible. This removes all sig‐
1055 natures from each user ID except for the most recent
1056 self-signature.
1057
1058
1059 change-usage
1060 Change the usage flags (capabilities) of the primary key
1061 or of subkeys. These usage flags (e.g. Certify, Sign,
1062 Authenticate, Encrypt) are set during key creation.
1063 Sometimes it is useful to have the opportunity to change
1064 them (for example to add Authenticate) after they have
1065 been created. Please take care when doing this; the al‐
1066 lowed usage flags depend on the key algorithm.
1067
1068
1069 cross-certify
1070 Add cross-certification signatures to signing subkeys
1071 that may not currently have them. Cross-certification
1072 signatures protect against a subtle attack against sign‐
1073 ing subkeys. See --require-cross-certification. All new
1074 keys generated have this signature by default, so this
1075 command is only useful to bring older keys up to date.
1076
1077
1078 save Save all changes to the keyring and quit.
1079
1080
1081 quit Quit the program without updating the keyring.
1082
1083 The listing shows you the key with its secondary keys and all
1084 user IDs. The primary user ID is indicated by a dot, and se‐
1085 lected keys or user IDs are indicated by an asterisk. The trust
1086 value is displayed with the primary key: "trust" is the assigned
1087 owner trust and "validity" is the calculated validity of the
1088 key. Validity values are also displayed for all user IDs. For
1089 possible values of trust, see: [trust-values].
1090
1091
1092 --sign-key name
1093 Signs a public key with your secret key. This is a shortcut ver‐
1094 sion of the subcommand "sign" from --edit-key.
1095
1096
1097 --lsign-key name
1098 Signs a public key with your secret key but marks it as non-ex‐
1099 portable. This is a shortcut version of the subcommand "lsign"
1100 from --edit-key.
1101
1102
1103 --quick-sign-key fpr [names]
1104 --quick-lsign-key fpr [names]
1105 Directly sign a key from the passphrase without any further user
1106 interaction. The fpr must be the verified primary fingerprint
1107 of a key in the local keyring. If no names are given, all useful
1108 user ids are signed; with given [names] only useful user ids
1109 matching one of these names are signed. By default, or if a
1110 name is prefixed with a '*', a case insensitive substring match
1111 is used. If a name is prefixed with a '=' a case sensitive ex‐
1112 act match is done.
1113
1114 The command --quick-lsign-key marks the signatures as non-ex‐
1115 portable. If such a non-exportable signature already exists the
1116 --quick-sign-key turns it into a exportable signature. If you
1117 need to update an existing signature, for example to add or
1118 change notation data, you need to use the option --force-sign-
1119 key.
1120
1121 This command uses reasonable defaults and thus does not provide
1122 the full flexibility of the "sign" subcommand from --edit-key.
1123 Its intended use is to help unattended key signing by utilizing
1124 a list of verified fingerprints.
1125
1126
1127 --quick-add-uid user-id new-user-id
1128 This command adds a new user id to an existing key. In contrast
1129 to the interactive sub-command adduid of --edit-key the new-
1130 user-id is added verbatim with only leading and trailing white
1131 space removed, it is expected to be UTF-8 encoded, and no checks
1132 on its form are applied.
1133
1134
1135 --quick-revoke-uid user-id user-id-to-revoke
1136 This command revokes a user ID on an existing key. It cannot be
1137 used to revoke the last user ID on key (some non-revoked user ID
1138 must remain), with revocation reason ``User ID is no longer
1139 valid''. If you want to specify a different revocation reason,
1140 or to supply supplementary revocation text, you should use the
1141 interactive sub-command revuid of --edit-key.
1142
1143
1144 --quick-revoke-sig fpr signing-fpr [names]
1145 This command revokes the key signatures made by signing-fpr from
1146 the key specified by the fingerprint fpr. With names given only
1147 the signatures on user ids of the key matching any of the given
1148 names are affected (see --quick-sign-key). If a revocation al‐
1149 ready exists a notice is printed instead of creating a new revo‐
1150 cation; no error is returned in this case. Note that key signa‐
1151 ture revocations may be superseded by a newer key signature and
1152 in turn again revoked.
1153
1154
1155 --quick-set-primary-uid user-id primary-user-id
1156 This command sets or updates the primary user ID flag on an ex‐
1157 isting key. user-id specifies the key and primary-user-id the
1158 user ID which shall be flagged as the primary user ID. The pri‐
1159 mary user ID flag is removed from all other user ids and the
1160 timestamp of all affected self-signatures is set one second
1161 ahead.
1162
1163
1164 --quick-update-pref user-id
1165 This command updates the preference list of the key to the cur‐
1166 rent default value (either built-in or set via --default-prefer‐
1167 ence-list). This is the unattended version of of using "set‐
1168 pref" in the --key-edit menu without giving a list. Note that
1169 you can show the preferences in a key listing by using --list-
1170 options show-pref or --list-options show-pref-verbose. You
1171 should also re-distribute updated keys to your peers.
1172
1173
1174 --change-passphrase user-id
1175 --passwd user-id
1176 Change the passphrase of the secret key belonging to the cer‐
1177 tificate specified as user-id. This is a shortcut for the sub-
1178 command passwd of the --edit-key menu. When using together with
1179 the option --dry-run this will not actually change the
1180 passphrase but check that the current passphrase is correct.
1181
1182
1184 gpg features a bunch of options to control the exact behaviour and to
1185 change the default configuration.
1186
1187
1188 Long options can be put in an options file (default
1189 "~/.gnupg/gpg.conf"). Short option names will not work - for example,
1190 "armor" is a valid option for the options file, while "a" is not. Do
1191 not write the 2 dashes, but simply the name of the option and any re‐
1192 quired arguments. Lines with a hash ('#') as the first non-white-space
1193 character are ignored. Commands may be put in this file too, but that
1194 is not generally useful as the command will execute automatically with
1195 every execution of gpg.
1196
1197 Please remember that option parsing stops as soon as a non-option is
1198 encountered, you can explicitly stop parsing by using the special op‐
1199 tion --.
1200
1201
1202
1203 How to change the configuration
1204
1205
1206 These options are used to change the configuration and most of them are
1207 usually found in the option file.
1208
1209
1210
1211 --default-key name
1212 Use name as the default key to sign with. If this option is not
1213 used, the default key is the first key found in the secret
1214 keyring. Note that -u or --local-user overrides this option.
1215 This option may be given multiple times. In this case, the last
1216 key for which a secret key is available is used. If there is no
1217 secret key available for any of the specified values, GnuPG will
1218 not emit an error message but continue as if this option wasn't
1219 given.
1220
1221
1222 --default-recipient name
1223 Use name as default recipient if option --recipient is not used
1224 and don't ask if this is a valid one. name must be non-empty.
1225
1226
1227 --default-recipient-self
1228 Use the default key as default recipient if option --recipient
1229 is not used and don't ask if this is a valid one. The default
1230 key is the first one from the secret keyring or the one set with
1231 --default-key.
1232
1233
1234 --no-default-recipient
1235 Reset --default-recipient and --default-recipient-self. Should
1236 not be used in an option file.
1237
1238
1239 -v, --verbose
1240 Give more information during processing. If used twice, the in‐
1241 put data is listed in detail.
1242
1243
1244 --no-verbose
1245 Reset verbose level to 0. Should not be used in an option file.
1246
1247
1248 -q, --quiet
1249 Try to be as quiet as possible. Should not be used in an option
1250 file.
1251
1252
1253 --batch
1254 --no-batch
1255 Use batch mode. Never ask, do not allow interactive commands.
1256 --no-batch disables this option. Note that even with a filename
1257 given on the command line, gpg might still need to read from
1258 STDIN (in particular if gpg figures that the input is a detached
1259 signature and no data file has been specified). Thus if you do
1260 not want to feed data via STDIN, you should connect STDIN to
1261 ‘/dev/null’.
1262
1263 It is highly recommended to use this option along with the op‐
1264 tions --status-fd and --with-colons for any unattended use of
1265 gpg. Should not be used in an option file.
1266
1267
1268 --no-tty
1269 Make sure that the TTY (terminal) is never used for any output.
1270 This option is needed in some cases because GnuPG sometimes
1271 prints warnings to the TTY even if --batch is used.
1272
1273
1274 --yes Assume "yes" on most questions. Should not be used in an option
1275 file.
1276
1277
1278 --no Assume "no" on most questions. Should not be used in an option
1279 file.
1280
1281
1282
1283 --list-filter {select=expr}
1284 A list filter can be used to output only certain keys during key
1285 listing commands. For the available property names, see the de‐
1286 scription of --import-filter.
1287
1288
1289
1290 --list-options parameters
1291 This is a space or comma delimited string that gives options
1292 used when listing keys and signatures (that is, --list-keys,
1293 --check-signatures, --list-public-keys, --list-secret-keys, and
1294 the --edit-key functions). Options can be prepended with a no-
1295 (after the two dashes) to give the opposite meaning. The op‐
1296 tions are:
1297
1298
1299
1300 show-photos
1301 Causes --list-keys, --check-signatures, --list-public-
1302 keys, and --list-secret-keys to display any photo IDs at‐
1303 tached to the key. Defaults to no. See also --photo-
1304 viewer. Does not work with --with-colons: see --attri‐
1305 bute-fd for the appropriate way to get photo data for
1306 scripts and other frontends.
1307
1308
1309 show-usage
1310 Show usage information for keys and subkeys in the stan‐
1311 dard key listing. This is a list of letters indicating
1312 the allowed usage for a key (E=encryption, S=signing,
1313 C=certification, A=authentication). Defaults to yes.
1314
1315
1316 show-policy-urls
1317 Show policy URLs in the --check-signatures listings.
1318 Defaults to no.
1319
1320
1321 show-notations
1322 show-std-notations
1323 show-user-notations
1324 Show all, IETF standard, or user-defined signature nota‐
1325 tions in the --check-signatures listings. Defaults to no.
1326
1327
1328 show-keyserver-urls
1329 Show any preferred keyserver URL in the --check-signa‐
1330 tures listings. Defaults to no.
1331
1332
1333 show-uid-validity
1334 Display the calculated validity of user IDs during key
1335 listings. Defaults to yes.
1336
1337
1338 show-unusable-uids
1339 Show revoked and expired user IDs in key listings. De‐
1340 faults to no.
1341
1342
1343 show-unusable-subkeys
1344 Show revoked and expired subkeys in key listings. De‐
1345 faults to no.
1346
1347
1348 show-unusable-sigs
1349 Show key signature made using weak or unsupported algo‐
1350 rithms.
1351
1352
1353 show-keyring
1354 Display the keyring name at the head of key listings to
1355 show which keyring a given key resides on. Defaults to
1356 no.
1357
1358
1359 show-sig-expire
1360 Show signature expiration dates (if any) during --check-
1361 signatures listings. Defaults to no.
1362
1363
1364 show-sig-subpackets
1365 Include signature subpackets in the key listing. This op‐
1366 tion can take an optional argument list of the subpackets
1367 to list. If no argument is passed, list all subpackets.
1368 Defaults to no. This option is only meaningful when using
1369 --with-colons along with --check-signatures.
1370
1371
1372 show-only-fpr-mbox
1373 For each user-id which has a valid mail address print
1374 only the fingerprint followed by the mail address.
1375
1376
1377 sort-sigs
1378 With --list-sigs and --check-sigs sort the signatures by
1379 keyID and creation time to make it easier to view the
1380 history of these signatures. The self-signature is also
1381 listed before other signatures. Defaults to yes.
1382
1383
1384
1385 --verify-options parameters
1386 This is a space or comma delimited string that gives options
1387 used when verifying signatures. Options can be prepended with a
1388 `no-' to give the opposite meaning. The options are:
1389
1390
1391
1392 show-photos
1393 Display any photo IDs present on the key that issued the
1394 signature. Defaults to no. See also --photo-viewer.
1395
1396
1397 show-policy-urls
1398 Show policy URLs in the signature being verified. De‐
1399 faults to yes.
1400
1401
1402 show-notations
1403 show-std-notations
1404 show-user-notations
1405 Show all, IETF standard, or user-defined signature nota‐
1406 tions in the signature being verified. Defaults to IETF
1407 standard.
1408
1409
1410 show-keyserver-urls
1411 Show any preferred keyserver URL in the signature being
1412 verified. Defaults to yes.
1413
1414
1415 show-uid-validity
1416 Display the calculated validity of the user IDs on the
1417 key that issued the signature. Defaults to yes.
1418
1419
1420 show-unusable-uids
1421 Show revoked and expired user IDs during signature veri‐
1422 fication. Defaults to no.
1423
1424
1425 show-primary-uid-only
1426 Show only the primary user ID during signature verifica‐
1427 tion. That is all the AKA lines as well as photo Ids are
1428 not shown with the signature verification status.
1429
1430
1431
1432 --enable-large-rsa
1433 --disable-large-rsa
1434 With --generate-key and --batch, enable the creation of RSA se‐
1435 cret keys as large as 8192 bit. Note: 8192 bit is more than is
1436 generally recommended. These large keys don't significantly im‐
1437 prove security, but they are more expensive to use, and their
1438 signatures and certifications are larger. This option is only
1439 available if the binary was build with large-secmem support.
1440
1441
1442 --enable-dsa2
1443 --disable-dsa2
1444 Enable hash truncation for all DSA keys even for old DSA Keys up
1445 to 1024 bit. This is also the default with --openpgp. Note
1446 that older versions of GnuPG also required this flag to allow
1447 the generation of DSA larger than 1024 bit.
1448
1449
1450 --photo-viewer string
1451 This is the command line that should be run to view a photo ID.
1452 "%i" will be expanded to a filename containing the photo. "%I"
1453 does the same, except the file will not be deleted once the
1454 viewer exits. Other flags are "%k" for the key ID, "%K" for the
1455 long key ID, "%f" for the key fingerprint, "%t" for the exten‐
1456 sion of the image type (e.g. "jpg"), "%T" for the MIME type of
1457 the image (e.g. "image/jpeg"), "%v" for the single-character
1458 calculated validity of the image being viewed (e.g. "f"), "%V"
1459 for the calculated validity as a string (e.g. "full"), "%U" for
1460 a base32 encoded hash of the user ID, and "%%" for an actual
1461 percent sign. If neither %i or %I are present, then the photo
1462 will be supplied to the viewer on standard input.
1463
1464 On Unix the default viewer is xloadimage -fork -quiet -title
1465 'KeyID 0x%k' STDIN with a fallback to display -title 'KeyID
1466 0x%k' %i and finally to xdg-open %i. On Windows !ShellExecute
1467 400 %i is used; here the command is a meta command to use that
1468 API call followed by a wait time in milliseconds which is used
1469 to give the viewer time to read the temporary image file before
1470 gpg deletes it again. Note that if your image viewer program is
1471 not secure, then executing it from gpg does not make it secure.
1472
1473
1474 --exec-path string
1475 Sets a list of directories to search for photo viewers If not
1476 provided photo viewers use the PATH environment variable.
1477
1478
1479 --keyring file
1480 Add file to the current list of keyrings. If file begins with a
1481 tilde and a slash, these are replaced by the $HOME directory. If
1482 the filename does not contain a slash, it is assumed to be in
1483 the GnuPG home directory ("~/.gnupg" unless --homedir or
1484 $GNUPGHOME is used).
1485
1486 Note that this adds a keyring to the current list. If the intent
1487 is to use the specified keyring alone, use --keyring along with
1488 --no-default-keyring.
1489
1490 If the option --no-keyring has been used no keyrings will be
1491 used at all.
1492
1493 Note that if the option use-keyboxd is enabled in ‘common.conf’,
1494 no keyrings are used at all and keys are all maintained by the
1495 keyboxd process in its own database.
1496
1497
1498 --primary-keyring file
1499 This is a varian of --keyring and designates file as the primary
1500 public keyring. This means that newly imported keys (via --im‐
1501 port or keyserver --recv-from) will go to this keyring.
1502
1503
1504
1505 --secret-keyring file
1506 This is an obsolete option and ignored. All secret keys are
1507 stored in the ‘private-keys-v1.d’ directory below the GnuPG home
1508 directory.
1509
1510
1511 --trustdb-name file
1512 Use file instead of the default trustdb. If file begins with a
1513 tilde and a slash, these are replaced by the $HOME directory. If
1514 the filename does not contain a slash, it is assumed to be in
1515 the GnuPG home directory (‘~/.gnupg’ if --homedir or $GNUPGHOME
1516 is not used).
1517
1518
1519 --homedir dir
1520 Set the name of the home directory to dir. If this option is not
1521 used, the home directory defaults to ‘~/.gnupg’. It is only
1522 recognized when given on the command line. It also overrides
1523 any home directory stated through the environment variable
1524 ‘GNUPGHOME’ or (on Windows systems) by means of the Registry en‐
1525 try HKCU\Software\GNU\GnuPG:HomeDir.
1526
1527 On Windows systems it is possible to install GnuPG as a portable
1528 application. In this case only this command line option is con‐
1529 sidered, all other ways to set a home directory are ignored.
1530
1531 To install GnuPG as a portable application under Windows, create
1532 an empty file named ‘gpgconf.ctl’ in the same directory as the
1533 tool ‘gpgconf.exe’. The root of the installation is then that
1534 directory; or, if ‘gpgconf.exe’ has been installed directly be‐
1535 low a directory named ‘bin’, its parent directory. You also
1536 need to make sure that the following directories exist and are
1537 writable: ‘ROOT/home’ for the GnuPG home and
1538 ‘ROOT/var/cache/gnupg’ for internal cache files.
1539
1540
1541
1542 --display-charset name
1543 Set the name of the native character set. This is used to con‐
1544 vert some informational strings like user IDs to the proper
1545 UTF-8 encoding. Note that this has nothing to do with the char‐
1546 acter set of data to be encrypted or signed; GnuPG does not re‐
1547 code user-supplied data. If this option is not used, the default
1548 character set is determined from the current locale. A verbosity
1549 level of 3 shows the chosen set. This option should not be used
1550 on Windows. Valid values for name are:
1551
1552
1553
1554 iso-8859-1
1555 This is the Latin 1 set.
1556
1557
1558 iso-8859-2
1559 The Latin 2 set.
1560
1561
1562 iso-8859-15
1563 This is currently an alias for the Latin 1 set.
1564
1565
1566 koi8-r The usual Russian set (RFC-1489).
1567
1568
1569 utf-8 Bypass all translations and assume that the OS uses na‐
1570 tive UTF-8 encoding.
1571
1572
1573 --utf8-strings
1574 --no-utf8-strings
1575 Assume that command line arguments are given as UTF-8 strings.
1576 The default (--no-utf8-strings) is to assume that arguments are
1577 encoded in the character set as specified by --display-charset.
1578 These options affect all following arguments. Both options may
1579 be used multiple times. This option should not be used in an
1580 option file.
1581
1582 This option has no effect on Windows. There the internal used
1583 UTF-8 encoding is translated for console input and output. The
1584 command line arguments are expected as Unicode and translated to
1585 UTF-8. Thus when calling this program from another, make sure
1586 to use the Unicode version of CreateProcess.
1587
1588
1589
1590 --options file
1591 Read options from file and do not try to read them from the de‐
1592 fault options file in the homedir (see --homedir). This option
1593 is ignored if used in an options file.
1594
1595
1596 --no-options
1597 Shortcut for --options /dev/null. This option is detected before
1598 an attempt to open an option file. Using this option will also
1599 prevent the creation of a ‘~/.gnupg’ homedir.
1600
1601
1602 -z n
1603 --compress-level n
1604 --bzip2-compress-level n
1605 --no-compress
1606 Set compression level to n for the ZIP and ZLIB compression al‐
1607 gorithms. The default is to use the default compression level of
1608 zlib (normally 6). --bzip2-compress-level sets the compression
1609 level for the BZIP2 compression algorithm (defaulting to 6 as
1610 well). This is a different option from --compress-level since
1611 BZIP2 uses a significant amount of memory for each additional
1612 compression level.
1613
1614 Option -z sets both. A value of 0 for n disables compression. A
1615 value of -1 forces compression using the default level. Option
1616 --no-compress is identical to -z0.
1617
1618 Except for the --store command compression is always used unless
1619 gpg detects that the input is already compressed. To inhibit
1620 the use of compression use -z0 or --no-compress; to force com‐
1621 pression use -z-1 or option z with another compression level
1622 than the default as indicated by -1. Note that this overriding
1623 of the default deection works only with z and not with the long
1624 variant of this option.
1625
1626
1627
1628 --bzip2-decompress-lowmem
1629 Use a different decompression method for BZIP2 compressed files.
1630 This alternate method uses a bit more than half the memory, but
1631 also runs at half the speed. This is useful under extreme low
1632 memory circumstances when the file was originally compressed at
1633 a high --bzip2-compress-level.
1634
1635
1636
1637 --mangle-dos-filenames
1638 --no-mangle-dos-filenames
1639 Older version of Windows cannot handle filenames with more than
1640 one dot. --mangle-dos-filenames causes GnuPG to replace (rather
1641 than add to) the extension of an output filename to avoid this
1642 problem. This option is off by default and has no effect on non-
1643 Windows platforms.
1644
1645
1646 --ask-cert-level
1647 --no-ask-cert-level
1648 When making a key signature, prompt for a certification level.
1649 If this option is not specified, the certification level used is
1650 set via --default-cert-level. See --default-cert-level for in‐
1651 formation on the specific levels and how they are used. --no-
1652 ask-cert-level disables this option. This option defaults to no.
1653
1654
1655 --default-cert-level n
1656 The default to use for the check level when signing a key.
1657
1658 0 means you make no particular claim as to how carefully you
1659 verified the key.
1660
1661 1 means you believe the key is owned by the person who claims to
1662 own it but you could not, or did not verify the key at all. This
1663 is useful for a "persona" verification, where you sign the key
1664 of a pseudonymous user.
1665
1666 2 means you did casual verification of the key. For example,
1667 this could mean that you verified the key fingerprint and
1668 checked the user ID on the key against a photo ID.
1669
1670 3 means you did extensive verification of the key. For example,
1671 this could mean that you verified the key fingerprint with the
1672 owner of the key in person, and that you checked, by means of a
1673 hard to forge document with a photo ID (such as a passport) that
1674 the name of the key owner matches the name in the user ID on the
1675 key, and finally that you verified (by exchange of email) that
1676 the email address on the key belongs to the key owner.
1677
1678 Note that the examples given above for levels 2 and 3 are just
1679 that: examples. In the end, it is up to you to decide just what
1680 "casual" and "extensive" mean to you.
1681
1682 This option defaults to 0 (no particular claim).
1683
1684
1685 --min-cert-level
1686 When building the trust database, treat any signatures with a
1687 certification level below this as invalid. Defaults to 2, which
1688 disregards level 1 signatures. Note that level 0 "no particular
1689 claim" signatures are always accepted.
1690
1691
1692 --trusted-key long key ID or fingerprint
1693 Assume that the specified key (which should be given as finger‐
1694 print) is as trustworthy as one of your own secret keys. This
1695 option is useful if you don't want to keep your secret keys (or
1696 one of them) online but still want to be able to check the va‐
1697 lidity of a given recipient's or signator's key. If the given
1698 key is not locally available but an LDAP keyserver is configured
1699 the missing key is imported from that server.
1700
1701
1702 --add-desig-revoker [sensitive:]fingerprint
1703 Add the key specified by fingerprint as a designated revoker to
1704 newly created keys. If the fingerprint is prefixed with the
1705 keyword ``sensitive:'' that info is normally not exported wit
1706 the key. This option may be given several time to add more than
1707 one designated revoker. If the keyword ``clear'' is used in‐
1708 stead of a fingerprint, all designated options previously en‐
1709 countered are discarded. Designated revokers are marked on the
1710 key as non-revocable. Note that a designated revoker specified
1711 using a parameter file will also be added to the key.
1712
1713
1714
1715 --trust-model {pgp|classic|tofu|tofu+pgp|direct|always|auto}
1716 Set what trust model GnuPG should follow. The models are:
1717
1718
1719
1720 pgp This is the Web of Trust combined with trust signatures
1721 as used in PGP 5.x and later. This is the default trust
1722 model when creating a new trust database.
1723
1724
1725 classic
1726 This is the standard Web of Trust as introduced by PGP 2.
1727
1728
1729 tofu
1730
1731 TOFU stands for Trust On First Use. In this experimental
1732 trust model, the first time a key is seen, it is memo‐
1733 rized. If later another key with a user id with the same
1734 email address is seen, both keys are marked as suspect.
1735 In that case, the next time either is used, a warning is
1736 displayed describing the conflict, why it might have oc‐
1737 curred (either the user generated a new key and failed to
1738 cross sign the old and new keys, the key is forgery, or a
1739 man-in-the-middle attack is being attempted), and the
1740 user is prompted to manually confirm the validity of the
1741 key in question.
1742
1743 Because a potential attacker is able to control the email
1744 address and thereby circumvent the conflict detection al‐
1745 gorithm by using an email address that is similar in ap‐
1746 pearance to a trusted email address, whenever a message
1747 is verified, statistics about the number of messages
1748 signed with the key are shown. In this way, a user can
1749 easily identify attacks using fake keys for regular cor‐
1750 respondents.
1751
1752 When compared with the Web of Trust, TOFU offers signifi‐
1753 cantly weaker security guarantees. In particular, TOFU
1754 only helps ensure consistency (that is, that the binding
1755 between a key and email address doesn't change). A major
1756 advantage of TOFU is that it requires little maintenance
1757 to use correctly. To use the web of trust properly, you
1758 need to actively sign keys and mark users as trusted in‐
1759 troducers. This is a time-consuming process and anecdo‐
1760 tal evidence suggests that even security-conscious users
1761 rarely take the time to do this thoroughly and instead
1762 rely on an ad-hoc TOFU process.
1763
1764 In the TOFU model, policies are associated with bindings
1765 between keys and email addresses (which are extracted
1766 from user ids and normalized). There are five policies,
1767 which can be set manually using the --tofu-policy option.
1768 The default policy can be set using the --tofu-default-
1769 policy option.
1770
1771 The TOFU policies are: auto, good, unknown, bad and ask.
1772 The auto policy is used by default (unless overridden by
1773 --tofu-default-policy) and marks a binding as marginally
1774 trusted. The good, unknown and bad policies mark a bind‐
1775 ing as fully trusted, as having unknown trust or as hav‐
1776 ing trust never, respectively. The unknown policy is
1777 useful for just using TOFU to detect conflicts, but to
1778 never assign positive trust to a binding. The final pol‐
1779 icy, ask prompts the user to indicate the binding's
1780 trust. If batch mode is enabled (or input is inappropri‐
1781 ate in the context), then the user is not prompted and
1782 the undefined trust level is returned.
1783
1784
1785 tofu+pgp
1786 This experimental trust model combines TOFU with the Web
1787 of Trust. This is done by computing the trust level for
1788 each model and then taking the maximum trust level where
1789 the trust levels are ordered as follows: unknown < unde‐
1790 fined < marginal < fully < ultimate < expired < never.
1791
1792 By setting --tofu-default-policy=unknown, this model can
1793 be used to implement the web of trust with TOFU's con‐
1794 flict detection algorithm, but without its assignment of
1795 positive trust values, which some security-conscious
1796 users don't like.
1797
1798
1799 direct Key validity is set directly by the user and not calcu‐
1800 lated via the Web of Trust. This model is solely based
1801 on the key and does not distinguish user IDs. Note that
1802 when changing to another trust model the trust values as‐
1803 signed to a key are transformed into ownertrust values,
1804 which also indicate how you trust the owner of the key to
1805 sign other keys.
1806
1807
1808 always Skip key validation and assume that used keys are always
1809 fully valid. You generally won't use this unless you are
1810 using some external validation scheme. This option also
1811 suppresses the "[uncertain]" tag printed with signature
1812 checks when there is no evidence that the user ID is
1813 bound to the key. Note that this trust model still does
1814 not allow the use of expired, revoked, or disabled keys.
1815
1816
1817 auto Select the trust model depending on whatever the internal
1818 trust database says. This is the default model if such a
1819 database already exists. Note that a tofu trust model is
1820 not considered here and must be enabled explicitly.
1821
1822
1823 --always-trust
1824 Identical to --trust-model always.
1825
1826
1827 --assert-signer fpr_or_file
1828 This option checks whether at least one valid signature on a
1829 file has been made with the specified key. The key is either
1830 specified as a fingerprint or a file listing fingerprints. The
1831 fingerprint must be given or listed in compact format (no colons
1832 or spaces in between). This option can be given multiple times
1833 and each fingerprint is checked against the signing key as well
1834 as the corresponding primary key. If fpr_or_file specifies a
1835 file, empty lines are ignored as well as all lines starting with
1836 a hash sign. With this option gpg is guaranteed to return with
1837 an exit code of 0 if and only if a signature has been encoun‐
1838 tered, is valid, and the key matches one of the fingerprints
1839 given by this option.
1840
1841
1842
1843 --auto-key-locate mechanisms
1844 --no-auto-key-locate
1845 GnuPG can automatically locate and retrieve keys as needed using
1846 this option. This happens when encrypting to an email address
1847 (in the "user@example.com" form), and there are no "user@exam‐
1848 ple.com" keys on the local keyring. This option takes any num‐
1849 ber of the mechanisms listed below, in the order they are to be
1850 tried. Instead of listing the mechanisms as comma delimited ar‐
1851 guments, the option may also be given several times to add more
1852 mechanism. The option --no-auto-key-locate or the mechanism
1853 "clear" resets the list. The default is "local,wkd".
1854
1855
1856
1857 cert Locate a key using DNS CERT, as specified in RFC-4398.
1858
1859
1860 dane Locate a key using DANE, as specified in draft-ietf-dane-
1861 openpgpkey-05.txt.
1862
1863
1864 wkd Locate a key using the Web Key Directory protocol.
1865
1866
1867 ldap Using DNS Service Discovery, check the domain in question
1868 for any LDAP keyservers to use. If this fails, attempt
1869 to locate the key using the PGP Universal method of
1870 checking ‘ldap://keys.(thedomain)’.
1871
1872
1873 ntds Locate the key using the Active Directory (Windows only).
1874 This method also allows to search by fingerprint using
1875 the command --locate-external-key. Note that this mecha‐
1876 nism is actually a shortcut for the mechanism ‘keyserver’
1877 but using "ldap:///" as the keyserver.
1878
1879
1880 keyserver
1881 Locate a key using a keyserver. This method also allows
1882 to search by fingerprint using the command --locate-ex‐
1883 ternal-key if any of the configured keyservers is an LDAP
1884 server.
1885
1886
1887 keyserver-URL
1888 In addition, a keyserver URL as used in the dirmngr con‐
1889 figuration may be used here to query that particular key‐
1890 server. This method also allows to search by fingerprint
1891 using the command --locate-external-key if the URL speci‐
1892 fies an LDAP server.
1893
1894
1895 local Locate the key using the local keyrings. This mechanism
1896 allows the user to select the order a local key lookup is
1897 done. Thus using ‘--auto-key-locate local’ is identical
1898 to --no-auto-key-locate.
1899
1900
1901 nodefault
1902 This flag disables the standard local key lookup, done
1903 before any of the mechanisms defined by the --auto-key-
1904 locate are tried. The position of this mechanism in the
1905 list does not matter. It is not required if local is
1906 also used.
1907
1908
1909 clear Clear all defined mechanisms. This is useful to override
1910 mechanisms given in a config file. Note that a nodefault
1911 in mechanisms will also be cleared unless it is given af‐
1912 ter the clear.
1913
1914
1915
1916
1917 --auto-key-import
1918 --no-auto-key-import
1919 This is an offline mechanism to get a missing key for signature
1920 verification and for later encryption to this key. If this op‐
1921 tion is enabled and a signature includes an embedded key, that
1922 key is used to verify the signature and on verification success
1923 the key is imported. The default is --no-auto-key-import.
1924
1925 On the sender (signing) site the option --include-key-block
1926 needs to be used to put the public part of the signing key as
1927 “Key Block subpacket” into the signature.
1928
1929
1930 --auto-key-retrieve
1931 --no-auto-key-retrieve
1932 These options enable or disable the automatic retrieving of keys
1933 from a keyserver when verifying signatures made by keys that are
1934 not on the local keyring. The default is --no-auto-key-re‐
1935 trieve.
1936
1937 The order of methods tried to lookup the key is:
1938
1939 1. If the option --auto-key-import is set and the signatures in‐
1940 cludes an embedded key, that key is used to verify the signature
1941 and on verification success that key is imported.
1942
1943 2. If a preferred keyserver is specified in the signature and
1944 the option honor-keyserver-url is active (which is not the de‐
1945 fault), that keyserver is tried. Note that the creator of the
1946 signature uses the option --sig-keyserver-url to specify the
1947 preferred keyserver for data signatures.
1948
1949 3. If the signature has the Signer's UID set (e.g. using
1950 --sender while creating the signature) a Web Key Directory (WKD)
1951 lookup is done. This is the default configuration but can be
1952 disabled by removing WKD from the auto-key-locate list or by us‐
1953 ing the option --disable-signer-uid.
1954
1955 4. If any keyserver is configured and the Issuer Fingerprint is
1956 part of the signature (since GnuPG 2.1.16), the configured key‐
1957 servers are tried.
1958
1959 Note that this option makes a "web bug" like behavior possible.
1960 Keyserver or Web Key Directory operators can see which keys you
1961 request, so by sending you a message signed by a brand new key
1962 (which you naturally will not have on your local keyring), the
1963 operator can tell both your IP address and the time when you
1964 verified the signature.
1965
1966
1967 --keyid-format {none|short|0xshort|long|0xlong}
1968 Select how to display key IDs. "none" does not show the key ID
1969 at all but shows the fingerprint in a separate line. "short" is
1970 the traditional 8-character key ID. "long" is the more accurate
1971 (but less convenient) 16-character key ID. Add an "0x" to ei‐
1972 ther to include an "0x" at the beginning of the key ID, as in
1973 0x99242560. Note that this option is ignored if the option
1974 --with-colons is used.
1975
1976
1977 --keyserver name
1978 This option is deprecated - please use the --keyserver in ‘dirm‐
1979 ngr.conf’ instead.
1980
1981 Use name as your keyserver. This is the server that --receive-
1982 keys, --send-keys, and --search-keys will communicate with to
1983 receive keys from, send keys to, and search for keys on. The
1984 format of the name is a URI: `scheme:[//]keyservername[:port]'
1985 The scheme is the type of keyserver: "hkp"/"hkps" for the HTTP
1986 (or compatible) keyservers or "ldap"/"ldaps" for the LDAP key‐
1987 servers. Note that your particular installation of GnuPG may
1988 have other keyserver types available as well. Keyserver schemes
1989 are case-insensitive.
1990
1991 Most keyservers synchronize with each other, so there is gener‐
1992 ally no need to send keys to more than one server. The keyserver
1993 hkp://keys.gnupg.net uses round robin DNS to give a different
1994 keyserver each time you use it.
1995
1996
1997 --keyserver-options {name=value}
1998 This is a space or comma delimited string that gives options for
1999 the keyserver. Options can be prefixed with a `no-' to give the
2000 opposite meaning. Valid import-options or export-options may be
2001 used here as well to apply to importing (--recv-key) or export‐
2002 ing (--send-key) a key from a keyserver. While not all options
2003 are available for all keyserver types, some common options are:
2004
2005
2006
2007 include-revoked
2008 When searching for a key with --search-keys, include keys
2009 that are marked on the keyserver as revoked. Note that
2010 not all keyservers differentiate between revoked and un‐
2011 revoked keys, and for such keyservers this option is
2012 meaningless. Note also that most keyservers do not have
2013 cryptographic verification of key revocations, and so
2014 turning this option off may result in skipping keys that
2015 are incorrectly marked as revoked.
2016
2017
2018 include-disabled
2019 When searching for a key with --search-keys, include keys
2020 that are marked on the keyserver as disabled. Note that
2021 this option is not used with HKP keyservers.
2022
2023
2024 auto-key-retrieve
2025 This is an obsolete alias for the option auto-key-re‐
2026 trieve. Please do not use it; it will be removed in fu‐
2027 ture versions..
2028
2029
2030 honor-keyserver-url
2031 When using --refresh-keys, if the key in question has a
2032 preferred keyserver URL, then use that preferred key‐
2033 server to refresh the key from. In addition, if auto-key-
2034 retrieve is set, and the signature being verified has a
2035 preferred keyserver URL, then use that preferred key‐
2036 server to fetch the key from. Note that this option in‐
2037 troduces a "web bug": The creator of the key can see when
2038 the keys is refreshed. Thus this option is not enabled
2039 by default.
2040
2041
2042 include-subkeys
2043 When receiving a key, include subkeys as potential tar‐
2044 gets. Note that this option is not used with HKP key‐
2045 servers, as they do not support retrieving keys by subkey
2046 id.
2047
2048
2049 timeout
2050 http-proxy=value
2051 verbose
2052 debug
2053 check-cert
2054
2055 ca-cert-file
2056 These options have no more function since GnuPG 2.1. Use
2057 the dirmngr configuration options instead.
2058
2059
2060 The default list of options is: "self-sigs-only, import-clean, repair-
2061 keys, repair-pks-subkey-bug, export-attributes". However, if the actual
2062 used source is an LDAP server "no-self-sigs-only" is assumed unless
2063 "self-sigs-only" has been explicitly configured.
2064
2065
2066
2067 --completes-needed n
2068 Number of completely trusted users to introduce a new key signer
2069 (defaults to 1).
2070
2071
2072 --marginals-needed n
2073 Number of marginally trusted users to introduce a new key signer
2074 (defaults to 3)
2075
2076
2077 --tofu-default-policy {auto|good|unknown|bad|ask}
2078 The default TOFU policy (defaults to auto). For more informa‐
2079 tion about the meaning of this option, see: [trust-model-tofu].
2080
2081
2082 --max-cert-depth n
2083 Maximum depth of a certification chain (default is 5).
2084
2085
2086 --no-sig-cache
2087 Do not cache the verification status of key signatures. Caching
2088 gives a much better performance in key listings. However, if you
2089 suspect that your public keyring is not safe against write modi‐
2090 fications, you can use this option to disable the caching. It
2091 probably does not make sense to disable it because all kind of
2092 damage can be done if someone else has write access to your pub‐
2093 lic keyring.
2094
2095
2096 --auto-check-trustdb
2097 --no-auto-check-trustdb
2098 If GnuPG feels that its information about the Web of Trust has
2099 to be updated, it automatically runs the --check-trustdb command
2100 internally. This may be a time consuming process. --no-auto-
2101 check-trustdb disables this option.
2102
2103
2104 --use-agent
2105 --no-use-agent
2106 This is dummy option. gpg always requires the agent.
2107
2108
2109 --gpg-agent-info
2110 This is dummy option. It has no effect when used with gpg.
2111
2112
2113
2114 --agent-program file
2115 Specify an agent program to be used for secret key operations.
2116 The default value is determined by running gpgconf with the op‐
2117 tion --list-dirs. Note that the pipe symbol (|) is used for a
2118 regression test suite hack and may thus not be used in the file
2119 name.
2120
2121
2122 --dirmngr-program file
2123 Specify a dirmngr program to be used for keyserver access. The
2124 default value is ‘/usr/bin/dirmngr’.
2125
2126
2127 --disable-dirmngr
2128 Entirely disable the use of the Dirmngr.
2129
2130
2131 --no-autostart
2132 Do not start the gpg-agent or the dirmngr if it has not yet been
2133 started and its service is required. This option is mostly use‐
2134 ful on machines where the connection to gpg-agent has been redi‐
2135 rected to another machines. If dirmngr is required on the re‐
2136 mote machine, it may be started manually using gpgconf --launch
2137 dirmngr.
2138
2139
2140 --lock-once
2141 Lock the databases the first time a lock is requested and do not
2142 release the lock until the process terminates.
2143
2144
2145 --lock-multiple
2146 Release the locks every time a lock is no longer needed. Use
2147 this to override a previous --lock-once from a config file.
2148
2149
2150 --lock-never
2151 Disable locking entirely. This option should be used only in
2152 very special environments, where it can be assured that only one
2153 process is accessing those files. A bootable floppy with a
2154 stand-alone encryption system will probably use this. Improper
2155 usage of this option may lead to data and key corruption.
2156
2157
2158 --exit-on-status-write-error
2159 This option will cause write errors on the status FD to immedi‐
2160 ately terminate the process. That should in fact be the default
2161 but it never worked this way and thus we need an option to en‐
2162 able this, so that the change won't break applications which
2163 close their end of a status fd connected pipe too early. Using
2164 this option along with --enable-progress-filter may be used to
2165 cleanly cancel long running gpg operations.
2166
2167
2168 --limit-card-insert-tries n
2169 With n greater than 0 the number of prompts asking to insert a
2170 smartcard gets limited to N-1. Thus with a value of 1 gpg won't
2171 at all ask to insert a card if none has been inserted at
2172 startup. This option is useful in the configuration file in case
2173 an application does not know about the smartcard support and
2174 waits ad infinitum for an inserted card.
2175
2176
2177 --no-random-seed-file
2178 GnuPG uses a file to store its internal random pool over invoca‐
2179 tions. This makes random generation faster; however sometimes
2180 write operations are not desired. This option can be used to
2181 achieve that with the cost of slower random generation.
2182
2183
2184 --no-greeting
2185 Suppress the initial copyright message.
2186
2187
2188 --no-secmem-warning
2189 Suppress the warning about "using insecure memory".
2190
2191
2192 --no-permission-warning
2193 Suppress the warning about unsafe file and home directory
2194 (--homedir) permissions. Note that the permission checks that
2195 GnuPG performs are not intended to be authoritative, but rather
2196 they simply warn about certain common permission problems. Do
2197 not assume that the lack of a warning means that your system is
2198 secure.
2199
2200 Note that the warning for unsafe --homedir permissions cannot be
2201 suppressed in the gpg.conf file, as this would allow an attacker
2202 to place an unsafe gpg.conf file in place, and use this file to
2203 suppress warnings about itself. The --homedir permissions warn‐
2204 ing may only be suppressed on the command line.
2205
2206
2207 --require-secmem
2208 --no-require-secmem
2209 Refuse to run if GnuPG cannot get secure memory. Defaults to no
2210 (i.e. run, but give a warning).
2211
2212
2213
2214 --require-cross-certification
2215 --no-require-cross-certification
2216 When verifying a signature made from a subkey, ensure that the
2217 cross certification "back signature" on the subkey is present
2218 and valid. This protects against a subtle attack against sub‐
2219 keys that can sign. Defaults to --require-cross-certification
2220 for gpg.
2221
2222
2223 --expert
2224 --no-expert
2225 Allow the user to do certain nonsensical or "silly" things like
2226 signing an expired or revoked key, or certain potentially incom‐
2227 patible things like generating unusual key types. This also dis‐
2228 ables certain warning messages about potentially incompatible
2229 actions. As the name implies, this option is for experts only.
2230 If you don't fully understand the implications of what it allows
2231 you to do, leave this off. --no-expert disables this option.
2232
2233
2234 Key related options
2235
2236
2237
2238
2239 --recipient name
2240 -r Encrypt for user id name. If this option or --hidden-recipient
2241 is not specified, GnuPG asks for the user-id unless --default-
2242 recipient is given.
2243
2244
2245 --hidden-recipient name
2246 -R Encrypt for user ID name, but hide the key ID of this user's
2247 key. This option helps to hide the receiver of the message and
2248 is a limited countermeasure against traffic analysis. If this
2249 option or --recipient is not specified, GnuPG asks for the user
2250 ID unless --default-recipient is given.
2251
2252
2253 --recipient-file file
2254 -f This option is similar to --recipient except that it encrypts to
2255 a key stored in the given file. file must be the name of a file
2256 containing exactly one key. gpg assumes that the key in this
2257 file is fully valid.
2258
2259
2260 --hidden-recipient-file file
2261 -F This option is similar to --hidden-recipient except that it en‐
2262 crypts to a key stored in the given file. file must be the name
2263 of a file containing exactly one key. gpg assumes that the key
2264 in this file is fully valid.
2265
2266
2267 --encrypt-to name
2268 Same as --recipient but this one is intended for use in the op‐
2269 tions file and may be used with your own user-id as an "encrypt-
2270 to-self". These keys are only used when there are other recipi‐
2271 ents given either by use of --recipient or by the asked user id.
2272 No trust checking is performed for these user ids and even dis‐
2273 abled keys can be used.
2274
2275
2276 --hidden-encrypt-to name
2277 Same as --hidden-recipient but this one is intended for use in
2278 the options file and may be used with your own user-id as a hid‐
2279 den "encrypt-to-self". These keys are only used when there are
2280 other recipients given either by use of --recipient or by the
2281 asked user id. No trust checking is performed for these user
2282 ids and even disabled keys can be used.
2283
2284
2285 --no-encrypt-to
2286 Disable the use of all --encrypt-to and --hidden-encrypt-to
2287 keys.
2288
2289
2290 --group {name=value}
2291 Sets up a named group, which is similar to aliases in email pro‐
2292 grams. Any time the group name is a recipient (-r or --recipi‐
2293 ent), it will be expanded to the values specified. Multiple
2294 groups with the same name are automatically merged into a single
2295 group.
2296
2297 The values are key IDs or fingerprints, but any key description
2298 is accepted. Note that a value with spaces in it will be treated
2299 as two different values. Note also there is only one level of
2300 expansion --- you cannot make an group that points to another
2301 group. When used from the command line, it may be necessary to
2302 quote the argument to this option to prevent the shell from
2303 treating it as multiple arguments.
2304
2305
2306 --ungroup name
2307 Remove a given entry from the --group list.
2308
2309
2310 --no-groups
2311 Remove all entries from the --group list.
2312
2313
2314 --local-user name
2315 -u Use name as the key to sign with. Note that this option over‐
2316 rides --default-key.
2317
2318
2319 --sender mbox
2320 This option has two purposes. mbox must either be a complete
2321 user ID containing a proper mail address or just a plain mail
2322 address. The option can be given multiple times.
2323
2324 When creating a signature this option tells gpg the signing
2325 key's user id used to make the signature and embeds that user ID
2326 into the created signature (using OpenPGP's ``Signer's User ID''
2327 subpacket). If the option is given multiple times a suitable
2328 user ID is picked. However, if the signing key was specified
2329 directly by using a mail address (i.e. not by using a finger‐
2330 print or key ID) this option is used and the mail address is em‐
2331 bedded in the created signature.
2332
2333 When verifying a signature mbox is used to restrict the informa‐
2334 tion printed by the TOFU code to matching user IDs. If the op‐
2335 tion is used and the signature contains a ``Signer's User ID''
2336 subpacket that information is is also used to restrict the
2337 printed information. Note that GnuPG considers only the mail
2338 address part of a User ID.
2339
2340 If this option or the said subpacket is available the TRUST
2341 lines as printed by option status-fd correspond to the corre‐
2342 sponding User ID; if no User ID is known the TRUST lines are
2343 computed directly on the key and do not give any information
2344 about the User ID. In the latter case it his highly recommended
2345 to scripts and other frontends to evaluate the VALIDSIG line,
2346 retrieve the key and print all User IDs along with their valid‐
2347 ity (trust) information.
2348
2349
2350
2351 --try-secret-key name
2352 For hidden recipients GPG needs to know the keys to use for
2353 trial decryption. The key set with --default-key is always
2354 tried first, but this is often not sufficient. This option al‐
2355 lows setting more keys to be used for trial decryption. Al‐
2356 though any valid user-id specification may be used for name it
2357 makes sense to use at least the long keyid to avoid ambiguities.
2358 Note that gpg-agent might pop up a pinentry for a lot keys to do
2359 the trial decryption. If you want to stop all further trial de‐
2360 cryption you may use close-window button instead of the cancel
2361 button.
2362
2363
2364 --try-all-secrets
2365 Don't look at the key ID as stored in the message but try all
2366 secret keys in turn to find the right decryption key. This op‐
2367 tion forces the behaviour as used by anonymous recipients (cre‐
2368 ated by using --throw-keyids or --hidden-recipient) and might
2369 come handy in case where an encrypted message contains a bogus
2370 key ID.
2371
2372
2373 --skip-hidden-recipients
2374 --no-skip-hidden-recipients
2375 During decryption skip all anonymous recipients. This option
2376 helps in the case that people use the hidden recipients feature
2377 to hide their own encrypt-to key from others. If one has many
2378 secret keys this may lead to a major annoyance because all keys
2379 are tried in turn to decrypt something which was not really in‐
2380 tended for it. The drawback of this option is that it is cur‐
2381 rently not possible to decrypt a message which includes real
2382 anonymous recipients.
2383
2384
2385
2386 Input and Output
2387
2388
2389
2390
2391 --armor
2392 -a Create ASCII armored output. The default is to create the bi‐
2393 nary OpenPGP format.
2394
2395
2396 --no-armor
2397 Assume the input data is not in ASCII armored format.
2398
2399
2400 --output file
2401 -o file
2402 Write output to file. To write to stdout use - as the filename.
2403
2404
2405 --max-output n
2406 This option sets a limit on the number of bytes that will be
2407 generated when processing a file. Since OpenPGP supports various
2408 levels of compression, it is possible that the plaintext of a
2409 given message may be significantly larger than the original
2410 OpenPGP message. While GnuPG works properly with such messages,
2411 there is often a desire to set a maximum file size that will be
2412 generated before processing is forced to stop by the OS limits.
2413 Defaults to 0, which means "no limit".
2414
2415
2416 --chunk-size n
2417 The AEAD encryption mode encrypts the data in chunks so that a
2418 receiving side can check for transmission errors or tampering at
2419 the end of each chunk and does not need to delay this until all
2420 data has been received. The used chunk size is 2^n byte. The
2421 lowest allowed value for n is 6 (64 byte) and the largest is the
2422 default of 22 which creates chunks not larger than 4 MiB.
2423
2424
2425 --input-size-hint n
2426 This option can be used to tell GPG the size of the input data
2427 in bytes. n must be a positive base-10 number. This option is
2428 only useful if the input is not taken from a file. GPG may use
2429 this hint to optimize its buffer allocation strategy. It is
2430 also used by the --status-fd line ``PROGRESS'' to provide a
2431 value for ``total'' if that is not available by other means.
2432
2433
2434 --key-origin string[,url]
2435 gpg can track the origin of a key. Certain origins are implic‐
2436 itly known (e.g. keyserver, web key directory) and set. For a
2437 standard import the origin of the keys imported can be set with
2438 this option. To list the possible values use "help" for string.
2439 Some origins can store an optional url argument. That URL can
2440 appended to string after a comma.
2441
2442
2443 --import-options parameters
2444 This is a space or comma delimited string that gives options for
2445 importing keys. Options can be prepended with a `no-' to give
2446 the opposite meaning. The options are:
2447
2448
2449
2450 import-local-sigs
2451 Allow importing key signatures marked as "local". This is
2452 not generally useful unless a shared keyring scheme is
2453 being used. Defaults to no.
2454
2455
2456 keep-ownertrust
2457 Normally possible still existing ownertrust values of a
2458 key are cleared if a key is imported. This is in general
2459 desirable so that a formerly deleted key does not auto‐
2460 matically gain an ownertrust values merely due to import.
2461 On the other hand it is sometimes necessary to re-import
2462 a trusted set of keys again but keeping already assigned
2463 ownertrust values. This can be achieved by using this
2464 option.
2465
2466
2467 repair-pks-subkey-bug
2468 During import, attempt to repair the damage caused by the
2469 PKS keyserver bug (pre version 0.9.6) that mangles keys
2470 with multiple subkeys. Note that this cannot completely
2471 repair the damaged key as some crucial data is removed by
2472 the keyserver, but it does at least give you back one
2473 subkey. Defaults to no for regular --import and to yes
2474 for keyserver --receive-keys.
2475
2476
2477 import-show
2478 show-only
2479 Show a listing of the key as imported right before it is
2480 stored. This can be combined with the option --dry-run
2481 to only look at keys; the option show-only is a shortcut
2482 for this combination. The command --show-keys is another
2483 shortcut for this. Note that suffixes like '#' for "sec"
2484 and "sbb" lines may or may not be printed.
2485
2486
2487 import-export
2488 Run the entire import code but instead of storing the key
2489 to the local keyring write it to the output. The export
2490 option export-dane affect the output. This option can
2491 for example be used to remove all invalid parts from a
2492 key without the need to store it.
2493
2494
2495 merge-only
2496 During import, allow key updates to existing keys, but do
2497 not allow any new keys to be imported. Defaults to no.
2498
2499
2500 import-clean
2501 After import, compact (remove all signatures except the
2502 self-signature) any user IDs from the new key that are
2503 not usable. Then, remove any signatures from the new key
2504 that are not usable. This includes signatures that were
2505 issued by keys that are not present on the keyring. This
2506 option is the same as running the --edit-key command
2507 "clean" after import. Defaults to no.
2508
2509
2510 self-sigs-only
2511 Accept only self-signatures while importing a key. All
2512 other key signatures are skipped at an early import
2513 stage. This option can be used with keyserver-options to
2514 mitigate attempts to flood a key with bogus signatures
2515 from a keyserver. The drawback is that all other valid
2516 key signatures, as required by the Web of Trust are also
2517 not imported. Note that when using this option along
2518 with import-clean it suppresses the final clean step af‐
2519 ter merging the imported key into the existing key.
2520
2521
2522 repair-keys
2523 After import, fix various problems with the keys. For
2524 example, this reorders signatures, and strips duplicate
2525 signatures. Defaults to yes.
2526
2527
2528 bulk-import
2529 When used the keyboxd (option use-keyboxd in ‘com‐
2530 mon.conf’) does the import within a single transaction.
2531
2532
2533 import-minimal
2534 Import the smallest key possible. This removes all signa‐
2535 tures except the most recent self-signature on each user
2536 ID. This option is the same as running the --edit-key
2537 command "minimize" after import. Defaults to no.
2538
2539
2540 restore
2541 import-restore
2542 Import in key restore mode. This imports all data which
2543 is usually skipped during import; including all GnuPG
2544 specific data. All other contradicting options are over‐
2545 ridden.
2546
2547
2548 --import-filter {name=expr}
2549 --export-filter {name=expr}
2550 These options define an import/export filter which are applied
2551 to the imported/exported keyblock right before it will be
2552 stored/written. name defines the type of filter to use, expr
2553 the expression to evaluate. The option can be used several
2554 times which then appends more expression to the same name.
2555
2556
2557 The available filter types are:
2558
2559
2560
2561 keep-uid
2562 This filter will keep a user id packet and its dependent
2563 packets in the keyblock if the expression evaluates to
2564 true.
2565
2566
2567 drop-subkey
2568 This filter drops the selected subkeys. Currently only
2569 implemented for --export-filter.
2570
2571
2572 drop-sig
2573 This filter drops the selected key signatures on user
2574 ids. Self-signatures are not considered. Currently only
2575 implemented for --import-filter.
2576
2577
2578 select This filter is only implemented by --list-filter. All
2579 property names may be used.
2580
2581
2582 For the syntax of the expression see the chapter "FILTER EXPRESSIONS".
2583 The property names for the expressions depend on the actual filter type
2584 and are indicated in the following table. Note that all property names
2585 may also be used by --list-filter.
2586
2587 Property names may be prefix with a scope delimited by a slash. Valid
2588 scopes are "pub" for public and secret primary keys, "sub" for public
2589 and secret subkeys, "uid" for for user-ID packets, and "sig" for signa‐
2590 ture packets. Invalid scopes are currently ignored.
2591
2592 The available properties are:
2593
2594
2595
2596 uid A string with the user id. (keep-uid)
2597
2598
2599 mbox The addr-spec part of a user id with mailbox or the empty
2600 string. (keep-uid)
2601
2602
2603 algostr
2604 A string with the key algorithm description. For example
2605 "rsa3072" or "ed25519".
2606
2607
2608 key_algo
2609 A number with the public key algorithm of a key or subkey
2610 packet. (drop-subkey)
2611
2612
2613 key_size
2614 A number with the effective key size of a key or subkey
2615 packet. (drop-subkey)
2616
2617
2618 key_created
2619 key_created_d
2620 The first is the timestamp a public key or subkey packet
2621 was created. The second is the same but given as an ISO
2622 string, e.g. "2016-08-17". (drop-subkey)
2623
2624
2625 key_expires
2626 key_expires_d
2627 The expiration time of a public key or subkey or 0 if it
2628 does not expire. The second is the same but given as an
2629 ISO date string or an empty string e.g. "2038-01-19".
2630
2631
2632 fpr The hexified fingerprint of the current subkey or primary
2633 key. (drop-subkey)
2634
2635
2636 primary
2637 Boolean indicating whether the user id is the primary
2638 one. (keep-uid)
2639
2640
2641 expired
2642 Boolean indicating whether a user id (keep-uid), a key
2643 (drop-subkey), or a signature (drop-sig) expired.
2644
2645
2646 revoked
2647 Boolean indicating whether a user id (keep-uid) or a key
2648 (drop-subkey) has been revoked.
2649
2650
2651 disabled
2652 Boolean indicating whether a primary key is disabled.
2653
2654
2655 secret Boolean indicating whether a key or subkey is a secret
2656 one. (drop-subkey)
2657
2658
2659 usage A string indicating the usage flags for the subkey, from
2660 the sequence ``ecsa?''. For example, a subkey capable of
2661 just signing and authentication would be an exact match
2662 for ``sa''. (drop-subkey)
2663
2664
2665 sig_created
2666 sig_created_d
2667 The first is the timestamp a signature packet was cre‐
2668 ated. The second is the same but given as an ISO date
2669 string, e.g. "2016-08-17". (drop-sig)
2670
2671
2672 sig_algo
2673 A number with the public key algorithm of a signature
2674 packet. (drop-sig)
2675
2676
2677 sig_digest_algo
2678 A number with the digest algorithm of a signature packet.
2679 (drop-sig)
2680
2681
2682 origin A string with the key origin or a question mark. For ex‐
2683 ample the string ``wkd'' is used if a key originated from
2684 a Web Key Directory lookup.
2685
2686
2687 lastupd
2688 The timestamp the key was last updated from a keyserver
2689 or the Web Key Directory.
2690
2691
2692 url A string with the the URL associated wit the last key
2693 lookup.
2694
2695
2696
2697 --export-options parameters
2698 This is a space or comma delimited string that gives options for
2699 exporting keys. Options can be prepended with a `no-' to give
2700 the opposite meaning. The options are:
2701
2702
2703
2704 export-local-sigs
2705 Allow exporting key signatures marked as "local". This is
2706 not generally useful unless a shared keyring scheme is
2707 being used. Defaults to no.
2708
2709
2710 export-attributes
2711 Include attribute user IDs (photo IDs) while exporting.
2712 Not including attribute user IDs is useful to export keys
2713 that are going to be used by an OpenPGP program that does
2714 not accept attribute user IDs. Defaults to yes.
2715
2716
2717 export-sensitive-revkeys
2718 Include designated revoker information that was marked as
2719 "sensitive". Defaults to no.
2720
2721
2722
2723 backup
2724 export-backup
2725 Export for use as a backup. The exported data includes
2726 all data which is needed to restore the key or keys later
2727 with GnuPG. The format is basically the OpenPGP format
2728 but enhanced with GnuPG specific data. All other contra‐
2729 dicting options are overridden.
2730
2731
2732 export-clean
2733 Compact (remove all signatures from) user IDs on the key
2734 being exported if the user IDs are not usable. Also, do
2735 not export any signatures that are not usable. This in‐
2736 cludes signatures that were issued by keys that are not
2737 present on the keyring. This option is the same as run‐
2738 ning the --edit-key command "clean" before export except
2739 that the local copy of the key is not modified. Defaults
2740 to no.
2741
2742
2743 export-minimal
2744 Export the smallest key possible. This removes all signa‐
2745 tures except the most recent self-signature on each user
2746 ID. This option is the same as running the --edit-key
2747 command "minimize" before export except that the local
2748 copy of the key is not modified. Defaults to no.
2749
2750
2751 export-revocs
2752 Export only standalone revocation certificates of the
2753 key. This option does not export revocations of 3rd
2754 party certificate revocations.
2755
2756
2757 export-dane
2758 Instead of outputting the key material output OpenPGP
2759 DANE records suitable to put into DNS zone files. An
2760 ORIGIN line is printed before each record to allow di‐
2761 verting the records to the corresponding zone file.
2762
2763
2764 mode1003
2765 Enable the use of a new secret key export format. This
2766 format avoids the re-encryption as required with the cur‐
2767 rent OpenPGP format and also improves the security of the
2768 secret key if it has been protected with a passphrase.
2769 Note that an unprotected key is exported as-is and thus
2770 not secure; the general rule to convey secret keys in an
2771 OpenPGP encrypted file still applies with this mode.
2772 Versions of GnuPG before 2.4.0 are not able to import
2773 such a secret file.
2774
2775
2776
2777 --with-colons
2778 Print key listings delimited by colons. Note that the output
2779 will be encoded in UTF-8 regardless of any --display-charset
2780 setting. This format is useful when GnuPG is called from scripts
2781 and other programs as it is easily machine parsed. The details
2782 of this format are documented in the file ‘doc/DETAILS’, which
2783 is included in the GnuPG source distribution.
2784
2785
2786 --fixed-list-mode
2787 Do not merge primary user ID and primary key in --with-colon
2788 listing mode and print all timestamps as seconds since
2789 1970-01-01. Since GnuPG 2.0.10, this mode is always used and
2790 thus this option is obsolete; it does not harm to use it though.
2791
2792
2793 --legacy-list-mode
2794 Revert to the pre-2.1 public key list mode. This only affects
2795 the human readable output and not the machine interface (i.e.
2796 --with-colons). Note that the legacy format does not convey
2797 suitable information for elliptic curves.
2798
2799
2800 --with-fingerprint
2801 Same as the command --fingerprint but changes only the format of
2802 the output and may be used together with another command.
2803
2804
2805 --with-subkey-fingerprint
2806 If a fingerprint is printed for the primary key, this option
2807 forces printing of the fingerprint for all subkeys. This could
2808 also be achieved by using the --with-fingerprint twice but by
2809 using this option along with keyid-format "none" a compact fin‐
2810 gerprint is printed.
2811
2812
2813 --with-icao-spelling
2814 Print the ICAO spelling of the fingerprint in addition to the
2815 hex digits.
2816
2817
2818 --with-keygrip
2819 Include the keygrip in the key listings. In --with-colons mode
2820 this is implicitly enable for secret keys.
2821
2822
2823 --with-key-origin
2824 Include the locally held information on the origin and last up‐
2825 date of a key in a key listing. In --with-colons mode this is
2826 always printed. This data is currently experimental and shall
2827 not be considered part of the stable API.
2828
2829
2830 --with-wkd-hash
2831 Print a Web Key Directory identifier along with each user ID in
2832 key listings. This is an experimental feature and semantics may
2833 change.
2834
2835
2836 --with-secret
2837 Include info about the presence of a secret key in public key
2838 listings done with --with-colons.
2839
2840
2841 OpenPGP protocol specific options
2842
2843
2844
2845
2846 -t, --textmode
2847 --no-textmode
2848 Treat input files as text and store them in the OpenPGP canoni‐
2849 cal text form with standard "CRLF" line endings. This also sets
2850 the necessary flags to inform the recipient that the encrypted
2851 or signed data is text and may need its line endings converted
2852 back to whatever the local system uses. This option is useful
2853 when communicating between two platforms that have different
2854 line ending conventions (UNIX-like to Mac, Mac to Windows, etc).
2855 --no-textmode disables this option, and is the default.
2856
2857
2858 --force-v3-sigs
2859 --no-force-v3-sigs
2860
2861 --force-v4-certs
2862 --no-force-v4-certs
2863 These options are obsolete and have no effect since GnuPG 2.1.
2864
2865
2866 --force-ocb
2867 --force-aead
2868 Force the use of AEAD encryption over MDC encryption. AEAD is a
2869 modern and faster way to do authenticated encryption than the
2870 old MDC method. --force-aead is an alias and deprecated. See
2871 also option --chunk-size.
2872
2873
2874 --force-mdc
2875 --disable-mdc
2876 These options are obsolete and have no effect since GnuPG 2.2.8.
2877 The MDC is always used unless the keys indicate that an AEAD al‐
2878 gorithm can be used in which case AEAD is used. But note: If
2879 the creation of a legacy non-MDC message is exceptionally re‐
2880 quired, the option --rfc2440 allows for this.
2881
2882
2883 --disable-signer-uid
2884 By default the user ID of the signing key is embedded in the
2885 data signature. As of now this is only done if the signing key
2886 has been specified with local-user using a mail address, or with
2887 sender. This information can be helpful for verifier to locate
2888 the key; see option --auto-key-retrieve.
2889
2890
2891 --include-key-block
2892 --no-include-key-block
2893 This option is used to embed the actual signing key into a data
2894 signature. The embedded key is stripped down to a single user
2895 id and includes only the signing subkey used to create the sig‐
2896 nature as well as as valid encryption subkeys. All other info
2897 is removed from the key to keep it and thus the signature small.
2898 This option is the OpenPGP counterpart to the gpgsm option --in‐
2899 clude-certs and allows the recipient of a signed message to re‐
2900 ply encrypted to the sender without using any online directories
2901 to lookup the key. The default is --no-include-key-block. See
2902 also the option --auto-key-import.
2903
2904
2905 --personal-cipher-preferences string
2906 Set the list of personal cipher preferences to string. Use gpg
2907 --version to get a list of available algorithms, and use none to
2908 set no preference at all. This allows the user to safely over‐
2909 ride the algorithm chosen by the recipient key preferences, as
2910 GPG will only select an algorithm that is usable by all recipi‐
2911 ents. The most highly ranked cipher in this list is also used
2912 for the --symmetric encryption command.
2913
2914
2915 --personal-digest-preferences string
2916 Set the list of personal digest preferences to string. Use gpg
2917 --version to get a list of available algorithms, and use none to
2918 set no preference at all. This allows the user to safely over‐
2919 ride the algorithm chosen by the recipient key preferences, as
2920 GPG will only select an algorithm that is usable by all recipi‐
2921 ents. The most highly ranked digest algorithm in this list is
2922 also used when signing without encryption (e.g. --clear-sign or
2923 --sign).
2924
2925
2926 --personal-compress-preferences string
2927 Set the list of personal compression preferences to string. Use
2928 gpg --version to get a list of available algorithms, and use
2929 none to set no preference at all. This allows the user to
2930 safely override the algorithm chosen by the recipient key pref‐
2931 erences, as GPG will only select an algorithm that is usable by
2932 all recipients. The most highly ranked compression algorithm in
2933 this list is also used when there are no recipient keys to con‐
2934 sider (e.g. --symmetric).
2935
2936
2937 --s2k-cipher-algo name
2938 Use name as the cipher algorithm for symmetric encryption with a
2939 passphrase if --personal-cipher-preferences and --cipher-algo
2940 are not given. The default is AES-128.
2941
2942
2943 --s2k-digest-algo name
2944 Use name as the digest algorithm used to mangle the passphrases
2945 for symmetric encryption. The default is SHA-1.
2946
2947
2948 --s2k-mode n
2949 Selects how passphrases for symmetric encryption are mangled. If
2950 n is 0 a plain passphrase (which is in general not recommended)
2951 will be used, a 1 adds a salt (which should not be used) to the
2952 passphrase and a 3 (the default) iterates the whole process a
2953 number of times (see --s2k-count).
2954
2955
2956 --s2k-count n
2957 Specify how many times the passphrases mangling for symmetric
2958 encryption is repeated. This value may range between 1024 and
2959 65011712 inclusive. The default is inquired from gpg-agent.
2960 Note that not all values in the 1024-65011712 range are legal
2961 and if an illegal value is selected, GnuPG will round up to the
2962 nearest legal value. This option is only meaningful if --s2k-
2963 mode is set to the default of 3.
2964
2965
2966
2967 Compliance options
2968
2969
2970 These options control what GnuPG is compliant to. Only one of these op‐
2971 tions may be active at a time. Note that the default setting of this is
2972 nearly always the correct one. See the INTEROPERABILITY WITH OTHER
2973 OPENPGP PROGRAMS section below before using one of these options.
2974
2975
2976
2977 --gnupg
2978 Use standard GnuPG behavior. This is essentially OpenPGP behav‐
2979 ior (see --openpgp), but with extension from the proposed update
2980 to OpenPGP and with some additional workarounds for common com‐
2981 patibility problems in different versions of PGP. This is the
2982 default option, so it is not generally needed, but it may be
2983 useful to override a different compliance option in the gpg.conf
2984 file.
2985
2986
2987 --openpgp
2988 Reset all packet, cipher and digest options to strict OpenPGP
2989 behavior. This option implies --allow-old-cipher-algos. Use
2990 this option to reset all previous options like --s2k-*, --ci‐
2991 pher-algo, --digest-algo and --compress-algo to OpenPGP compli‐
2992 ant values. All PGP workarounds are disabled.
2993
2994
2995 --rfc4880
2996 Reset all packet, cipher and digest options to strict RFC-4880
2997 behavior. This option implies --allow-old-cipher-algos. Note
2998 that this is currently the same thing as --openpgp.
2999
3000
3001 --rfc4880bis
3002 Reset all packet, cipher and digest options to strict according
3003 to the proposed updates of RFC-4880.
3004
3005
3006 --rfc2440
3007 Reset all packet, cipher and digest options to strict RFC-2440
3008 behavior. Note that by using this option encryption packets are
3009 created in a legacy mode without MDC protection. This is dan‐
3010 gerous and should thus only be used for experiments. This op‐
3011 tion implies --allow-old-cipher-algos. See also option --ig‐
3012 nore-mdc-error.
3013
3014
3015 --pgp6 This option is obsolete; it is handled as an alias for --pgp7
3016
3017
3018 --pgp7 Set up all options to be as PGP 7 compliant as possible. This
3019 allowed the ciphers IDEA, 3DES, CAST5,AES128, AES192, AES256,
3020 and TWOFISH., the hashes MD5, SHA1 and RIPEMD160, and the com‐
3021 pression algorithms none and ZIP. This option implies --escape-
3022 from-lines and disables --throw-keyids,
3023
3024
3025 --pgp8 Set up all options to be as PGP 8 compliant as possible. PGP 8
3026 is a lot closer to the OpenPGP standard than previous versions
3027 of PGP, so all this does is disable --throw-keyids and set --es‐
3028 cape-from-lines. All algorithms are allowed except for the
3029 SHA224, SHA384, and SHA512 digests.
3030
3031
3032 --compliance string
3033 This option can be used instead of one of the options above.
3034 Valid values for string are the above option names (without the
3035 double dash) and possibly others as shown when using "help" for
3036 string.
3037
3038
3039 --min-rsa-length n
3040 This option adjusts the compliance mode "de-vs" for stricter key
3041 size requirements. For example, a value of 3000 turns rsa2048
3042 and dsa2048 keys into non-VS-NfD compliant keys.
3043
3044
3045 --require-compliance
3046 To check that data has been encrypted according to the rules of
3047 the current compliance mode, a gpg user needs to evaluate the
3048 status lines. This is allows frontends to handle compliance
3049 check in a more flexible way. However, for scripted use the re‐
3050 quired evaluation of the status-line requires quite some effort;
3051 this option can be used instead to make sure that the gpg
3052 process exits with a failure if the compliance rules are not
3053 fulfilled. Note that this option has currently an effect only
3054 in "de-vs" mode.
3055
3056
3057 Doing things one usually doesn't want to do
3058
3059
3060
3061
3062 -n
3063 --dry-run
3064 Don't make any changes (this is not completely implemented).
3065
3066
3067 --list-only
3068 Changes the behaviour of some commands. This is like --dry-run
3069 but different in some cases. The semantic of this option may be
3070 extended in the future. Currently it only skips the actual de‐
3071 cryption pass and therefore enables a fast listing of the en‐
3072 cryption keys.
3073
3074
3075 -i
3076 --interactive
3077 Prompt before overwriting any files.
3078
3079
3080 --compatibility-flags flags
3081 Set compatibility flags to work around problems due to non-com‐
3082 pliant keys or data. The flags are given as a comma separated
3083 list of flag names and are OR-ed together. The special flag
3084 "none" clears the list and allows to start over with an empty
3085 list. To get a list of available flags the sole word "help" can
3086 be used.
3087
3088
3089 --debug-level level
3090 Select the debug level for investigating problems. level may be
3091 a numeric value or by a keyword:
3092
3093
3094 none No debugging at all. A value of less than 1 may be used
3095 instead of the keyword.
3096
3097 basic Some basic debug messages. A value between 1 and 2 may
3098 be used instead of the keyword.
3099
3100 advanced
3101 More verbose debug messages. A value between 3 and 5 may
3102 be used instead of the keyword.
3103
3104 expert Even more detailed messages. A value between 6 and 8 may
3105 be used instead of the keyword.
3106
3107 guru All of the debug messages you can get. A value greater
3108 than 8 may be used instead of the keyword. The creation
3109 of hash tracing files is only enabled if the keyword is
3110 used.
3111
3112 How these messages are mapped to the actual debugging flags is not
3113 specified and may change with newer releases of this program. They are
3114 however carefully selected to best aid in debugging.
3115
3116
3117 --debug flags
3118 Set debug flags. All flags are or-ed and flags may be given in
3119 C syntax (e.g. 0x0042) or as a comma separated list of flag
3120 names. To get a list of all supported flags the single word
3121 "help" can be used. This option is only useful for debugging and
3122 the behavior may change at any time without notice.
3123
3124
3125 --debug-all
3126 Set all useful debugging flags.
3127
3128
3129 --debug-iolbf
3130 Set stdout into line buffered mode. This option is only honored
3131 when given on the command line.
3132
3133
3134 --debug-set-iobuf-size n
3135 Change the buffer size of the IOBUFs to n kilobyte. Using 0
3136 prints the current size. Note well: This is a maintainer only
3137 option and may thus be changed or removed at any time without
3138 notice.
3139
3140
3141 --debug-allow-large-chunks
3142 To facilitate software tests and experiments this option allows
3143 to specify a limit of up to 4 EiB (--chunk-size 62).
3144
3145
3146 --debug-ignore-expiration
3147 This option tries to override certain key expiration dates. It
3148 is only useful for certain regression tests.
3149
3150
3151 --faked-system-time epoch
3152 This option is only useful for testing; it sets the system time
3153 back or forth to epoch which is the number of seconds elapsed
3154 since the year 1970. Alternatively epoch may be given as a full
3155 ISO time string (e.g. "20070924T154812").
3156
3157 If you suffix epoch with an exclamation mark (!), the system
3158 time will appear to be frozen at the specified time.
3159
3160
3161 --full-timestrings
3162 Change the format of printed creation and expiration times from
3163 just the date to the date and time. This is in general not use‐
3164 ful and the same information is anyway available in --with-
3165 colons mode. These longer strings are also not well aligned
3166 with other printed data.
3167
3168
3169 --enable-progress-filter
3170 Enable certain PROGRESS status outputs. This option allows
3171 frontends to display a progress indicator while gpg is process‐
3172 ing larger files. There is a slight performance overhead using
3173 it.
3174
3175
3176 --status-fd n
3177 Write special status strings to the file descriptor n. See the
3178 file DETAILS in the documentation for a listing of them.
3179
3180
3181 --status-file file
3182 Same as --status-fd, except the status data is written to file
3183 file.
3184
3185
3186 --logger-fd n
3187 Write log output to file descriptor n and not to STDERR.
3188
3189
3190 --log-file file
3191 --logger-file file
3192 Same as --logger-fd, except the logger data is written to file
3193 file. Use ‘socket://’ to log to s socket.
3194
3195
3196 --log-time
3197 Prefix all log output with a timestamp even if no log file is
3198 used.
3199
3200
3201 --attribute-fd n
3202 Write attribute subpackets to the file descriptor n. This is
3203 most useful for use with --status-fd, since the status messages
3204 are needed to separate out the various subpackets from the
3205 stream delivered to the file descriptor.
3206
3207
3208 --attribute-file file
3209 Same as --attribute-fd, except the attribute data is written to
3210 file file.
3211
3212
3213 --comment string
3214 --no-comments
3215 Use string as a comment string in cleartext signatures and ASCII
3216 armored messages or keys (see --armor). The default behavior is
3217 not to use a comment string. --comment may be repeated multiple
3218 times to get multiple comment strings. --no-comments removes all
3219 comments. It is a good idea to keep the length of a single com‐
3220 ment below 60 characters to avoid problems with mail programs
3221 wrapping such lines. Note that comment lines, like all other
3222 header lines, are not protected by the signature.
3223
3224
3225 --emit-version
3226 --no-emit-version
3227 Force inclusion of the version string in ASCII armored output.
3228 If given once only the name of the program and the major number
3229 is emitted, given twice the minor is also emitted, given thrice
3230 the micro is added, and given four times an operating system
3231 identification is also emitted. --no-emit-version (default)
3232 disables the version line.
3233
3234
3235 --sig-notation {name=value}
3236 --cert-notation {name=value}
3237 -N, --set-notation {name=value}
3238 Put the name value pair into the signature as notation data.
3239 name must consist only of printable characters or spaces, and
3240 must contain a '@' character in the form keyname@domain.exam‐
3241 ple.com (substituting the appropriate keyname and domain name,
3242 of course). This is to help prevent pollution of the IETF re‐
3243 served notation namespace. The --expert flag overrides the '@'
3244 check. value may be any printable string; it will be encoded in
3245 UTF-8, so you should check that your --display-charset is set
3246 correctly. If you prefix name with an exclamation mark (!), the
3247 notation data will be flagged as critical (rfc4880:5.2.3.16).
3248 --sig-notation sets a notation for data signatures. --cert-nota‐
3249 tion sets a notation for key signatures (certifications). --set-
3250 notation sets both.
3251
3252 There are special codes that may be used in notation names. "%k"
3253 will be expanded into the key ID of the key being signed, "%K"
3254 into the long key ID of the key being signed, "%f" into the fin‐
3255 gerprint of the key being signed, "%s" into the key ID of the
3256 key making the signature, "%S" into the long key ID of the key
3257 making the signature, "%g" into the fingerprint of the key mak‐
3258 ing the signature (which might be a subkey), "%p" into the fin‐
3259 gerprint of the primary key of the key making the signature,
3260 "%c" into the signature count from the OpenPGP smartcard, and
3261 "%%" results in a single "%". %k, %K, and %f are only meaningful
3262 when making a key signature (certification), and %c is only
3263 meaningful when using the OpenPGP smartcard.
3264
3265
3266 --known-notation name
3267 Adds name to a list of known critical signature notations. The
3268 effect of this is that gpg will not mark a signature with a
3269 critical signature notation of that name as bad. Note that gpg
3270 already knows by default about a few critical signatures nota‐
3271 tion names.
3272
3273
3274 --sig-policy-url string
3275 --cert-policy-url string
3276 --set-policy-url string
3277 Use string as a Policy URL for signatures (rfc4880:5.2.3.20).
3278 If you prefix it with an exclamation mark (!), the policy URL
3279 packet will be flagged as critical. --sig-policy-url sets a pol‐
3280 icy url for data signatures. --cert-policy-url sets a policy url
3281 for key signatures (certifications). --set-policy-url sets both.
3282
3283 The same %-expandos used for notation data are available here as
3284 well.
3285
3286
3287 --sig-keyserver-url string
3288 Use string as a preferred keyserver URL for data signatures. If
3289 you prefix it with an exclamation mark (!), the keyserver URL
3290 packet will be flagged as critical.
3291
3292 The same %-expandos used for notation data are available here as
3293 well.
3294
3295
3296 --set-filename string
3297 Use string as the filename which is stored inside messages.
3298 This overrides the default, which is to use the actual filename
3299 of the file being encrypted. Using the empty string for string
3300 effectively removes the filename from the output.
3301
3302
3303 --for-your-eyes-only
3304 --no-for-your-eyes-only
3305 Set the `for your eyes only' flag in the message. This causes
3306 GnuPG to refuse to save the file unless the --output option is
3307 given, and PGP to use a "secure viewer" with a claimed Tempest-
3308 resistant font to display the message. This option overrides
3309 --set-filename. --no-for-your-eyes-only disables this option.
3310
3311
3312 --use-embedded-filename
3313 --no-use-embedded-filename
3314 Try to create a file with a name as embedded in the data. This
3315 can be a dangerous option as it enables overwriting files. De‐
3316 faults to no. Note that the option --output overrides this op‐
3317 tion.
3318
3319
3320 --cipher-algo name
3321 Use name as cipher algorithm. Running the program with the com‐
3322 mand --version yields a list of supported algorithms. If this is
3323 not used the cipher algorithm is selected from the preferences
3324 stored with the key. In general, you do not want to use this op‐
3325 tion as it allows you to violate the OpenPGP standard. The op‐
3326 tion --personal-cipher-preferences is the safe way to accomplish
3327 the same thing.
3328
3329
3330 --digest-algo name
3331 Use name as the message digest algorithm. Running the program
3332 with the command --version yields a list of supported algo‐
3333 rithms. In general, you do not want to use this option as it al‐
3334 lows you to violate the OpenPGP standard. The option --per‐
3335 sonal-digest-preferences is the safe way to accomplish the same
3336 thing.
3337
3338
3339 --compress-algo name
3340 Use compression algorithm name. "zlib" is RFC-1950 ZLIB compres‐
3341 sion. "zip" is RFC-1951 ZIP compression which is used by PGP.
3342 "bzip2" is a more modern compression scheme that can compress
3343 some things better than zip or zlib, but at the cost of more
3344 memory used during compression and decompression. "uncompressed"
3345 or "none" disables compression. If this option is not used, the
3346 default behavior is to examine the recipient key preferences to
3347 see which algorithms the recipient supports. If all else fails,
3348 ZIP is used for maximum compatibility.
3349
3350 ZLIB may give better compression results than ZIP, as the com‐
3351 pression window size is not limited to 8k. BZIP2 may give even
3352 better compression results than that, but will use a signifi‐
3353 cantly larger amount of memory while compressing and decompress‐
3354 ing. This may be significant in low memory situations. Note,
3355 however, that PGP (all versions) only supports ZIP compression.
3356 Using any algorithm other than ZIP or "none" will make the mes‐
3357 sage unreadable with PGP. In general, you do not want to use
3358 this option as it allows you to violate the OpenPGP standard.
3359 The option --personal-compress-preferences is the safe way to
3360 accomplish the same thing.
3361
3362
3363 --cert-digest-algo name
3364 Use name as the message digest algorithm used when signing a
3365 key. Running the program with the command --version yields a
3366 list of supported algorithms. Be aware that if you choose an
3367 algorithm that GnuPG supports but other OpenPGP implementations
3368 do not, then some users will not be able to use the key signa‐
3369 tures you make, or quite possibly your entire key. Note also
3370 that a public key algorithm must be compatible with the speci‐
3371 fied digest algorithm; thus selecting an arbitrary digest algo‐
3372 rithm may result in error messages from lower crypto layers or
3373 lead to security flaws.
3374
3375
3376
3377 --disable-cipher-algo name
3378 Never allow the use of name as cipher algorithm. The given name
3379 will not be checked so that a later loaded algorithm will still
3380 get disabled.
3381
3382
3383 --disable-pubkey-algo name
3384 Never allow the use of name as public key algorithm. The given
3385 name will not be checked so that a later loaded algorithm will
3386 still get disabled.
3387
3388
3389 --throw-keyids
3390 --no-throw-keyids
3391 Do not put the recipient key IDs into encrypted messages. This
3392 helps to hide the receivers of the message and is a limited
3393 countermeasure against traffic analysis. ([Using a little social
3394 engineering anyone who is able to decrypt the message can check
3395 whether one of the other recipients is the one he suspects.])
3396 On the receiving side, it may slow down the decryption process
3397 because all available secret keys must be tried. --no-throw-
3398 keyids disables this option. This option is essentially the same
3399 as using --hidden-recipient for all recipients.
3400
3401
3402 --not-dash-escaped
3403 This option changes the behavior of cleartext signatures so that
3404 they can be used for patch files. You should not send such an
3405 armored file via email because all spaces and line endings are
3406 hashed too. You can not use this option for data which has 5
3407 dashes at the beginning of a line, patch files don't have this.
3408 A special armor header line tells GnuPG about this cleartext
3409 signature option.
3410
3411
3412 --escape-from-lines
3413 --no-escape-from-lines
3414 Because some mailers change lines starting with "From " to
3415 ">From " it is good to handle such lines in a special way when
3416 creating cleartext signatures to prevent the mail system from
3417 breaking the signature. Note that all other PGP versions do it
3418 this way too. Enabled by default. --no-escape-from-lines dis‐
3419 ables this option.
3420
3421
3422 --passphrase-repeat n
3423 Specify how many times gpg will request a new passphrase be re‐
3424 peated. This is useful for helping memorize a passphrase. De‐
3425 faults to 1 repetition; can be set to 0 to disable any
3426 passphrase repetition. Note that a n greater than 1 will pop up
3427 the pinentry window n+1 times even if a modern pinentry with two
3428 entry fields is used.
3429
3430
3431 --passphrase-fd n
3432 Read the passphrase from file descriptor n. Only the first line
3433 will be read from file descriptor n. If you use 0 for n, the
3434 passphrase will be read from STDIN. This can only be used if
3435 only one passphrase is supplied.
3436
3437 Note that since Version 2.0 this passphrase is only used if the
3438 option --batch has also been given. Since Version 2.1 the
3439 --pinentry-mode also needs to be set to loopback.
3440
3441
3442 --passphrase-file file
3443 Read the passphrase from file file. Only the first line will be
3444 read from file file. This can only be used if only one
3445 passphrase is supplied. Obviously, a passphrase stored in a file
3446 is of questionable security if other users can read this file.
3447 Don't use this option if you can avoid it.
3448
3449 Note that since Version 2.0 this passphrase is only used if the
3450 option --batch has also been given. Since Version 2.1 the
3451 --pinentry-mode also needs to be set to loopback.
3452
3453
3454 --passphrase string
3455 Use string as the passphrase. This can only be used if only one
3456 passphrase is supplied. Obviously, this is of very questionable
3457 security on a multi-user system. Don't use this option if you
3458 can avoid it.
3459
3460 Note that since Version 2.0 this passphrase is only used if the
3461 option --batch has also been given. Since Version 2.1 the
3462 --pinentry-mode also needs to be set to loopback.
3463
3464
3465 --pinentry-mode mode
3466 Set the pinentry mode to mode. Allowed values for mode are:
3467
3468 default
3469 Use the default of the agent, which is ask.
3470
3471 ask Force the use of the Pinentry.
3472
3473 cancel Emulate use of Pinentry's cancel button.
3474
3475 error Return a Pinentry error (``No Pinentry'').
3476
3477 loopback
3478 Redirect Pinentry queries to the caller. Note that in
3479 contrast to Pinentry the user is not prompted again if he
3480 enters a bad password.
3481
3482
3483 --no-symkey-cache
3484 Disable the passphrase cache used for symmetrical en- and de‐
3485 cryption. This cache is based on the message specific salt
3486 value (cf. --s2k-mode).
3487
3488
3489 --request-origin origin
3490 Tell gpg to assume that the operation ultimately originated at
3491 origin. Depending on the origin certain restrictions are ap‐
3492 plied and the Pinentry may include an extra note on the origin.
3493 Supported values for origin are: local which is the default, re‐
3494 mote to indicate a remote origin or browser for an operation re‐
3495 quested by a web browser.
3496
3497
3498 --command-fd n
3499 This is a replacement for the deprecated shared-memory IPC mode.
3500 If this option is enabled, user input on questions is not ex‐
3501 pected from the TTY but from the given file descriptor. It
3502 should be used together with --status-fd. See the file doc/DE‐
3503 TAILS in the source distribution for details on how to use it.
3504
3505
3506 --command-file file
3507 Same as --command-fd, except the commands are read out of file
3508 file
3509
3510
3511 --allow-non-selfsigned-uid
3512 --no-allow-non-selfsigned-uid
3513 Allow the import and use of keys with user IDs which are not
3514 self-signed. This is not recommended, as a non self-signed user
3515 ID is trivial to forge. --no-allow-non-selfsigned-uid disables.
3516
3517
3518 --allow-freeform-uid
3519 Disable all checks on the form of the user ID while generating a
3520 new one. This option should only be used in very special envi‐
3521 ronments as it does not ensure the de-facto standard format of
3522 user IDs.
3523
3524
3525 --ignore-time-conflict
3526 GnuPG normally checks that the timestamps associated with keys
3527 and signatures have plausible values. However, sometimes a sig‐
3528 nature seems to be older than the key due to clock problems.
3529 This option makes these checks just a warning. See also --ig‐
3530 nore-valid-from for timestamp issues on subkeys.
3531
3532
3533 --ignore-valid-from
3534 GnuPG normally does not select and use subkeys created in the
3535 future. This option allows the use of such keys and thus ex‐
3536 hibits the pre-1.0.7 behaviour. You should not use this option
3537 unless there is some clock problem. See also --ignore-time-con‐
3538 flict for timestamp issues with signatures.
3539
3540
3541 --ignore-crc-error
3542 The ASCII armor used by OpenPGP is protected by a CRC checksum
3543 against transmission errors. Occasionally the CRC gets mangled
3544 somewhere on the transmission channel but the actual content
3545 (which is protected by the OpenPGP protocol anyway) is still
3546 okay. This option allows GnuPG to ignore CRC errors.
3547
3548
3549 --ignore-mdc-error
3550 This option changes a MDC integrity protection failure into a
3551 warning. It is required to decrypt old messages which did not
3552 use an MDC. It may also be useful if a message is partially
3553 garbled, but it is necessary to get as much data as possible out
3554 of that garbled message. Be aware that a missing or failed MDC
3555 can be an indication of an attack. Use with great caution; see
3556 also option --rfc2440.
3557
3558
3559 --allow-old-cipher-algos
3560 Old cipher algorithms like 3DES, IDEA, or CAST5 encrypt data us‐
3561 ing blocks of 64 bits; modern algorithms use blocks of 128 bit
3562 instead. To avoid certain attack on these old algorithms it is
3563 suggested not to encrypt more than 150 MiByte using the same
3564 key. For this reason gpg does not allow the use of 64 bit block
3565 size algorithms for encryption unless this option is specified.
3566
3567
3568 --allow-weak-digest-algos
3569 Signatures made with known-weak digest algorithms are normally
3570 rejected with an ``invalid digest algorithm'' message. This op‐
3571 tion allows the verification of signatures made with such weak
3572 algorithms. MD5 is the only digest algorithm considered weak by
3573 default. See also --weak-digest to reject other digest algo‐
3574 rithms.
3575
3576
3577 --weak-digest name
3578 Treat the specified digest algorithm as weak. Signatures made
3579 over weak digests algorithms are normally rejected. This option
3580 can be supplied multiple times if multiple algorithms should be
3581 considered weak. See also --allow-weak-digest-algos to disable
3582 rejection of weak digests. MD5 is always considered weak, and
3583 does not need to be listed explicitly.
3584
3585
3586 --allow-weak-key-signatures
3587 To avoid a minor risk of collision attacks on third-party key
3588 signatures made using SHA-1, those key signatures are considered
3589 invalid. This options allows to override this restriction.
3590
3591
3592 --override-compliance-check
3593 This was a temporary introduced option and has no more effect.
3594
3595
3596 --no-default-keyring
3597 Do not add the default keyring to the list of keyrings. Note
3598 that GnuPG needs for almost all operations a keyring. Thus if
3599 you use this option and do not provide alternate keyrings via
3600 --keyring, then GnuPG will still use the default keyring.
3601
3602 Note that if the option use-keyboxd is enabled in ‘common.conf’,
3603 no keyrings are used at all and keys are all maintained by the
3604 keyboxd process in its own database.
3605
3606
3607 --no-keyring
3608 Do not use any keyring at all. This overrides the default and
3609 all options which specify keyrings.
3610
3611
3612 --skip-verify
3613 Skip the signature verification step. This may be used to make
3614 the decryption faster if the signature verification is not
3615 needed.
3616
3617
3618 --with-key-data
3619 Print key listings delimited by colons (like --with-colons) and
3620 print the public key data.
3621
3622
3623 --list-signatures
3624 --list-sigs
3625 Same as --list-keys, but the signatures are listed too. This
3626 command has the same effect as using --list-keys with --with-
3627 sig-list. Note that in contrast to --check-signatures the key
3628 signatures are not verified. This command can be used to create
3629 a list of signing keys missing in the local keyring; for exam‐
3630 ple:
3631
3632 gpg --list-sigs --with-colons USERID | \
3633 awk -F: '$1=="sig" && $2=="?" {if($13){print $13}else{print $5}}'
3634
3635
3636 --fast-list-mode
3637 Changes the output of the list commands to work faster; this is
3638 achieved by leaving some parts empty. Some applications don't
3639 need the user ID and the trust information given in the list‐
3640 ings. By using this options they can get a faster listing. The
3641 exact behaviour of this option may change in future versions.
3642 If you are missing some information, don't use this option.
3643
3644
3645 --no-literal
3646 This is not for normal use. Use the source to see for what it
3647 might be useful.
3648
3649
3650 --set-filesize
3651 This is not for normal use. Use the source to see for what it
3652 might be useful.
3653
3654
3655 --show-session-key
3656 Display the session key used for one message. See --override-
3657 session-key for the counterpart of this option.
3658
3659 We think that Key Escrow is a Bad Thing; however the user should
3660 have the freedom to decide whether to go to prison or to reveal
3661 the content of one specific message without compromising all
3662 messages ever encrypted for one secret key.
3663
3664 You can also use this option if you receive an encrypted message
3665 which is abusive or offensive, to prove to the administrators of
3666 the messaging system that the ciphertext transmitted corresponds
3667 to an inappropriate plaintext so they can take action against
3668 the offending user.
3669
3670
3671 --override-session-key string
3672 --override-session-key-fd fd
3673 Don't use the public key but the session key string respective
3674 the session key taken from the first line read from file de‐
3675 scriptor fd. The format of this string is the same as the one
3676 printed by --show-session-key. This option is normally not used
3677 but comes handy in case someone forces you to reveal the content
3678 of an encrypted message; using this option you can do this with‐
3679 out handing out the secret key. Note that using --override-ses‐
3680 sion-key may reveal the session key to all local users via the
3681 global process table. Often it is useful to combine this option
3682 with --no-keyring.
3683
3684
3685 --ask-sig-expire
3686 --no-ask-sig-expire
3687 When making a data signature, prompt for an expiration time. If
3688 this option is not specified, the expiration time set via --de‐
3689 fault-sig-expire is used. --no-ask-sig-expire disables this op‐
3690 tion.
3691
3692
3693 --default-sig-expire
3694 The default expiration time to use for signature expiration.
3695 Valid values are "0" for no expiration, a number followed by the
3696 letter d (for days), w (for weeks), m (for months), or y (for
3697 years) (for example "2m" for two months, or "5y" for five
3698 years), or an absolute date in the form YYYY-MM-DD. Defaults to
3699 "0".
3700
3701
3702 --ask-cert-expire
3703 --no-ask-cert-expire
3704 When making a key signature, prompt for an expiration time. If
3705 this option is not specified, the expiration time set via --de‐
3706 fault-cert-expire is used. --no-ask-cert-expire disables this
3707 option.
3708
3709
3710 --default-cert-expire
3711 The default expiration time to use for key signature expiration.
3712 Valid values are "0" for no expiration, a number followed by the
3713 letter d (for days), w (for weeks), m (for months), or y (for
3714 years) (for example "2m" for two months, or "5y" for five
3715 years), or an absolute date in the form YYYY-MM-DD. Defaults to
3716 "0".
3717
3718
3719 --default-new-key-algo string
3720 This option can be used to change the default algorithms for key
3721 generation. The string is similar to the arguments required for
3722 the command --quick-add-key but slightly different. For example
3723 the current default of "rsa2048/cert,sign+rsa2048/encr" (or
3724 "rsa3072") can be changed to the value of what we currently call
3725 future default, which is "ed25519/cert,sign+cv25519/encr". You
3726 need to consult the source code to learn the details. Note that
3727 the advanced key generation commands can always be used to spec‐
3728 ify a key algorithm directly.
3729
3730
3731 --no-auto-trust-new-key
3732 When creating a new key the ownertrust of the new key is set to
3733 ultimate. This option disables this and the user needs to manu‐
3734 ally assign an ownertrust value.
3735
3736
3737 --force-sign-key
3738 This option modifies the behaviour of the commands --quick-sign-
3739 key, --quick-lsign-key, and the "sign" sub-commands of --edit-
3740 key by forcing the creation of a key signature, even if one al‐
3741 ready exists.
3742
3743
3744 --forbid-gen-key
3745 This option is intended for use in the global config file to
3746 disallow the use of generate key commands. Those commands will
3747 then fail with the error code for Not Enabled.
3748
3749
3750 --allow-secret-key-import
3751 This is an obsolete option and is not used anywhere.
3752
3753
3754 --allow-multiple-messages
3755
3756 --no-allow-multiple-messages
3757 These are obsolete options; they have no more effect since GnuPG
3758 2.2.8.
3759
3760
3761 --enable-special-filenames
3762 This option enables a mode in which filenames of the form ‘-&n’,
3763 where n is a non-negative decimal number, refer to the file de‐
3764 scriptor n and not to a file with that name.
3765
3766
3767 --no-expensive-trust-checks
3768 Experimental use only.
3769
3770
3771 --preserve-permissions
3772 Don't change the permissions of a secret keyring back to user
3773 read/write only. Use this option only if you really know what
3774 you are doing.
3775
3776
3777 --default-preference-list string
3778 Set the list of default preferences to string. This preference
3779 list is used for new keys and becomes the default for "setpref"
3780 in the --edit-key menu.
3781
3782
3783 --default-keyserver-url name
3784 Set the default keyserver URL to name. This keyserver will be
3785 used as the keyserver URL when writing a new self-signature on a
3786 key, which includes key generation and changing preferences.
3787
3788
3789 --list-config
3790 Display various internal configuration parameters of GnuPG. This
3791 option is intended for external programs that call GnuPG to per‐
3792 form tasks, and is thus not generally useful. See the file
3793 ‘doc/DETAILS’ in the source distribution for the details of
3794 which configuration items may be listed. --list-config is only
3795 usable with --with-colons set.
3796
3797
3798 --list-gcrypt-config
3799 Display various internal configuration parameters of Libgcrypt.
3800
3801
3802 --gpgconf-list
3803 This command is similar to --list-config but in general only in‐
3804 ternally used by the gpgconf tool.
3805
3806
3807 --gpgconf-test
3808 This is more or less dummy action. However it parses the con‐
3809 figuration file and returns with failure if the configuration
3810 file would prevent gpg from startup. Thus it may be used to run
3811 a syntax check on the configuration file.
3812
3813
3814
3815 --chuid uid
3816 Change the current user to uid which may either be a number or a
3817 name. This can be used from the root account to run gpg for an‐
3818 other user. If uid is not the current UID a standard PATH is
3819 set and the envvar GNUPGHOME is unset. To override the latter
3820 the option --homedir can be used. This option has only an ef‐
3821 fect when used on the command line. This option has currently
3822 no effect at all on Windows.
3823
3824
3825 Deprecated options
3826
3827
3828
3829
3830 --show-photos
3831 --no-show-photos
3832 Causes --list-keys, --list-signatures, --list-public-keys,
3833 --list-secret-keys, and verifying a signature to also display
3834 the photo ID attached to the key, if any. See also --photo-
3835 viewer. These options are deprecated. Use --list-options
3836 [no-]show-photos and/or --verify-options [no-]show-photos in‐
3837 stead.
3838
3839
3840 --show-keyring
3841 Display the keyring name at the head of key listings to show
3842 which keyring a given key resides on. This option is deprecated:
3843 use --list-options [no-]show-keyring instead.
3844
3845
3846 --show-notation
3847 --no-show-notation
3848 Show signature notations in the --list-signatures or --check-
3849 signatures listings as well as when verifying a signature with a
3850 notation in it. These options are deprecated. Use --list-options
3851 [no-]show-notation and/or --verify-options [no-]show-notation
3852 instead.
3853
3854
3855 --show-policy-url
3856 --no-show-policy-url
3857 Show policy URLs in the --list-signatures or --check-signatures
3858 listings as well as when verifying a signature with a policy URL
3859 in it. These options are deprecated. Use --list-options
3860 [no-]show-policy-url and/or --verify-options [no-]show-policy-
3861 url instead.
3862
3863
3864 --personal-aead-preferences string
3865 This option is deprecated and has no more effect since version
3866 2.3.9.
3867
3868
3869 --aead-algo name
3870 This option is deprecated and has no more effect since version
3871 2.3.9.
3872
3873
3874
3876 gpg -se -r Bob file
3877 sign and encrypt for user Bob
3878
3879
3880 gpg --clear-sign file
3881 make a cleartext signature
3882
3883
3884 gpg -sb file
3885 make a detached signature
3886
3887
3888 gpg -u 0x12345678 -sb file
3889 make a detached signature with the key 0x12345678
3890
3891
3892 gpg --list-keys user_ID
3893 show keys
3894
3895
3896 gpg --fingerprint user_ID
3897 show fingerprint
3898
3899
3900 gpg --verify pgpfile
3901 gpg --verify sigfile [datafile]
3902 Verify the signature of the file but do not output the data un‐
3903 less requested. The second form is used for detached signa‐
3904 tures, where sigfile is the detached signature (either ASCII ar‐
3905 mored or binary) and datafile are the signed data; if this is
3906 not given, the name of the file holding the signed data is con‐
3907 structed by cutting off the extension (".asc" or ".sig") of sig‐
3908 file or by asking the user for the filename. If the option
3909 --output is also used the signed data is written to the file
3910 specified by that option; use - to write the signed data to std‐
3911 out.
3912
3914 There are different ways to specify a user ID to GnuPG. Some of them
3915 are only valid for gpg others are only good for gpgsm. Here is the en‐
3916 tire list of ways to specify a key:
3917
3918
3919
3920 By key Id.
3921 This format is deduced from the length of the string and its
3922 content or 0x prefix. The key Id of an X.509 certificate are the
3923 low 64 bits of its SHA-1 fingerprint. The use of key Ids is
3924 just a shortcut, for all automated processing the fingerprint
3925 should be used.
3926
3927 When using gpg an exclamation mark (!) may be appended to force
3928 using the specified primary or secondary key and not to try and
3929 calculate which primary or secondary key to use.
3930
3931 The last four lines of the example give the key ID in their long
3932 form as internally used by the OpenPGP protocol. You can see the
3933 long key ID using the option --with-colons.
3934
3935 234567C4
3936 0F34E556E
3937 01347A56A
3938 0xAB123456
3939
3940 234AABBCC34567C4
3941 0F323456784E56EAB
3942 01AB3FED1347A5612
3943 0x234AABBCC34567C4
3944
3945
3946
3947
3948 By fingerprint.
3949 This format is deduced from the length of the string and its
3950 content or the 0x prefix. Note, that only the 20 byte version
3951 fingerprint is available with gpgsm (i.e. the SHA-1 hash of the
3952 certificate).
3953
3954 When using gpg an exclamation mark (!) may be appended to force
3955 using the specified primary or secondary key and not to try and
3956 calculate which primary or secondary key to use.
3957
3958 The best way to specify a key Id is by using the fingerprint.
3959 This avoids any ambiguities in case that there are duplicated
3960 key IDs.
3961
3962 1234343434343434C434343434343434
3963 123434343434343C3434343434343734349A3434
3964 0E12343434343434343434EAB3484343434343434
3965 0xE12343434343434343434EAB3484343434343434
3966
3967
3968 gpgsm also accepts colons between each pair of hexadecimal digits be‐
3969 cause this is the de-facto standard on how to present X.509 finger‐
3970 prints. gpg also allows the use of the space separated SHA-1 finger‐
3971 print as printed by the key listing commands.
3972
3973
3974 By exact match on OpenPGP user ID.
3975 This is denoted by a leading equal sign. It does not make sense
3976 for X.509 certificates.
3977
3978 =Heinrich Heine <heinrichh@uni-duesseldorf.de>
3979
3980
3981 By exact match on an email address.
3982 This is indicated by enclosing the email address in the usual
3983 way with left and right angles.
3984
3985 <heinrichh@uni-duesseldorf.de>
3986
3987
3988
3989 By partial match on an email address.
3990 This is indicated by prefixing the search string with an @.
3991 This uses a substring search but considers only the mail address
3992 (i.e. inside the angle brackets).
3993
3994 @heinrichh
3995
3996
3997 By exact match on the subject's DN.
3998 This is indicated by a leading slash, directly followed by the
3999 RFC-2253 encoded DN of the subject. Note that you can't use the
4000 string printed by gpgsm --list-keys because that one has been
4001 reordered and modified for better readability; use --with-colons
4002 to print the raw (but standard escaped) RFC-2253 string.
4003
4004 /CN=Heinrich Heine,O=Poets,L=Paris,C=FR
4005
4006
4007 By exact match on the issuer's DN.
4008 This is indicated by a leading hash mark, directly followed by a
4009 slash and then directly followed by the RFC-2253 encoded DN of
4010 the issuer. This should return the Root cert of the issuer.
4011 See note above.
4012
4013 #/CN=Root Cert,O=Poets,L=Paris,C=FR
4014
4015
4016
4017 By exact match on serial number and issuer's DN.
4018 This is indicated by a hash mark, followed by the hexadecimal
4019 representation of the serial number, then followed by a slash
4020 and the RFC-2253 encoded DN of the issuer. See note above.
4021
4022 #4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
4023
4024
4025 By keygrip.
4026 This is indicated by an ampersand followed by the 40 hex digits
4027 of a keygrip. gpgsm prints the keygrip when using the command
4028 --dump-cert.
4029
4030 &D75F22C3F86E355877348498CDC92BD21010A480
4031
4032
4033
4034 By substring match.
4035 This is the default mode but applications may want to explicitly
4036 indicate this by putting the asterisk in front. Match is not
4037 case sensitive.
4038
4039 Heine
4040 *Heine
4041
4042
4043 . and + prefixes
4044 These prefixes are reserved for looking up mails anchored at the
4045 end and for a word search mode. They are not yet implemented
4046 and using them is undefined.
4047
4048
4049 Please note that we have reused the hash mark identifier which
4050 was used in old GnuPG versions to indicate the so called local-
4051 id. It is not anymore used and there should be no conflict when
4052 used with X.509 stuff.
4053
4054 Using the RFC-2253 format of DNs has the drawback that it is not
4055 possible to map them back to the original encoding, however we
4056 don't have to do this because our key database stores this en‐
4057 coding as meta data.
4058
4059
4061 The options --import-filter and --export-filter use expressions with
4062 this syntax (square brackets indicate an optional part and curly braces
4063 a repetition, white space between the elements are allowed):
4064
4065 [lc] {[{flag}] PROPNAME op VALUE [lc]}
4066
4067 The name of a property (PROPNAME) may only consist of letters, digits
4068 and underscores. The description for the filter type describes which
4069 properties are defined. If an undefined property is used it evaluates
4070 to the empty string. Unless otherwise noted, the VALUE must always be
4071 given and may not be the empty string. No quoting is defined for the
4072 value, thus the value may not contain the strings && or ||, which are
4073 used as logical connection operators. The flag -- can be used to re‐
4074 move this restriction.
4075
4076 Numerical values are computed as long int; standard C notation applies.
4077 lc is the logical connection operator; either && for a conjunction or
4078 || for a disjunction. A conjunction is assumed at the begin of an ex‐
4079 pression. Conjunctions have higher precedence than disjunctions. If
4080 VALUE starts with one of the characters used in any op a space after
4081 the op is required.
4082
4083
4084 The supported operators (op) are:
4085
4086
4087
4088 =~ Substring must match.
4089
4090
4091 !~ Substring must not match.
4092
4093
4094 = The full string must match.
4095
4096
4097 <> The full string must not match.
4098
4099
4100 == The numerical value must match.
4101
4102
4103 != The numerical value must not match.
4104
4105
4106 <= The numerical value of the field must be LE than the value.
4107
4108
4109 < The numerical value of the field must be LT than the value.
4110
4111
4112 > The numerical value of the field must be GT than the value.
4113
4114
4115 >= The numerical value of the field must be GE than the value.
4116
4117
4118 -le The string value of the field must be less or equal than the
4119 value.
4120
4121
4122 -lt The string value of the field must be less than the value.
4123
4124
4125 -gt The string value of the field must be greater than the value.
4126
4127
4128 -ge The string value of the field must be greater or equal than the
4129 value.
4130
4131
4132 -n True if value is not empty (no value allowed).
4133
4134
4135 -z True if value is empty (no value allowed).
4136
4137
4138 -t Alias for "PROPNAME != 0" (no value allowed).
4139
4140
4141 -f Alias for "PROPNAME == 0" (no value allowed).
4142
4143
4144 Values for flag must be space separated. The supported flags are:
4145
4146
4147 -- VALUE spans to the end of the expression.
4148
4149 -c The string match in this part is done case-sensitive.
4150
4151 -t Leading and trailing spaces are not removed from VALUE. The op‐
4152 tional single space after op is here required.
4153
4154 The filter options concatenate several specifications for a filter of
4155 the same type. For example the four options in this example:
4156
4157 --import-filter keep-uid="uid =~ Alfa"
4158 --import-filter keep-uid="&& uid !~ Test"
4159 --import-filter keep-uid="|| uid =~ Alpha"
4160 --import-filter keep-uid="uid !~ Test"
4161
4162
4163 which is equivalent to
4164
4165 --import-filter \
4166 keep-uid="uid =~ Alfa" && uid !~ Test" || uid =~ Alpha" && "uid !~ Test"
4167
4168 imports only the user ids of a key containing the strings "Alfa" or
4169 "Alpha" but not the string "test".
4170
4171
4173 Trust values are used to indicate ownertrust and validity of keys and
4174 user IDs. They are displayed with letters or strings:
4175
4176
4177
4178 -
4179 unknown
4180 No ownertrust assigned / not yet calculated.
4181
4182
4183 e
4184 expired
4185
4186 Trust calculation has failed; probably due to an expired key.
4187
4188
4189 q
4190 undefined, undef
4191 Not enough information for calculation.
4192
4193
4194 n
4195 never Never trust this key.
4196
4197
4198 m
4199 marginal
4200 Marginally trusted.
4201
4202
4203 f
4204 full Fully trusted.
4205
4206
4207 u
4208 ultimate
4209 Ultimately trusted.
4210
4211
4212 r
4213 revoked
4214 For validity only: the key or the user ID has been revoked.
4215
4216
4217 ?
4218 err The program encountered an unknown trust value.
4219
4220
4222 There are a few configuration files to control certain aspects of gpg's
4223 operation. Unless noted, they are expected in the current home direc‐
4224 tory (see: [option --homedir]).
4225
4226
4227
4228 gpg.conf
4229 This is the standard configuration file read by gpg on startup.
4230 It may contain any valid long option; the leading two dashes may
4231 not be entered and the option may not be abbreviated. This de‐
4232 fault name may be changed on the command line (see: [gpg-option
4233 --options]). You should backup this file.
4234
4235
4236 common.conf
4237 This is an optional configuration file read by gpg on startup.
4238 It may contain options pertaining to all components of GnuPG.
4239 Its current main use is for the "use-keyboxd" option. If the
4240 default home directory ‘~/.gnupg’ does not exist, GnuPG creates
4241 this directory and a ‘common.conf’ file with "use_keyboxd".
4242
4243
4244 Note that on larger installations, it is useful to put predefined files
4245 into the directory ‘/etc/skel/.gnupg’ so that newly created users start
4246 up with a working configuration. For existing users a small helper
4247 script is provided to create these files (see: [addgnupghome]).
4248
4249 For internal purposes gpg creates and maintains a few other files; They
4250 all live in the current home directory (see: [option --homedir]). Only
4251 the gpg program may modify these files.
4252
4253
4254
4255 ~/.gnupg
4256 This is the default home directory which is used if neither the
4257 environment variable GNUPGHOME nor the option --homedir is
4258 given.
4259
4260
4261 ~/.gnupg/pubring.gpg
4262 The public keyring using a legacy format. You should backup
4263 this file.
4264
4265 If this file is not available, gpg defaults to the new keybox
4266 format and creates a file ‘pubring.kbx’ unless that file already
4267 exists in which case that file will also be used for OpenPGP
4268 keys.
4269
4270 Note that in the case that both files, ‘pubring.gpg’ and ‘pub‐
4271 ring.kbx’ exists but the latter has no OpenPGP keys, the legacy
4272 file ‘pubring.gpg’ will be used. Take care: GnuPG versions be‐
4273 fore 2.1 will always use the file ‘pubring.gpg’ because they do
4274 not know about the new keybox format. In the case that you have
4275 to use GnuPG 1.4 to decrypt archived data you should keep this
4276 file.
4277
4278
4279 ~/.gnupg/pubring.gpg.lock
4280 The lock file for the public keyring.
4281
4282
4283 ~/.gnupg/pubring.kbx
4284 The public keyring using the new keybox format. This file is
4285 shared with gpgsm. You should backup this file. See above for
4286 the relation between this file and it predecessor.
4287
4288 To convert an existing ‘pubring.gpg’ file to the keybox format,
4289 you first backup the ownertrust values, then rename ‘pub‐
4290 ring.gpg’ to ‘publickeys.backup’, so it won’t be recognized by
4291 any GnuPG version, run import, and finally restore the own‐
4292 ertrust values:
4293
4294 $ cd ~/.gnupg
4295 $ gpg --export-ownertrust >otrust.lst
4296 $ mv pubring.gpg publickeys.backup
4297 $ gpg --import-options restore --import publickeys.backup
4298 $ gpg --import-ownertrust otrust.lst
4299
4300
4301 ~/.gnupg/pubring.kbx.lock
4302 The lock file for ‘pubring.kbx’.
4303
4304
4305 ~/.gnupg/secring.gpg
4306 The legacy secret keyring as used by GnuPG versions before 2.1.
4307 It is not used by GnuPG 2.1 and later. You may want to keep it
4308 in case you have to use GnuPG 1.4 to decrypt archived data.
4309
4310
4311 ~/.gnupg/secring.gpg.lock
4312 The lock file for the legacy secret keyring.
4313
4314
4315 ~/.gnupg/.gpg-v21-migrated
4316 File indicating that a migration to GnuPG 2.1 has been done.
4317
4318
4319 ~/.gnupg/trustdb.gpg
4320 The trust database. There is no need to backup this file; it is
4321 better to backup the ownertrust values (see: [option --export-
4322 ownertrust]).
4323
4324
4325 ~/.gnupg/trustdb.gpg.lock
4326 The lock file for the trust database.
4327
4328
4329 ~/.gnupg/random_seed
4330 A file used to preserve the state of the internal random pool.
4331
4332
4333 ~/.gnupg/openpgp-revocs.d/
4334 This is the directory where gpg stores pre-generated revocation
4335 certificates. The file name corresponds to the OpenPGP finger‐
4336 print of the respective key. It is suggested to backup those
4337 certificates and if the primary private key is not stored on the
4338 disk to move them to an external storage device. Anyone who can
4339 access these files is able to revoke the corresponding key. You
4340 may want to print them out. You should backup all files in this
4341 directory and take care to keep this backup closed away.
4342
4343
4344 Operation is further controlled by a few environment variables:
4345
4346
4347
4348 HOME Used to locate the default home directory.
4349
4350
4351 GNUPGHOME
4352 If set directory used instead of "~/.gnupg".
4353
4354
4355 GPG_AGENT_INFO
4356 This variable is obsolete; it was used by GnuPG versions before
4357 2.1.
4358
4359
4360 PINENTRY_USER_DATA
4361 This value is passed via gpg-agent to pinentry. It is useful to
4362 convey extra information to a custom pinentry.
4363
4364
4365 COLUMNS
4366 LINES Used to size some displays to the full size of the screen.
4367
4368
4369 LANGUAGE
4370 Apart from its use by GNU, it is used in the W32 version to
4371 override the language selection done through the Registry. If
4372 used and set to a valid and available language name (langid),
4373 the file with the translation is loaded from
4374 gpgdir/gnupg.nls/langid.mo. Here gpgdir is the directory out of
4375 which the gpg binary has been loaded. If it can't be loaded the
4376 Registry is tried and as last resort the native Windows locale
4377 system is used.
4378
4379
4380 GNUPG_BUILD_ROOT
4381 This variable is only used by the regression test suite as a
4382 helper under operating systems without proper support to figure
4383 out the name of a process' text file.
4384
4385
4386 GNUPG_EXEC_DEBUG_FLAGS
4387 This variable allows to enable diagnostics for process manage‐
4388 ment. A numeric decimal value is expected. Bit 0 enables gen‐
4389 eral diagnostics, bit 1 enables certain warnings on Windows.
4390
4391
4392 When calling the gpg-agent component gpg sends a set of environment
4393 variables to gpg-agent. The names of these variables can be listed us‐
4394 ing the command:
4395
4396 gpg-connect-agent 'getinfo std_env_names' /bye | awk '$1=="D" {print $2}'
4397
4398
4399
4400
4401
4403 gpg is often used as a backend engine by other software. To help with
4404 this a machine interface has been defined to have an unambiguous way to
4405 do this. The options --status-fd and --batch are almost always re‐
4406 quired for this.
4407
4408
4409
4410
4411
4412 Programmatic use of GnuPG
4413
4414
4415 Please consider using GPGME instead of calling gpg directly. GPGME of‐
4416 fers a stable, backend-independent interface for many cryptographic op‐
4417 erations. It supports OpenPGP and S/MIME, and also allows interaction
4418 with various GnuPG components.
4419
4420 GPGME provides a C-API, and comes with bindings for C++, Qt, and
4421 Python. Bindings for other languages are available.
4422
4423
4424
4425 Ephemeral home directories
4426
4427
4428 Sometimes you want to contain effects of some operation, for example
4429 you want to import a key to inspect it, but you do not want this key to
4430 be added to your keyring. In earlier versions of GnuPG, it was possi‐
4431 ble to specify alternate keyring files for both public and secret keys.
4432 In modern GnuPG versions, however, we changed how secret keys are
4433 stored in order to better protect secret key material, and it was not
4434 possible to preserve this interface.
4435
4436 The preferred way to do this is to use ephemeral home directories.
4437 This technique works across all versions of GnuPG.
4438
4439 Create a temporary directory, create (or copy) a configuration that
4440 meets your needs, make gpg use this directory either using the environ‐
4441 ment variable GNUPGHOME, or the option --homedir. GPGME supports this
4442 too on a per-context basis, by modifying the engine info of contexts.
4443 Now execute whatever operation you like, import and export key material
4444 as necessary. Once finished, you can delete the directory. All GnuPG
4445 backend services that were started will detect this and shut down.
4446
4447
4448
4449 The quick key manipulation interface
4450
4451
4452 Recent versions of GnuPG have an interface to manipulate keys without
4453 using the interactive command --edit-key. This interface was added
4454 mainly for the benefit of GPGME (please consider using GPGME, see the
4455 manual subsection ``Programmatic use of GnuPG''). This interface is
4456 described in the subsection ``How to manage your keys''.
4457
4458
4459
4460 Unattended key generation
4461
4462
4463 The command --generate-key may be used along with the option --batch
4464 for unattended key generation. This is the most flexible way of gener‐
4465 ating keys, but it is also the most complex one. Consider using the
4466 quick key manipulation interface described in the previous subsection
4467 ``The quick key manipulation interface''.
4468
4469 The parameters for the key are either read from stdin or given as a
4470 file on the command line. The format of the parameter file is as fol‐
4471 lows: Text only, line length is limited to about 1000 characters.
4472 UTF-8 encoding must be used to specify non-ASCII characters. Empty
4473 lines are ignored. Leading and trailing white space is ignored. A
4474 hash sign as the first non white space character indicates a comment
4475 line. Control statements are indicated by a leading percent sign,
4476 their arguments are separated by white space from the keyword. Parame‐
4477 ters are specified by a keyword, followed by a colon; arguments are
4478 separated by white space. The first parameter must be ‘Key-Type’ but
4479 control statements may be placed anywhere. The order of the parameters
4480 does not matter except for ‘Key-Type’. The parameters are only used
4481 for the generated keyblock (primary and subkeys); parameters from pre‐
4482 vious sets are not used. Some syntax checks may be performed. Key
4483 commences when either the end of the parameter file is reached, the
4484 next ‘Key-Type’ parameter is encountered, or the control statement
4485 ‘%commit’ is encountered.
4486
4487
4488 Control statements:
4489
4490
4491
4492 %echo text
4493 Print text as diagnostic.
4494
4495
4496 %dry-run
4497 Suppress actual key generation (useful for syntax checking).
4498
4499
4500 %commit
4501 Perform the key generation. Note that an implicit commit is
4502 done at the next parameter.
4503
4504
4505 %pubring filename
4506 Do not write the key to the default or commandline given keyring
4507 but to filename. This must be given before the first commit to
4508 take place, duplicate specification of the same filename is ig‐
4509 nored, the last filename before a commit is used. The filename
4510 is used until a new filename is used (at commit points) and all
4511 keys are written to that file. If a new filename is given, this
4512 file is created (and overwrites an existing one).
4513
4514 See the previous subsection ``Ephemeral home directories'' for a
4515 more robust way to contain side-effects.
4516
4517
4518 %secring filename
4519 This option is a no-op for GnuPG 2.1 and later.
4520
4521 See the previous subsection ``Ephemeral home directories''.
4522
4523
4524 %ask-passphrase
4525 %no-ask-passphrase
4526 This option is a no-op since GnuPG version 2.1.
4527
4528
4529 %no-protection
4530 Using this option allows the creation of keys without any
4531 passphrase protection. This option is mainly intended for re‐
4532 gression tests.
4533
4534
4535 %transient-key
4536 If given the keys are created using a faster and a somewhat less
4537 secure random number generator. This option may be used for
4538 keys which are only used for a short time and do not require
4539 full cryptographic strength. It takes only effect if used to‐
4540 gether with the control statement ‘%no-protection’.
4541
4542
4543 General Parameters:
4544
4545
4546
4547 Key-Type: algo
4548 Starts a new parameter block by giving the type of the primary
4549 key. The algorithm must be capable of signing. This is a re‐
4550 quired parameter. algo may either be an OpenPGP algorithm num‐
4551 ber or a string with the algorithm name. The special value ‘de‐
4552 fault’ may be used for algo to create the default key type; in
4553 this case a ‘Key-Usage’ shall not be given and ‘default’ also be
4554 used for ‘Subkey-Type’.
4555
4556
4557 Key-Length: nbits
4558 The requested length of the generated key in bits. The default
4559 is returned by running the command ‘gpg --gpgconf-list’. For
4560 ECC keys this parameter is ignored.
4561
4562
4563 Key-Curve: curve
4564 The requested elliptic curve of the generated key. This is a
4565 required parameter for ECC keys. It is ignored for non-ECC
4566 keys.
4567
4568
4569 Key-Grip: hexstring
4570 This is optional and used to generate a CSR or certificate for
4571 an already existing key. Key-Length will be ignored when given.
4572
4573
4574 Key-Usage: usage-list
4575 Space or comma delimited list of key usages. Allowed values are
4576 ‘encrypt’, ‘sign’, and ‘auth’. This is used to generate the key
4577 flags. Please make sure that the algorithm is capable of this
4578 usage. Note that OpenPGP requires that all primary keys are ca‐
4579 pable of certification, so no matter what usage is given here,
4580 the ‘cert’ flag will be on. If no ‘Key-Usage’ is specified and
4581 the ‘Key-Type’ is not ‘default’, all allowed usages for that
4582 particular algorithm are used; if it is not given but ‘default’
4583 is used the usage will be ‘sign’.
4584
4585
4586 Subkey-Type: algo
4587 This generates a secondary key (subkey). Currently only one
4588 subkey can be handled. See also ‘Key-Type’ above.
4589
4590
4591 Subkey-Length: nbits
4592 Length of the secondary key (subkey) in bits. The default is
4593 returned by running the command ‘gpg --gpgconf-list’.
4594
4595
4596 Subkey-Curve: curve
4597 Key curve for a subkey; similar to ‘Key-Curve’.
4598
4599
4600 Subkey-Usage: usage-list
4601 Key usage lists for a subkey; similar to ‘Key-Usage’.
4602
4603
4604 Passphrase: string
4605 If you want to specify a passphrase for the secret key, enter it
4606 here. Default is to use the Pinentry dialog to ask for a
4607 passphrase.
4608
4609
4610 Name-Real: name
4611 Name-Comment: comment
4612 Name-Email: email
4613 The three parts of a user name. Remember to use UTF-8 encoding
4614 here. If you don't give any of them, no user ID is created.
4615
4616
4617 Expire-Date: iso-date|(number[d|w|m|y])
4618 Set the expiration date for the key (and the subkey). It may
4619 either be entered in ISO date format (e.g. "20000815T145012") or
4620 as number of days, weeks, month or years after the creation
4621 date. The special notation "seconds=N" is also allowed to spec‐
4622 ify a number of seconds since creation. Without a letter days
4623 are assumed. Note that there is no check done on the overflow
4624 of the type used by OpenPGP for timestamps. Thus you better
4625 make sure that the given value make sense. Although OpenPGP
4626 works with time intervals, GnuPG uses an absolute value inter‐
4627 nally and thus the last year we can represent is 2105.
4628
4629
4630 Creation-Date: iso-date
4631 Set the creation date of the key as stored in the key informa‐
4632 tion and which is also part of the fingerprint calculation. Ei‐
4633 ther a date like "1986-04-26" or a full timestamp like
4634 "19860426T042640" may be used. The time is considered to be
4635 UTC. The special notation "seconds=N" may be used to directly
4636 specify a the number of seconds since Epoch (Unix time). If it
4637 is not given the current time is used.
4638
4639
4640 Preferences: string
4641 Set the cipher, hash, and compression preference values for this
4642 key. This expects the same type of string as the sub-command
4643 ‘setpref’ in the --edit-key menu.
4644
4645
4646 Revoker: algo:fpr [sensitive]
4647 Add a designated revoker to the generated key. Algo is the pub‐
4648 lic key algorithm of the designated revoker (i.e. RSA=1, DSA=17,
4649 etc.) fpr is the fingerprint of the designated revoker. The
4650 optional ‘sensitive’ flag marks the designated revoker as sensi‐
4651 tive information. Only v4 keys may be designated revokers.
4652
4653
4654 Keyserver: string
4655 This is an optional parameter that specifies the preferred key‐
4656 server URL for the key.
4657
4658
4659 Handle: string
4660 This is an optional parameter only used with the status lines
4661 KEY_CREATED and KEY_NOT_CREATED. string may be up to 100 char‐
4662 acters and should not contain spaces. It is useful for batch
4663 key generation to associate a key parameter block with a status
4664 line.
4665
4666
4667 Here is an example on how to create a key in an ephemeral home direc‐
4668 tory:
4669 $ export GNUPGHOME="$(mktemp -d)"
4670 $ cat >foo <<EOF
4671 %echo Generating a basic OpenPGP key
4672 Key-Type: DSA
4673 Key-Length: 1024
4674 Subkey-Type: ELG-E
4675 Subkey-Length: 1024
4676 Name-Real: Joe Tester
4677 Name-Comment: with stupid passphrase
4678 Name-Email: joe@foo.bar
4679 Expire-Date: 0
4680 Passphrase: abc
4681 # Do a commit here, so that we can later print "done" :-)
4682 %commit
4683 %echo done
4684 EOF
4685 $ gpg --batch --generate-key foo
4686 [...]
4687 $ gpg --list-secret-keys
4688 /tmp/tmp.0NQxB74PEf/pubring.kbx
4689 -------------------------------
4690 sec dsa1024 2016-12-16 [SCA]
4691 768E895903FC1C44045C8CB95EEBDB71E9E849D0
4692 uid [ultimate] Joe Tester (with stupid passphrase) <joe@foo.bar>
4693 ssb elg1024 2016-12-16 [E]
4694
4695
4696 If you want to create a key with the default algorithms you would use
4697 these parameters:
4698 %echo Generating a default key
4699 Key-Type: default
4700 Subkey-Type: default
4701 Name-Real: Joe Tester
4702 Name-Comment: with stupid passphrase
4703 Name-Email: joe@foo.bar
4704 Expire-Date: 0
4705 Passphrase: abc
4706 # Do a commit here, so that we can later print "done" :-)
4707 %commit
4708 %echo done
4709
4710
4711
4712
4713
4715 On older systems this program should be installed as setuid(root). This
4716 is necessary to lock memory pages. Locking memory pages prevents the
4717 operating system from writing memory pages (which may contain
4718 passphrases or other sensitive material) to disk. If you get no warning
4719 message about insecure memory your operating system supports locking
4720 without being root. The program drops root privileges as soon as locked
4721 memory is allocated.
4722
4723 Note also that some systems (especially laptops) have the ability to
4724 ``suspend to disk'' (also known as ``safe sleep'' or ``hibernate'').
4725 This writes all memory to disk before going into a low power or even
4726 powered off mode. Unless measures are taken in the operating system to
4727 protect the saved memory, passphrases or other sensitive material may
4728 be recoverable from it later.
4729
4730 Before you report a bug you should first search the mailing list ar‐
4731 chives for similar problems and second check whether such a bug has al‐
4732 ready been reported to our bug tracker at https://bugs.gnupg.org.
4733
4734
4735
4737 gpgv(1), gpgsm(1), gpg-agent(1)
4738
4739 The full documentation for this tool is maintained as a Texinfo manual.
4740 If GnuPG and the info program are properly installed at your site, the
4741 command
4742
4743 info gnupg
4744
4745 should give you access to the complete manual including a menu struc‐
4746 ture and an index.
4747
4748
4749
4750GnuPG 2.4.3 2023-06-21 GPG(1)