1GPG(1) GNU Privacy Guard 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
14 gpg is the OpenPGP part of the GNU Privacy Guard (GnuPG). It is a tool
15 to provide digital encryption and signing services using the OpenPGP
16 standard. gpg features complete key management and all bells and whis‐
17 tles you can expect from a decent OpenPGP implementation.
18
19 This is the standalone version of gpg. For desktop use you should con‐
20 sider using gpg2.
21
22
23
24
25
26
27
28
30 Commands are not distinguished from options execpt for the fact that
31 only one command is allowed.
32
33 gpg may be run with no commands, in which case it will perform a rea‐
34 sonable action depending on the type of file it is given as input (an
35 encrypted message is decrypted, a signature is verified, a file con‐
36 taining keys is listed).
37
38 Please remember that option as well as command parsing stops as soon as
39 a non-option is encountered, you can explicitly stop parsing by using
40 the special option --.
41
42
43
44
45
46
47 Commands not specific to the function
48
49
50
51 --version
52 Print the program version and licensing information. Note that
53 you cannot abbreviate this command.
54
55
56 --help
57
58 -h Print a usage message summarizing the most useful command line
59 options. Not that you cannot abbreviate this command.
60
61
62 --warranty
63 Print warranty information.
64
65
66 --dump-options
67 Print a list of all available options and commands. Note that
68 you cannot abbreviate this command.
69
70
71
72
73 Commands to select the type of operation
74
75
76
77
78
79 --sign
80
81 -s Make a signature. This command may be combined with --encrypt
82 (for a signed and encrypted message), --symmetric (for a signed
83 and symmetrically encrypted message), or --encrypt and --symmet‐
84 ric together (for a signed message that may be decrypted via a
85 secret key or a passphrase).
86
87
88 --clearsign
89 Make a clear text signature. The content in a clear text signa‐
90 ture is readable without any special software. OpenPGP software
91 is only needed to verify the signature. Clear text signatures
92 may modify end-of-line whitespace for platform independence and
93 are not intended to be reversible.
94
95
96 --detach-sign
97
98 -b Make a detached signature.
99
100
101 --encrypt
102
103 -e Encrypt data. This option may be combined with --sign (for a
104 signed and encrypted message), --symmetric (for a message that
105 may be decrypted via a secret key or a passphrase), or --sign
106 and --symmetric together (for a signed message that may be
107 decrypted via a secret key or a passphrase).
108
109
110 --symmetric
111
112 -c Encrypt with a symmetric cipher using a passphrase. The default
113 symmetric cipher used is CAST5, but may be chosen with the
114 --cipher-algo option. This option may be combined with --sign
115 (for a signed and symmetrically encrypted message), --encrypt
116 (for a message that may be decrypted via a secret key or a
117 passphrase), or --sign and --encrypt together (for a signed mes‐
118 sage that may be decrypted via a secret key or a passphrase).
119
120
121 --store
122 Store only (make a simple RFC1991 literal data packet).
123
124
125 --decrypt
126
127 -d Decrypt the file given on the command line (or stdin if no file
128 is specified) and write it to stdout (or the file specified with
129 --output). If the decrypted file is signed, the signature is
130 also verified. This command differs from the default operation,
131 as it never writes to the filename which is included in the file
132 and it rejects files which don't begin with an encrypted mes‐
133 sage.
134
135
136 --verify
137 Assume that the first argument is a signed file or a detached
138 signature and verify it without generating any output. With no
139 arguments, the signature packet is read from stdin. If only a
140 sigfile is given, it may be a complete signature or a detached
141 signature, in which case the signed stuff is expected in a file
142 without the ".sig" or ".asc" extension. With more than 1 argu‐
143 ment, the first should be a detached signature and the remaining
144 files are the signed stuff. To read the signed stuff from stdin,
145 use
146 as the second filename. For security reasons a detached signa‐
147 ture cannot read the signed material from stdin without denoting
148 it in the above way.
149
150
151 --multifile
152 This modifies certain other commands to accept multiple files
153 for processing on the command line or read from stdin with each
154 filename on a separate line. This allows for many files to be
155 processed at once. --multifile may currently be used along with
156 --verify, --encrypt, and --decrypt. Note that --multifile --ver‐
157 ify may not be used with detached signatures.
158
159
160 --verify-files
161 Identical to --multifile --verify.
162
163
164 --encrypt-files
165 Identical to --multifile --encrypt.
166
167
168 --decrypt-files
169 Identical to --multifile --decrypt.
170
171
172 --list-keys
173
174 -k
175
176 --list-public-keys
177 List all keys from the public keyrings, or just the keys given
178 on the command line. -k is slightly different from --list-keys
179 in that it allows only for one argument and takes the second
180 argument as the keyring to search. This is for command line
181 compatibility with PGP 2 and has been removed in gpg2.
182
183 Avoid using the output of this command in scripts or other pro‐
184 grams as it is likely to change as GnuPG changes. See --with-
185 colons for a machine-parseable key listing command that is
186 appropriate for use in scripts and other programs.
187
188
189 --list-secret-keys
190
191 -K List all keys from the secret keyrings, or just the ones given
192 on the command line. A # after the letters sec means that the
193 secret key is not usable (for example, if it was created via
194 --export-secret-subkeys).
195
196
197 --list-sigs
198 Same as --list-keys, but the signatures are listed too.
199
200 For each signature listed, there are several flags in between
201 the "sig" tag and keyid. These flags give additional information
202 about each signature. From left to right, they are the numbers
203 1-3 for certificate check level (see --ask-cert-level), "L" for
204 a local or non-exportable signature (see --lsign-key), "R" for a
205 nonRevocable signature (see the --edit-key command "nrsign"),
206 "P" for a signature that contains a policy URL (see --cert-pol‐
207 icy-url), "N" for a signature that contains a notation (see
208 --cert-notation), "X" for an eXpired signature (see --ask-cert-
209 expire), and the numbers 1-9 or "T" for 10 and above to indicate
210 trust signature levels (see the --edit-key command "tsign").
211
212
213 --check-sigs
214 Same as --list-sigs, but the signatures are verified.
215
216
217 --fingerprint
218 List all keys (or the specified ones) along with their finger‐
219 prints. This is the same output as --list-keys but with the
220 additional output of a line with the fingerprint. May also be
221 combined with --list-sigs or --check-sigs. If this command is
222 given twice, the fingerprints of all secondary keys are listed
223 too.
224
225
226 --list-packets
227 List only the sequence of packets. This is mainly useful for
228 debugging.
229
230
231
232 --card-edit
233 Present a menu to work with a smartcard. The subcommand "help"
234 provides an overview on available commands. For a detailed
235 description, please see the Card HOWTO at
236 http://www.gnupg.org/documentation/howtos.html#GnuPG-cardHOWTO .
237
238
239 --card-status
240 Show the content of the smart card.
241
242
243 --change-pin
244 Present a menu to allow changing the PIN of a smartcard. This
245 functionality is also available as the subcommand "passwd" with
246 the --card-edit command.
247
248
249 --delete-key name
250 Remove key from the public keyring. In batch mode either --yes
251 is required or the key must be specified by fingerprint. This is
252 a safeguard against accidental deletion of multiple keys.
253
254
255 --delete-secret-key name
256 Remove key from the secret and public keyring. In batch mode the
257 key must be specified by fingerprint.
258
259
260 --delete-secret-and-public-key name
261 Same as --delete-key, but if a secret key exists, it will be
262 removed first. In batch mode the key must be specified by fin‐
263 gerprint.
264
265
266 --export
267 Either export all keys from all keyrings (default keyrings and
268 those registered via option --keyring), or if at least one name
269 is given, those of the given name. The new keyring is written to
270 stdout or to the file given with option --output. Use together
271 with --armor to mail those keys.
272
273
274 --send-keys key IDs
275 Similar to --export but sends the keys to a keyserver. Finger‐
276 prints may be used instead of key IDs. Option --keyserver must
277 be used to give the name of this keyserver. Don't send your com‐
278 plete keyring to a keyserver --- select only those keys which
279 are new or changed by you.
280
281
282 --export-secret-keys
283
284 --export-secret-subkeys
285 Same as --export, but exports the secret keys instead. This is
286 normally not very useful and a security risk. The second form
287 of the command has the special property to render the secret
288 part of the primary key useless; this is a GNU extension to
289 OpenPGP and other implementations can not be expected to suc‐
290 cessfully import such a key. See the option --simple-sk-check‐
291 sum if you want to import such an exported key with an older
292 OpenPGP implementation.
293
294
295 --import
296
297 --fast-import
298 Import/merge keys. This adds the given keys to the keyring. The
299 fast version is currently just a synonym.
300
301 There are a few other options which control how this command
302 works. Most notable here is the --keyserver-options merge-only
303 option which does not insert new keys but does only the merging
304 of new signatures, user-IDs and subkeys.
305
306
307 --recv-keys key IDs
308 Import the keys with the given key IDs from a keyserver. Option
309 --keyserver must be used to give the name of this keyserver.
310
311
312 --refresh-keys
313 Request updates from a keyserver for keys that already exist on
314 the local keyring. This is useful for updating a key with the
315 latest signatures, user IDs, etc. Calling this with no arguments
316 will refresh the entire keyring. Option --keyserver must be used
317 to give the name of the keyserver for all keys that do not have
318 preferred keyservers set (see --keyserver-options honor-key‐
319 server-url).
320
321
322 --search-keys names
323 Search the keyserver for the given names. Multiple names given
324 here will be joined together to create the search string for the
325 keyserver. Option --keyserver must be used to give the name of
326 this keyserver. Keyservers that support different search meth‐
327 ods allow using the syntax specified in "How to specify a user
328 ID" below. Note that different keyserver types support different
329 search methods. Currently only LDAP supports them all.
330
331
332 --fetch-keys URIs
333 Retrieve keys located at the specified URIs. Note that different
334 installations of GnuPG may support different protocols (HTTP,
335 FTP, LDAP, etc.)
336
337
338 --update-trustdb
339 Do trust database maintenance. This command iterates over all
340 keys and builds the Web of Trust. This is an interactive command
341 because it may have to ask for the "ownertrust" values for keys.
342 The user has to give an estimation of how far she trusts the
343 owner of the displayed key to correctly certify (sign) other
344 keys. GnuPG only asks for the ownertrust value if it has not yet
345 been assigned to a key. Using the --edit-key menu, the assigned
346 value can be changed at any time.
347
348
349 --check-trustdb
350 Do trust database maintenance without user interaction. From
351 time to time the trust database must be updated so that expired
352 keys or signatures and the resulting changes in the Web of Trust
353 can be tracked. Normally, GnuPG will calculate when this is
354 required and do it automatically unless --no-auto-check-trustdb
355 is set. This command can be used to force a trust database check
356 at any time. The processing is identical to that of --update-
357 trustdb but it skips keys with a not yet defined "ownertrust".
358
359 For use with cron jobs, this command can be used together with
360 --batch in which case the trust database check is done only if a
361 check is needed. To force a run even in batch mode add the
362 option --yes.
363
364
365 --export-ownertrust
366 Send the ownertrust values to stdout. This is useful for backup
367 purposes as these values are the only ones which can't be re-
368 created from a corrupted trust DB.
369
370
371 --import-ownertrust
372 Update the trustdb with the ownertrust values stored in files
373 (or stdin if not given); existing values will be overwritten.
374
375
376 --rebuild-keydb-caches
377 When updating from version 1.0.6 to 1.0.7 this command should be
378 used to create signature caches in the keyring. It might be
379 handy in other situations too.
380
381
382 --print-md algo
383
384 --print-mds
385 Print message digest of algorithm ALGO for all given files or
386 stdin. With the second form (or a deprecated "*" as algo)
387 digests for all available algorithms are printed.
388
389
390 --gen-random 0|1|2
391 Emit count random bytes of the given quality level. If count is
392 not given or zero, an endless sequence of random bytes will be
393 emitted. PLEASE, don't use this command unless you know what
394 you are doing; it may remove precious entropy from the system!
395
396
397 --gen-prime mode bits
398 Use the source, Luke :-). The output format is still subject to
399 change.
400
401
402
403 --enarmor
404
405 --dearmor
406 Pack or unpack an arbitrary input into/from an OpenPGP ASCII
407 armor. This is a GnuPG extension to OpenPGP and in general not
408 very useful.
409
410
411
412
413
414 How to manage your keys
415
416
417 This section explains the main commands for key management
418
419
420
421 --gen-key
422 Generate a new key pair. This command is normally only used
423 interactively.
424
425 There is an experimental feature which allows you to create keys
426 in batch mode. See the file `doc/DETAILS' in the source distri‐
427 bution on how to use this.
428
429
430 --gen-revoke name
431 Generate a revocation certificate for the complete key. To
432 revoke a subkey or a signature, use the --edit command.
433
434
435 --desig-revoke name
436 Generate a designated revocation certificate for a key. This
437 allows a user (with the permission of the keyholder) to revoke
438 someone else's key.
439
440
441
442 --edit-key
443 Present a menu which enables you to do most of the key manage‐
444 ment related tasks. It expects the specification of a key on
445 the command line.
446
447
448
449 sign Make a signature on key of user name If the key is not
450 yet signed by the default user (or the users given with
451 -u), the program displays the information of the key
452 again, together with its fingerprint and asks whether it
453 should be signed. This question is repeated for all users
454 specified with -u.
455
456
457 lsign Same as "sign" but the signature is marked as non-
458 exportable and will therefore never be used by others.
459 This may be used to make keys valid only in the local
460 environment.
461
462
463 nrsign Same as "sign" but the signature is marked as non-revoca‐
464 ble and can therefore never be revoked.
465
466
467 tsign Make a trust signature. This is a signature that combines
468 the notions of certification (like a regular signature),
469 and trust (like the "trust" command). It is generally
470 only useful in distinct communities or groups.
471
472 Note that "l" (for local / non-exportable), "nr" (for non-revo‐
473 cable, and "t" (for trust) may be freely mixed and prefixed to
474 "sign" to create a signature of any type desired.
475
476
477
478 revsig Revoke a signature. For every signature which has been
479 generated by one of the secret keys, GnuPG asks whether a
480 revocation certificate should be generated.
481
482
483 trust Change the owner trust value. This updates the trust-db
484 immediately and no save is required.
485
486
487 disable
488
489 enable Disable or enable an entire key. A disabled key can not
490 normally be used for encryption.
491
492
493 adduid Create an alternate user id.
494
495
496 addphoto
497 Create a photographic user id. This will prompt for a
498 JPEG file that will be embedded into the user ID. Note
499 that a very large JPEG will make for a very large key.
500 Also note that some programs will display your JPEG
501 unchanged (GnuPG), and some programs will scale it to fit
502 in a dialog box (PGP).
503
504
505 deluid Delete a user id. Note that it is not possible to
506 retract a user id, once it has been send to the public
507 (i.e. to a keyserver). In that case you better use
508 revuid.
509
510
511 delsig Delete a signature. Note that it is not possible to
512 retract a signature, once it has been send to the public
513 (i.e. to a keyserver). In that case you better use
514 revsig.
515
516
517 revuid Revoke a user id.
518
519
520 addkey Add a subkey to this key.
521
522
523 addcardkey
524 Generate a key on a card and add it to this key.
525
526
527 keytocard
528 Transfer the selected secret key (or the primary key if
529 no key has been selected) to a smartcard. The secret key
530 in the keyring will be replaced by a stub if the key
531 could be stored successfully on the card and you use the
532 save command later. Only certain key types may be trans‐
533 ferred to the card. A sub menu allows you to select on
534 what card to store the key. Note that it is not possible
535 to get that key back from the card - if the card gets
536 broken your secret key will be lost unless you have a
537 backup somewhere.
538
539
540 bkuptocard file
541 Restore the given file to a card. This command may be
542 used to restore a backup key (as generated during card
543 initialization) to a new card. In almost all cases this
544 will be the encryption key. You should use this command
545 only with the corresponding public key and make sure that
546 the file given as argument is indeed the backup to
547 restore. You should then select 2 to restore as encryp‐
548 tion key. You will first be asked to enter the
549 passphrase of the backup key and then for the Admin PIN
550 of the card.
551
552
553 delkey Remove a subkey (secondart key). Note that it is not pos‐
554 sible to retract a subkey, once it has been send to the
555 public (i.e. to a keyserver). In that case you better
556 use revkey.
557
558
559 addrevoker
560 Add a designated revoker. This takes one optional argu‐
561 ment: "sensitive". If a designated revoker is marked as
562 sensitive, it will not be exported by default (see
563 export-options).
564
565
566 revkey Revoke a subkey.
567
568
569 expire Change the key expiration time. If a subkey is selected,
570 the expiration time of this subkey will be changed. With
571 no selection, the key expiration of the primary key is
572 changed.
573
574
575 passwd Change the passphrase of the secret key.
576
577
578 primary
579 Flag the current user id as the primary one, removes the
580 primary user id flag from all other user ids and sets the
581 timestamp of all affected self-signatures one second
582 ahead. Note that setting a photo user ID as primary makes
583 it primary over other photo user IDs, and setting a regu‐
584 lar user ID as primary makes it primary over other regu‐
585 lar user IDs.
586
587
588 uid n Toggle selection of user id with index n. Use 0 to dese‐
589 lect all.
590
591
592 key n Toggle selection of subkey with index n. Use 0 to dese‐
593 lect all.
594
595
596 check Check all selected user ids.
597
598
599 showphoto
600 Display the selected photographic user id.
601
602
603 pref List preferences from the selected user ID. This shows
604 the actual preferences, without including any implied
605 preferences.
606
607
608 showpref
609 More verbose preferences listing for the selected user
610 ID. This shows the preferences in effect by including the
611 implied preferences of 3DES (cipher), SHA-1 (digest), and
612 Uncompressed (compression) if they are not already
613 included in the preference list. In addition, the pre‐
614 ferred keyserver and signature notations (if any) are
615 shown.
616
617
618 setpref string
619 Set the list of user ID preferences to string for all (or
620 just the selected) user IDs. Calling setpref with no
621 arguments sets the preference list to the default (either
622 built-in or set via --default-preference-list), and call‐
623 ing setpref with "none" as the argument sets an empty
624 preference list. Use gpg --version to get a list of
625 available algorithms. Note that while you can change the
626 preferences on an attribute user ID (aka "photo ID"),
627 GnuPG does not select keys via attribute user IDs so
628 these preferences will not be used by GnuPG.
629
630
631 keyserver
632 Set a preferred keyserver for the specified user ID(s).
633 This allows other users to know where you prefer they get
634 your key from. See --keyserver-options honor-keyserver-
635 url for more on how this works. Setting a value of
636 "none" removes an existing preferred keyserver.
637
638
639 notation
640 Set a name=value notation for the specified user ID(s).
641 See --cert-notation for more on how this works. Setting a
642 value of "none" removes all notations, setting a notation
643 prefixed with a minus sign (-) removes that notation, and
644 setting a notation name (without the =value) prefixed
645 with a minus sign removes all notations with that name.
646
647
648 toggle Toggle between public and secret key listing.
649
650
651 clean Compact (by removing all signatures except the selfsig)
652 any user ID that is no longer usable (e.g. revoked, or
653 expired). Then, remove any signatures that are not usable
654 by the trust calculations. Specifically, this removes
655 any signature that does not validate, any signature that
656 is superseded by a later signature, revoked signatures,
657 and signatures issued by keys that are not present on the
658 keyring.
659
660
661 minimize
662 Make the key as small as possible. This removes all sig‐
663 natures from each user ID except for the most recent
664 self-signature.
665
666
667 cross-certify
668 Add cross-certification signatures to signing subkeys
669 that may not currently have them. Cross-certification
670 signatures protect against a subtle attack against sign‐
671 ing subkeys. See --require-cross-certification.
672
673
674 save Save all changes to the key rings and quit.
675
676
677 quit Quit the program without updating the key rings.
678
679
680 The listing shows you the key with its secondary keys and all
681 user ids. Selected keys or user ids are indicated by an aster‐
682 isk. The trust value is displayed with the primary key: the
683 first is the assigned owner trust and the second is the calcu‐
684 lated trust value. Letters are used for the values:
685
686
687
688 - No ownertrust assigned / not yet calculated.
689
690
691 e Trust calculation has failed; probably due to an expired
692 key.
693
694
695 q Not enough information for calculation.
696
697
698 n Never trust this key.
699
700
701 m Marginally trusted.
702
703
704 f Fully trusted.
705
706
707 u Ultimately trusted.
708
709
710 --sign-key name
711 Signs a public key with your secret key. This is a shortcut ver‐
712 sion of the subcommand "sign" from --edit.
713
714
715 --lsign-key name
716 Signs a public key with your secret key but marks it as non-
717 exportable. This is a shortcut version of the subcommand "lsign"
718 from --edit-key.
719
720
721
722
723
724
726 gpg comes features a bunch of options to control the exact behaviour
727 and to change the default configuration.
728
729
730 Long options can be put in an options file (default
731 "~/.gnupg/gpg.conf"). Short option names will not work - for example,
732 "armor" is a valid option for the options file, while "a" is not. Do
733 not write the 2 dashes, but simply the name of the option and any
734 required arguments. Lines with a hash ('#') as the first non-white-
735 space character are ignored. Commands may be put in this file too, but
736 that is not generally useful as the command will execute automatically
737 with every execution of gpg.
738
739 Please remember that option parsing stops as soon as a non-option is
740 encountered, you can explicitly stop parsing by using the special
741 option --.
742
743
744
745 How to change the configuration
746
747
748 These options are used to change the configuraton and are usually found
749 in the option file.
750
751
752
753 --default-key name
754 Use name as the default key to sign with. If this option is not
755 used, the default key is the first key found in the secret
756 keyring. Note that -u or --local-user overrides this option.
757
758
759 --default-recipient name
760 Use name as default recipient if option --recipient is not used
761 and don't ask if this is a valid one. name must be non-empty.
762
763
764 --default-recipient-self
765 Use the default key as default recipient if option --recipient
766 is not used and don't ask if this is a valid one. The default
767 key is the first one from the secret keyring or the one set with
768 --default-key.
769
770
771 --no-default-recipient
772 Reset --default-recipient and --default-recipient-self.
773
774
775 -v, --verbose
776 Give more information during processing. If used twice, the
777 input data is listed in detail.
778
779
780 --no-verbose
781 Reset verbose level to 0.
782
783
784 -q, --quiet
785 Try to be as quiet as possible.
786
787
788 --list-options parameters
789 This is a space or comma delimited string that gives options
790 used when listing keys and signatures (that is, --list-keys,
791 --list-sigs, --list-public-keys, --list-secret-keys, and the
792 --edit-key functions). Options can be prepended with a no-
793 (after the two dashes) to give the opposite meaning. The
794 options are:
795
796
797
798 show-photos
799 Causes --list-keys, --list-sigs, --list-public-keys, and
800 --list-secret-keys to display any photo IDs attached to
801 the key. Defaults to no. See also --photo-viewer.
802
803
804 show-policy-urls
805 Show policy URLs in the --list-sigs or --check-sigs list‐
806 ings. Defaults to no.
807
808
809 show-notations
810
811 show-std-notations
812
813 show-user-notations
814 Show all, IETF standard, or user-defined signature nota‐
815 tions in the --list-sigs or --check-sigs listings.
816 Defaults to no.
817
818
819 show-keyserver-urls
820
821 Show any preferred keyserver URL in the --list-sigs or
822 --check-sigs listings. Defaults to no.
823
824
825 show-uid-validity
826 Display the calculated validity of user IDs during key
827 listings. Defaults to no.
828
829
830 show-unusable-uids
831 Show revoked and expired user IDs in key listings.
832 Defaults to no.
833
834
835 show-unusable-subkeys
836 Show revoked and expired subkeys in key listings.
837 Defaults to no.
838
839
840 show-keyring
841 Display the keyring name at the head of key listings to
842 show which keyring a given key resides on. Defaults to
843 no.
844
845
846 show-sig-expire
847 Show signature expiration dates (if any) during --list-
848 sigs or --check-sigs listings. Defaults to no.
849
850
851 show-sig-subpackets
852 Include signature subpackets in the key listing. This
853 option can take an optional argument list of the subpack‐
854 ets to list. If no argument is passed, list all subpack‐
855 ets. Defaults to no. This option is only meaningful when
856 using --with-colons along with --list-sigs or --check-
857 sigs.
858
859
860 --verify-options parameters
861 This is a space or comma delimited string that gives options
862 used when verifying signatures. Options can be prepended with a
863 `no-' to give the opposite meaning. The options are:
864
865
866
867 show-photos
868 Display any photo IDs present on the key that issued the
869 signature. Defaults to no. See also --photo-viewer.
870
871
872 show-policy-urls
873 Show policy URLs in the signature being verified.
874 Defaults to no.
875
876
877 show-notations
878
879 show-std-notations
880
881 show-user-notations
882 Show all, IETF standard, or user-defined signature nota‐
883 tions in the signature being verified. Defaults to IETF
884 standard.
885
886
887 show-keyserver-urls
888 Show any preferred keyserver URL in the signature being
889 verified. Defaults to no.
890
891
892 show-uid-validity
893 Display the calculated validity of the user IDs on the
894 key that issued the signature. Defaults to no.
895
896
897 show-unusable-uids
898 Show revoked and expired user IDs during signature veri‐
899 fication. Defaults to no.
900
901
902 show-primary-uid-only
903 Show only the primary user ID during signature verifica‐
904 tion. That is all the AKA lines as well as photo Ids are
905 not shown with the signature verification status.
906
907
908 pka-lookups
909 Enable PKA lookups to verify sender addresses. Note that
910 PKA is based on DNS, and so enabling this option may dis‐
911 close information on when and what signatures are veri‐
912 fied or to whom data is encrypted. This is similar to the
913 "web bug" described for the auto-key-retrieve feature.
914
915
916 pka-trust-increase
917 Raise the trust in a signature to full if the signature
918 passes PKA validation. This option is only meaningful if
919 pka-lookups is set.
920
921
922 --enable-dsa2
923
924 --disable-dsa2
925 Enables new-style DSA keys which (unlike the old style) may be
926 larger than 1024 bit and use hashes other than SHA-1 and
927 RIPEMD/160. Note that very few programs currently support these
928 keys and signatures from them.
929
930
931 --photo-viewer string
932 This is the command line that should be run to view a photo ID.
933 "%i" will be expanded to a filename containing the photo. "%I"
934 does the same, except the file will not be deleted once the
935 viewer exits. Other flags are "%k" for the key ID, "%K" for the
936 long key ID, "%f" for the key fingerprint, "%t" for the exten‐
937 sion of the image type (e.g. "jpg"), "%T" for the MIME type of
938 the image (e.g. "image/jpeg"), and "%%" for an actual percent
939 sign. If neither %i or %I are present, then the photo will be
940 supplied to the viewer on standard input.
941
942 The default viewer is "xloadimage -fork -quiet -title 'KeyID
943 0x%k' stdin". Note that if your image viewer program is not
944 secure, then executing it from GnuPG does not make it secure.
945
946
947 --exec-path string
948 Sets a list of directories to search for photo viewers and key‐
949 server helpers. If not provided, keyserver helpers use the com‐
950 piled-in default directory, and photo viewers use the $PATH
951 environment variable. Note, that on W32 system this value is
952 ignored when searching for keyserver helpers.
953
954
955 --keyring file
956 Add file to the current list of keyrings. If file begins with a
957 tilde and a slash, these are replaced by the $HOME directory. If
958 the filename does not contain a slash, it is assumed to be in
959 the GnuPG home directory ("~/.gnupg" if --homedir or $GNUPGHOME
960 is not used).
961
962 Note that this adds a keyring to the current list. If the intent
963 is to use the specified keyring alone, use --keyring along with
964 --no-default-keyring.
965
966
967 --secret-keyring file
968 Same as --keyring but for the secret keyrings.
969
970
971 --primary-keyring file
972 Designate file as the primary public keyring. This means that
973 newly imported keys (via --import or keyserver --recv-from) will
974 go to this keyring.
975
976
977 --trustdb-name file
978 Use file instead of the default trustdb. If file begins with a
979 tilde and a slash, these are replaced by the $HOME directory. If
980 the filename does not contain a slash, it is assumed to be in
981 the GnuPG home directory (`~/.gnupg' if --homedir or $GNUPGHOME
982 is not used).
983
984
985
986 --homedir dir
987 Set the name of the home directory to dir. If his option is not
988 used, the home directory defaults to `~/.gnupg'. It is only
989 recognized when given on the command line. It also overrides
990 any home directory stated through the environment variable
991 `GNUPGHOME' or (on W32 systems) by means on the Registry entry
992 HKCU\Software\GNU\GnuPG:HomeDir.
993
994
995
996 --pcsc-driver file
997 Use file to access the smartcard reader. The current default is
998 `libpcsclite.so.1' for GLIBC based systems, `/Sys‐
999 tem/Library/Frameworks/PCSC.framework/PCSC' for MAC OS X, `win‐
1000 scard.dll' for Windows and `libpcsclite.so' for other systems.
1001
1002
1003 --disable-ccid
1004 Disable the integrated support for CCID compliant readers. This
1005 allows to fall back to one of the other drivers even if the
1006 internal CCID driver can handle the reader. Note, that CCID sup‐
1007 port is only available if libusb was available at build time.
1008
1009
1010 --reader-port number_or_string
1011 This option may be used to specify the port of the card termi‐
1012 nal. A value of 0 refers to the first serial device; add 32768
1013 to access USB devices. The default is 32768 (first USB device).
1014 PC/SC or CCID readers might need a string here; run the program
1015 in verbose mode to get a list of available readers. The default
1016 is then the first reader found.
1017
1018
1019 --display-charset name
1020 Set the name of the native character set. This is used to con‐
1021 vert some informational strings like user IDs to the proper
1022 UTF-8 encoding. Note that this has nothing to do with the char‐
1023 acter set of data to be encrypted or signed; GnuPG does not
1024 recode user supplied data. If this option is not used, the
1025 default character set is determined from the current locale. A
1026 verbosity level of 3 shows the chosen set. Valid values for
1027 name are:
1028
1029
1030
1031 iso-8859-1
1032 This is the Latin 1 set.
1033
1034
1035 iso-8859-2
1036 The Latin 2 set.
1037
1038
1039 iso-8859-15
1040 This is currently an alias for the Latin 1 set.
1041
1042
1043 koi8-r The usual Russian set (rfc1489).
1044
1045
1046 utf-8 Bypass all translations and assume that the OS uses
1047 native UTF-8 encoding.
1048
1049
1050 --utf8-strings
1051
1052 --no-utf8-strings
1053 Assume that command line arguments are given as UTF8 strings.
1054 The default (--no-utf8-strings) is to assume that arguments are
1055 encoded in the character set as specified by --display-charset.
1056 These options affect all following arguments. Both options may
1057 be used multiple times.
1058
1059
1060
1061 --options file
1062 Read options from file and do not try to read them from the
1063 default options file in the homedir (see --homedir). This option
1064 is ignored if used in an options file.
1065
1066
1067 --no-options
1068 Shortcut for --options /dev/null. This option is detected before
1069 an attempt to open an option file. Using this option will also
1070 prevent the creation of a `~/.gnupg' homedir.
1071
1072
1073
1074
1075 -z n
1076
1077 --compress-level n
1078
1079 --bzip2-compress-level n
1080 Set compression level to n for the ZIP and ZLIB compression
1081 algorithms. The default is to use the default compression level
1082 of zlib (normally 6). --bzip2-compress-level sets the compres‐
1083 sion level for the BZIP2 compression algorithm (defaulting to 6
1084 as well). This is a different option from --compress-level since
1085 BZIP2 uses a significant amount of memory for each additional
1086 compression level. -z sets both. A value of 0 for n disables
1087 compression.
1088
1089
1090 --bzip2-decompress-lowmem
1091 Use a different decompression method for BZIP2 compressed files.
1092 This alternate method uses a bit more than half the memory, but
1093 also runs at half the speed. This is useful under extreme low
1094 memory circumstances when the file was originally compressed at
1095 a high --bzip2-compress-level.
1096
1097
1098
1099 --mangle-dos-filenames
1100
1101 --no-mangle-dos-filenames
1102 Older version of Windows cannot handle filenames with more than
1103 one dot. --mangle-dos-filenames causes GnuPG to replace (rather
1104 than add to) the extension of an output filename to avoid this
1105 problem. This option is off by default and has no effect on non-
1106 Windows platforms.
1107
1108
1109 --ask-cert-level
1110
1111 --no-ask-cert-level
1112 When making a key signature, prompt for a certification level.
1113 If this option is not specified, the certification level used is
1114 set via --default-cert-level. See --default-cert-level for
1115 information on the specific levels and how they are used. --no-
1116 ask-cert-level disables this option. This option defaults to no.
1117
1118
1119 --default-cert-level n
1120 The default to use for the check level when signing a key.
1121
1122 0 means you make no particular claim as to how carefully you
1123 verified the key.
1124
1125 1 means you believe the key is owned by the person who claims to
1126 own it but you could not, or did not verify the key at all. This
1127 is useful for a "persona" verification, where you sign the key
1128 of a pseudonymous user.
1129
1130 2 means you did casual verification of the key. For example,
1131 this could mean that you verified that the key fingerprint and
1132 checked the user ID on the key against a photo ID.
1133
1134 3 means you did extensive verification of the key. For example,
1135 this could mean that you verified the key fingerprint with the
1136 owner of the key in person, and that you checked, by means of a
1137 hard to forge document with a photo ID (such as a passport) that
1138 the name of the key owner matches the name in the user ID on the
1139 key, and finally that you verified (by exchange of email) that
1140 the email address on the key belongs to the key owner.
1141
1142 Note that the examples given above for levels 2 and 3 are just
1143 that: examples. In the end, it is up to you to decide just what
1144 "casual" and "extensive" mean to you.
1145
1146 This option defaults to 0 (no particular claim).
1147
1148
1149 --min-cert-level
1150 When building the trust database, treat any signatures with a
1151 certification level below this as invalid. Defaults to 2, which
1152 disregards level 1 signatures. Note that level 0 "no particular
1153 claim" signatures are always accepted.
1154
1155
1156 --trusted-key long key ID
1157 Assume that the specified key (which must be given as a full 8
1158 byte key ID) is as trustworthy as one of your own secret keys.
1159 This option is useful if you don't want to keep your secret keys
1160 (or one of them) online but still want to be able to check the
1161 validity of a given recipient's or signator's key.
1162
1163
1164 --trust-model pgp|classic|direct|always|auto
1165 Set what trust model GnuPG should follow. The models are:
1166
1167
1168
1169 pgp This is the Web of Trust combined with trust signatures
1170 as used in PGP 5.x and later. This is the default trust
1171 model when creating a new trust database.
1172
1173
1174 classic
1175 This is the standard Web of Trust as used in PGP 2.x and
1176 earlier.
1177
1178
1179 direct Key validity is set directly by the user and not calcu‐
1180 lated via the Web of Trust.
1181
1182
1183 always Skip key validation and assume that used keys are always
1184 fully trusted. You generally won't use this unless you
1185 are using some external validation scheme. This option
1186 also suppresses the "[uncertain]" tag printed with signa‐
1187 ture checks when there is no evidence that the user ID is
1188 bound to the key.
1189
1190
1191 auto Select the trust model depending on whatever the internal
1192 trust database says. This is the default model if such a
1193 database already exists.
1194
1195
1196 --auto-key-locate parameters
1197
1198 --no-auto-key-locate
1199 GnuPG can automatically locate and retrieve keys as needed using
1200 this option. This happens when encrypting to an email address
1201 (in the "user@example.com" form), and there are no user@exam‐
1202 ple.com keys on the local keyring. This option takes any number
1203 of the following arguments, in the order they are to be tried:
1204
1205
1206
1207 cert locate a key using DNS CERT, as specified in 2538bis
1208 (currently in draft): http://www.josefs‐
1209 son.org/rfc2538bis/
1210
1211
1212 pka locate a key using DNS PKA.
1213
1214
1215 ldap locate a key using the PGP Universal method of checking
1216 "ldap://keys.(thedomain)".
1217
1218
1219 keyserver
1220 locate a key using whatever keyserver is defined using
1221 the --keyserver option.
1222
1223
1224 (keyserver URL)
1225 In addition, a keyserver URL as used in the --keyserver
1226 option may be used here to query that particular key‐
1227 server.
1228
1229
1230 --keyid-format short|0xshort|long|0xlong
1231 Select how to display key IDs. "short" is the traditional
1232 8-character key ID. "long" is the more accurate (but less conve‐
1233 nient) 16-character key ID. Add an "0x" to either to include an
1234 "0x" at the beginning of the key ID, as in 0x99242560.
1235
1236
1237 --keyserver name
1238 Use name as your keyserver. This is the server that --recv-keys,
1239 --send-keys, and --search-keys will communicate with to receive
1240 keys from, send keys to, and search for keys on. The format of
1241 the name is a URI: `scheme:[//]keyservername[:port]' The scheme
1242 is the type of keyserver: "hkp" for the HTTP (or compatible)
1243 keyservers, "ldap" for the LDAP keyservers, or "mailto" for the
1244 Graff email keyserver. Note that your particular installation of
1245 GnuPG may have other keyserver types available as well. Key‐
1246 server schemes are case-insensitive. After the keyserver name,
1247 optional keyserver configuration options may be provided. These
1248 are the same as the global --keyserver-options from below, but
1249 apply only to this particular keyserver.
1250
1251 Most keyservers synchronize with each other, so there is gener‐
1252 ally no need to send keys to more than one server. The keyserver
1253 hkp://subkeys.pgp.net uses round robin DNS to give a different
1254 keyserver each time you use it.
1255
1256
1257 --keyserver-options name=value1
1258 This is a space or comma delimited string that gives options for
1259 the keyserver. Options can be prepended with a `no-' to give the
1260 opposite meaning. Valid import-options or export-options may be
1261 used here as well to apply to importing (--recv-key) or export‐
1262 ing (--send-key) a key from a keyserver. While not all options
1263 are available for all keyserver types, some common options are:
1264
1265
1266
1267 include-revoked
1268 When searching for a key with --search-keys, include keys
1269 that are marked on the keyserver as revoked. Note that
1270 not all keyservers differentiate between revoked and
1271 unrevoked keys, and for such keyservers this option is
1272 meaningless. Note also that most keyservers do not have
1273 cryptographic verification of key revocations, and so
1274 turning this option off may result in skipping keys that
1275 are incorrectly marked as revoked.
1276
1277
1278 include-disabled
1279 When searching for a key with --search-keys, include keys
1280 that are marked on the keyserver as disabled. Note that
1281 this option is not used with HKP keyservers.
1282
1283
1284 auto-key-retrieve
1285 This option enables the automatic retrieving of keys from
1286 a keyserver when verifying signatures made by keys that
1287 are not on the local keyring.
1288
1289 Note that this option makes a "web bug" like behavior
1290 possible. Keyserver operators can see which keys you
1291 request, so by sending you a message signed by a brand
1292 new key (which you naturally will not have on your local
1293 keyring), the operator can tell both your IP address and
1294 the time when you verified the signature.
1295
1296
1297 honor-keyserver-url
1298 When using --refresh-keys, if the key in question has a
1299 preferred keyserver URL, then use that preferred key‐
1300 server to refresh the key from. In addition, if auto-key-
1301 retrieve is set, and the signature being verified has a
1302 preferred keyserver URL, then use that preferred key‐
1303 server to fetch the key from. Defaults to yes.
1304
1305
1306 honor-pka-record
1307 If auto-key-retrieve is set, and the signature being ver‐
1308 ified has a PKA record, then use the PKA information to
1309 fetch the key. Defaults to yes.
1310
1311
1312 include-subkeys
1313 When receiving a key, include subkeys as potential tar‐
1314 gets. Note that this option is not used with HKP key‐
1315 servers, as they do not support retrieving keys by subkey
1316 id.
1317
1318
1319 use-temp-files
1320 On most Unix-like platforms, GnuPG communicates with the
1321 keyserver helper program via pipes, which is the most
1322 efficient method. This option forces GnuPG to use tempo‐
1323 rary files to communicate. On some platforms (such as
1324 Win32 and RISC OS), this option is always enabled.
1325
1326
1327 keep-temp-files
1328 If using `use-temp-files', do not delete the temp files
1329 after using them. This option is useful to learn the key‐
1330 server communication protocol by reading the temporary
1331 files.
1332
1333
1334 verbose
1335 Tell the keyserver helper program to be more verbose.
1336 This option can be repeated multiple times to increase
1337 the verbosity level.
1338
1339
1340 timeout
1341 Tell the keyserver helper program how long (in seconds)
1342 to try and perform a keyserver action before giving up.
1343 Note that performing multiple actions at the same time
1344 uses this timeout value per action. For example, when
1345 retrieving multiple keys via --recv-keys, the timeout
1346 applies separately to each key retrieval, and not to the
1347 --recv-keys command as a whole. Defaults to 30 seconds.
1348
1349
1350 http-proxy=value
1351 Set the proxy to use for HTTP and HKP keyservers. This
1352 overrides the "http_proxy" environment variable, if any.
1353
1354
1355 max-cert-size
1356 When retrieving a key via DNS CERT, only accept keys up
1357 to this size. Defaults to 16384 bytes.
1358
1359
1360 --completes-needed n
1361 Number of completely trusted users to introduce a new key signer
1362 (defaults to 1).
1363
1364
1365 --marginals-needed n
1366 Number of marginally trusted users to introduce a new key signer
1367 (defaults to 3)
1368
1369
1370 --max-cert-depth n
1371 Maximum depth of a certification chain (default is 5).
1372
1373
1374 --simple-sk-checksum
1375 Secret keys are integrity protected by using a SHA-1 checksum.
1376 This method is part of the upcoming enhanced OpenPGP specifica‐
1377 tion but GnuPG already uses it as a countermeasure against cer‐
1378 tain attacks. Old applications don't understand this new for‐
1379 mat, so this option may be used to switch back to the old behav‐
1380 iour. Using this option bears a security risk. Note that using
1381 this option only takes effect when the secret key is encrypted -
1382 the simplest way to make this happen is to change the passphrase
1383 on the key (even changing it to the same value is acceptable).
1384
1385
1386 --no-sig-cache
1387 Do not cache the verification status of key signatures. Caching
1388 gives a much better performance in key listings. However, if you
1389 suspect that your public keyring is not save against write modi‐
1390 fications, you can use this option to disable the caching. It
1391 probably does not make sense to disable it because all kind of
1392 damage can be done if someone else has write access to your pub‐
1393 lic keyring.
1394
1395
1396 --no-sig-create-check
1397 GnuPG normally verifies each signature right after creation to
1398 protect against bugs and hardware malfunctions which could leak
1399 out bits from the secret key. This extra verification needs some
1400 time (about 115% for DSA keys), and so this option can be used
1401 to disable it. However, due to the fact that the signature cre‐
1402 ation needs manual interaction, this performance penalty does
1403 not matter in most settings.
1404
1405
1406 --auto-check-trustdb
1407
1408 --no-auto-check-trustdb
1409 If GnuPG feels that its information about the Web of Trust has
1410 to be updated, it automatically runs the --check-trustdb command
1411 internally. This may be a time consuming process. --no-auto-
1412 check-trustdb disables this option.
1413
1414
1415 --use-agent
1416
1417 --no-use-agent
1418 Try to use the GnuPG-Agent. With this option, GnuPG first tries
1419 to connect to the agent before it asks for a passphrase. --no-
1420 use-agent disables this option.
1421
1422
1423 --gpg-agent-info
1424 Override the value of the environment variable
1425
1426 been given. Given that this option is not anymore used by gpg2,
1427 it should be avoided if possible.
1428
1429
1430 --lock-once
1431 Lock the databases the first time a lock is requested and do not
1432 release the lock until the process terminates.
1433
1434
1435 --lock-multiple
1436 Release the locks every time a lock is no longer needed. Use
1437 this to override a previous --lock-once from a config file.
1438
1439
1440 --lock-never
1441 Disable locking entirely. This option should be used only in
1442 very special environments, where it can be assured that only one
1443 process is accessing those files. A bootable floppy with a
1444 stand-alone encryption system will probably use this. Improper
1445 usage of this option may lead to data and key corruption.
1446
1447
1448 --exit-on-status-write-error
1449 This option will cause write errors on the status FD to immedi‐
1450 ately terminate the process. That should in fact be the default
1451 but it never worked this way and thus we need an option to
1452 enable this, so that the change won't break applications which
1453 close their end of a status fd connected pipe too early. Using
1454 this option along with --enable-progress-filter may be used to
1455 cleanly cancel long running gpg operations.
1456
1457
1458 --limit-card-insert-tries n
1459 With n greater than 0 the number of prompts asking to insert a
1460 smartcard gets limited to N-1. Thus with a value of 1 gpg won't
1461 at all ask to insert a card if none has been inserted at
1462 startup. This option is useful in the configuration file in case
1463 an application does not know about the smartcard support and
1464 waits ad infinitum for an inserted card.
1465
1466
1467 --no-random-seed-file
1468 GnuPG uses a file to store its internal random pool over invoca‐
1469 tions. This makes random generation faster; however sometimes
1470 write operations are not desired. This option can be used to
1471 achieve that with the cost of slower random generation.
1472
1473
1474 --no-greeting
1475 Suppress the initial copyright message.
1476
1477
1478 --no-secmem-warning
1479 Suppress the warning about "using insecure memory".
1480
1481
1482 --no-permission-warning
1483 Suppress the warning about unsafe file and home directory
1484 (--homedir) permissions. Note that the permission checks that
1485 GnuPG performs are not intended to be authoritative, but rather
1486 they simply warn about certain common permission problems. Do
1487 not assume that the lack of a warning means that your system is
1488 secure.
1489
1490 Note that the warning for unsafe --homedir permissions cannot be
1491 suppressed in the gpg.conf file, as this would allow an attacker
1492 to place an unsafe gpg.conf file in place, and use this file to
1493 suppress warnings about itself. The --homedir permissions warn‐
1494 ing may only be suppressed on the command line.
1495
1496
1497 --no-mdc-warning
1498 Suppress the warning about missing MDC integrity protection.
1499
1500
1501 --require-secmem
1502
1503 --no-require-secmem
1504 Refuse to run if GnuPG cannot get secure memory. Defaults to no
1505 (i.e. run, but give a warning).
1506
1507
1508
1509 --require-cross-certification
1510
1511 --no-require-cross-certification
1512 When verifying a signature made from a subkey, ensure that the
1513 cross certification "back signature" on the subkey is present
1514 and valid. This protects against a subtle attack against sub‐
1515 keys that can sign. Defaults to --require-cross-certification
1516 for gpg.
1517
1518
1519 --expert
1520
1521 --no-expert
1522 Allow the user to do certain nonsensical or "silly" things like
1523 signing an expired or revoked key, or certain potentially incom‐
1524 patible things like generating unusual key types. This also dis‐
1525 ables certain warning messages about potentially incompatible
1526 actions. As the name implies, this option is for experts only.
1527 If you don't fully understand the implications of what it allows
1528 you to do, leave this off. --no-expert disables this option.
1529
1530
1531
1532
1533
1534
1535
1536
1537 Key related options
1538
1539
1540
1541
1542 --recipient name
1543
1544 -r Encrypt for user id name. If this option or --hidden-recipient
1545 is not specified, GnuPG asks for the user-id unless --default-
1546 recipient is given.
1547
1548
1549 --hidden-recipient name
1550
1551 -R Encrypt for user ID name, but hide the key ID of this user's
1552 key. This option helps to hide the receiver of the message and
1553 is a limited countermeasure against traffic analysis. If this
1554 option or --recipient is not specified, GnuPG asks for the user
1555 ID unless --default-recipient is given.
1556
1557
1558 --encrypt-to name
1559 Same as --recipient but this one is intended for use in the
1560 options file and may be used with your own user-id as an
1561 "encrypt-to-self". These keys are only used when there are other
1562 recipients given either by use of --recipient or by the asked
1563 user id. No trust checking is performed for these user ids and
1564 even disabled keys can be used.
1565
1566
1567 --hidden-encrypt-to name
1568 Same as --hidden-recipient but this one is intended for use in
1569 the options file and may be used with your own user-id as a hid‐
1570 den "encrypt-to-self". These keys are only used when there are
1571 other recipients given either by use of --recipient or by the
1572 asked user id. No trust checking is performed for these user
1573 ids and even disabled keys can be used.
1574
1575
1576 --no-encrypt-to
1577 Disable the use of all --encrypt-to and --hidden-encrypt-to
1578 keys.
1579
1580
1581 --group name=value1
1582 Sets up a named group, which is similar to aliases in email pro‐
1583 grams. Any time the group name is a recipient (-r or --recipi‐
1584 ent), it will be expanded to the values specified. Multiple
1585 groups with the same name are automatically merged into a single
1586 group.
1587
1588 The values are key IDs or fingerprints, but any key description
1589 is accepted. Note that a value with spaces in it will be treated
1590 as two different values. Note also there is only one level of
1591 expansion --- you cannot make an group that points to another
1592 group. When used from the command line, it may be necessary to
1593 quote the argument to this option to prevent the shell from
1594 treating it as multiple arguments.
1595
1596
1597 --ungroup name
1598 Remove a given entry from the --group list.
1599
1600
1601 --no-groups
1602 Remove all entries from the --group list.
1603
1604
1605 --local-user name
1606
1607 -u Use name as the key to sign with. Note that this option over‐
1608 rides --default-key.
1609
1610
1611 --try-all-secrets
1612 Don't look at the key ID as stored in the message but try all
1613 secret keys in turn to find the right decryption key. This
1614 option forces the behaviour as used by anonymous recipients
1615 (created by using --throw-keyids) and might come handy in case
1616 where an encrypted message contains a bogus key ID.
1617
1618
1619
1620
1621
1622
1623
1624
1625 Input and Output
1626
1627
1628
1629
1630 --armor
1631
1632 -a Create ASCII armored output. The default is to create the
1633 binary OpenPGP format.
1634
1635
1636 --no-armor
1637 Assume the input data is not in ASCII armored format.
1638
1639
1640 --output file
1641
1642 -o file
1643 Write output to file.
1644
1645
1646 --max-output n
1647 This option sets a limit on the number of bytes that will be
1648 generated when processing a file. Since OpenPGP supports various
1649 levels of compression, it is possible that the plaintext of a
1650 given message may be significantly larger than the original
1651 OpenPGP message. While GnuPG works properly with such messages,
1652 there is often a desire to set a maximum file size that will be
1653 generated before processing is forced to stop by the OS limits.
1654 Defaults to 0, which means "no limit".
1655
1656
1657 --import-options parameters
1658 This is a space or comma delimited string that gives options for
1659 importing keys. Options can be prepended with a `no-' to give
1660 the opposite meaning. The options are:
1661
1662
1663
1664 import-local-sigs
1665 Allow importing key signatures marked as "local". This is
1666 not generally useful unless a shared keyring scheme is
1667 being used. Defaults to no.
1668
1669
1670 repair-pks-subkey-bug
1671 During import, attempt to repair the damage caused by the
1672 PKS keyserver bug (pre version 0.9.6) that mangles keys
1673 with multiple subkeys. Note that this cannot completely
1674 repair the damaged key as some crucial data is removed by
1675 the keyserver, but it does at least give you back one
1676 subkey. Defaults to no for regular --import and to yes
1677 for keyserver --recv-keys.
1678
1679
1680 merge-only
1681 During import, allow key updates to existing keys, but do
1682 not allow any new keys to be imported. Defaults to no.
1683
1684
1685 import-clean
1686 After import, compact (remove all signatures except the
1687 self-signature) any user IDs from the new key that are
1688 not usable. Then, remove any signatures from the new key
1689 that are not usable. This includes signatures that were
1690 issued by keys that are not present on the keyring. This
1691 option is the same as running the --edit-key command
1692 "clean" after import. Defaults to no.
1693
1694
1695 import-minimal
1696 Import the smallest key possible. This removes all signa‐
1697 tures except the most recent self-signature on each user
1698 ID. This option is the same as running the --edit-key
1699 command "minimize" after import. Defaults to no.
1700
1701
1702 --export-options parameters
1703 This is a space or comma delimited string that gives options for
1704 exporting keys. Options can be prepended with a `no-' to give
1705 the opposite meaning. The options are:
1706
1707
1708
1709 export-local-sigs
1710 Allow exporting key signatures marked as "local". This is
1711 not generally useful unless a shared keyring scheme is
1712 being used. Defaults to no.
1713
1714
1715 export-attributes
1716 Include attribute user IDs (photo IDs) while exporting.
1717 This is useful to export keys if they are going to be
1718 used by an OpenPGP program that does not accept attribute
1719 user IDs. Defaults to yes.
1720
1721
1722 export-sensitive-revkeys
1723 Include designated revoker information that was marked as
1724 "sensitive". Defaults to no.
1725
1726
1727 export-reset-subkey-passwd
1728 When using the --export-secret-subkeys command, this
1729 option resets the passphrases for all exported subkeys to
1730 empty. This is useful when the exported subkey is to be
1731 used on an unattended machine where a passphrase doesn't
1732 necessarily make sense. Defaults to no.
1733
1734
1735 export-clean
1736 Compact (remove all signatures from) user IDs on the key
1737 being exported if the user IDs are not usable. Also, do
1738 not export any signatures that are not usable. This
1739 includes signatures that were issued by keys that are not
1740 present on the keyring. This option is the same as run‐
1741 ning the --edit-key command "clean" before export except
1742 that the local copy of the key is not modified. Defaults
1743 to no.
1744
1745
1746 export-minimal
1747 Export the smallest key possible. This removes all signa‐
1748 tures except the most recent self-signature on each user
1749 ID. This option is the same as running the --edit-key
1750 command "minimize" before export except that the local
1751 copy of the key is not modified. Defaults to no.
1752
1753
1754 --with-colons
1755 Print key listings delimited by colons. Note that the output
1756 will be encoded in UTF-8 regardless of any --display-charset
1757 setting. This format is useful when GnuPG is called from scripts
1758 and other programs as it is easily machine parsed. The details
1759 of this format are documented in the file `doc/DETAILS', which
1760 is included in the GnuPG source distribution.
1761
1762
1763 --fixed-list-mode
1764 Do not merge primary user ID and primary key in --with-colon
1765 listing mode and print all timestamps as seconds since
1766 1970-01-01.
1767
1768
1769 --with-fingerprint
1770 Same as the command --fingerprint but changes only the format of
1771 the output and may be used together with another command.
1772
1773
1774
1775
1776
1777 OpenPGP protocol specific options.
1778
1779
1780
1781
1782 -t, --textmode
1783
1784 --no-textmode
1785 Treat input files as text and store them in the OpenPGP canoni‐
1786 cal text form with standard "CRLF" line endings. This also sets
1787 the necessary flags to inform the recipient that the encrypted
1788 or signed data is text and may need its line endings converted
1789 back to whatever the local system uses. This option is useful
1790 when communicating between two platforms that have different
1791 line ending conventions (UNIX-like to Mac, Mac to Windows, etc).
1792 --no-textmode disables this option, and is the default.
1793
1794 If -t (but not --textmode) is used together with armoring and
1795 signing, this enables clearsigned messages. This kludge is
1796 needed for command-line compatibility with command-line versions
1797 of PGP; normally you would use --sign or --clearsign to select
1798 the type of the signature.
1799
1800
1801
1802
1803 --force-v3-sigs
1804
1805 --no-force-v3-sigs
1806 OpenPGP states that an implementation should generate v4 signa‐
1807 tures but PGP versions 5 through 7 only recognize v4 signatures
1808 on key material. This option forces v3 signatures for signatures
1809 on data. Note that this option overrides --ask-sig-expire, as
1810 v3 signatures cannot have expiration dates. --no-force-v3-sigs
1811 disables this option.
1812
1813
1814 --force-v4-certs
1815
1816 --no-force-v4-certs
1817 Always use v4 key signatures even on v3 keys. This option also
1818 changes the default hash algorithm for v3 RSA keys from MD5 to
1819 SHA-1. --no-force-v4-certs disables this option.
1820
1821
1822 --force-mdc
1823 Force the use of encryption with a modification detection code.
1824 This is always used with the newer ciphers (those with a block‐
1825 size greater than 64 bits), or if all of the recipient keys
1826 indicate MDC support in their feature flags.
1827
1828
1829 --disable-mdc
1830 Disable the use of the modification detection code. Note that by
1831 using this option, the encrypted message becomes vulnerable to a
1832 message modification attack.
1833
1834
1835 --personal-cipher-preferences string
1836 Set the list of personal cipher preferences to string, this list
1837 should be a string similar to the one printed by the command
1838 "pref" in the edit menu. This allows the user to factor in their
1839 own preferred algorithms when algorithms are chosen via recipi‐
1840 ent key preferences. The most highly ranked cipher in this list
1841 is also used for the --symmetric encryption command.
1842
1843
1844 --personal-digest-preferences string
1845 Set the list of personal digest preferences to string, this list
1846 should be a string similar to the one printed by the command
1847 "pref" in the edit menu. This allows the user to factor in their
1848 own preferred algorithms when algorithms are chosen via recipi‐
1849 ent key preferences. The most highly ranked digest algorithm in
1850 this list is algo used when signing without encryption (e.g.
1851 --clearsign or --sign). The default value is SHA-1.
1852
1853
1854 --personal-compress-preferences string
1855 Set the list of personal compression preferences to string, this
1856 list should be a string similar to the one printed by the com‐
1857 mand "pref" in the edit menu. This allows the user to factor in
1858 their own preferred algorithms when algorithms are chosen via
1859 recipient key preferences. The most highly ranked algorithm in
1860 this list is also used when there are no recipient keys to con‐
1861 sider (e.g. --symmetric).
1862
1863
1864
1865
1866 --s2k-cipher-algo name
1867 Use name as the cipher algorithm used to protect secret keys.
1868 The default cipher is CAST5. This cipher is also used for con‐
1869 ventional encryption if --personal-cipher-preferences and
1870 --cipher-algo is not given.
1871
1872
1873 --s2k-digest-algo name
1874 Use name as the digest algorithm used to mangle the passphrases.
1875 The default algorithm is SHA-1.
1876
1877
1878 --s2k-mode n
1879 Selects how passphrases are mangled. If n is 0 a plain
1880 passphrase (which is not recommended) will be used, a 1 adds a
1881 salt to the passphrase and a 3 (the default) iterates the whole
1882 process a number of times (see --s2k-count). Unless --rfc1991
1883 is used, this mode is also used for conventional encryption.
1884
1885
1886 --s2k-count n
1887 Specify how many times the passphrase mangling is repeated.
1888 This value may range between 1024 and 65011712 inclusive, and
1889 the default is 65536. Note that not all values in the
1890 1024-65011712 range are legal and if an illegal value is
1891 selected, GnuPG will round up to the nearest legal value. This
1892 option is only meaningful if --s2k-mode is 3.
1893
1894
1895
1896
1897
1898 Compliance options
1899
1900
1901 These options control what GnuPG is compliant to. Only one of these
1902 options may be active at a time. Note that the default setting of this
1903 is nearly always the correct one. See the INTEROPERABILITY WITH OTHER
1904 OPENPGP PROGRAMS section below before using one of these options.
1905
1906
1907
1908 --gnupg
1909 Use standard GnuPG behavior. This is essentially OpenPGP behav‐
1910 ior (see --openpgp), but with some additional workarounds for
1911 common compatibility problems in different versions of PGP. This
1912 is the default option, so it is not generally needed, but it may
1913 be useful to override a different compliance option in the
1914 gpg.conf file.
1915
1916
1917 --openpgp
1918 Reset all packet, cipher and digest options to strict OpenPGP
1919 behavior. Use this option to reset all previous options like
1920 --rfc1991, --force-v3-sigs, --s2k-*, --cipher-algo, --digest-
1921 algo and --compress-algo to OpenPGP compliant values. All PGP
1922 workarounds are disabled.
1923
1924
1925 --rfc2440
1926 Reset all packet, cipher and digest options to strict RFC-2440
1927 behavior. Note that this is currently the same thing as
1928 --openpgp.
1929
1930
1931 --rfc1991
1932 Try to be more RFC-1991 (PGP 2.x) compliant.
1933
1934
1935 --pgp2 Set up all options to be as PGP 2.x compliant as possible, and
1936 warn if an action is taken (e.g. encrypting to a non-RSA key)
1937 that will create a message that PGP 2.x will not be able to han‐
1938 dle. Note that `PGP 2.x' here means `MIT PGP 2.6.2'. There are
1939 other versions of PGP 2.x available, but the MIT release is a
1940 good common baseline.
1941
1942 This option implies --rfc1991 --disable-mdc --no-force-v4-certs
1943 --no-sk-comment --escape-from-lines --force-v3-sigs --no-ask-
1944 sig-expire --no-ask-cert-expire --cipher-algo IDEA --digest-algo
1945 MD5 --compress-algo 1. It also disables --textmode when encrypt‐
1946 ing.
1947
1948
1949 --pgp6 Set up all options to be as PGP 6 compliant as possible. This
1950 restricts you to the ciphers IDEA (if the IDEA plugin is
1951 installed), 3DES, and CAST5, the hashes MD5, SHA1 and RIPEMD160,
1952 and the compression algorithms none and ZIP. This also disables
1953 --throw-keyids, and making signatures with signing subkeys as
1954 PGP 6 does not understand signatures made by signing subkeys.
1955
1956 This option implies --disable-mdc --no-sk-comment --escape-from-
1957 lines --force-v3-sigs --no-ask-sig-expire.
1958
1959
1960 --pgp7 Set up all options to be as PGP 7 compliant as possible. This is
1961 identical to --pgp6 except that MDCs are not disabled, and the
1962 list of allowable ciphers is expanded to add AES128, AES192,
1963 AES256, and TWOFISH.
1964
1965
1966 --pgp8 Set up all options to be as PGP 8 compliant as possible. PGP 8
1967 is a lot closer to the OpenPGP standard than previous versions
1968 of PGP, so all this does is disable --throw-keyids and set
1969 --escape-from-lines. All algorithms are allowed except for the
1970 SHA224, SHA384, and SHA512 digests.
1971
1972
1973
1974
1975
1976 Doing things one usually doesn't want to do.
1977
1978
1979
1980
1981 -n
1982
1983 --dry-run
1984 Don't make any changes (this is not completely implemented).
1985
1986
1987 --list-only
1988 Changes the behaviour of some commands. This is like --dry-run
1989 but different in some cases. The semantic of this command may be
1990 extended in the future. Currently it only skips the actual
1991 decryption pass and therefore enables a fast listing of the
1992 encryption keys.
1993
1994
1995 -i
1996
1997 --interactive
1998 Prompt before overwriting any files.
1999
2000
2001 --debug flags
2002 Set debugging flags. All flags are or-ed and flags may be given
2003 in C syntax (e.g. 0x0042).
2004
2005
2006 --debug-all
2007 Set all useful debugging flags.
2008
2009
2010 --debug-ccid-driver
2011 Enable debug output from the included CCID driver for smart‐
2012 cards. Note that this option is only available on some system.
2013
2014
2015 --enable-progress-filter
2016 Enable certain PROGRESS status outputs. This option allows fron‐
2017 tends to display a progress indicator while gpg is processing
2018 larger files. There is a slight performance overhead using it.
2019
2020
2021 --status-fd n
2022 Write special status strings to the file descriptor n. See the
2023 file DETAILS in the documentation for a listing of them.
2024
2025
2026 --status-file file
2027 Same as --status-fd, except the status data is written to file
2028 file.
2029
2030
2031 --logger-fd n
2032 Write log output to file descriptor n and not to stderr.
2033
2034
2035 --logger-file file
2036 Same as --logger-fd, except the logger data is written to file
2037 file.
2038
2039
2040 --attribute-fd n
2041 Write attribute subpackets to the file descriptor n. This is
2042 most useful for use with --status-fd, since the status messages
2043 are needed to separate out the various subpackets from the
2044 stream delivered to the file descriptor.
2045
2046
2047 --attribute-file file
2048 Same as --attribute-fd, except the attribute data is written to
2049 file file.
2050
2051
2052 --comment string
2053
2054 --no-comments
2055 Use string as a comment string in clear text signatures and
2056 ASCII armored messages or keys (see --armor). The default behav‐
2057 ior is not to use a comment string. --comment may be repeated
2058 multiple times to get multiple comment strings. --no-comments
2059 removes all comments. It is a good idea to keep the length of a
2060 single comment below 60 characters to avoid problems with mail
2061 programs wrapping such lines. Note that comment lines, like all
2062 other header lines, are not protected by the signature.
2063
2064
2065 --emit-version
2066
2067 --no-emit-version
2068 Force inclusion of the version string in ASCII armored output.
2069 --no-emit-version disables this option.
2070
2071
2072 --sig-notation name=value
2073
2074 --cert-notation name=value
2075
2076 -N, --set-notation name=value
2077 Put the name value pair into the signature as notation data.
2078 name must consist only of printable characters or spaces, and
2079 must contain a '@' character in the form keyname@domain.exam‐
2080 ple.com (substituting the appropriate keyname and domain name,
2081 of course). This is to help prevent pollution of the IETF
2082 reserved notation namespace. The --expert flag overrides the '@'
2083 check. value may be any printable string; it will be encoded in
2084 UTF8, so you should check that your --display-charset is set
2085 correctly. If you prefix name with an exclamation mark (!), the
2086 notation data will be flagged as critical (rfc2440:5.2.3.15).
2087 --sig-notation sets a notation for data signatures. --cert-nota‐
2088 tion sets a notation for key signatures (certifications). --set-
2089 notation sets both.
2090
2091 There are special codes that may be used in notation names. "%k"
2092 will be expanded into the key ID of the key being signed, "%K"
2093 into the long key ID of the key being signed, "%f" into the fin‐
2094 gerprint of the key being signed, "%s" into the key ID of the
2095 key making the signature, "%S" into the long key ID of the key
2096 making the signature, "%g" into the fingerprint of the key mak‐
2097 ing the signature (which might be a subkey), "%p" into the fin‐
2098 gerprint of the primary key of the key making the signature,
2099 "%c" into the signature count from the OpenPGP smartcard, and
2100 "%%" results in a single "%". %k, %K, and %f are only meaningful
2101 when making a key signature (certification), and %c is only
2102 meaningful when using the OpenPGP smartcard.
2103
2104
2105 --sig-policy-url string
2106
2107 --cert-policy-url string
2108
2109 --set-policy-url string
2110 Use string as a Policy URL for signatures (rfc2440:5.2.3.19).
2111 If you prefix it with an exclamation mark (!), the policy URL
2112 packet will be flagged as critical. --sig-policy-url sets a pol‐
2113 icy url for data signatures. --cert-policy-url sets a policy url
2114 for key signatures (certifications). --set-policy-url sets both.
2115
2116 The same %-expandos used for notation data are available here as
2117 well.
2118
2119
2120 --sig-keyserver-url string
2121 Use string as a preferred keyserver URL for data signatures. If
2122 you prefix it with an exclamation mark (!), the keyserver URL
2123 packet will be flagged as critical.
2124
2125 The same %-expandos used for notation data are available here as
2126 well.
2127
2128
2129 --set-filename string
2130 Use string as the filename which is stored inside messages.
2131 This overrides the default, which is to use the actual filename
2132 of the file being encrypted.
2133
2134
2135 --for-your-eyes-only
2136
2137 --no-for-your-eyes-only
2138 Set the `for your eyes only' flag in the message. This causes
2139 GnuPG to refuse to save the file unless the --output option is
2140 given, and PGP to use the "secure viewer" with a Tempest-resis‐
2141 tant font to display the message. This option overrides --set-
2142 filename. --no-for-your-eyes-only disables this option.
2143
2144
2145 --use-embedded-filename
2146
2147 --no-use-embedded-filename
2148 Try to create a file with a name as embedded in the data. This
2149 can be a dangerous option as it allows to overwrite files.
2150 Defaults to no.
2151
2152
2153 --cipher-algo name
2154 Use name as cipher algorithm. Running the program with the com‐
2155 mand --version yields a list of supported algorithms. If this is
2156 not used the cipher algorithm is selected from the preferences
2157 stored with the key. In general, you do not want to use this
2158 option as it allows you to violate the OpenPGP standard. --per‐
2159 sonal-cipher-preferences is the safe way to accomplish the same
2160 thing.
2161
2162
2163 --digest-algo name
2164 Use name as the message digest algorithm. Running the program
2165 with the command --version yields a list of supported algo‐
2166 rithms. In general, you do not want to use this option as it
2167 allows you to violate the OpenPGP standard. --personal-digest-
2168 preferences is the safe way to accomplish the same thing.
2169
2170
2171 --compress-algo name
2172 Use compression algorithm name. "zlib" is RFC-1950 ZLIB compres‐
2173 sion. "zip" is RFC-1951 ZIP compression which is used by PGP.
2174 "bzip2" is a more modern compression scheme that can compress
2175 some things better than zip or zlib, but at the cost of more
2176 memory used during compression and decompression. "uncompressed"
2177 or "none" disables compression. If this option is not used, the
2178 default behavior is to examine the recipient key preferences to
2179 see which algorithms the recipient supports. If all else fails,
2180 ZIP is used for maximum compatibility.
2181
2182 ZLIB may give better compression results than ZIP, as the com‐
2183 pression window size is not limited to 8k. BZIP2 may give even
2184 better compression results than that, but will use a signifi‐
2185 cantly larger amount of memory while compressing and decompress‐
2186 ing. This may be significant in low memory situations. Note,
2187 however, that PGP (all versions) only supports ZIP compression.
2188 Using any algorithm other than ZIP or "none" will make the mes‐
2189 sage unreadable with PGP. In general, you do not want to use
2190 this option as it allows you to violate the OpenPGP standard.
2191 --personal-compress-preferences is the safe way to accomplish
2192 the same thing.
2193
2194
2195 --cert-digest-algo name
2196 Use name as the message digest algorithm used when signing a
2197 key. Running the program with the command --version yields a
2198 list of supported algorithms. Be aware that if you choose an
2199 algorithm that GnuPG supports but other OpenPGP implementations
2200 do not, then some users will not be able to use the key signa‐
2201 tures you make, or quite possibly your entire key.
2202
2203
2204 --disable-cipher-algo name
2205 Never allow the use of name as cipher algorithm. The given name
2206 will not be checked so that a later loaded algorithm will still
2207 get disabled.
2208
2209
2210 --disable-pubkey-algo name
2211 Never allow the use of name as public key algorithm. The given
2212 name will not be checked so that a later loaded algorithm will
2213 still get disabled.
2214
2215
2216 --throw-keyids
2217
2218 --no-throw-keyids
2219 Do not put the recipient key IDs into encrypted messages. This
2220 helps to hide the receivers of the message and is a limited
2221 countermeasure against traffic analysis. On the receiving side,
2222 it may slow down the decryption process because all available
2223 secret keys must be tried. --no-throw-keyids disables this
2224 option. This option is essentially the same as using --hidden-
2225 recipient for all recipients.
2226
2227
2228 --not-dash-escaped
2229 This option changes the behavior of cleartext signatures so that
2230 they can be used for patch files. You should not send such an
2231 armored file via email because all spaces and line endings are
2232 hashed too. You can not use this option for data which has 5
2233 dashes at the beginning of a line, patch files don't have this.
2234 A special armor header line tells GnuPG about this cleartext
2235 signature option.
2236
2237
2238 --escape-from-lines
2239
2240 --no-escape-from-lines
2241 Because some mailers change lines starting with "From " to
2242 ">From " it is good to handle such lines in a special way when
2243 creating cleartext signatures to prevent the mail system from
2244 breaking the signature. Note that all other PGP versions do it
2245 this way too. Enabled by default. --no-escape-from-lines dis‐
2246 ables this option.
2247
2248
2249 --passphrase-repeat n
2250 Specify how many times gpg will request a new passphrase be
2251 repeated. This is useful for helping memorize a passphrase.
2252 Defaults to 1 repetition.
2253
2254
2255 --passphrase-fd n
2256 Read the passphrase from file descriptor n. Only the first line
2257 will be read from file descriptor n. If you use 0 for n, the
2258 passphrase will be read from stdin. This can only be used if
2259 only one passphrase is supplied.
2260
2261
2262 --passphrase-file file
2263 Read the passphrase from file file. Only the first line will be
2264 read from file file. This can only be used if only one
2265 passphrase is supplied. Obviously, a passphrase stored in a file
2266 is of questionable security if other users can read this file.
2267 Don't use this option if you can avoid it.
2268
2269
2270 --passphrase string
2271 Use string as the passphrase. This can only be used if only one
2272 passphrase is supplied. Obviously, this is of very questionable
2273 security on a multi-user system. Don't use this option if you
2274 can avoid it.
2275
2276
2277 --command-fd n
2278 This is a replacement for the deprecated shared-memory IPC mode.
2279 If this option is enabled, user input on questions is not
2280 expected from the TTY but from the given file descriptor. It
2281 should be used together with --status-fd. See the file
2282 doc/DETAILS in the source distribution for details on how to use
2283 it.
2284
2285
2286 --command-file file
2287 Same as --command-fd, except the commands are read out of file
2288 file
2289
2290
2291 --allow-non-selfsigned-uid
2292
2293 --no-allow-non-selfsigned-uid
2294 Allow the import and use of keys with user IDs which are not
2295 self-signed. This is not recommended, as a non self-signed user
2296 ID is trivial to forge. --no-allow-non-selfsigned-uid disables.
2297
2298
2299 --allow-freeform-uid
2300 Disable all checks on the form of the user ID while generating a
2301 new one. This option should only be used in very special envi‐
2302 ronments as it does not ensure the de-facto standard format of
2303 user IDs.
2304
2305
2306 --ignore-time-conflict
2307 GnuPG normally checks that the timestamps associated with keys
2308 and signatures have plausible values. However, sometimes a sig‐
2309 nature seems to be older than the key due to clock problems.
2310 This option makes these checks just a warning. See also
2311 --ignore-valid-from for timestamp issues on subkeys.
2312
2313
2314 --ignore-valid-from
2315 GnuPG normally does not select and use subkeys created in the
2316 future. This option allows the use of such keys and thus
2317 exhibits the pre-1.0.7 behaviour. You should not use this option
2318 unless you there is some clock problem. See also --ignore-time-
2319 conflict for timestamp issues with signatures.
2320
2321
2322 --ignore-crc-error
2323 The ASCII armor used by OpenPGP is protected by a CRC checksum
2324 against transmission errors. Occasionally the CRC gets mangled
2325 somewhere on the transmission channel but the actual content
2326 (which is protected by the OpenPGP protocol anyway) is still
2327 okay. This option allows GnuPG to ignore CRC errors.
2328
2329
2330 --ignore-mdc-error
2331 This option changes a MDC integrity protection failure into a
2332 warning. This can be useful if a message is partially corrupt,
2333 but it is necessary to get as much data as possible out of the
2334 corrupt message. However, be aware that a MDC protection fail‐
2335 ure may also mean that the message was tampered with intention‐
2336 ally by an attacker.
2337
2338
2339 --no-default-keyring
2340 Do not add the default keyrings to the list of keyrings. Note
2341 that GnuPG will not operate without any keyrings, so if you use
2342 this option and do not provide alternate keyrings via --keyring
2343 or --secret-keyring, then GnuPG will still use the default pub‐
2344 lic or secret keyrings.
2345
2346
2347 --skip-verify
2348 Skip the signature verification step. This may be used to make
2349 the decryption faster if the signature verification is not
2350 needed.
2351
2352
2353 --with-key-data
2354 Print key listings delimited by colons (like --with-colons) and
2355 print the public key data.
2356
2357
2358 --fast-list-mode
2359 Changes the output of the list commands to work faster; this is
2360 achieved by leaving some parts empty. Some applications don't
2361 need the user ID and the trust information given in the list‐
2362 ings. By using this options they can get a faster listing. The
2363 exact behaviour of this option may change in future versions.
2364 If you are missing some information, don't use this option.
2365
2366
2367 --no-literal
2368 This is not for normal use. Use the source to see for what it
2369 might be useful.
2370
2371
2372 --set-filesize
2373 This is not for normal use. Use the source to see for what it
2374 might be useful.
2375
2376
2377 --show-session-key
2378 Display the session key used for one message. See --override-
2379 session-key for the counterpart of this option.
2380
2381 We think that Key Escrow is a Bad Thing; however the user should
2382 have the freedom to decide whether to go to prison or to reveal
2383 the content of one specific message without compromising all
2384 messages ever encrypted for one secret key. DON'T USE IT UNLESS
2385 YOU ARE REALLY FORCED TO DO SO.
2386
2387
2388 --override-session-key string
2389 Don't use the public key but the session key string. The format
2390 of this string is the same as the one printed by --show-session-
2391 key. This option is normally not used but comes handy in case
2392 someone forces you to reveal the content of an encrypted mes‐
2393 sage; using this option you can do this without handing out the
2394 secret key.
2395
2396
2397 --ask-sig-expire
2398
2399 --no-ask-sig-expire
2400 When making a data signature, prompt for an expiration time. If
2401 this option is not specified, the expiration time set via
2402 --default-sig-expire is used. --no-ask-sig-expire disables this
2403 option. Note that by default, --force-v3-sigs is set which also
2404 disables this option. If you want signature expiration, you must
2405 set --no-force-v3-sigs as well as turning --ask-sig-expire on.
2406
2407
2408 --default-sig-expire
2409 The default expiration time to use for signature expiration.
2410 Valid values are "0" for no expiration, a number followed by the
2411 letter d (for days), w (for weeks), m (for months), or y (for
2412 years) (for example "2m" for two months, or "5y" for five
2413 years), or an absolute date in the form YYYY-MM-DD. Defaults to
2414 "0".
2415
2416
2417 --ask-cert-expire
2418
2419 --no-ask-cert-expire
2420 When making a key signature, prompt for an expiration time. If
2421 this option is not specified, the expiration time set via
2422 --default-cert-expire is used. --no-ask-cert-expire disables
2423 this option.
2424
2425
2426 --default-cert-expire
2427 The default expiration time to use for key signature expiration.
2428 Valid values are "0" for no expiration, a number followed by the
2429 letter d (for days), w (for weeks), m (for months), or y (for
2430 years) (for example "2m" for two months, or "5y" for five
2431 years), or an absolute date in the form YYYY-MM-DD. Defaults to
2432 "0".
2433
2434
2435 --allow-secret-key-import
2436 This is an obsolete option and is not used anywhere.
2437
2438
2439 --allow-multiple-messages
2440
2441 --no-allow-multiple-messages
2442 Allow processing of multiple OpenPGP messages contained in a
2443 single file or stream. Some programs that call GPG are not pre‐
2444 pared to deal with multiple messages being processed together,
2445 so this option defaults to no. Note that versions of GPG prior
2446 to 1.4.7 always allowed multiple messages.
2447
2448
2449 --enable-special-filenames
2450 This options enables a mode in which filenames of the form
2451 `-&n', where n is a non-negative decimal number, refer to the
2452 file descriptor n and not to a file with that name.
2453
2454
2455 --no-expensive-trust-checks
2456 Experimental use only.
2457
2458
2459 --preserve-permissions
2460 Don't change the permissions of a secret keyring back to user
2461 read/write only. Use this option only if you really know what
2462 you are doing.
2463
2464
2465 --default-preference-list string
2466 Set the list of default preferences to string. This preference
2467 list is used for new keys and becomes the default for "setpref"
2468 in the edit menu.
2469
2470
2471 --default-keyserver-url name
2472 Set the default keyserver URL to name. This keyserver will be
2473 used as the keyserver URL when writing a new self-signature on a
2474 key, which includes key generation and changing preferences.
2475
2476
2477 --list-config
2478 Display various internal configuration parameters of GnuPG. This
2479 option is intended for external programs that call GnuPG to per‐
2480 form tasks, and is thus not generally useful. See the file
2481 `doc/DETAILS' in the source distribution for the details of
2482 which configuration items may be listed. --list-config is only
2483 usable with --with-colons set.
2484
2485
2486 --gpgconf-list
2487 This command is simliar to --list-config but in general only
2488 internally used by the gpgconf tool.
2489
2490
2491 --gpgconf-test
2492 This is more or less dummy action. However it parses the con‐
2493 figuration file and returns with failure if the configuraion
2494 file would prevent gpg from startup. Thus it may be used to run
2495 a syntax check on the configuration file.
2496
2497
2498
2499
2500 Deprecated options
2501
2502
2503
2504
2505 --load-extension name
2506 Load an extension module. If name does not contain a slash it is
2507 searched for in the directory configured when GnuPG was built
2508 (generally "/usr/local/lib/gnupg"). Extensions are not generally
2509 useful anymore, and the use of this option is deprecated.
2510
2511
2512 --show-photos
2513
2514 --no-show-photos
2515 Causes --list-keys, --list-sigs, --list-public-keys, --list-
2516 secret-keys, and verifying a signature to also display the photo
2517 ID attached to the key, if any. See also --photo-viewer. These
2518 options are deprecated. Use --list-options [no-]show-photos
2519 and/or --verify-options [no-]show-photos instead.
2520
2521
2522 --show-keyring
2523 Display the keyring name at the head of key listings to show
2524 which keyring a given key resides on. This option is deprecated:
2525 use --list-options [no-]show-keyring instead.
2526
2527
2528 --ctapi-driver file
2529 Use file to access the smartcard reader. The current default is
2530 `libtowitoko.so'. Note that the use of this interface is depre‐
2531 cated; it may be removed in future releases.
2532
2533
2534 --always-trust
2535 Identical to --trust-model always. This option is deprecated.
2536
2537
2538 --show-notation
2539
2540 --no-show-notation
2541 Show signature notations in the --list-sigs or --check-sigs
2542 listings as well as when verifying a signature with a notation
2543 in it. These options are deprecated. Use --list-options
2544 [no-]show-notation and/or --verify-options [no-]show-notation
2545 instead.
2546
2547
2548 --show-policy-url
2549
2550 --no-show-policy-url
2551 Show policy URLs in the --list-sigs or --check-sigs listings as
2552 well as when verifying a signature with a policy URL in it.
2553 These options are deprecated. Use --list-options [no-]show-pol‐
2554 icy-url and/or --verify-options [no-]show-policy-url instead.
2555
2556
2557
2558
2559
2560
2562 gpg -se -r Bob file
2563 sign and encrypt for user Bob
2564
2565
2566 gpg --clearsign file
2567 make a clear text signature
2568
2569
2570 gpg -sb file
2571 make a detached signature
2572
2573
2574 gpg --list-keys user_ID
2575 show keys
2576
2577
2578 gpg --fingerprint user_ID
2579 show fingerprint
2580
2581
2582 gpg --verify pgpfile
2583
2584 gpg --verify sigfile
2585 Verify the signature of the file but do not output the data. The
2586 second form is used for detached signatures, where sigfile is
2587 the detached signature (either ASCII armored or binary) and are
2588 the signed data; if this is not given, the name of the file
2589 holding the signed data is constructed by cutting off the exten‐
2590 sion (".asc" or ".sig") of sigfile or by asking the user for the
2591 filename.
2592
2593
2594
2595
2597 There are different ways to specify a user ID to GnuPG. Some of them
2598 are only valid for gpg others are only good for gpgsm. Here is the
2599 entire list of ways to specify a key:
2600
2601
2602
2603 By key Id.
2604 This format is deduced from the length of the string and its
2605 content or 0x prefix. The key Id of an X.509 certificate are the
2606 low 64 bits of its SHA-1 fingerprint. The use of key Ids is
2607 just a shortcut, for all automated processing the fingerprint
2608 should be used.
2609
2610 When using gpg an exclamation mark may be appended to force
2611 using the specified primary or secondary key and not to try and
2612 calculate which primary or secondary key to use.
2613
2614 The last four lines of the example give the key ID in their long
2615 form as internally used by the OpenPGP protocol. You can see the
2616 long key ID using the option --with-colons.
2617
2618 234567C4
2619 0F34E556E
2620 01347A56A
2621 0xAB123456
2622
2623 234AABBCC34567C4
2624 0F323456784E56EAB
2625 01AB3FED1347A5612
2626 0x234AABBCC34567C4
2627
2628
2629
2630
2631 By fingerprint.
2632 This format is deduced from the length of the string and its
2633 content or the 0x prefix. Note, that only the 20 byte version
2634 fingerprint is available with gpgsm (i.e. the SHA-1 hash of the
2635 certificate).
2636
2637 When using gpg an exclamation mark may be appended to force
2638 using the specified primary or secondary key and not to try and
2639 calculate which primary or secondary key to use.
2640
2641 The best way to specify a key Id is by using the fingerprint.
2642 This avoids any ambiguities in case that there are duplicated
2643 key IDs.
2644
2645 1234343434343434C434343434343434
2646 123434343434343C3434343434343734349A3434
2647 0E12343434343434343434EAB3484343434343434
2648 0xE12343434343434343434EAB3484343434343434
2649
2650
2651 (gpgsm also accepts colons between each pair of hexadecimal digits
2652 because this is the de-facto standard on how to present X.509 finger‐
2653 prints.)
2654
2655
2656 By exact match on OpenPGP user ID.
2657 This is denoted by a leading equal sign. It does not make sense
2658 for X.509 certificates.
2659
2660 =Heinrich Heine <heinrichh@uni-duesseldorf.de>
2661
2662
2663 By exact match on an email address.
2664 This is indicated by enclosing the email address in the usual
2665 way with left and right angles.
2666
2667 <heinrichh@uni-duesseldorf.de>
2668
2669
2670
2671 By word match.
2672 All words must match exactly (not case sensitive) but can appear
2673 in any order in the user ID or a subjects name. Words are any
2674 sequences of letters, digits, the underscore and all characters
2675 with bit 7 set.
2676
2677 +Heinrich Heine duesseldorf
2678
2679
2680 By exact match on the subject's DN.
2681 This is indicated by a leading slash, directly followed by the
2682 RFC-2253 encoded DN of the subject. Note that you can't use the
2683 string printed by "gpgsm --list-keys" because that one as been
2684 reordered and modified for better readability; use --with-colons
2685 to print the raw (but standard escaped) RFC-2253 string
2686
2687 /CN=Heinrich Heine,O=Poets,L=Paris,C=FR
2688
2689
2690 By exact match on the issuer's DN.
2691 This is indicated by a leading hash mark, directly followed by a
2692 slash and then directly followed by the rfc2253 encoded DN of
2693 the issuer. This should return the Root cert of the issuer.
2694 See note above.
2695
2696 #/CN=Root Cert,O=Poets,L=Paris,C=FR
2697
2698
2699
2700 By exact match on serial number and issuer's DN.
2701 This is indicated by a hash mark, followed by the hexadecmal
2702 representation of the serial number, the followed by a slash and
2703 the RFC-2253 encoded DN of the issuer. See note above.
2704
2705 #4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
2706
2707
2708 By keygrip
2709 This is indicated by an ampersand followed by the 40 hex digits
2710 of a keygrip. gpgsm prints the keygrip when using the command
2711 --dump-cert. It does not yet work for OpenPGP keys.
2712
2713 &D75F22C3F86E355877348498CDC92BD21010A480
2714
2715
2716
2717 By substring match.
2718 This is the default mode but applications may want to explicitly
2719 indicate this by putting the asterisk in front. Match is not
2720 case sensitive.
2721
2722 Heine
2723 *Heine
2724
2725
2726
2727 Please note that we have reused the hash mark identifier which was used
2728 in old GnuPG versions to indicate the so called local-id. It is not
2729 anymore used and there should be no conflict when used with X.509
2730 stuff.
2731
2732 Using the RFC-2253 format of DNs has the drawback that it is not possi‐
2733 ble to map them back to the original encoding, however we don't have to
2734 do this because our key database stores this encoding as meta data.
2735
2736
2737
2738
2739
2741 The program returns 0 if everything was fine, 1 if at least a signature
2742 was bad, and other error codes for fatal errors.
2743
2744
2746 Use a *good* password for your user account and a *good* passphrase to
2747 protect your secret key. This passphrase is the weakest part of the
2748 whole system. Programs to do dictionary attacks on your secret keyring
2749 are very easy to write and so you should protect your "~/.gnupg/"
2750 directory very well.
2751
2752 Keep in mind that, if this program is used over a network (telnet), it
2753 is *very* easy to spy out your passphrase!
2754
2755 If you are going to verify detached signatures, make sure that the pro‐
2756 gram knows about it; either give both filenames on the command line or
2757 use
2758 to specify stdin.
2759
2760
2762 GnuPG tries to be a very flexible implementation of the OpenPGP stan‐
2763 dard. In particular, GnuPG implements many of the optional parts of the
2764 standard, such as the SHA-512 hash, and the ZLIB and BZIP2 compression
2765 algorithms. It is important to be aware that not all OpenPGP programs
2766 implement these optional algorithms and that by forcing their use via
2767 the --cipher-algo, --digest-algo, --cert-digest-algo, or --compress-
2768 algo options in GnuPG, it is possible to create a perfectly valid
2769 OpenPGP message, but one that cannot be read by the intended recipient.
2770
2771 There are dozens of variations of OpenPGP programs available, and each
2772 supports a slightly different subset of these optional algorithms. For
2773 example, until recently, no (unhacked) version of PGP supported the
2774 BLOWFISH cipher algorithm. A message using BLOWFISH simply could not be
2775 read by a PGP user. By default, GnuPG uses the standard OpenPGP prefer‐
2776 ences system that will always do the right thing and create messages
2777 that are usable by all recipients, regardless of which OpenPGP program
2778 they use. Only override this safe default if you really know what you
2779 are doing.
2780
2781 If you absolutely must override the safe default, or if the preferences
2782 on a given key are invalid for some reason, you are far better off
2783 using the --pgp6, --pgp7, or --pgp8 options. These options are safe as
2784 they do not force any particular algorithms in violation of OpenPGP,
2785 but rather reduce the available algorithms to a "PGP-safe" list.
2786
2787
2789 There are a few configuration files to control certain aspects of gpg's
2790 operation. Unless noted, they are expected in the current home direc‐
2791 tory (see: [option --homedir]).
2792
2793
2794
2795 gpg.conf
2796 This is the standard configuration file read by gpg on startup.
2797 It may contain any valid long option; the leading two dashes may
2798 not be entered and the option may not be abbreviated. This
2799 default name may be changed on the command line (see: [option
2800 --options]).
2801
2802
2803 Note that on larger installations, it is useful to put predefined files
2804 into the directory `/etc/skel/.gnupg/' so that newly created users
2805 start up with a working configuration.
2806
2807 For internal purposes gpg creates and maintaines a few other files;
2808 They all live in in the current home directory (see: [option --home‐
2809 dir]). Only the gpg may modify these files.
2810
2811
2812
2813 ~/.gnupg/secring.gpg
2814 The secret keyring.
2815
2816
2817 ~/.gnupg/secring.gpg.lock
2818 and the lock file
2819
2820
2821 ~/.gnupg/pubring.gpg
2822 The public keyring
2823
2824
2825 ~/.gnupg/pubring.gpg.lock
2826 and the lock file
2827
2828
2829 ~/.gnupg/trustdb.gpg
2830 The trust database
2831
2832
2833 ~/.gnupg/trustdb.gpg.lock
2834 and the lock file
2835
2836
2837 ~/.gnupg/random_seed
2838 used to preserve the internal random pool
2839
2840
2841 /usr[/local]/share/gnupg/options.skel
2842 Skeleton options file
2843
2844
2845 /usr[/local]/lib/gnupg/
2846 Default location for extensions
2847
2848
2849 Operation is further controlled by a few environment variables:
2850
2851
2852
2853 HOME Used to locate the default home directory.
2854
2855
2856 GNUPGHOME
2857 If set directory used instead of "~/.gnupg".
2858
2859
2860 GPG_AGENT_INFO
2861 Used to locate the gpg-agent. This is only honored when --use-
2862 agent is set. The value consists of 3 colon delimited fields:
2863 The first is the path to the Unix Domain Socket, the second the
2864 PID of the gpg-agent and the protocol version which should be
2865 set to 1. When starting the gpg-agent as described in its docu‐
2866 mentation, this variable is set to the correct value. The option
2867 --gpg-agent-info can be used to override it.
2868
2869
2870 COLUMNS
2871
2872 LINES Used to size some displays to the full size of the screen.
2873
2874
2875
2876 LANGUAGE
2877 Apart from its use by GNU, it is used in the W32 version to
2878 override the language selection done through the Registry. If
2879 used and set to a a valid and available language name (langid),
2880 the file with the translation is loaded from
2881 gpgdir/gnupg.nls/langid.mo. Here gpgdir is the directory out of
2882 which the gpg binary has been laoded. If it can't be loaded the
2883 Registry is tried as a fallback.
2884
2885
2886
2887
2888
2890 On many systems this program should be installed as setuid(root). This
2891 is necessary to lock memory pages. Locking memory pages prevents the
2892 operating system from writing memory pages (which may contain
2893 passphrases or other sensitive material) to disk. If you get no warning
2894 message about insecure memory your operating system supports locking
2895 without being root. The program drops root privileges as soon as locked
2896 memory is allocated.
2897
2898 Note also that some systems (especially laptops) have the ability to
2899 ``suspend to disk'' (also known as ``safe sleep'' or ``hibernate'').
2900 This writes all memory to disk before going into a low power or even
2901 powered off mode. Unless measures are taken in the operating system to
2902 protect the saved memory, passphrases or other sensitive material may
2903 be recoverable from it later.
2904
2905
2907 gpgv(1),
2908
2909 The full documentation for this tool is maintained as a Texinfo manual.
2910 If GnuPG and the info program are properly installed at your site, the
2911 command
2912
2913 info gnupg1
2914
2915 should give you access to the complete manual including a menu struc‐
2916 ture and an index.
2917
2918
2919
2920GnuPG 1.4.7 2008-04-16 GPG(1)