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