chiark / gitweb /
doc: Document summary values of TOFU_STATS
[gnupg2.git] / doc / gnupg.info-1
1 This is gnupg.info, produced by makeinfo version 6.3 from gnupg.texi.
2
3 This is the 'The GNU Privacy Guard Manual' (version 2.1.17, December
4 2016).
5
6    (C) 2002, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
7 (C) 2013, 2014, 2015 Werner Koch.
8 (C) 2015 g10 Code GmbH.
9
10      Permission is granted to copy, distribute and/or modify this
11      document under the terms of the GNU General Public License as
12      published by the Free Software Foundation; either version 3 of the
13      License, or (at your option) any later version.  The text of the
14      license can be found in the section entitled "Copying".
15 INFO-DIR-SECTION GNU Utilities
16 START-INFO-DIR-ENTRY
17 * gpg2: (gnupg).           OpenPGP encryption and signing tool.
18 * gpgsm: (gnupg).          S/MIME encryption and signing tool.
19 * gpg-agent: (gnupg).      The secret key daemon.
20 * dirmngr: (gnupg).        X.509 CRL and OCSP server.
21 * dirmngr-client: (gnupg). X.509 CRL and OCSP client.
22 END-INFO-DIR-ENTRY
23
24 \1f
25 File: gnupg.info,  Node: Top,  Next: Installation,  Up: (dir)
26
27 Using the GNU Privacy Guard
28 ***************************
29
30 This is the 'The GNU Privacy Guard Manual' (version 2.1.17, December
31 2016).
32
33    (C) 2002, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
34 (C) 2013, 2014, 2015 Werner Koch.
35 (C) 2015 g10 Code GmbH.
36
37      Permission is granted to copy, distribute and/or modify this
38      document under the terms of the GNU General Public License as
39      published by the Free Software Foundation; either version 3 of the
40      License, or (at your option) any later version.  The text of the
41      license can be found in the section entitled "Copying".
42
43    This manual documents how to use the GNU Privacy Guard system as well
44 as the administration and the architecture.
45
46 * Menu:
47
48 * Installation::        A short installation guide.
49
50 * Invoking GPG-AGENT::  How to launch the secret key daemon.
51 * Invoking DIRMNGR::    How to launch the CRL and OCSP daemon.
52 * Invoking GPG::        Using the OpenPGP protocol.
53 * Invoking GPGSM::      Using the S/MIME protocol.
54 * Invoking SCDAEMON::   How to handle Smartcards.
55 * Specify a User ID::   How to Specify a User Id.
56
57 * Helper Tools::        Description of small helper tools
58
59 * Howtos::              How to do certain things.
60 * System Notes::        Notes pertaining to certain OSes.
61 * Debugging::           How to solve problems
62
63 * Copying::             GNU General Public License says
64                         how you can copy and share GnuPG
65 * Contributors::        People who have contributed to GnuPG.
66
67 * Glossary::            Short description of terms used.
68 * Option Index::        Index to command line options.
69 * Environment Index::   Index to environment variables and files.
70 * Index::               Index of concepts and symbol names.
71
72 \1f
73 File: gnupg.info,  Node: Installation,  Next: Invoking GPG-AGENT,  Prev: Top,  Up: Top
74
75 1 A short installation guide
76 ****************************
77
78 Unfortunately the installation guide has not been finished in time.
79 Instead of delaying the release of GnuPG 2.0 even further, I decided to
80 release without that guide.  The chapter on gpg-agent and gpgsm do
81 include brief information on how to set up the whole thing.  Please
82 watch the GnuPG website for updates of the documentation.  In the
83 meantime you may search the GnuPG mailing list archives or ask on the
84 gnupg-users mailing list for advise on how to solve problems or how to
85 get that whole thing up and running.
86
87    ** Building the software
88
89    Building the software is described in the file 'INSTALL'.  Given that
90 you are already reading this documentation we can only give some extra
91 hints.
92
93    To comply with the rules on GNU systems you should have build time
94 configured 'gnupg' using:
95
96      ./configure --sysconfdir=/etc --localstatedir=/var
97
98    This is to make sure that system wide configuration files are
99 searched in the directory '/etc' and variable data below '/var'; the
100 default would be to also install them below '/usr/local' where the
101 binaries get installed.  If you selected to use the '--prefix=/' you
102 obviously don't need those option as they are the default then.
103
104    ** Notes on setting a root CA key to trusted
105
106    X.509 is based on a hierarchical key infrastructure.  At the root of
107 the tree a trusted anchor (root certificate) is required.  There are
108 usually no other means of verifying whether this root certificate is
109 trustworthy than looking it up in a list.  GnuPG uses a file
110 ('trustlist.txt') to keep track of all root certificates it knows about.
111 There are 3 ways to get certificates into this list:
112
113    * Use the list which comes with GnuPG. However this list only
114      contains a few root certificates.  Most installations will need
115      more.
116
117    * Let 'gpgsm' ask you whether you want to insert a new root
118      certificate.  This feature is enabled by default; you may disable
119      it using the option 'no-allow-mark-trusted' into 'gpg-agent.conf'.
120
121    * Manually maintain the list of trusted root certificates.  For a
122      multi user installation this can be done once for all users on a
123      machine.  Specific changes on a per-user base are also possible.
124
125 \1f
126 File: gnupg.info,  Node: Invoking GPG-AGENT,  Next: Invoking DIRMNGR,  Prev: Installation,  Up: Top
127
128 2 Invoking GPG-AGENT
129 ********************
130
131 'gpg-agent' is a daemon to manage secret (private) keys independently
132 from any protocol.  It is used as a backend for 'gpg' and 'gpgsm' as
133 well as for a couple of other utilities.
134
135    The agent is automatically started on demand by 'gpg', 'gpgsm',
136 'gpgconf', or 'gpg-connect-agent'.  Thus there is no reason to start it
137 manually.  In case you want to use the included Secure Shell Agent you
138 may start the agent using:
139
140      gpg-connect-agent /bye
141
142 If you want to manually terminate the currently-running agent, you can
143 safely do so with:
144
145      gpgconf --kill gpg-agent
146
147 You should always add the following lines to your '.bashrc' or whatever
148 initialization file is used for all shell invocations:
149
150      GPG_TTY=$(tty)
151      export GPG_TTY
152
153 It is important that this environment variable always reflects the
154 output of the 'tty' command.  For W32 systems this option is not
155 required.
156
157    Please make sure that a proper pinentry program has been installed
158 under the default filename (which is system dependent) or use the option
159 'pinentry-program' to specify the full name of that program.  It is
160 often useful to install a symbolic link from the actual used pinentry
161 (e.g.  '/usr/local/bin/pinentry-gtk') to the expected one (e.g.
162 '/usr/local/bin/pinentry').
163
164 *Note Option Index::, for an index to 'GPG-AGENT''s commands and
165 options.
166
167 * Menu:
168
169 * Agent Commands::      List of all commands.
170 * Agent Options::       List of all options.
171 * Agent Configuration:: Configuration files.
172 * Agent Signals::       Use of some signals.
173 * Agent Examples::      Some usage examples.
174 * Agent Protocol::      The protocol the agent uses.
175
176 \1f
177 File: gnupg.info,  Node: Agent Commands,  Next: Agent Options,  Up: Invoking GPG-AGENT
178
179 2.1 Commands
180 ============
181
182 Commands are not distinguished from options except for the fact that
183 only one command is allowed.
184
185 '--version'
186      Print the program version and licensing information.  Note that you
187      cannot abbreviate this command.
188
189 '--help'
190 '-h'
191      Print a usage message summarizing the most useful command-line
192      options.  Note that you cannot abbreviate this command.
193
194 '--dump-options'
195      Print a list of all available options and commands.  Note that you
196      cannot abbreviate this command.
197
198 '--server'
199      Run in server mode and wait for commands on the 'stdin'.  The
200      default mode is to create a socket and listen for commands there.
201
202 '--daemon [COMMAND LINE]'
203      Start the gpg-agent as a daemon; that is, detach it from the
204      console and run it in the background.
205
206      As an alternative you may create a new process as a child of
207      gpg-agent: 'gpg-agent --daemon /bin/sh'.  This way you get a new
208      shell with the environment setup properly; after you exit from this
209      shell, gpg-agent terminates within a few seconds.
210
211 '--supervised'
212      Run in the foreground, sending logs by default to stderr, and
213      listening on provided file descriptors, which must already be bound
214      to listening sockets.  This command is useful when running under
215      systemd or other similar process supervision schemes.  This option
216      is not supported on Windows.
217
218      In -supervised mode, different file descriptors can be provided for
219      use as different socket types (e.g.  ssh, extra) as long as they
220      are identified in the environment variable 'LISTEN_FDNAMES' (see
221      sd_listen_fds(3) on some Linux distributions for more information
222      on this convention).
223
224 \1f
225 File: gnupg.info,  Node: Agent Options,  Next: Agent Configuration,  Prev: Agent Commands,  Up: Invoking GPG-AGENT
226
227 2.2 Option Summary
228 ==================
229
230 '--options FILE'
231      Reads configuration from FILE instead of from the default per-user
232      configuration file.  The default configuration file is named
233      'gpg-agent.conf' and expected in the '.gnupg' directory directly
234      below the home directory of the user.
235
236 '--homedir DIR'
237      Set the name of the home directory to DIR.  If this option is not
238      used, the home directory defaults to '~/.gnupg'.  It is only
239      recognized when given on the command line.  It also overrides any
240      home directory stated through the environment variable 'GNUPGHOME'
241      or (on Windows systems) by means of the Registry entry
242      HKCU\SOFTWARE\GNU\GNUPG:HOMEDIR.
243
244      On Windows systems it is possible to install GnuPG as a portable
245      application.  In this case only this command line option is
246      considered, all other ways to set a home directory are ignored.
247
248      To install GnuPG as a portable application under Windows, create an
249      empty file named 'gpgconf.ctl' in the same directory as the tool
250      'gpgconf.exe'.  The root of the installation is then that
251      directory; or, if 'gpgconf.exe' has been installed directly below a
252      directory named 'bin', its parent directory.  You also need to make
253      sure that the following directories exist and are writable:
254      'ROOT/home' for the GnuPG home and 'ROOT/usr/local/var/cache/gnupg'
255      for internal cache files.
256
257 '-v'
258 '--verbose'
259      Outputs additional information while running.  You can increase the
260      verbosity by giving several verbose commands to 'gpgsm', such as
261      '-vv'.
262
263 '-q'
264 '--quiet'
265      Try to be as quiet as possible.
266
267 '--batch'
268      Don't invoke a pinentry or do any other thing requiring human
269      interaction.
270
271 '--faked-system-time EPOCH'
272      This option is only useful for testing; it sets the system time
273      back or forth to EPOCH which is the number of seconds elapsed since
274      the year 1970.
275
276 '--debug-level LEVEL'
277      Select the debug level for investigating problems.  LEVEL may be a
278      numeric value or a keyword:
279
280      'none'
281           No debugging at all.  A value of less than 1 may be used
282           instead of the keyword.
283      'basic'
284           Some basic debug messages.  A value between 1 and 2 may be
285           used instead of the keyword.
286      'advanced'
287           More verbose debug messages.  A value between 3 and 5 may be
288           used instead of the keyword.
289      'expert'
290           Even more detailed messages.  A value between 6 and 8 may be
291           used instead of the keyword.
292      'guru'
293           All of the debug messages you can get.  A value greater than 8
294           may be used instead of the keyword.  The creation of hash
295           tracing files is only enabled if the keyword is used.
296
297      How these messages are mapped to the actual debugging flags is not
298      specified and may change with newer releases of this program.  They
299      are however carefully selected to best aid in debugging.
300
301 '--debug FLAGS'
302      This option is only useful for debugging and the behavior may
303      change at any time without notice.  FLAGS are bit encoded and may
304      be given in usual C-Syntax.  The currently defined bits are:
305
306      '0 (1)'
307           X.509 or OpenPGP protocol related data
308      '1 (2)'
309           values of big number integers
310      '2 (4)'
311           low level crypto operations
312      '5 (32)'
313           memory allocation
314      '6 (64)'
315           caching
316      '7 (128)'
317           show memory statistics
318      '9 (512)'
319           write hashed data to files named 'dbgmd-000*'
320      '10 (1024)'
321           trace Assuan protocol
322      '12 (4096)'
323           bypass all certificate validation
324
325 '--debug-all'
326      Same as '--debug=0xffffffff'
327
328 '--debug-wait N'
329      When running in server mode, wait N seconds before entering the
330      actual processing loop and print the pid.  This gives time to
331      attach a debugger.
332
333 '--debug-quick-random'
334      This option inhibits the use of the very secure random quality
335      level (Libgcrypt’s 'GCRY_VERY_STRONG_RANDOM') and degrades all
336      request down to standard random quality.  It is only used for
337      testing and should not be used for any production quality keys.
338      This option is only effective when given on the command line.
339
340      On GNU/Linux, another way to quickly generate insecure keys is to
341      use 'rngd' to fill the kernel's entropy pool with lower quality
342      random data.  'rngd' is typically provided by the 'rng-tools'
343      package.  It can be run as follows: 'sudo rngd -f -r /dev/urandom'.
344
345 '--debug-pinentry'
346      This option enables extra debug information pertaining to the
347      Pinentry.  As of now it is only useful when used along with
348      '--debug 1024'.
349
350 '--no-detach'
351      Don't detach the process from the console.  This is mainly useful
352      for debugging.
353
354 '-s'
355 '--sh'
356 '-c'
357 '--csh'
358      Format the info output in daemon mode for use with the standard
359      Bourne shell or the C-shell respectively.  The default is to guess
360      it based on the environment variable 'SHELL' which is correct in
361      almost all cases.
362
363 '--no-grab'
364      Tell the pinentry not to grab the keyboard and mouse.  This option
365      should in general not be used to avoid X-sniffing attacks.
366
367 '--log-file FILE'
368      Append all logging output to FILE.  This is very helpful in seeing
369      what the agent actually does.  Use 'socket://' to log to socket.
370      If neither a log file nor a log file descriptor has been set on a
371      Windows platform, the Registry entry
372      'HKCU\Software\GNU\GnuPG:DefaultLogFile', if set, is used to
373      specify the logging output.
374
375 '--no-allow-mark-trusted'
376      Do not allow clients to mark keys as trusted, i.e.  put them into
377      the 'trustlist.txt' file.  This makes it harder for users to
378      inadvertently accept Root-CA keys.
379
380 '--allow-preset-passphrase'
381      This option allows the use of 'gpg-preset-passphrase' to seed the
382      internal cache of 'gpg-agent' with passphrases.
383
384 '--no-allow-loopback-pinentry'
385 '--allow-loopback-pinentry'
386      Disallow or allow clients to use the loopback pinentry features;
387      see the option 'pinentry-mode' for details.  Allow is the default.
388
389      The '--force' option of the Assuan command 'DELETE_KEY' is also
390      controlled by this option: The option is ignored if a loopback
391      pinentry is disallowed.
392
393 '--no-allow-external-cache'
394      Tell Pinentry not to enable features which use an external cache
395      for passphrases.
396
397      Some desktop environments prefer to unlock all credentials with one
398      master password and may have installed a Pinentry which employs an
399      additional external cache to implement such a policy.  By using
400      this option the Pinentry is advised not to make use of such a cache
401      and instead always ask the user for the requested passphrase.
402
403 '--allow-emacs-pinentry'
404      Tell Pinentry to allow features to divert the passphrase entry to a
405      running Emacs instance.  How this is exactly handled depends on the
406      version of the used Pinentry.
407
408 '--ignore-cache-for-signing'
409      This option will let 'gpg-agent' bypass the passphrase cache for
410      all signing operation.  Note that there is also a per-session
411      option to control this behavior but this command line option takes
412      precedence.
413
414 '--default-cache-ttl N'
415      Set the time a cache entry is valid to N seconds.  The default is
416      600 seconds.  Each time a cache entry is accessed, the entry's
417      timer is reset.  To set an entry's maximum lifetime, use
418      'max-cache-ttl'.
419
420 '--default-cache-ttl-ssh N'
421      Set the time a cache entry used for SSH keys is valid to N seconds.
422      The default is 1800 seconds.  Each time a cache entry is accessed,
423      the entry's timer is reset.  To set an entry's maximum lifetime,
424      use 'max-cache-ttl-ssh'.
425
426 '--max-cache-ttl N'
427      Set the maximum time a cache entry is valid to N seconds.  After
428      this time a cache entry will be expired even if it has been
429      accessed recently or has been set using 'gpg-preset-passphrase'.
430      The default is 2 hours (7200 seconds).
431
432 '--max-cache-ttl-ssh N'
433      Set the maximum time a cache entry used for SSH keys is valid to N
434      seconds.  After this time a cache entry will be expired even if it
435      has been accessed recently or has been set using
436      'gpg-preset-passphrase'.  The default is 2 hours (7200 seconds).
437
438 '--enforce-passphrase-constraints'
439      Enforce the passphrase constraints by not allowing the user to
440      bypass them using the "Take it anyway" button.
441
442 '--min-passphrase-len N'
443      Set the minimal length of a passphrase.  When entering a new
444      passphrase shorter than this value a warning will be displayed.
445      Defaults to 8.
446
447 '--min-passphrase-nonalpha N'
448      Set the minimal number of digits or special characters required in
449      a passphrase.  When entering a new passphrase with less than this
450      number of digits or special characters a warning will be displayed.
451      Defaults to 1.
452
453 '--check-passphrase-pattern FILE'
454      Check the passphrase against the pattern given in FILE.  When
455      entering a new passphrase matching one of these pattern a warning
456      will be displayed.  FILE should be an absolute filename.  The
457      default is not to use any pattern file.
458
459      Security note: It is known that checking a passphrase against a
460      list of pattern or even against a complete dictionary is not very
461      effective to enforce good passphrases.  Users will soon figure up
462      ways to bypass such a policy.  A better policy is to educate users
463      on good security behavior and optionally to run a passphrase
464      cracker regularly on all users passphrases to catch the very simple
465      ones.
466
467 '--max-passphrase-days N'
468      Ask the user to change the passphrase if N days have passed since
469      the last change.  With '--enforce-passphrase-constraints' set the
470      user may not bypass this check.
471
472 '--enable-passphrase-history'
473      This option does nothing yet.
474
475 '--pinentry-invisible-char CHAR'
476      This option asks the Pinentry to use CHAR for displaying hidden
477      characters.  CHAR must be one character UTF-8 string.  A Pinentry
478      may or may not honor this request.
479
480 '--pinentry-timeout N'
481      This option asks the Pinentry to timeout after N seconds with no
482      user input.  The default value of 0 does not ask the pinentry to
483      timeout, however a Pinentry may use its own default timeout value
484      in this case.  A Pinentry may or may not honor this request.
485
486 '--pinentry-program FILENAME'
487      Use program FILENAME as the PIN entry.  The default is installation
488      dependent.  With the default configuration the name of the default
489      pinentry is 'pinentry'; if that file does not exist but a
490      'pinentry-basic' exist the latter is used.
491
492      On a Windows platform the default is to use the first existing
493      program from this list: 'bin\pinentry.exe',
494      '..\Gpg4win\bin\pinentry.exe', '..\Gpg4win\pinentry.exe',
495      '..\GNU\GnuPG\pinentry.exe', '..\GNU\bin\pinentry.exe',
496      'bin\pinentry-basic.exe' where the file names are relative to the
497      GnuPG installation directory.
498
499 '--pinentry-touch-file FILENAME'
500      By default the filename of the socket gpg-agent is listening for
501      requests is passed to Pinentry, so that it can touch that file
502      before exiting (it does this only in curses mode).  This option
503      changes the file passed to Pinentry to FILENAME.  The special name
504      '/dev/null' may be used to completely disable this feature.  Note
505      that Pinentry will not create that file, it will only change the
506      modification and access time.
507
508 '--scdaemon-program FILENAME'
509      Use program FILENAME as the Smartcard daemon.  The default is
510      installation dependent and can be shown with the 'gpgconf' command.
511
512 '--disable-scdaemon'
513      Do not make use of the scdaemon tool.  This option has the effect
514      of disabling the ability to do smartcard operations.  Note, that
515      enabling this option at runtime does not kill an already forked
516      scdaemon.
517
518 '--disable-check-own-socket'
519      'gpg-agent' employs a periodic self-test to detect a stolen socket.
520      This usually means a second instance of 'gpg-agent' has taken over
521      the socket and 'gpg-agent' will then terminate itself.  This option
522      may be used to disable this self-test for debugging purposes.
523
524 '--use-standard-socket'
525 '--no-use-standard-socket'
526 '--use-standard-socket-p'
527      Since GnuPG 2.1 the standard socket is always used.  These options
528      have no more effect.  The command 'gpg-agent
529      --use-standard-socket-p' will thus always return success.
530
531 '--display STRING'
532 '--ttyname STRING'
533 '--ttytype STRING'
534 '--lc-ctype STRING'
535 '--lc-messages STRING'
536 '--xauthority STRING'
537      These options are used with the server mode to pass localization
538      information.
539
540 '--keep-tty'
541 '--keep-display'
542      Ignore requests to change the current 'tty' or X window system's
543      'DISPLAY' variable respectively.  This is useful to lock the
544      pinentry to pop up at the 'tty' or display you started the agent.
545
546 '--extra-socket NAME'
547      The extra socket is created by default, you may use this option to
548      change the name of the socket.  To disable the creation of the
549      socket use "none" or "/dev/null" for NAME.
550
551      Also listen on native gpg-agent connections on the given socket.
552      The intended use for this extra socket is to setup a Unix domain
553      socket forwarding from a remote machine to this socket on the local
554      machine.  A 'gpg' running on the remote machine may then connect to
555      the local gpg-agent and use its private keys.  This enables
556      decrypting or signing data on a remote machine without exposing the
557      private keys to the remote machine.
558
559 '--enable-ssh-support'
560 '--enable-putty-support'
561
562      The OpenSSH Agent protocol is always enabled, but 'gpg-agent' will
563      only set the 'SSH_AUTH_SOCK' variable if this flag is given.
564
565      In this mode of operation, the agent does not only implement the
566      gpg-agent protocol, but also the agent protocol used by OpenSSH
567      (through a separate socket).  Consequently, it should be possible
568      to use the gpg-agent as a drop-in replacement for the well known
569      ssh-agent.
570
571      SSH Keys, which are to be used through the agent, need to be added
572      to the gpg-agent initially through the ssh-add utility.  When a key
573      is added, ssh-add will ask for the password of the provided key
574      file and send the unprotected key material to the agent; this
575      causes the gpg-agent to ask for a passphrase, which is to be used
576      for encrypting the newly received key and storing it in a gpg-agent
577      specific directory.
578
579      Once a key has been added to the gpg-agent this way, the gpg-agent
580      will be ready to use the key.
581
582      Note: in case the gpg-agent receives a signature request, the user
583      might need to be prompted for a passphrase, which is necessary for
584      decrypting the stored key.  Since the ssh-agent protocol does not
585      contain a mechanism for telling the agent on which display/terminal
586      it is running, gpg-agent's ssh-support will use the TTY or X
587      display where gpg-agent has been started.  To switch this display
588      to the current one, the following command may be used:
589
590           gpg-connect-agent updatestartuptty /bye
591
592      Although all GnuPG components try to start the gpg-agent as needed,
593      this is not possible for the ssh support because ssh does not know
594      about it.  Thus if no GnuPG tool which accesses the agent has been
595      run, there is no guarantee that ssh is able to use gpg-agent for
596      authentication.  To fix this you may start gpg-agent if needed
597      using this simple command:
598
599           gpg-connect-agent /bye
600
601      Adding the '--verbose' shows the progress of starting the agent.
602
603      The '--enable-putty-support' is only available under Windows and
604      allows the use of gpg-agent with the ssh implementation 'putty'.
605      This is similar to the regular ssh-agent support but makes use of
606      Windows message queue as required by 'putty'.
607
608    All the long options may also be given in the configuration file
609 after stripping off the two leading dashes.
610
611 \1f
612 File: gnupg.info,  Node: Agent Configuration,  Next: Agent Signals,  Prev: Agent Options,  Up: Invoking GPG-AGENT
613
614 2.3 Configuration
615 =================
616
617 There are a few configuration files needed for the operation of the
618 agent.  By default they may all be found in the current home directory
619 (*note option --homedir::).
620
621 'gpg-agent.conf'
622      This is the standard configuration file read by 'gpg-agent' on
623      startup.  It may contain any valid long option; the leading two
624      dashes may not be entered and the option may not be abbreviated.
625      This file is also read after a 'SIGHUP' however only a few options
626      will actually have an effect.  This default name may be changed on
627      the command line (*note option --options::).  You should backup
628      this file.
629
630 'trustlist.txt'
631      This is the list of trusted keys.  You should backup this file.
632
633      Comment lines, indicated by a leading hash mark, as well as empty
634      lines are ignored.  To mark a key as trusted you need to enter its
635      fingerprint followed by a space and a capital letter 'S'.  Colons
636      may optionally be used to separate the bytes of a fingerprint; this
637      enables cutting and pasting the fingerprint from a key listing
638      output.  If the line is prefixed with a '!' the key is explicitly
639      marked as not trusted.
640
641      Here is an example where two keys are marked as ultimately trusted
642      and one as not trusted:
643
644             # CN=Wurzel ZS 3,O=Intevation GmbH,C=DE
645             A6935DD34EF3087973C706FC311AA2CCF733765B S
646
647             # CN=PCA-1-Verwaltung-02/O=PKI-1-Verwaltung/C=DE
648             DC:BD:69:25:48:BD:BB:7E:31:6E:BB:80:D3:00:80:35:D4:F8:A6:CD S
649
650             # CN=Root-CA/O=Schlapphuete/L=Pullach/C=DE
651             !14:56:98:D3:FE:9C:CA:5A:31:6E:BC:81:D3:11:4E:00:90:A3:44:C2 S
652   
653
654      Before entering a key into this file, you need to ensure its
655      authenticity.  How to do this depends on your organisation; your
656      administrator might have already entered those keys which are
657      deemed trustworthy enough into this file.  Places where to look for
658      the fingerprint of a root certificate are letters received from the
659      CA or the website of the CA (after making 100% sure that this is
660      indeed the website of that CA). You may want to consider
661      disallowing interactive updates of this file by using the *note
662      option --no-allow-mark-trusted::.  It might even be advisable to
663      change the permissions to read-only so that this file can't be
664      changed inadvertently.
665
666      As a special feature a line 'include-default' will include a global
667      list of trusted certificates (e.g.  '/etc/gnupg/trustlist.txt').
668      This global list is also used if the local list is not available.
669
670      It is possible to add further flags after the 'S' for use by the
671      caller:
672
673      'relax'
674           Relax checking of some root certificate requirements.  As of
675           now this flag allows the use of root certificates with a
676           missing basicConstraints attribute (despite that it is a MUST
677           for CA certificates) and disables CRL checking for the root
678           certificate.
679
680      'cm'
681           If validation of a certificate finally issued by a CA with
682           this flag set fails, try again using the chain validation
683           model.
684
685 'sshcontrol'
686      This file is used when support for the secure shell agent protocol
687      has been enabled (*note option --enable-ssh-support::).  Only keys
688      present in this file are used in the SSH protocol.  You should
689      backup this file.
690
691      The 'ssh-add' tool may be used to add new entries to this file; you
692      may also add them manually.  Comment lines, indicated by a leading
693      hash mark, as well as empty lines are ignored.  An entry starts
694      with optional whitespace, followed by the keygrip of the key given
695      as 40 hex digits, optionally followed by the caching TTL in seconds
696      and another optional field for arbitrary flags.  A non-zero TTL
697      overrides the global default as set by '--default-cache-ttl-ssh'.
698
699      The only flag support is 'confirm'.  If this flag is found for a
700      key, each use of the key will pop up a pinentry to confirm the use
701      of that key.  The flag is automatically set if a new key was loaded
702      into 'gpg-agent' using the option '-c' of the 'ssh-add' command.
703
704      The keygrip may be prefixed with a '!' to disable an entry.
705
706      The following example lists exactly one key.  Note that keys
707      available through a OpenPGP smartcard in the active smartcard
708      reader are implicitly added to this list; i.e.  there is no need to
709      list them.
710
711                  # Key added on: 2011-07-20 20:38:46
712                  # Fingerprint:  5e:8d:c4:ad:e7:af:6e:27:8a:d6:13:e4:79:ad:0b:81
713                  34B62F25E277CF13D3C6BCEBFD3F85D08F0A864B 0 confirm
714
715 'private-keys-v1.d/'
716
717      This is the directory where gpg-agent stores the private keys.
718      Each key is stored in a file with the name made up of the keygrip
719      and the suffix 'key'.  You should backup all files in this
720      directory and take great care to keep this backup closed away.
721
722    Note that on larger installations, it is useful to put predefined
723 files into the directory '/etc/skel/.gnupg' so that newly created users
724 start up with a working configuration.  For existing users the a small
725 helper script is provided to create these files (*note addgnupghome::).
726
727 \1f
728 File: gnupg.info,  Node: Agent Signals,  Next: Agent Examples,  Prev: Agent Configuration,  Up: Invoking GPG-AGENT
729
730 2.4 Use of some signals
731 =======================
732
733 A running 'gpg-agent' may be controlled by signals, i.e.  using the
734 'kill' command to send a signal to the process.
735
736    Here is a list of supported signals:
737
738 'SIGHUP'
739      This signal flushes all cached passphrases and if the program has
740      been started with a configuration file, the configuration file is
741      read again.  Only certain options are honored: 'quiet', 'verbose',
742      'debug', 'debug-all', 'debug-level', 'debug-pinentry', 'no-grab',
743      'pinentry-program', 'pinentry-invisible-char', 'default-cache-ttl',
744      'max-cache-ttl', 'ignore-cache-for-signing',
745      'no-allow-external-cache', 'allow-emacs-pinentry',
746      'no-allow-mark-trusted', 'disable-scdaemon', and
747      'disable-check-own-socket'.  'scdaemon-program' is also supported
748      but due to the current implementation, which calls the scdaemon
749      only once, it is not of much use unless you manually kill the
750      scdaemon.
751
752 'SIGTERM'
753      Shuts down the process but waits until all current requests are
754      fulfilled.  If the process has received 3 of these signals and
755      requests are still pending, a shutdown is forced.
756
757 'SIGINT'
758      Shuts down the process immediately.
759
760 'SIGUSR1'
761      Dump internal information to the log file.
762
763 'SIGUSR2'
764      This signal is used for internal purposes.
765
766 \1f
767 File: gnupg.info,  Node: Agent Examples,  Next: Agent Protocol,  Prev: Agent Signals,  Up: Invoking GPG-AGENT
768
769 2.5 Examples
770 ============
771
772 It is important to set the environment variable 'GPG_TTY' in your login
773 shell, for example in the '~/.bashrc' init script:
774
775        export GPG_TTY=$(tty)
776
777    If you enabled the Ssh Agent Support, you also need to tell ssh about
778 it by adding this to your init script:
779
780      unset SSH_AGENT_PID
781      if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
782        export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
783      fi
784
785 \1f
786 File: gnupg.info,  Node: Agent Protocol,  Prev: Agent Examples,  Up: Invoking GPG-AGENT
787
788 2.6 Agent's Assuan Protocol
789 ===========================
790
791 Note: this section does only document the protocol, which is used by
792 GnuPG components; it does not deal with the ssh-agent protocol.  To see
793 the full specification of each command, use
794
795        gpg-connect-agent 'help COMMAND' /bye
796
797 or just 'help' to list all available commands.
798
799 The 'gpg-agent' daemon is started on demand by the GnuPG components.
800
801    To identify a key we use a thing called keygrip which is the SHA-1
802 hash of an canonical encoded S-Expression of the public key as used in
803 Libgcrypt.  For the purpose of this interface the keygrip is given as a
804 hex string.  The advantage of using this and not the hash of a
805 certificate is that it will be possible to use the same keypair for
806 different protocols, thereby saving space on the token used to keep the
807 secret keys.
808
809    The 'gpg-agent' may send status messages during a command or when
810 returning from a command to inform a client about the progress or result
811 of an operation.  For example, the INQUIRE_MAXLEN status message may be
812 sent during a server inquire to inform the client of the maximum usable
813 length of the inquired data (which should not be exceeded).
814
815 * Menu:
816
817 * Agent PKDECRYPT::       Decrypting a session key
818 * Agent PKSIGN::          Signing a Hash
819 * Agent GENKEY::          Generating a Key
820 * Agent IMPORT::          Importing a Secret Key
821 * Agent EXPORT::          Exporting a Secret Key
822 * Agent ISTRUSTED::       Importing a Root Certificate
823 * Agent GET_PASSPHRASE::  Ask for a passphrase
824 * Agent CLEAR_PASSPHRASE:: Expire a cached passphrase
825 * Agent PRESET_PASSPHRASE:: Set a passphrase for a keygrip
826 * Agent GET_CONFIRMATION:: Ask for confirmation
827 * Agent HAVEKEY::         Check whether a key is available
828 * Agent LEARN::           Register a smartcard
829 * Agent PASSWD::          Change a Passphrase
830 * Agent UPDATESTARTUPTTY:: Change the Standard Display
831 * Agent GETEVENTCOUNTER:: Get the Event Counters
832 * Agent GETINFO::         Return information about the process
833 * Agent OPTION::          Set options for the session
834
835 \1f
836 File: gnupg.info,  Node: Agent PKDECRYPT,  Next: Agent PKSIGN,  Up: Agent Protocol
837
838 2.6.1 Decrypting a session key
839 ------------------------------
840
841 The client asks the server to decrypt a session key.  The encrypted
842 session key should have all information needed to select the appropriate
843 secret key or to delegate it to a smartcard.
844
845        SETKEY <keyGrip>
846
847    Tell the server about the key to be used for decryption.  If this is
848 not used, 'gpg-agent' may try to figure out the key by trying to decrypt
849 the message with each key available.
850
851        PKDECRYPT
852
853    The agent checks whether this command is allowed and then does an
854 INQUIRY to get the ciphertext the client should then send the cipher
855 text.
856
857          S: INQUIRE CIPHERTEXT
858          C: D (xxxxxx
859          C: D xxxx)
860          C: END
861
862    Please note that the server may send status info lines while reading
863 the data lines from the client.  The data send is a SPKI like S-Exp with
864 this structure:
865
866           (enc-val
867             (<algo>
868               (<param_name1> <mpi>)
869            ...
870               (<param_namen> <mpi>)))
871
872    Where algo is a string with the name of the algorithm; see the
873 libgcrypt documentation for a list of valid algorithms.  The number and
874 names of the parameters depend on the algorithm.  The agent does return
875 an error if there is an inconsistency.
876
877    If the decryption was successful the decrypted data is returned by
878 means of "D" lines.
879
880    Here is an example session:
881         C: PKDECRYPT
882         S: INQUIRE CIPHERTEXT
883         C: D (enc-val elg (a 349324324)
884         C: D    (b 3F444677CA)))
885         C: END
886         S: # session key follows
887         S: S PADDING 0
888         S: D (value 1234567890ABCDEF0)
889         S: OK decryption successful
890
891    The “PADDING” status line is only send if gpg-agent can tell what
892 kind of padding is used.  As of now only the value 0 is used to indicate
893 that the padding has been removed.
894
895 \1f
896 File: gnupg.info,  Node: Agent PKSIGN,  Next: Agent GENKEY,  Prev: Agent PKDECRYPT,  Up: Agent Protocol
897
898 2.6.2 Signing a Hash
899 --------------------
900
901 The client asks the agent to sign a given hash value.  A default key
902 will be chosen if no key has been set.  To set a key a client first
903 uses:
904
905         SIGKEY <keyGrip>
906
907    This can be used multiple times to create multiple signature, the
908 list of keys is reset with the next PKSIGN command or a RESET. The
909 server tests whether the key is a valid key to sign something and
910 responds with okay.
911
912         SETHASH --hash=<name>|<algo> <hexstring>
913
914    The client can use this command to tell the server about the data
915 <hexstring> (which usually is a hash) to be signed.  <algo> is the
916 decimal encoded hash algorithm number as used by Libgcrypt.  Either
917 <algo> or -hash=<name> must be given.  Valid names for <name> are:
918
919 'sha1'
920      The SHA-1 hash algorithm
921 'sha256'
922      The SHA-256 hash algorithm
923 'rmd160'
924      The RIPE-MD160 hash algorithm
925 'md5'
926      The old and broken MD5 hash algorithm
927 'tls-md5sha1'
928      A combined hash algorithm as used by the TLS protocol.
929
930 The actual signing is done using
931
932         PKSIGN <options>
933
934    Options are not yet defined, but may later be used to choose among
935 different algorithms.  The agent does then some checks, asks for the
936 passphrase and as a result the server returns the signature as an SPKI
937 like S-expression in "D" lines:
938
939           (sig-val
940             (<algo>
941               (<param_name1> <mpi>)
942            ...
943               (<param_namen> <mpi>)))
944
945    The operation is affected by the option
946
947         OPTION use-cache-for-signing=0|1
948
949    The default of '1' uses the cache.  Setting this option to '0' will
950 lead 'gpg-agent' to ignore the passphrase cache.  Note, that there is
951 also a global command line option for 'gpg-agent' to globally disable
952 the caching.
953
954    Here is an example session:
955         C: SIGKEY <keyGrip>
956         S: OK key available
957         C: SIGKEY <keyGrip>
958         S: OK key available
959         C: PKSIGN
960         S: # I did ask the user whether he really wants to sign
961         S: # I did ask the user for the passphrase
962         S: INQUIRE HASHVAL
963         C: D ABCDEF012345678901234
964         C: END
965         S: # signature follows
966         S: D (sig-val rsa (s 45435453654612121212))
967         S: OK
968
969 \1f
970 File: gnupg.info,  Node: Agent GENKEY,  Next: Agent IMPORT,  Prev: Agent PKSIGN,  Up: Agent Protocol
971
972 2.6.3 Generating a Key
973 ----------------------
974
975 This is used to create a new keypair and store the secret key inside the
976 active PSE -- which is in most cases a Soft-PSE. A not-yet-defined
977 option allows choosing the storage location.  To get the secret key out
978 of the PSE, a special export tool has to be used.
979
980         GENKEY [--no-protection] [--preset] [<cache_nonce>]
981
982    Invokes the key generation process and the server will then inquire
983 on the generation parameters, like:
984
985         S: INQUIRE KEYPARM
986         C: D (genkey (rsa (nbits  1024)))
987         C: END
988
989    The format of the key parameters which depends on the algorithm is of
990 the form:
991
992          (genkey
993            (algo
994              (parameter_name_1 ....)
995                ....
996              (parameter_name_n ....)))
997
998    If everything succeeds, the server returns the *public key* in a SPKI
999 like S-Expression like this:
1000
1001           (public-key
1002             (rsa
1003          (n <mpi>)
1004          (e <mpi>)))
1005
1006    Here is an example session:
1007         C: GENKEY
1008         S: INQUIRE KEYPARM
1009         C: D (genkey (rsa (nbits  1024)))
1010         C: END
1011         S: D (public-key
1012         S: D   (rsa (n 326487324683264) (e 10001)))
1013         S  OK key created
1014
1015    The '--no-protection' option may be used to prevent prompting for a
1016 passphrase to protect the secret key while leaving the secret key
1017 unprotected.  The '--preset' option may be used to add the passphrase to
1018 the cache using the default cache parameters.
1019
1020    The '--inq-passwd' option may be used to create the key with a
1021 supplied passphrase.  When used the agent does an inquiry with the
1022 keyword 'NEWPASSWD' to retrieve that passphrase.  This option takes
1023 precedence over '--no-protection'; however if the client sends a empty
1024 (zero-length) passphrase, this is identical to '--no-protection'.
1025
1026 \1f
1027 File: gnupg.info,  Node: Agent IMPORT,  Next: Agent EXPORT,  Prev: Agent GENKEY,  Up: Agent Protocol
1028
1029 2.6.4 Importing a Secret Key
1030 ----------------------------
1031
1032 This operation is not yet supported by GpgAgent.  Specialized tools are
1033 to be used for this.
1034
1035    There is no actual need because we can expect that secret keys
1036 created by a 3rd party are stored on a smartcard.  If we have generated
1037 the key ourselves, we do not need to import it.
1038
1039 \1f
1040 File: gnupg.info,  Node: Agent EXPORT,  Next: Agent ISTRUSTED,  Prev: Agent IMPORT,  Up: Agent Protocol
1041
1042 2.6.5 Export a Secret Key
1043 -------------------------
1044
1045 Not implemented.
1046
1047    Should be done by an extra tool.
1048
1049 \1f
1050 File: gnupg.info,  Node: Agent ISTRUSTED,  Next: Agent GET_PASSPHRASE,  Prev: Agent EXPORT,  Up: Agent Protocol
1051
1052 2.6.6 Importing a Root Certificate
1053 ----------------------------------
1054
1055 Actually we do not import a Root Cert but provide a way to validate any
1056 piece of data by storing its Hash along with a description and an
1057 identifier in the PSE. Here is the interface description:
1058
1059          ISTRUSTED <fingerprint>
1060
1061    Check whether the OpenPGP primary key or the X.509 certificate with
1062 the given fingerprint is an ultimately trusted key or a trusted Root CA
1063 certificate.  The fingerprint should be given as a hexstring (without
1064 any blanks or colons or whatever in between) and may be left padded with
1065 00 in case of an MD5 fingerprint.  GPGAgent will answer with:
1066
1067          OK
1068
1069    The key is in the table of trusted keys.
1070
1071          ERR 304 (Not Trusted)
1072
1073    The key is not in this table.
1074
1075    Gpg needs the entire list of trusted keys to maintain the web of
1076 trust; the following command is therefore quite helpful:
1077
1078          LISTTRUSTED
1079
1080    GpgAgent returns a list of trusted keys line by line:
1081
1082          S: D 000000001234454556565656677878AF2F1ECCFF P
1083          S: D 340387563485634856435645634856438576457A P
1084          S: D FEDC6532453745367FD83474357495743757435D S
1085          S: OK
1086
1087    The first item on a line is the hexified fingerprint where MD5
1088 fingerprints are '00' padded to the left and the second item is a flag
1089 to indicate the type of key (so that gpg is able to only take care of
1090 PGP keys).  P = OpenPGP, S = S/MIME. A client should ignore the rest of
1091 the line, so that we can extend the format in the future.
1092
1093    Finally a client should be able to mark a key as trusted:
1094
1095         MARKTRUSTED FINGERPRINT "P"|"S"
1096
1097    The server will then pop up a window to ask the user whether she
1098 really trusts this key.  For this it will probably ask for a text to be
1099 displayed like this:
1100
1101         S: INQUIRE TRUSTDESC
1102         C: D Do you trust the key with the fingerprint @FPR@
1103         C: D bla fasel blurb.
1104         C: END
1105         S: OK
1106
1107    Known sequences with the pattern @foo@ are replaced according to this
1108 table:
1109
1110 '@FPR16@'
1111      Format the fingerprint according to gpg rules for a v3 keys.
1112 '@FPR20@'
1113      Format the fingerprint according to gpg rules for a v4 keys.
1114 '@FPR@'
1115      Choose an appropriate format to format the fingerprint.
1116 '@@'
1117      Replaced by a single '@'.
1118
1119 \1f
1120 File: gnupg.info,  Node: Agent GET_PASSPHRASE,  Next: Agent CLEAR_PASSPHRASE,  Prev: Agent ISTRUSTED,  Up: Agent Protocol
1121
1122 2.6.7 Ask for a passphrase
1123 --------------------------
1124
1125 This function is usually used to ask for a passphrase to be used for
1126 symmetric encryption, but may also be used by programs which need
1127 special handling of passphrases.  This command uses a syntax which helps
1128 clients to use the agent with minimum effort.
1129
1130        GET_PASSPHRASE [--data] [--check] [--no-ask] [--repeat[=N]] \
1131                       [--qualitybar] CACHE_ID                \
1132                       [ERROR_MESSAGE PROMPT DESCRIPTION]
1133
1134    CACHE_ID is expected to be a string used to identify a cached
1135 passphrase.  Use a 'X' to bypass the cache.  With no other arguments the
1136 agent returns a cached passphrase or an error.  By convention either the
1137 hexified fingerprint of the key shall be used for CACHE_ID or an
1138 arbitrary string prefixed with the name of the calling application and a
1139 colon: Like 'gpg:somestring'.
1140
1141    ERROR_MESSAGE is either a single 'X' for no error message or a string
1142 to be shown as an error message like (e.g.  "invalid passphrase").
1143 Blanks must be percent escaped or replaced by '+''.
1144
1145    PROMPT is either a single 'X' for a default prompt or the text to be
1146 shown as the prompt.  Blanks must be percent escaped or replaced by '+'.
1147
1148    DESCRIPTION is a text shown above the entry field.  Blanks must be
1149 percent escaped or replaced by '+'.
1150
1151    The agent either returns with an error or with a OK followed by the
1152 hex encoded passphrase.  Note that the length of the strings is
1153 implicitly limited by the maximum length of a command.  If the option
1154 '--data' is used, the passphrase is not returned on the OK line but by
1155 regular data lines; this is the preferred method.
1156
1157    If the option '--check' is used, the standard passphrase constraints
1158 checks are applied.  A check is not done if the passphrase has been
1159 found in the cache.
1160
1161    If the option '--no-ask' is used and the passphrase is not in the
1162 cache the user will not be asked to enter a passphrase but the error
1163 code 'GPG_ERR_NO_DATA' is returned.
1164
1165    If the option '--qualitybar' is used and a minimum passphrase length
1166 has been configured, a visual indication of the entered passphrase
1167 quality is shown.
1168
1169        CLEAR_PASSPHRASE CACHE_ID
1170
1171    may be used to invalidate the cache entry for a passphrase.  The
1172 function returns with OK even when there is no cached passphrase.
1173
1174 \1f
1175 File: gnupg.info,  Node: Agent CLEAR_PASSPHRASE,  Next: Agent PRESET_PASSPHRASE,  Prev: Agent GET_PASSPHRASE,  Up: Agent Protocol
1176
1177 2.6.8 Remove a cached passphrase
1178 --------------------------------
1179
1180 Use this command to remove a cached passphrase.
1181
1182        CLEAR_PASSPHRASE [--mode=normal] <cache_id>
1183
1184    The '--mode=normal' option can be used to clear a CACHE_ID that was
1185 set by gpg-agent.
1186
1187 \1f
1188 File: gnupg.info,  Node: Agent PRESET_PASSPHRASE,  Next: Agent GET_CONFIRMATION,  Prev: Agent CLEAR_PASSPHRASE,  Up: Agent Protocol
1189
1190 2.6.9 Set a passphrase for a keygrip
1191 ------------------------------------
1192
1193 This command adds a passphrase to the cache for the specified KEYGRIP.
1194
1195        PRESET_PASSPHRASE [--inquire] <string_or_keygrip> <timeout> [<hexstring>]
1196
1197    The passphrase is a hexidecimal string when specified.  When not
1198 specified, the passphrase will be retrieved from the pinentry module
1199 unless the '--inquire' option was specified in which case the passphrase
1200 will be retrieved from the client.
1201
1202    The TIMEOUT parameter keeps the passphrase cached for the specified
1203 number of seconds.  A value of '-1' means infinite while '0' means the
1204 default (currently only a timeout of -1 is allowed, which means to never
1205 expire it).
1206
1207 \1f
1208 File: gnupg.info,  Node: Agent GET_CONFIRMATION,  Next: Agent HAVEKEY,  Prev: Agent PRESET_PASSPHRASE,  Up: Agent Protocol
1209
1210 2.6.10 Ask for confirmation
1211 ---------------------------
1212
1213 This command may be used to ask for a simple confirmation by presenting
1214 a text and 2 buttons: Okay and Cancel.
1215
1216        GET_CONFIRMATION DESCRIPTION
1217
1218    DESCRIPTIONis displayed along with a Okay and Cancel button.  Blanks
1219 must be percent escaped or replaced by '+'.  A 'X' may be used to
1220 display confirmation dialog with a default text.
1221
1222    The agent either returns with an error or with a OK. Note, that the
1223 length of DESCRIPTION is implicitly limited by the maximum length of a
1224 command.
1225
1226 \1f
1227 File: gnupg.info,  Node: Agent HAVEKEY,  Next: Agent LEARN,  Prev: Agent GET_CONFIRMATION,  Up: Agent Protocol
1228
1229 2.6.11 Check whether a key is available
1230 ---------------------------------------
1231
1232 This can be used to see whether a secret key is available.  It does not
1233 return any information on whether the key is somehow protected.
1234
1235        HAVEKEY KEYGRIPS
1236
1237    The agent answers either with OK or 'No_Secret_Key' (208).  The
1238 caller may want to check for other error codes as well.  More than one
1239 keygrip may be given.  In this case the command returns success if at
1240 least one of the keygrips corresponds to an available secret key.
1241
1242 \1f
1243 File: gnupg.info,  Node: Agent LEARN,  Next: Agent PASSWD,  Prev: Agent HAVEKEY,  Up: Agent Protocol
1244
1245 2.6.12 Register a smartcard
1246 ---------------------------
1247
1248        LEARN [--send]
1249
1250    This command is used to register a smartcard.  With the '--send'
1251 option given the certificates are sent back.
1252
1253 \1f
1254 File: gnupg.info,  Node: Agent PASSWD,  Next: Agent UPDATESTARTUPTTY,  Prev: Agent LEARN,  Up: Agent Protocol
1255
1256 2.6.13 Change a Passphrase
1257 --------------------------
1258
1259        PASSWD [--cache-nonce=<c>] [--passwd-nonce=<s>] [--preset] KEYGRIP
1260
1261    This command is used to interactively change the passphrase of the
1262 key identified by the hex string KEYGRIP.  The '--preset' option may be
1263 used to add the new passphrase to the cache using the default cache
1264 parameters.
1265
1266 \1f
1267 File: gnupg.info,  Node: Agent UPDATESTARTUPTTY,  Next: Agent GETEVENTCOUNTER,  Prev: Agent PASSWD,  Up: Agent Protocol
1268
1269 2.6.14 Change the standard display
1270 ----------------------------------
1271
1272        UPDATESTARTUPTTY
1273
1274    Set the startup TTY and X-DISPLAY variables to the values of this
1275 session.  This command is useful to direct future pinentry invocations
1276 to another screen.  It is only required because there is no way in the
1277 ssh-agent protocol to convey this information.
1278
1279 \1f
1280 File: gnupg.info,  Node: Agent GETEVENTCOUNTER,  Next: Agent GETINFO,  Prev: Agent UPDATESTARTUPTTY,  Up: Agent Protocol
1281
1282 2.6.15 Get the Event Counters
1283 -----------------------------
1284
1285        GETEVENTCOUNTER
1286
1287    This function return one status line with the current values of the
1288 event counters.  The event counters are useful to avoid polling by
1289 delaying a poll until something has changed.  The values are decimal
1290 numbers in the range '0' to 'UINT_MAX' and wrapping around to 0.  The
1291 actual values should not be relied upon; they shall only be used to
1292 detect a change.
1293
1294    The currently defined counters are are:
1295 'ANY'
1296      Incremented with any change of any of the other counters.
1297 'KEY'
1298      Incremented for added or removed private keys.
1299 'CARD'
1300      Incremented for changes of the card readers stati.
1301
1302 \1f
1303 File: gnupg.info,  Node: Agent GETINFO,  Next: Agent OPTION,  Prev: Agent GETEVENTCOUNTER,  Up: Agent Protocol
1304
1305 2.6.16 Return information about the process
1306 -------------------------------------------
1307
1308 This is a multipurpose function to return a variety of information.
1309
1310      GETINFO WHAT
1311
1312    The value of WHAT specifies the kind of information returned:
1313 'version'
1314      Return the version of the program.
1315 'pid'
1316      Return the process id of the process.
1317 'socket_name'
1318      Return the name of the socket used to connect the agent.
1319 'ssh_socket_name'
1320      Return the name of the socket used for SSH connections.  If SSH
1321      support has not been enabled the error 'GPG_ERR_NO_DATA' will be
1322      returned.
1323
1324 \1f
1325 File: gnupg.info,  Node: Agent OPTION,  Prev: Agent GETINFO,  Up: Agent Protocol
1326
1327 2.6.17 Set options for the session
1328 ----------------------------------
1329
1330 Here is a list of session options which are not yet described with other
1331 commands.  The general syntax for an Assuan option is:
1332
1333      OPTION  KEY=VALUE
1334
1335 Supported KEYs are:
1336
1337 'agent-awareness'
1338      This may be used to tell gpg-agent of which gpg-agent version the
1339      client is aware of.  gpg-agent uses this information to enable
1340      features which might break older clients.
1341
1342 'putenv'
1343      Change the session's environment to be used for the Pinentry.
1344      Valid values are:
1345
1346      'NAME'
1347           Delete envvar NAME
1348      'NAME='
1349           Set envvar NAME to the empty string
1350      'NAME=VALUE'
1351           Set envvar NAME to the string VALUE.
1352
1353 'use-cache-for-signing'
1354      See Assuan command 'PKSIGN'.
1355
1356 'allow-pinentry-notify'
1357      This does not need any value.  It is used to enable the
1358      PINENTRY_LAUNCHED inquiry.
1359
1360 'pinentry-mode'
1361      This option is used to change the operation mode of the pinentry.
1362      The following values are defined:
1363
1364      'ask'
1365           This is the default mode which pops up a pinentry as needed.
1366
1367      'cancel'
1368           Instead of popping up a pinentry, return the error code
1369           'GPG_ERR_CANCELED'.
1370
1371      'error'
1372           Instead of popping up a pinentry, return the error code
1373           'GPG_ERR_NO_PIN_ENTRY'.
1374
1375      'loopback'
1376           Use a loopback pinentry.  This fakes a pinentry by using
1377           inquiries back to the caller to ask for a passphrase.  This
1378           option may only be set if the agent has been configured for
1379           that.  To disable this feature use *note option
1380           --no-allow-loopback-pinentry::.
1381
1382 'cache-ttl-opt-preset'
1383      This option sets the cache TTL for new entries created by GENKEY
1384      and PASSWD commands when using the '--preset' option.  It it is not
1385      used a default value is used.
1386
1387 's2k-count'
1388      Instead of using the standard S2K count (which is computed on the
1389      fly), the given S2K count is used for new keys or when changing the
1390      passphrase of a key.  Values below 65536 are considered to be 0.
1391      This option is valid for the entire session or until reset to 0.
1392      This option is useful if the key is later used on boxes which are
1393      either much slower or faster than the actual box.
1394
1395 \1f
1396 File: gnupg.info,  Node: Invoking DIRMNGR,  Next: Invoking GPG,  Prev: Invoking GPG-AGENT,  Up: Top
1397
1398 3 Invoking DIRMNGR
1399 ******************
1400
1401 Since version 2.1 of GnuPG, 'dirmngr' takes care of accessing the
1402 OpenPGP keyservers.  As with previous versions it is also used as a
1403 server for managing and downloading certificate revocation lists (CRLs)
1404 for X.509 certificates, downloading X.509 certificates, and providing
1405 access to OCSP providers.  Dirmngr is invoked internally by 'gpg',
1406 'gpgsm', or via the 'gpg-connect-agent' tool.
1407
1408 *Note Option Index::,for an index to 'DIRMNGR''s commands and options.
1409
1410 * Menu:
1411
1412 * Dirmngr Commands::      List of all commands.
1413 * Dirmngr Options::       List of all options.
1414 * Dirmngr Configuration:: Configuration files.
1415 * Dirmngr Signals::       Use of signals.
1416 * Dirmngr Examples::      Some usage examples.
1417 * Dirmngr Protocol::      The protocol dirmngr uses.
1418
1419 \1f
1420 File: gnupg.info,  Node: Dirmngr Commands,  Next: Dirmngr Options,  Up: Invoking DIRMNGR
1421
1422 3.1 Commands
1423 ============
1424
1425 Commands are not distinguished from options except for the fact that
1426 only one command is allowed.
1427
1428 '--version'
1429      Print the program version and licensing information.  Note that you
1430      cannot abbreviate this command.
1431
1432 '--help, -h'
1433      Print a usage message summarizing the most useful command-line
1434      options.  Note that you cannot abbreviate this command.
1435
1436 '--dump-options'
1437      Print a list of all available options and commands.  Note that you
1438      cannot abbreviate this command.
1439
1440 '--server'
1441      Run in server mode and wait for commands on the 'stdin'.  The
1442      default mode is to create a socket and listen for commands there.
1443      This is only used for testing.
1444
1445 '--daemon'
1446      Run in background daemon mode and listen for commands on a socket.
1447      This is the way 'dirmngr' is started on demand by the other GnuPG
1448      components.  To force starting 'dirmngr' it is in general best to
1449      use 'gpgconf --launch dirmngr'.
1450
1451 '--supervised'
1452      Run in the foreground, sending logs to stderr, and listening on
1453      file descriptor 3, which must already be bound to a listening
1454      socket.  This is useful when running under systemd or other similar
1455      process supervision schemes.  This option is not supported on
1456      Windows.
1457
1458 '--list-crls'
1459      List the contents of the CRL cache on 'stdout'.  This is probably
1460      only useful for debugging purposes.
1461
1462 '--load-crl FILE'
1463      This command requires a filename as additional argument, and it
1464      will make Dirmngr try to import the CRL in FILE into it's cache.
1465      Note, that this is only possible if Dirmngr is able to retrieve the
1466      CA's certificate directly by its own means.  In general it is
1467      better to use 'gpgsm''s '--call-dirmngr loadcrl filename' command
1468      so that 'gpgsm' can help dirmngr.
1469
1470 '--fetch-crl URL'
1471      This command requires an URL as additional argument, and it will
1472      make dirmngr try to retrieve and import the CRL from that URL into
1473      it's cache.  This is mainly useful for debugging purposes.  The
1474      'dirmngr-client' provides the same feature for a running dirmngr.
1475
1476 '--shutdown'
1477      This commands shuts down an running instance of Dirmngr.  This
1478      command has currently no effect.
1479
1480 '--flush'
1481      This command removes all CRLs from Dirmngr's cache.  Client
1482      requests will thus trigger reading of fresh CRLs.
1483
1484 \1f
1485 File: gnupg.info,  Node: Dirmngr Options,  Next: Dirmngr Configuration,  Prev: Dirmngr Commands,  Up: Invoking DIRMNGR
1486
1487 3.2 Option Summary
1488 ==================
1489
1490 '--options FILE'
1491      Reads configuration from FILE instead of from the default per-user
1492      configuration file.  The default configuration file is named
1493      'dirmngr.conf' and expected in the home directory.
1494
1495 '--homedir DIR'
1496      Set the name of the home directory to DIR.  This option is only
1497      effective when used on the command line.  The default is the
1498      directory named '.gnupg' directly below the home directory of the
1499      user unless the environment variable 'GNUPGHOME' has been set in
1500      which case its value will be used.  Many kinds of data are stored
1501      within this directory.
1502
1503 '-v'
1504 '--verbose'
1505      Outputs additional information while running.  You can increase the
1506      verbosity by giving several verbose commands to DIRMNGR, such as
1507      '-vv'.
1508
1509 '--log-file FILE'
1510      Append all logging output to FILE.  This is very helpful in seeing
1511      what the agent actually does.  Use 'socket://' to log to socket.
1512
1513 '--debug-level LEVEL'
1514      Select the debug level for investigating problems.  LEVEL may be a
1515      numeric value or by a keyword:
1516
1517      'none'
1518           No debugging at all.  A value of less than 1 may be used
1519           instead of the keyword.
1520      'basic'
1521           Some basic debug messages.  A value between 1 and 2 may be
1522           used instead of the keyword.
1523      'advanced'
1524           More verbose debug messages.  A value between 3 and 5 may be
1525           used instead of the keyword.
1526      'expert'
1527           Even more detailed messages.  A value between 6 and 8 may be
1528           used instead of the keyword.
1529      'guru'
1530           All of the debug messages you can get.  A value greater than 8
1531           may be used instead of the keyword.  The creation of hash
1532           tracing files is only enabled if the keyword is used.
1533
1534      How these messages are mapped to the actual debugging flags is not
1535      specified and may change with newer releases of this program.  They
1536      are however carefully selected to best aid in debugging.
1537
1538 '--debug FLAGS'
1539      This option is only useful for debugging and the behavior may
1540      change at any time without notice.  FLAGS are bit encoded and may
1541      be given in usual C-Syntax.
1542
1543 '--debug-all'
1544      Same as '--debug=0xffffffff'
1545
1546 '--gnutls-debug LEVEL'
1547      Enable debugging of GNUTLS at LEVEL.
1548
1549 '--debug-wait N'
1550      When running in server mode, wait N seconds before entering the
1551      actual processing loop and print the pid.  This gives time to
1552      attach a debugger.
1553
1554 '--disable-check-own-socket'
1555      On some platforms 'dirmngr' is able to detect the removal of its
1556      socket file and shutdown itself.  This option disable this
1557      self-test for debugging purposes.
1558
1559 '-s'
1560 '--sh'
1561 '-c'
1562 '--csh'
1563      Format the info output in daemon mode for use with the standard
1564      Bourne shell respective the C-shell.  The default is to guess it
1565      based on the environment variable 'SHELL' which is in almost all
1566      cases sufficient.
1567
1568 '--force'
1569      Enabling this option forces loading of expired CRLs; this is only
1570      useful for debugging.
1571
1572 '--use-tor'
1573      This option switches Dirmngr and thus GnuPG into "Tor mode" to
1574      route all network access via Tor (an anonymity network).  WARNING:
1575      As of now this still leaks the DNS queries; e.g.  to lookup the
1576      hosts in a keyserver pool.  Certain other features are disabled if
1577      this mode is active.
1578
1579 '--standard-resolver'
1580      This option forces the use of the system's standard DNS resolver
1581      code.  This is mainly used for debugging.  Note that on Windows a
1582      standard resolver is not used and all DNS access will return the
1583      error "Not Implemented" if this function is used.
1584
1585 '--recursive-resolver'
1586      When possible use a recursive resolver instead of a stub resolver.
1587
1588 '--resolver-timeout N'
1589      Set the timeout for the DNS resolver to N seconds.  The default are
1590      30 seconds.
1591
1592 '--allow-version-check'
1593      Allow Dirmngr to connect to 'https://versions.gnupg.org' to get the
1594      list of current software versions.  If this option is enabled, or
1595      if 'use-tor' is active, the list is retrieved when the local copy
1596      does not exist or is older than 5 to 7 days.  See the option
1597      '--query-swdb' of the command 'gpgconf' for more details.
1598
1599 '--keyserver NAME'
1600      Use NAME as your keyserver.  This is the server that 'gpg'
1601      communicates with to receive keys, send keys, and search for keys.
1602      The format of the NAME is a URI: 'scheme:[//]keyservername[:port]'
1603      The scheme is the type of keyserver: "hkp" for the HTTP (or
1604      compatible) keyservers, "ldap" for the LDAP keyservers, or "mailto"
1605      for the Graff email keyserver.  Note that your particular
1606      installation of GnuPG may have other keyserver types available as
1607      well.  Keyserver schemes are case-insensitive.  After the keyserver
1608      name, optional keyserver configuration options may be provided.
1609      These are the same as the '--keyserver-options' of 'gpg', but apply
1610      only to this particular keyserver.
1611
1612      Most keyservers synchronize with each other, so there is generally
1613      no need to send keys to more than one server.  The keyserver
1614      'hkp://keys.gnupg.net' uses round robin DNS to give a different
1615      keyserver each time you use it.
1616
1617      If exactly two keyservers are configured and only one is a Tor
1618      hidden service (.onion), Dirmngr selects the keyserver to use
1619      depending on whether Tor is locally running or not.  The check for
1620      a running Tor is done for each new connection.
1621
1622      If no keyserver is explicitly configured, dirmngr will use the
1623      built-in default of hkps://hkps.pool.sks-keyservers.net.
1624
1625 '--nameserver IPADDR'
1626      In "Tor mode" Dirmngr uses a public resolver via Tor to resolve DNS
1627      names.  If the default public resolver, which is '8.8.8.8', shall
1628      not be used a different one can be given using this option.  Note
1629      that a numerical IP address must be given (IPv6 or IPv4) and that
1630      no error checking is done for IPADDR.
1631
1632 '--disable-ldap'
1633      Entirely disables the use of LDAP.
1634
1635 '--disable-http'
1636      Entirely disables the use of HTTP.
1637
1638 '--ignore-http-dp'
1639      When looking for the location of a CRL, the to be tested
1640      certificate usually contains so called "CRL Distribution Point"
1641      (DP) entries which are URLs describing the way to access the CRL.
1642      The first found DP entry is used.  With this option all entries
1643      using the HTTP scheme are ignored when looking for a suitable DP.
1644
1645 '--ignore-ldap-dp'
1646      This is similar to '--ignore-http-dp' but ignores entries using the
1647      LDAP scheme.  Both options may be combined resulting in ignoring
1648      DPs entirely.
1649
1650 '--ignore-ocsp-service-url'
1651      Ignore all OCSP URLs contained in the certificate.  The effect is
1652      to force the use of the default responder.
1653
1654 '--honor-http-proxy'
1655      If the environment variable 'http_proxy' has been set, use its
1656      value to access HTTP servers.
1657
1658 '--http-proxy HOST[:PORT]'
1659      Use HOST and PORT to access HTTP servers.  The use of this option
1660      overrides the environment variable 'http_proxy' regardless whether
1661      '--honor-http-proxy' has been set.
1662
1663 '--ldap-proxy HOST[:PORT]'
1664      Use HOST and PORT to connect to LDAP servers.  If PORT is omitted,
1665      port 389 (standard LDAP port) is used.  This overrides any
1666      specified host and port part in a LDAP URL and will also be used if
1667      host and port have been omitted from the URL.
1668
1669 '--only-ldap-proxy'
1670      Never use anything else but the LDAP "proxy" as configured with
1671      '--ldap-proxy'.  Usually 'dirmngr' tries to use other configured
1672      LDAP server if the connection using the "proxy" failed.
1673
1674 '--ldapserverlist-file FILE'
1675      Read the list of LDAP servers to consult for CRLs and certificates
1676      from file instead of the default per-user ldap server list file.
1677      The default value for FILE is 'dirmngr_ldapservers.conf'.
1678
1679      This server list file contains one LDAP server per line in the
1680      format
1681
1682      HOSTNAME:PORT:USERNAME:PASSWORD:BASE_DN
1683
1684      Lines starting with a '#' are comments.
1685
1686      Note that as usual all strings entered are expected to be UTF-8
1687      encoded.  Obviously this will lead to problems if the password has
1688      originally been encoded as Latin-1.  There is no other solution
1689      here than to put such a password in the binary encoding into the
1690      file (i.e.  non-ascii characters won't show up readable).(1)
1691
1692 '--ldaptimeout SECS'
1693      Specify the number of seconds to wait for an LDAP query before
1694      timing out.  The default is currently 100 seconds.  0 will never
1695      timeout.
1696
1697 '--add-servers'
1698      This option makes dirmngr add any servers it discovers when
1699      validating certificates against CRLs to the internal list of
1700      servers to consult for certificates and CRLs.
1701
1702      This option is useful when trying to validate a certificate that
1703      has a CRL distribution point that points to a server that is not
1704      already listed in the ldapserverlist.  Dirmngr will always go to
1705      this server and try to download the CRL, but chances are high that
1706      the certificate used to sign the CRL is located on the same server.
1707      So if dirmngr doesn't add that new server to list, it will often
1708      not be able to verify the signature of the CRL unless the
1709      '--add-servers' option is used.
1710
1711      Note: The current version of dirmngr has this option disabled by
1712      default.
1713
1714 '--allow-ocsp'
1715      This option enables OCSP support if requested by the client.
1716
1717      OCSP requests are rejected by default because they may violate the
1718      privacy of the user; for example it is possible to track the time
1719      when a user is reading a mail.
1720
1721 '--ocsp-responder URL'
1722      Use URL as the default OCSP Responder if the certificate does not
1723      contain information about an assigned responder.  Note, that
1724      '--ocsp-signer' must also be set to a valid certificate.
1725
1726 '--ocsp-signer FPR|FILE'
1727      Use the certificate with the fingerprint FPR to check the responses
1728      of the default OCSP Responder.  Alternatively a filename can be
1729      given in which case the response is expected to be signed by one of
1730      the certificates described in that file.  Any argument which
1731      contains a slash, dot or tilde is considered a filename.  Usual
1732      filename expansion takes place: A tilde at the start followed by a
1733      slash is replaced by the content of 'HOME', no slash at start
1734      describes a relative filename which will be searched at the home
1735      directory.  To make sure that the FILE is searched in the home
1736      directory, either prepend the name with "./" or use a name which
1737      contains a dot.
1738
1739      If a response has been signed by a certificate described by these
1740      fingerprints no further check upon the validity of this certificate
1741      is done.
1742
1743      The format of the FILE is a list of SHA-1 fingerprint, one per line
1744      with optional colons between the bytes.  Empty lines and lines
1745      prefix with a hash mark are ignored.
1746
1747 '--ocsp-max-clock-skew N'
1748      The number of seconds a skew between the OCSP responder and them
1749      local clock is accepted.  Default is 600 (10 minutes).
1750
1751 '--ocsp-max-period N'
1752      Seconds a response is at maximum considered valid after the time
1753      given in the thisUpdate field.  Default is 7776000 (90 days).
1754
1755 '--ocsp-current-period N'
1756      The number of seconds an OCSP response is considered valid after
1757      the time given in the NEXT_UPDATE datum.  Default is 10800 (3
1758      hours).
1759
1760 '--max-replies N'
1761      Do not return more that N items in one query.  The default is 10.
1762
1763 '--ignore-cert-extension OID'
1764      Add OID to the list of ignored certificate extensions.  The OID is
1765      expected to be in dotted decimal form, like '2.5.29.3'.  This
1766      option may be used more than once.  Critical flagged certificate
1767      extensions matching one of the OIDs in the list are treated as if
1768      they are actually handled and thus the certificate won't be
1769      rejected due to an unknown critical extension.  Use this option
1770      with care because extensions are usually flagged as critical for a
1771      reason.
1772
1773 '--hkp-cacert FILE'
1774      Use the root certificates in FILE for verification of the TLS
1775      certificates used with 'hkps' (keyserver access over TLS). If the
1776      file is in PEM format a suffix of '.pem' is expected for FILE.
1777      This option may be given multiple times to add more root
1778      certificates.  Tilde expansion is supported.
1779
1780      If no 'hkp-cacert' directive is present, dirmngr will make a
1781      reasonable choice: if the keyserver in question is the special pool
1782      'hkps.pool.sks-keyservers.net', it will use the bundled root
1783      certificate for that pool.  Otherwise, it will use the system CAs.
1784
1785    ---------- Footnotes ----------
1786
1787    (1) The 'gpgconf' tool might be helpful for frontends as it enables
1788 editing this configuration file using percent-escaped strings.
1789
1790 \1f
1791 File: gnupg.info,  Node: Dirmngr Configuration,  Next: Dirmngr Signals,  Prev: Dirmngr Options,  Up: Invoking DIRMNGR
1792
1793 3.3 Configuration
1794 =================
1795
1796 Dirmngr makes use of several directories when running in daemon mode:
1797
1798 '~/.gnupg'
1799      This is the standard home directory for all configuration files.
1800
1801 '/etc/gnupg/trusted-certs'
1802      This directory should be filled with certificates of Root CAs you
1803      are trusting in checking the CRLs and signing OCSP Responses.
1804
1805      Usually these are the same certificates you use with the
1806      applications making use of dirmngr.  It is expected that each of
1807      these certificate files contain exactly one DER encoded certificate
1808      in a file with the suffix '.crt' or '.der'.  'dirmngr' reads those
1809      certificates on startup and when given a SIGHUP. Certificates which
1810      are not readable or do not make up a proper X.509 certificate are
1811      ignored; see the log file for details.
1812
1813      Applications using dirmngr (e.g.  gpgsm) can request these
1814      certificates to complete a trust chain in the same way as with the
1815      extra-certs directory (see below).
1816
1817      Note that for OCSP responses the certificate specified using the
1818      option '--ocsp-signer' is always considered valid to sign OCSP
1819      requests.
1820
1821 '/etc/gnupg/extra-certs'
1822      This directory may contain extra certificates which are preloaded
1823      into the internal cache on startup.  Applications using dirmngr
1824      (e.g.  gpgsm) can request cached certificates to complete a trust
1825      chain.  This is convenient in cases you have a couple intermediate
1826      CA certificates or certificates usually used to sign OCSP
1827      responses.  These certificates are first tried before going out to
1828      the net to look for them.  These certificates must also be DER
1829      encoded and suffixed with '.crt' or '.der'.
1830
1831 '~/.gnupg/crls.d'
1832      This directory is used to store cached CRLs.  The 'crls.d' part
1833      will be created by dirmngr if it does not exists but you need to
1834      make sure that the upper directory exists.
1835
1836    To be able to see what's going on you should create the configure
1837 file '~/gnupg/dirmngr.conf' with at least one line:
1838
1839      log-file ~/dirmngr.log
1840
1841    To be able to perform OCSP requests you probably want to add the
1842 line:
1843
1844      allow-ocsp
1845
1846    To make sure that new options are read and that after the
1847 installation of a new GnuPG versions the installed dirmngr is running,
1848 you may want to kill an existing dirmngr first:
1849
1850      gpgconf --kill dirmngr
1851
1852    You may check the log file to see whether all desired root
1853 certificates have been loaded correctly.
1854
1855 \1f
1856 File: gnupg.info,  Node: Dirmngr Signals,  Next: Dirmngr Examples,  Prev: Dirmngr Configuration,  Up: Invoking DIRMNGR
1857
1858 3.4 Use of signals
1859 ==================
1860
1861 A running 'dirmngr' may be controlled by signals, i.e.  using the 'kill'
1862 command to send a signal to the process.
1863
1864    Here is a list of supported signals:
1865
1866 'SIGHUP'
1867      This signal flushes all internally cached CRLs as well as any
1868      cached certificates.  Then the certificate cache is reinitialized
1869      as on startup.  Options are re-read from the configuration file.
1870      Instead of sending this signal it is better to use
1871           gpgconf --reload dirmngr
1872
1873 'SIGTERM'
1874      Shuts down the process but waits until all current requests are
1875      fulfilled.  If the process has received 3 of these signals and
1876      requests are still pending, a shutdown is forced.  You may also use
1877           gpgconf --kill dirmngr
1878      instead of this signal
1879
1880 'SIGINT'
1881      Shuts down the process immediately.
1882
1883 'SIGUSR1'
1884      This prints some caching statistics to the log file.
1885
1886 \1f
1887 File: gnupg.info,  Node: Dirmngr Examples,  Next: Dirmngr Protocol,  Prev: Dirmngr Signals,  Up: Invoking DIRMNGR
1888
1889 3.5 Examples
1890 ============
1891
1892 Here is an example on how to show dirmngr's internal table of OpenPGP
1893 keyserver addresses.  The output is intended for debugging purposes and
1894 not part of a defined API.
1895
1896        gpg-connect-agent --dirmngr 'keyserver --hosttable' /bye
1897
1898    To inhibit the use of a particular host you have noticed in one of
1899 the keyserver pools, you may use
1900
1901       gpg-connect-agent --dirmngr 'keyserver --dead pgpkeys.bnd.de' /bye
1902
1903    The description of the 'keyserver' command can be printed using
1904
1905       gpg-connect-agent --dirmngr 'help keyserver' /bye
1906
1907 \1f
1908 File: gnupg.info,  Node: Dirmngr Protocol,  Prev: Dirmngr Examples,  Up: Invoking DIRMNGR
1909
1910 3.6 Dirmngr's Assuan Protocol
1911 =============================
1912
1913 Assuan is the IPC protocol used to access dirmngr.  This is a
1914 description of the commands implemented by dirmngr.
1915
1916 * Menu:
1917
1918 * Dirmngr LOOKUP::      Look up a certificate via LDAP
1919 * Dirmngr ISVALID::     Validate a certificate using a CRL or OCSP.
1920 * Dirmngr CHECKCRL::    Validate a certificate using a CRL.
1921 * Dirmngr CHECKOCSP::   Validate a certificate using OCSP.
1922 * Dirmngr CACHECERT::   Put a certificate into the internal cache.
1923 * Dirmngr VALIDATE::    Validate a certificate for debugging.
1924
1925 \1f
1926 File: gnupg.info,  Node: Dirmngr LOOKUP,  Next: Dirmngr ISVALID,  Up: Dirmngr Protocol
1927
1928 3.6.1 Return the certificate(s) found
1929 -------------------------------------
1930
1931 Lookup certificate.  To allow multiple patterns (which are ORed) quoting
1932 is required: Spaces are to be translated into "+" or into "%20";
1933 obviously this requires that the usual escape quoting rules are applied.
1934 The server responds with:
1935
1936        S: D <DER encoded certificate>
1937        S: END
1938        S: D <second DER encoded certificate>
1939        S: END
1940        S: OK
1941
1942    In this example 2 certificates are returned.  The server may return
1943 any number of certificates; OK will also be returned when no
1944 certificates were found.  The dirmngr might return a status line
1945
1946        S: S TRUNCATED <n>
1947
1948    To indicate that the output was truncated to N items due to a
1949 limitation of the server or by an arbitrary set limit.
1950
1951    The option '--url' may be used if instead of a search pattern a
1952 complete URL to the certificate is known:
1953
1954        C: LOOKUP --url CN%3DWerner%20Koch,o%3DIntevation%20GmbH,c%3DDE?userCertificate
1955
1956    If the option '--cache-only' is given, no external lookup is done so
1957 that only certificates from the cache are returned.
1958
1959    With the option '--single', the first and only the first match will
1960 be returned.  Unless option '--cache-only' is also used, no local lookup
1961 will be done in this case.
1962
1963 \1f
1964 File: gnupg.info,  Node: Dirmngr ISVALID,  Next: Dirmngr CHECKCRL,  Prev: Dirmngr LOOKUP,  Up: Dirmngr Protocol
1965
1966 3.6.2 Validate a certificate using a CRL or OCSP
1967 ------------------------------------------------
1968
1969        ISVALID [--only-ocsp] [--force-default-responder] CERTID|CERTFPR
1970
1971    Check whether the certificate described by the CERTID has been
1972 revoked.  Due to caching, the Dirmngr is able to answer immediately in
1973 most cases.
1974
1975    The CERTID is a hex encoded string consisting of two parts, delimited
1976 by a single dot.  The first part is the SHA-1 hash of the issuer name
1977 and the second part the serial number.
1978
1979    Alternatively the certificate's SHA-1 fingerprint CERTFPR may be
1980 given in which case an OCSP request is done before consulting the CRL.
1981 If the option '--only-ocsp' is given, no fallback to a CRL check will be
1982 used.  If the option '--force-default-responder' is given, only the
1983 default OCSP responder will be used and any other methods of obtaining
1984 an OCSP responder URL won't be used.
1985
1986 Common return values are:
1987
1988 'GPG_ERR_NO_ERROR (0)'
1989      This is the positive answer: The certificate is not revoked and we
1990      have an up-to-date revocation list for that certificate.  If OCSP
1991      was used the responder confirmed that the certificate has not been
1992      revoked.
1993
1994 'GPG_ERR_CERT_REVOKED'
1995      This is the negative answer: The certificate has been revoked.
1996      Either it is in a CRL and that list is up to date or an OCSP
1997      responder informed us that it has been revoked.
1998
1999 'GPG_ERR_NO_CRL_KNOWN'
2000      No CRL is known for this certificate or the CRL is not valid or out
2001      of date.
2002
2003 'GPG_ERR_NO_DATA'
2004      The OCSP responder returned an "unknown" status.  This means that
2005      it is not aware of the certificate's status.
2006
2007 'GPG_ERR_NOT_SUPPORTED'
2008      This is commonly seen if OCSP support has not been enabled in the
2009      configuration.
2010
2011    If DirMngr has not enough information about the given certificate
2012 (which is the case for not yet cached certificates), it will will
2013 inquire the missing data:
2014
2015        S: INQUIRE SENDCERT <CertID>
2016        C: D <DER encoded certificate>
2017        C: END
2018
2019    A client should be aware that DirMngr may ask for more than one
2020 certificate.
2021
2022    If Dirmngr has a certificate but the signature of the certificate
2023 could not been validated because the root certificate is not known to
2024 dirmngr as trusted, it may ask back to see whether the client trusts
2025 this the root certificate:
2026
2027        S: INQUIRE ISTRUSTED <CertHexfpr>
2028        C: D 1
2029        C: END
2030
2031    Only this answer will let Dirmngr consider the certificate as valid.
2032
2033 \1f
2034 File: gnupg.info,  Node: Dirmngr CHECKCRL,  Next: Dirmngr CHECKOCSP,  Prev: Dirmngr ISVALID,  Up: Dirmngr Protocol
2035
2036 3.6.3 Validate a certificate using a CRL
2037 ----------------------------------------
2038
2039 Check whether the certificate with FINGERPRINT (SHA-1 hash of the entire
2040 X.509 certificate blob) is valid or not by consulting the CRL
2041 responsible for this certificate.  If the fingerprint has not been given
2042 or the certificate is not known, the function inquires the certificate
2043 using:
2044
2045        S: INQUIRE TARGETCERT
2046        C: D <DER encoded certificate>
2047        C: END
2048
2049    Thus the caller is expected to return the certificate for the request
2050 (which should match FINGERPRINT) as a binary blob.  Processing then
2051 takes place without further interaction; in particular dirmngr tries to
2052 locate other required certificate by its own mechanism which includes a
2053 local certificate store as well as a list of trusted root certificates.
2054
2055 The return code is 0 for success; i.e.  the certificate has not been
2056 revoked or one of the usual error codes from libgpg-error.
2057
2058 \1f
2059 File: gnupg.info,  Node: Dirmngr CHECKOCSP,  Next: Dirmngr CACHECERT,  Prev: Dirmngr CHECKCRL,  Up: Dirmngr Protocol
2060
2061 3.6.4 Validate a certificate using OCSP
2062 ---------------------------------------
2063
2064        CHECKOCSP [--force-default-responder] [FINGERPRINT]
2065
2066    Check whether the certificate with FINGERPRINT (the SHA-1 hash of the
2067 entire X.509 certificate blob) is valid by consulting the appropriate
2068 OCSP responder.  If the fingerprint has not been given or the
2069 certificate is not known by Dirmngr, the function inquires the
2070 certificate using:
2071
2072        S: INQUIRE TARGETCERT
2073        C: D <DER encoded certificate>
2074        C: END
2075
2076    Thus the caller is expected to return the certificate for the request
2077 (which should match FINGERPRINT) as a binary blob.  Processing then
2078 takes place without further interaction; in particular dirmngr tries to
2079 locate other required certificates by its own mechanism which includes a
2080 local certificate store as well as a list of trusted root certificates.
2081
2082    If the option '--force-default-responder' is given, only the default
2083 OCSP responder is used.  This option is the per-command variant of the
2084 global option '--ignore-ocsp-service-url'.
2085
2086 The return code is 0 for success; i.e.  the certificate has not been
2087 revoked or one of the usual error codes from libgpg-error.
2088
2089 \1f
2090 File: gnupg.info,  Node: Dirmngr CACHECERT,  Next: Dirmngr VALIDATE,  Prev: Dirmngr CHECKOCSP,  Up: Dirmngr Protocol
2091
2092 3.6.5 Put a certificate into the internal cache
2093 -----------------------------------------------
2094
2095 Put a certificate into the internal cache.  This command might be useful
2096 if a client knows in advance certificates required for a test and wants
2097 to make sure they get added to the internal cache.  It is also helpful
2098 for debugging.  To get the actual certificate, this command immediately
2099 inquires it using
2100
2101        S: INQUIRE TARGETCERT
2102        C: D <DER encoded certificate>
2103        C: END
2104
2105    Thus the caller is expected to return the certificate for the request
2106 as a binary blob.
2107
2108 The return code is 0 for success; i.e.  the certificate has not been
2109 successfully cached or one of the usual error codes from libgpg-error.
2110
2111 \1f
2112 File: gnupg.info,  Node: Dirmngr VALIDATE,  Prev: Dirmngr CACHECERT,  Up: Dirmngr Protocol
2113
2114 3.6.6 Validate a certificate for debugging
2115 ------------------------------------------
2116
2117 Validate a certificate using the certificate validation function used
2118 internally by dirmngr.  This command is only useful for debugging.  To
2119 get the actual certificate, this command immediately inquires it using
2120
2121        S: INQUIRE TARGETCERT
2122        C: D <DER encoded certificate>
2123        C: END
2124
2125    Thus the caller is expected to return the certificate for the request
2126 as a binary blob.
2127
2128 \1f
2129 File: gnupg.info,  Node: Invoking GPG,  Next: Invoking GPGSM,  Prev: Invoking DIRMNGR,  Up: Top
2130
2131 4 Invoking GPG
2132 **************
2133
2134 'gpg' is the OpenPGP part of the GNU Privacy Guard (GnuPG). It is a tool
2135 to provide digital encryption and signing services using the OpenPGP
2136 standard.  'gpg' features complete key management and all the bells and
2137 whistles you would expect from a full OpenPGP implementation.
2138
2139    There are two main versions of GnuPG: GnuPG 1.x and GnuPG 2.x.  GnuPG
2140 2.x supports modern encryption algorithms and thus should be preferred
2141 over GnuPG 1.x.  You only need to use GnuPG 1.x if your platform doesn't
2142 support GnuPG 2.x, or you need support for some features that GnuPG 2.x
2143 has deprecated, e.g., decrypting data created with PGP-2 keys.
2144
2145    If you are looking for version 1 of GnuPG, you may find that version
2146 installed under the name 'gpg1'.
2147
2148    *Note Option Index::, for an index to 'gpg''s commands and options.
2149
2150 * Menu:
2151
2152 * GPG Commands::            List of all commands.
2153 * GPG Options::             List of all options.
2154 * GPG Configuration::       Configuration files.
2155 * GPG Examples::            Some usage examples.
2156
2157 Developer information:
2158 * Unattended Usage of GPG:: Using 'gpg' from other programs.
2159
2160 \1f
2161 File: gnupg.info,  Node: GPG Commands,  Next: GPG Options,  Up: Invoking GPG
2162
2163 4.1 Commands
2164 ============
2165
2166 Commands are not distinguished from options except for the fact that
2167 only one command is allowed.  Generally speaking, irrelevant options are
2168 silently ignored, and may not be checked for correctness.
2169
2170    'gpg' may be run with no commands.  In this case it will perform a
2171 reasonable action depending on the type of file it is given as input (an
2172 encrypted message is decrypted, a signature is verified, a file
2173 containing keys is listed, etc.).
2174
2175 * Menu:
2176
2177 * General GPG Commands::        Commands not specific to the functionality.
2178 * Operational GPG Commands::    Commands to select the type of operation.
2179 * OpenPGP Key Management::      How to manage your keys.
2180
2181 \1f
2182 File: gnupg.info,  Node: General GPG Commands,  Next: Operational GPG Commands,  Up: GPG Commands
2183
2184 4.1.1 Commands not specific to the function
2185 -------------------------------------------
2186
2187 '--version'
2188      Print the program version and licensing information.  Note that you
2189      cannot abbreviate this command.
2190
2191 '--help'
2192 '-h'
2193      Print a usage message summarizing the most useful command-line
2194      options.  Note that you cannot abbreviate this command.
2195
2196 '--warranty'
2197      Print warranty information.
2198
2199 '--dump-options'
2200      Print a list of all available options and commands.  Note that you
2201      cannot abbreviate this command.
2202
2203 \1f
2204 File: gnupg.info,  Node: Operational GPG Commands,  Next: OpenPGP Key Management,  Prev: General GPG Commands,  Up: GPG Commands
2205
2206 4.1.2 Commands to select the type of operation
2207 ----------------------------------------------
2208
2209 '--sign'
2210 '-s'
2211      Sign a message.  This command may be combined with '--encrypt' (to
2212      sign and encrypt a message), '--symmetric' (to sign and
2213      symmetrically encrypt a message), or both '--encrypt' and
2214      '--symmetric' (to sign and encrypt a message that can be decrypted
2215      using a secret key or a passphrase).  The signing key is chosen by
2216      default or can be set explicitly using the '--local-user' and
2217      '--default-key' options.
2218
2219 '--clear-sign'
2220 '--clearsign'
2221      Make a cleartext signature.  The content in a cleartext signature
2222      is readable without any special software.  OpenPGP software is only
2223      needed to verify the signature.  cleartext signatures may modify
2224      end-of-line whitespace for platform independence and are not
2225      intended to be reversible.  The signing key is chosen by default or
2226      can be set explicitly using the '--local-user' and '--default-key'
2227      options.
2228
2229 '--detach-sign'
2230 '-b'
2231      Make a detached signature.
2232
2233 '--encrypt'
2234 '-e'
2235      Encrypt data.  This command may be combined with '--sign' (to sign
2236      and encrypt a message), '--symmetric' (to encrypt a message that
2237      can decrypted using a secret key or a passphrase), or '--sign' and
2238      '--symmetric' together (for a signed message that can be decrypted
2239      using a secret key or a passphrase).
2240
2241 '--symmetric'
2242 '-c'
2243      Encrypt with a symmetric cipher using a passphrase.  The default
2244      symmetric cipher used is AES-128, but may be chosen with the
2245      '--cipher-algo' option.  This command may be combined with '--sign'
2246      (for a signed and symmetrically encrypted message), '--encrypt'
2247      (for a message that may be decrypted via a secret key or a
2248      passphrase), or '--sign' and '--encrypt' together (for a signed
2249      message that may be decrypted via a secret key or a passphrase).
2250
2251 '--store'
2252      Store only (make a simple literal data packet).
2253
2254 '--decrypt'
2255 '-d'
2256      Decrypt the file given on the command line (or STDIN if no file is
2257      specified) and write it to STDOUT (or the file specified with
2258      '--output').  If the decrypted file is signed, the signature is
2259      also verified.  This command differs from the default operation, as
2260      it never writes to the filename which is included in the file and
2261      it rejects files that don't begin with an encrypted message.
2262
2263 '--verify'
2264      Assume that the first argument is a signed file and verify it
2265      without generating any output.  With no arguments, the signature
2266      packet is read from STDIN. If only one argument is given, the
2267      specified file is expected to include a complete signature.
2268
2269      With more than one argument, the first argument should specify a
2270      file with a detached signature and the remaining files should
2271      contain the signed data.  To read the signed data from STDIN, use
2272      '-' as the second filename.  For security reasons, a detached
2273      signature will not read the signed material from STDIN if not
2274      explicitly specified.
2275
2276      Note: If the option '--batch' is not used, 'gpg' may assume that a
2277      single argument is a file with a detached signature, and it will
2278      try to find a matching data file by stripping certain suffixes.
2279      Using this historical feature to verify a detached signature is
2280      strongly discouraged; you should always specify the data file
2281      explicitly.
2282
2283      Note: When verifying a cleartext signature, 'gpg' verifies only
2284      what makes up the cleartext signed data and not any extra data
2285      outside of the cleartext signature or the header lines directly
2286      following the dash marker line.  The option '--output' may be used
2287      to write out the actual signed data, but there are other pitfalls
2288      with this format as well.  It is suggested to avoid cleartext
2289      signatures in favor of detached signatures.
2290
2291 '--multifile'
2292      This modifies certain other commands to accept multiple files for
2293      processing on the command line or read from STDIN with each
2294      filename on a separate line.  This allows for many files to be
2295      processed at once.  '--multifile' may currently be used along with
2296      '--verify', '--encrypt', and '--decrypt'.  Note that '--multifile
2297      --verify' may not be used with detached signatures.
2298
2299 '--verify-files'
2300      Identical to '--multifile --verify'.
2301
2302 '--encrypt-files'
2303      Identical to '--multifile --encrypt'.
2304
2305 '--decrypt-files'
2306      Identical to '--multifile --decrypt'.
2307
2308 '--list-keys'
2309 '-k'
2310 '--list-public-keys'
2311      List the specified keys.  If no keys are specified, then all keys
2312      from the configured public keyrings are listed.
2313
2314      Never use the output of this command in scripts or other programs.
2315      The output is intended only for humans and its format is likely to
2316      change.  The '--with-colons' option emits the output in a stable,
2317      machine-parseable format, which is intended for use by scripts and
2318      other programs.
2319
2320 '--list-secret-keys'
2321 '-K'
2322      List the specified secret keys.  If no keys are specified, then all
2323      known secret keys are listed.  A '#' after the letters 'sec' means
2324      that the secret key is not usable (for example, if it was exported
2325      using '--export-secret-subkeys').  See also '--list-keys'.
2326
2327 '--list-signatures'
2328 '--list-sigs'
2329      Same as '--list-keys', but the signatures are listed too.  This
2330      command has the same effect as using '--list-keys' with
2331      '--with-sig-list'.
2332
2333      For each signature listed, there are several flags in between the
2334      "sig" tag and keyid.  These flags give additional information about
2335      each signature.  From left to right, they are the numbers 1-3 for
2336      certificate check level (see '--ask-cert-level'), "L" for a local
2337      or non-exportable signature (see '--lsign-key'), "R" for a
2338      nonRevocable signature (see the '--edit-key' command "nrsign"), "P"
2339      for a signature that contains a policy URL (see
2340      '--cert-policy-url'), "N" for a signature that contains a notation
2341      (see '--cert-notation'), "X" for an eXpired signature (see
2342      '--ask-cert-expire'), and the numbers 1-9 or "T" for 10 and above
2343      to indicate trust signature levels (see the '--edit-key' command
2344      "tsign").
2345
2346 '--check-signatures'
2347 '--check-sigs'
2348      Same as '--list-signatures', but the signatures are verified.  Note
2349      that for performance reasons the revocation status of a signing key
2350      is not shown.  This command has the same effect as using
2351      '--list-keys' with '--with-sig-check'.
2352
2353      The status of the verification is indicated by a flag directly
2354      following the "sig" tag (and thus before the flags described above
2355      for '--list-signatures').  A "!"  indicates that the signature has
2356      been successfully verified, a "-" denotes a bad signature and a "%"
2357      is used if an error occurred while checking the signature (e.g.  a
2358      non supported algorithm).
2359
2360 '--locate-keys'
2361      Locate the keys given as arguments.  This command basically uses
2362      the same algorithm as used when locating keys for encryption or
2363      signing and may thus be used to see what keys 'gpg' might use.  In
2364      particular external methods as defined by '--auto-key-locate' may
2365      be used to locate a key.  Only public keys are listed.
2366
2367 '--fingerprint'
2368      List all keys (or the specified ones) along with their
2369      fingerprints.  This is the same output as '--list-keys' but with
2370      the additional output of a line with the fingerprint.  May also be
2371      combined with '--list-signatures' or '--check-signatures'.  If this
2372      command is given twice, the fingerprints of all secondary keys are
2373      listed too.  This command also forces pretty printing of
2374      fingerprints if the keyid format has been set to "none".
2375
2376 '--list-packets'
2377      List only the sequence of packets.  This command is only useful for
2378      debugging.  When used with option '--verbose' the actual MPI values
2379      are dumped and not only their lengths.  Note that the output of
2380      this command may change with new releases.
2381
2382 '--edit-card'
2383 '--card-edit'
2384      Present a menu to work with a smartcard.  The subcommand "help"
2385      provides an overview on available commands.  For a detailed
2386      description, please see the Card HOWTO at
2387      https://gnupg.org/documentation/howtos.html#GnuPG-cardHOWTO .
2388
2389 '--card-status'
2390      Show the content of the smart card.
2391
2392 '--change-pin'
2393      Present a menu to allow changing the PIN of a smartcard.  This
2394      functionality is also available as the subcommand "passwd" with the
2395      '--edit-card' command.
2396
2397 '--delete-keys name'
2398 '--delete-keys name'
2399      Remove key from the public keyring.  In batch mode either '--yes'
2400      is required or the key must be specified by fingerprint.  This is a
2401      safeguard against accidental deletion of multiple keys.
2402
2403 '--delete-secret-keys name'
2404      Remove key from the secret keyring.  In batch mode the key must be
2405      specified by fingerprint.  The option '--yes' can be used to advice
2406      gpg-agent not to request a confirmation.  This extra pre-caution is
2407      done because 'gpg' can't be sure that the secret key (as controlled
2408      by gpg-agent) is only used for the given OpenPGP public key.
2409
2410 '--delete-secret-and-public-key name'
2411      Same as '--delete-key', but if a secret key exists, it will be
2412      removed first.  In batch mode the key must be specified by
2413      fingerprint.  The option '--yes' can be used to advice gpg-agent
2414      not to request a confirmation.
2415
2416 '--export'
2417      Either export all keys from all keyrings (default keyrings and
2418      those registered via option '--keyring'), or if at least one name
2419      is given, those of the given name.  The exported keys are written
2420      to STDOUT or to the file given with option '--output'.  Use
2421      together with '--armor' to mail those keys.
2422
2423 '--send-keys key IDs'
2424      Similar to '--export' but sends the keys to a keyserver.
2425      Fingerprints may be used instead of key IDs.  Option '--keyserver'
2426      must be used to give the name of this keyserver.  Don't send your
2427      complete keyring to a keyserver -- select only those keys which are
2428      new or changed by you.  If no key IDs are given, 'gpg' does
2429      nothing.
2430
2431 '--export-secret-keys'
2432 '--export-secret-subkeys'
2433      Same as '--export', but exports the secret keys instead.  The
2434      exported keys are written to STDOUT or to the file given with
2435      option '--output'.  This command is often used along with the
2436      option '--armor' to allow for easy printing of the key for paper
2437      backup; however the external tool 'paperkey' does a better job of
2438      creating backups on paper.  Note that exporting a secret key can be
2439      a security risk if the exported keys are sent over an insecure
2440      channel.
2441
2442      The second form of the command has the special property to render
2443      the secret part of the primary key useless; this is a GNU extension
2444      to OpenPGP and other implementations can not be expected to
2445      successfully import such a key.  Its intended use is in generating
2446      a full key with an additional signing subkey on a dedicated
2447      machine.  This command then exports the key without the primary key
2448      to the main machine.
2449
2450      GnuPG may ask you to enter the passphrase for the key.  This is
2451      required, because the internal protection method of the secret key
2452      is different from the one specified by the OpenPGP protocol.
2453
2454 '--export-ssh-key'
2455      This command is used to export a key in the OpenSSH public key
2456      format.  It requires the specification of one key by the usual
2457      means and exports the latest valid subkey which has an
2458      authentication capability to STDOUT or to the file given with
2459      option '--output'.  That output can directly be added to ssh's
2460      'authorized_key' file.
2461
2462      By specifying the key to export using a key ID or a fingerprint
2463      suffixed with an exclamation mark (!), a specific subkey or the
2464      primary key can be exported.  This does not even require that the
2465      key has the authentication capability flag set.
2466
2467 '--import'
2468 '--fast-import'
2469      Import/merge keys.  This adds the given keys to the keyring.  The
2470      fast version is currently just a synonym.
2471
2472      There are a few other options which control how this command works.
2473      Most notable here is the '--import-options merge-only' option which
2474      does not insert new keys but does only the merging of new
2475      signatures, user-IDs and subkeys.
2476
2477 '--receive-keys key IDs'
2478 '--recv-keys key IDs'
2479      Import the keys with the given key IDs from a keyserver.  Option
2480      '--keyserver' must be used to give the name of this keyserver.
2481
2482 '--refresh-keys'
2483      Request updates from a keyserver for keys that already exist on the
2484      local keyring.  This is useful for updating a key with the latest
2485      signatures, user IDs, etc.  Calling this with no arguments will
2486      refresh the entire keyring.  Option '--keyserver' must be used to
2487      give the name of the keyserver for all keys that do not have
2488      preferred keyservers set (see '--keyserver-options
2489      honor-keyserver-url').
2490
2491 '--search-keys names'
2492      Search the keyserver for the given names.  Multiple names given
2493      here will be joined together to create the search string for the
2494      keyserver.  Option '--keyserver' must be used to give the name of
2495      this keyserver.  Keyservers that support different search methods
2496      allow using the syntax specified in "How to specify a user ID"
2497      below.  Note that different keyserver types support different
2498      search methods.  Currently only LDAP supports them all.
2499
2500 '--fetch-keys URIs'
2501      Retrieve keys located at the specified URIs.  Note that different
2502      installations of GnuPG may support different protocols (HTTP, FTP,
2503      LDAP, etc.).  When using HTTPS the system provided root
2504      certificates are used by this command.
2505
2506 '--update-trustdb'
2507      Do trust database maintenance.  This command iterates over all keys
2508      and builds the Web of Trust.  This is an interactive command
2509      because it may have to ask for the "ownertrust" values for keys.
2510      The user has to give an estimation of how far she trusts the owner
2511      of the displayed key to correctly certify (sign) other keys.  GnuPG
2512      only asks for the ownertrust value if it has not yet been assigned
2513      to a key.  Using the '--edit-key' menu, the assigned value can be
2514      changed at any time.
2515
2516 '--check-trustdb'
2517      Do trust database maintenance without user interaction.  From time
2518      to time the trust database must be updated so that expired keys or
2519      signatures and the resulting changes in the Web of Trust can be
2520      tracked.  Normally, GnuPG will calculate when this is required and
2521      do it automatically unless '--no-auto-check-trustdb' is set.  This
2522      command can be used to force a trust database check at any time.
2523      The processing is identical to that of '--update-trustdb' but it
2524      skips keys with a not yet defined "ownertrust".
2525
2526      For use with cron jobs, this command can be used together with
2527      '--batch' in which case the trust database check is done only if a
2528      check is needed.  To force a run even in batch mode add the option
2529      '--yes'.
2530
2531 '--export-ownertrust'
2532      Send the ownertrust values to STDOUT. This is useful for backup
2533      purposes as these values are the only ones which can't be
2534      re-created from a corrupted trustdb.  Example:
2535             gpg --export-ownertrust > otrust.txt
2536
2537 '--import-ownertrust'
2538      Update the trustdb with the ownertrust values stored in 'files' (or
2539      STDIN if not given); existing values will be overwritten.  In case
2540      of a severely damaged trustdb and if you have a recent backup of
2541      the ownertrust values (e.g.  in the file 'otrust.txt'), you may
2542      re-create the trustdb using these commands:
2543             cd ~/.gnupg
2544             rm trustdb.gpg
2545             gpg --import-ownertrust < otrust.txt
2546
2547 '--rebuild-keydb-caches'
2548      When updating from version 1.0.6 to 1.0.7 this command should be
2549      used to create signature caches in the keyring.  It might be handy
2550      in other situations too.
2551
2552 '--print-md algo'
2553 '--print-mds'
2554      Print message digest of algorithm ALGO for all given files or
2555      STDIN. With the second form (or a deprecated "*" as algo) digests
2556      for all available algorithms are printed.
2557
2558 '--gen-random 0|1|2 count'
2559      Emit COUNT random bytes of the given quality level 0, 1 or 2.  If
2560      COUNT is not given or zero, an endless sequence of random bytes
2561      will be emitted.  If used with '--armor' the output will be base64
2562      encoded.  PLEASE, don't use this command unless you know what you
2563      are doing; it may remove precious entropy from the system!
2564
2565 '--gen-prime mode bits'
2566      Use the source, Luke :-).  The output format is still subject to
2567      change.
2568
2569 '--enarmor'
2570 '--dearmor'
2571      Pack or unpack an arbitrary input into/from an OpenPGP ASCII armor.
2572      This is a GnuPG extension to OpenPGP and in general not very
2573      useful.
2574
2575 '--tofu-policy auto|good|unknown|bad|ask key...'
2576      Set the TOFU policy for all the bindings associated with the
2577      specified keys.  For more information about the meaning of the
2578      policies, *note trust-model-tofu::.  The keys may be specified
2579      either by their fingerprint (preferred) or their keyid.
2580
2581 \1f
2582 File: gnupg.info,  Node: OpenPGP Key Management,  Prev: Operational GPG Commands,  Up: GPG Commands
2583
2584 4.1.3 How to manage your keys
2585 -----------------------------
2586
2587 This section explains the main commands for key management.
2588
2589 '--quick-generate-key user-id [algo [usage [expire]]]'
2590      This is a simple command to generate a standard key with one user
2591      id.  In contrast to '--generate-key' the key is generated directly
2592      without the need to answer a bunch of prompts.  Unless the option
2593      '--yes' is given, the key creation will be canceled if the given
2594      user id already exists in the keyring.
2595
2596      If invoked directly on the console without any special options an
2597      answer to a "Continue?"  style confirmation prompt is required.  In
2598      case the user id already exists in the keyring a second prompt to
2599      force the creation of the key will show up.
2600
2601      If 'algo' or 'usage' are given, only the primary key is created and
2602      no prompts are shown.  To specify an expiration date but still
2603      create a primary and subkey use "default" or "future-default" for
2604      'algo' and "default" for 'usage'.  For a description of these
2605      optional arguments see the command '--quick-add-key'.  The 'usage'
2606      accepts also the value "cert" which can be used to create a
2607      certification only primary key; the default is to a create
2608      certification and signing key.
2609
2610      The 'expire' argument can be used to specify an expiration date for
2611      the key.  Several formats are supported; commonly the ISO
2612      YYYY-MM-DD format is used.  The values "never", "none" can be used
2613      for no expiration date.  Not specifying a value, or using "-"
2614      results in a key expiring in a reasonable default interval.
2615
2616      If this command is used with '--batch', '--pinentry-mode' has been
2617      set to 'loopback', and one of the passphrase options
2618      ('--passphrase', '--passphrase-fd', or 'passphrase-file') is used,
2619      the supplied passphrase is used for the new key and the agent does
2620      not ask for it.  To create a key without any protection
2621      '--passphrase ''' may be used.
2622
2623 '--quick-set-expire fpr expire'
2624      Directly set the expiration time of the primary key to 'expire'.
2625      To remove the expiration time '0' can be used.
2626
2627 '--quick-add-key fpr [algo [usage [expire]]]'
2628      Directly add a subkey to the key identified by the fingerprint
2629      'fpr'.  Without the optional arguments an encryption subkey is
2630      added.  If any of the arguments are given a more specific subkey is
2631      added.
2632
2633      'algo' may be any of the supported algorithms or curve names given
2634      in the format as used by key listings.  To use the default
2635      algorithm the string "default" or "-" can be used.  Supported
2636      algorithms are "rsa", "dsa", "elg", "ed25519", "cv25519", and other
2637      ECC curves.  For example the string "rsa" adds an RSA key with the
2638      default key length; a string "rsa4096" requests that the key length
2639      is 4096 bits.  The string "future-default" is an alias for the
2640      algorithm which will likely be used as default algorithm in future
2641      versions of gpg.
2642
2643      Depending on the given 'algo' the subkey may either be an
2644      encryption subkey or a signing subkey.  If an algorithm is capable
2645      of signing and encryption and such a subkey is desired, a 'usage'
2646      string must be given.  This string is either "default" or "-" to
2647      keep the default or a comma delimited list of keywords: "sign" for
2648      a signing subkey, "auth" for an authentication subkey, and "encr"
2649      for an encryption subkey ("encrypt" can be used as alias for
2650      "encr").  The valid combinations depend on the algorithm.
2651
2652      The 'expire' argument can be used to specify an expiration date for
2653      the subkey.  Several formats are supported; commonly the ISO
2654      YYYY-MM-DD format is used.  The values "never", "none", or "-" can
2655      be used for no expiration date.
2656
2657 '--generate-key'
2658 '--gen-key'
2659      Generate a new key pair using the current default parameters.  This
2660      is the standard command to create a new key.  In addition to the
2661      key a revocation certificate is created and stored in the
2662      'openpgp-revocs.d' directory below the GnuPG home directory.
2663
2664 '--full-generate-key'
2665 '--full-gen-key'
2666      Generate a new key pair with dialogs for all options.  This is an
2667      extended version of '--generate-key'.
2668
2669      There is also a feature which allows you to create keys in batch
2670      mode.  See the manual section "Unattended key generation" on how to
2671      use this.
2672
2673 '--generate-revocation name'
2674 '--gen-revoke name'
2675      Generate a revocation certificate for the complete key.  To only
2676      revoke a subkey or a key signature, use the '--edit' command.
2677
2678      This command merely creates the revocation certificate so that it
2679      can be used to revoke the key if that is ever needed.  To actually
2680      revoke a key the created revocation certificate needs to be merged
2681      with the key to revoke.  This is done by importing the revocation
2682      certificate using the '--import' command.  Then the revoked key
2683      needs to be published, which is best done by sending the key to a
2684      keyserver (command '--send-key') and by exporting ('--export') it
2685      to a file which is then send to frequent communication partners.
2686
2687 '--generate-designated-revocation name'
2688 '--desig-revoke name'
2689      Generate a designated revocation certificate for a key.  This
2690      allows a user (with the permission of the keyholder) to revoke
2691      someone else's key.
2692
2693 '--edit-key'
2694      Present a menu which enables you to do most of the key management
2695      related tasks.  It expects the specification of a key on the
2696      command line.
2697
2698      uid 'n'
2699           Toggle selection of user ID or photographic user ID with index
2700           'n'.  Use '*' to select all and '0' to deselect all.
2701
2702      key 'n'
2703           Toggle selection of subkey with index 'n' or key ID 'n'.  Use
2704           '*' to select all and '0' to deselect all.
2705
2706      sign
2707           Make a signature on key of user 'name'.  If the key is not yet
2708           signed by the default user (or the users given with '-u'), the
2709           program displays the information of the key again, together
2710           with its fingerprint and asks whether it should be signed.
2711           This question is repeated for all users specified with '-u'.
2712
2713      lsign
2714           Same as "sign" but the signature is marked as non-exportable
2715           and will therefore never be used by others.  This may be used
2716           to make keys valid only in the local environment.
2717
2718      nrsign
2719           Same as "sign" but the signature is marked as non-revocable
2720           and can therefore never be revoked.
2721
2722      tsign
2723           Make a trust signature.  This is a signature that combines the
2724           notions of certification (like a regular signature), and trust
2725           (like the "trust" command).  It is generally only useful in
2726           distinct communities or groups.  For more information please
2727           read the sections "Trust Signature" and "Regular Expression"
2728           in RFC-4880.
2729
2730      Note that "l" (for local / non-exportable), "nr" (for
2731      non-revocable, and "t" (for trust) may be freely mixed and prefixed
2732      to "sign" to create a signature of any type desired.
2733
2734      If the option '--only-sign-text-ids' is specified, then any
2735      non-text based user ids (e.g., photo IDs) will not be selected for
2736      signing.
2737
2738      delsig
2739           Delete a signature.  Note that it is not possible to retract a
2740           signature, once it has been send to the public (i.e.  to a
2741           keyserver).  In that case you better use 'revsig'.
2742
2743      revsig
2744           Revoke a signature.  For every signature which has been
2745           generated by one of the secret keys, GnuPG asks whether a
2746           revocation certificate should be generated.
2747
2748      check
2749           Check the signatures on all selected user IDs.  With the extra
2750           option 'selfsig' only self-signatures are shown.
2751
2752      adduid
2753           Create an additional user ID.
2754
2755      addphoto
2756           Create a photographic user ID. This will prompt for a JPEG
2757           file that will be embedded into the user ID. Note that a very
2758           large JPEG will make for a very large key.  Also note that
2759           some programs will display your JPEG unchanged (GnuPG), and
2760           some programs will scale it to fit in a dialog box (PGP).
2761
2762      showphoto
2763           Display the selected photographic user ID.
2764
2765      deluid
2766           Delete a user ID or photographic user ID. Note that it is not
2767           possible to retract a user id, once it has been send to the
2768           public (i.e.  to a keyserver).  In that case you better use
2769           'revuid'.
2770
2771      revuid
2772           Revoke a user ID or photographic user ID.
2773
2774      primary
2775           Flag the current user id as the primary one, removes the
2776           primary user id flag from all other user ids and sets the
2777           timestamp of all affected self-signatures one second ahead.
2778           Note that setting a photo user ID as primary makes it primary
2779           over other photo user IDs, and setting a regular user ID as
2780           primary makes it primary over other regular user IDs.
2781
2782      keyserver
2783           Set a preferred keyserver for the specified user ID(s).  This
2784           allows other users to know where you prefer they get your key
2785           from.  See '--keyserver-options honor-keyserver-url' for more
2786           on how this works.  Setting a value of "none" removes an
2787           existing preferred keyserver.
2788
2789      notation
2790           Set a name=value notation for the specified user ID(s).  See
2791           '--cert-notation' for more on how this works.  Setting a value
2792           of "none" removes all notations, setting a notation prefixed
2793           with a minus sign (-) removes that notation, and setting a
2794           notation name (without the =value) prefixed with a minus sign
2795           removes all notations with that name.
2796
2797      pref
2798           List preferences from the selected user ID. This shows the
2799           actual preferences, without including any implied preferences.
2800
2801      showpref
2802           More verbose preferences listing for the selected user ID.
2803           This shows the preferences in effect by including the implied
2804           preferences of 3DES (cipher), SHA-1 (digest), and Uncompressed
2805           (compression) if they are not already included in the
2806           preference list.  In addition, the preferred keyserver and
2807           signature notations (if any) are shown.
2808
2809      setpref 'string'
2810           Set the list of user ID preferences to 'string' for all (or
2811           just the selected) user IDs.  Calling setpref with no
2812           arguments sets the preference list to the default (either
2813           built-in or set via '--default-preference-list'), and calling
2814           setpref with "none" as the argument sets an empty preference
2815           list.  Use 'gpg --version' to get a list of available
2816           algorithms.  Note that while you can change the preferences on
2817           an attribute user ID (aka "photo ID"), GnuPG does not select
2818           keys via attribute user IDs so these preferences will not be
2819           used by GnuPG.
2820
2821           When setting preferences, you should list the algorithms in
2822           the order which you'd like to see them used by someone else
2823           when encrypting a message to your key.  If you don't include
2824           3DES, it will be automatically added at the end.  Note that
2825           there are many factors that go into choosing an algorithm (for
2826           example, your key may not be the only recipient), and so the
2827           remote OpenPGP application being used to send to you may or
2828           may not follow your exact chosen order for a given message.
2829           It will, however, only choose an algorithm that is present on
2830           the preference list of every recipient key.  See also the
2831           INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS section below.
2832
2833      addkey
2834           Add a subkey to this key.
2835
2836      addcardkey
2837           Generate a subkey on a card and add it to this key.
2838
2839      keytocard
2840           Transfer the selected secret subkey (or the primary key if no
2841           subkey has been selected) to a smartcard.  The secret key in
2842           the keyring will be replaced by a stub if the key could be
2843           stored successfully on the card and you use the save command
2844           later.  Only certain key types may be transferred to the card.
2845           A sub menu allows you to select on what card to store the key.
2846           Note that it is not possible to get that key back from the
2847           card - if the card gets broken your secret key will be lost
2848           unless you have a backup somewhere.
2849
2850      bkuptocard 'file'
2851           Restore the given file to a card.  This command may be used to
2852           restore a backup key (as generated during card initialization)
2853           to a new card.  In almost all cases this will be the
2854           encryption key.  You should use this command only with the
2855           corresponding public key and make sure that the file given as
2856           argument is indeed the backup to restore.  You should then
2857           select 2 to restore as encryption key.  You will first be
2858           asked to enter the passphrase of the backup key and then for
2859           the Admin PIN of the card.
2860
2861      delkey
2862           Remove a subkey (secondary key).  Note that it is not possible
2863           to retract a subkey, once it has been send to the public (i.e.
2864           to a keyserver).  In that case you better use 'revkey'.  Also
2865           note that this only deletes the public part of a key.
2866
2867      revkey
2868           Revoke a subkey.
2869
2870      expire
2871           Change the key or subkey expiration time.  If a subkey is
2872           selected, the expiration time of this subkey will be changed.
2873           With no selection, the key expiration of the primary key is
2874           changed.
2875
2876      trust
2877           Change the owner trust value for the key.  This updates the
2878           trust-db immediately and no save is required.
2879
2880      disable
2881      enable
2882           Disable or enable an entire key.  A disabled key can not
2883           normally be used for encryption.
2884
2885      addrevoker
2886           Add a designated revoker to the key.  This takes one optional
2887           argument: "sensitive".  If a designated revoker is marked as
2888           sensitive, it will not be exported by default (see
2889           export-options).
2890
2891      passwd
2892           Change the passphrase of the secret key.
2893
2894      toggle
2895           This is dummy command which exists only for backward
2896           compatibility.
2897
2898      clean
2899           Compact (by removing all signatures except the selfsig) any
2900           user ID that is no longer usable (e.g.  revoked, or expired).
2901           Then, remove any signatures that are not usable by the trust
2902           calculations.  Specifically, this removes any signature that
2903           does not validate, any signature that is superseded by a later
2904           signature, revoked signatures, and signatures issued by keys
2905           that are not present on the keyring.
2906
2907      minimize
2908           Make the key as small as possible.  This removes all
2909           signatures from each user ID except for the most recent
2910           self-signature.
2911
2912      cross-certify
2913           Add cross-certification signatures to signing subkeys that may
2914           not currently have them.  Cross-certification signatures
2915           protect against a subtle attack against signing subkeys.  See
2916           '--require-cross-certification'.  All new keys generated have
2917           this signature by default, so this command is only useful to
2918           bring older keys up to date.
2919
2920      save
2921           Save all changes to the keyrings and quit.
2922
2923      quit
2924           Quit the program without updating the keyrings.
2925
2926      The listing shows you the key with its secondary keys and all user
2927      ids.  The primary user id is indicated by a dot, and selected keys
2928      or user ids are indicated by an asterisk.  The trust value is
2929      displayed with the primary key: the first is the assigned owner
2930      trust and the second is the calculated trust value.  Letters are
2931      used for the values:
2932
2933      -
2934           No ownertrust assigned / not yet calculated.
2935
2936      e
2937           Trust calculation has failed; probably due to an expired key.
2938
2939      q
2940           Not enough information for calculation.
2941
2942      n
2943           Never trust this key.
2944
2945      m
2946           Marginally trusted.
2947
2948      f
2949           Fully trusted.
2950
2951      u
2952           Ultimately trusted.
2953
2954 '--sign-key name'
2955      Signs a public key with your secret key.  This is a shortcut
2956      version of the subcommand "sign" from '--edit'.
2957
2958 '--lsign-key name'
2959      Signs a public key with your secret key but marks it as
2960      non-exportable.  This is a shortcut version of the subcommand
2961      "lsign" from '--edit-key'.
2962
2963 '--quick-sign-key fpr [names]'
2964 '--quick-lsign-key fpr [names]'
2965      Directly sign a key from the passphrase without any further user
2966      interaction.  The 'fpr' must be the verified primary fingerprint of
2967      a key in the local keyring.  If no 'names' are given, all useful
2968      user ids are signed; with given ['names'] only useful user ids
2969      matching one of theses names are signed.  By default, or if a name
2970      is prefixed with a '*', a case insensitive substring match is used.
2971      If a name is prefixed with a '=' a case sensitive exact match is
2972      done.
2973
2974      The command '--quick-lsign-key' marks the signatures as
2975      non-exportable.  If such a non-exportable signature already exists
2976      the '--quick-sign-key' turns it into a exportable signature.
2977
2978      This command uses reasonable defaults and thus does not provide the
2979      full flexibility of the "sign" subcommand from '--edit-key'.  Its
2980      intended use is to help unattended key signing by utilizing a list
2981      of verified fingerprints.
2982
2983 '--quick-add-uid USER-ID NEW-USER-ID'
2984      This command adds a new user id to an existing key.  In contrast to
2985      the interactive sub-command 'adduid' of '--edit-key' the
2986      NEW-USER-ID is added verbatim with only leading and trailing white
2987      space removed, it is expected to be UTF-8 encoded, and no checks on
2988      its form are applied.
2989
2990 '--quick-revoke-uid USER-ID USER-ID-TO-REVOKE'
2991      This command revokes a User ID on an existing key.  It cannot be
2992      used to revoke the last User ID on key (some non-revoked User ID
2993      must remain), with revocation reason "User ID is no longer valid".
2994      If you want to specify a different revocation reason, or to supply
2995      supplementary revocation text, you should use the interactive
2996      sub-command 'revuid' of '--edit-key'.
2997
2998 '--change-passphrase USER_ID'
2999 '--passwd USER_ID'
3000      Change the passphrase of the secret key belonging to the
3001      certificate specified as USER_ID.  This is a shortcut for the
3002      sub-command 'passwd' of the edit key menu.
3003
3004 \1f
3005 File: gnupg.info,  Node: GPG Options,  Next: GPG Configuration,  Prev: GPG Commands,  Up: Invoking GPG
3006
3007 4.2 Option Summary
3008 ==================
3009
3010 'gpg' features a bunch of options to control the exact behaviour and to
3011 change the default configuration.
3012
3013 * Menu:
3014
3015 * GPG Configuration Options::   How to change the configuration.
3016 * GPG Key related Options::     Key related options.
3017 * GPG Input and Output::        Input and Output.
3018 * OpenPGP Options::             OpenPGP protocol specific options.
3019 * Compliance Options::          Compliance options.
3020 * GPG Esoteric Options::        Doing things one usually doesn't want to do.
3021 * Deprecated Options::          Deprecated options.
3022
3023    Long options can be put in an options file (default
3024 "~/.gnupg/gpg.conf").  Short option names will not work - for example,
3025 "armor" is a valid option for the options file, while "a" is not.  Do
3026 not write the 2 dashes, but simply the name of the option and any
3027 required arguments.  Lines with a hash ('#') as the first
3028 non-white-space character are ignored.  Commands may be put in this file
3029 too, but that is not generally useful as the command will execute
3030 automatically with every execution of gpg.
3031
3032    Please remember that option parsing stops as soon as a non-option is
3033 encountered, you can explicitly stop parsing by using the special option
3034 '--'.
3035
3036 \1f
3037 File: gnupg.info,  Node: GPG Configuration Options,  Next: GPG Key related Options,  Up: GPG Options
3038
3039 4.2.1 How to change the configuration
3040 -------------------------------------
3041
3042 These options are used to change the configuration and are usually found
3043 in the option file.
3044
3045 '--default-key NAME'
3046      Use NAME as the default key to sign with.  If this option is not
3047      used, the default key is the first key found in the secret keyring.
3048      Note that '-u' or '--local-user' overrides this option.  This
3049      option may be given multiple times.  In this case, the last key for
3050      which a secret key is available is used.  If there is no secret key
3051      available for any of the specified values, GnuPG will not emit an
3052      error message but continue as if this option wasn't given.
3053
3054 '--default-recipient NAME'
3055      Use NAME as default recipient if option '--recipient' is not used
3056      and don't ask if this is a valid one.  NAME must be non-empty.
3057
3058 '--default-recipient-self'
3059      Use the default key as default recipient if option '--recipient' is
3060      not used and don't ask if this is a valid one.  The default key is
3061      the first one from the secret keyring or the one set with
3062      '--default-key'.
3063
3064 '--no-default-recipient'
3065      Reset '--default-recipient' and '--default-recipient-self'.
3066
3067 '-v, --verbose'
3068      Give more information during processing.  If used twice, the input
3069      data is listed in detail.
3070
3071 '--no-verbose'
3072      Reset verbose level to 0.
3073
3074 '-q, --quiet'
3075      Try to be as quiet as possible.
3076
3077 '--batch'
3078 '--no-batch'
3079      Use batch mode.  Never ask, do not allow interactive commands.
3080      '--no-batch' disables this option.  Note that even with a filename
3081      given on the command line, gpg might still need to read from STDIN
3082      (in particular if gpg figures that the input is a detached
3083      signature and no data file has been specified).  Thus if you do not
3084      want to feed data via STDIN, you should connect STDIN to
3085      g'/dev/null'.
3086
3087      It is highly recommended to use this option along with the options
3088      '--status-fd' and '--with-colons' for any unattended of 'gpg'.
3089
3090 '--no-tty'
3091      Make sure that the TTY (terminal) is never used for any output.
3092      This option is needed in some cases because GnuPG sometimes prints
3093      warnings to the TTY even if '--batch' is used.
3094
3095 '--yes'
3096      Assume "yes" on most questions.
3097
3098 '--no'
3099      Assume "no" on most questions.
3100
3101 '--list-options parameters'
3102      This is a space or comma delimited string that gives options used
3103      when listing keys and signatures (that is, '--list-keys',
3104      '--list-signatures', '--list-public-keys', '--list-secret-keys',
3105      and the '--edit-key' functions).  Options can be prepended with a
3106      'no-' (after the two dashes) to give the opposite meaning.  The
3107      options are:
3108
3109      show-photos
3110           Causes '--list-keys', '--list-signatures',
3111           '--list-public-keys', and '--list-secret-keys' to display any
3112           photo IDs attached to the key.  Defaults to no.  See also
3113           '--photo-viewer'.  Does not work with '--with-colons': see
3114           '--attribute-fd' for the appropriate way to get photo data for
3115           scripts and other frontends.
3116
3117      show-usage
3118           Show usage information for keys and subkeys in the standard
3119           key listing.  This is a list of letters indicating the allowed
3120           usage for a key ('E'=encryption, 'S'=signing,
3121           'C'=certification, 'A'=authentication).  Defaults to yes.
3122
3123      show-policy-urls
3124           Show policy URLs in the '--list-signatures' or
3125           '--check-signatures' listings.  Defaults to no.
3126
3127      show-notations
3128      show-std-notations
3129      show-user-notations
3130           Show all, IETF standard, or user-defined signature notations
3131           in the '--list-signatures' or '--check-signatures' listings.
3132           Defaults to no.
3133
3134      show-keyserver-urls
3135           Show any preferred keyserver URL in the '--list-signatures' or
3136           '--check-signatures' listings.  Defaults to no.
3137
3138      show-uid-validity
3139           Display the calculated validity of user IDs during key
3140           listings.  Defaults to yes.
3141
3142      show-unusable-uids
3143           Show revoked and expired user IDs in key listings.  Defaults
3144           to no.
3145
3146      show-unusable-subkeys
3147           Show revoked and expired subkeys in key listings.  Defaults to
3148           no.
3149
3150      show-keyring
3151           Display the keyring name at the head of key listings to show
3152           which keyring a given key resides on.  Defaults to no.
3153
3154      show-sig-expire
3155           Show signature expiration dates (if any) during
3156           '--list-signatures' or '--check-signatures' listings.
3157           Defaults to no.
3158
3159      show-sig-subpackets
3160           Include signature subpackets in the key listing.  This option
3161           can take an optional argument list of the subpackets to list.
3162           If no argument is passed, list all subpackets.  Defaults to
3163           no.  This option is only meaningful when using '--with-colons'
3164           along with '--list-signatures' or '--check-signatures'.
3165
3166 '--verify-options parameters'
3167      This is a space or comma delimited string that gives options used
3168      when verifying signatures.  Options can be prepended with a 'no-'
3169      to give the opposite meaning.  The options are:
3170
3171      show-photos
3172           Display any photo IDs present on the key that issued the
3173           signature.  Defaults to no.  See also '--photo-viewer'.
3174
3175      show-policy-urls
3176           Show policy URLs in the signature being verified.  Defaults to
3177           yes.
3178
3179      show-notations
3180      show-std-notations
3181      show-user-notations
3182           Show all, IETF standard, or user-defined signature notations
3183           in the signature being verified.  Defaults to IETF standard.
3184
3185      show-keyserver-urls
3186           Show any preferred keyserver URL in the signature being
3187           verified.  Defaults to yes.
3188
3189      show-uid-validity
3190           Display the calculated validity of the user IDs on the key
3191           that issued the signature.  Defaults to yes.
3192
3193      show-unusable-uids
3194           Show revoked and expired user IDs during signature
3195           verification.  Defaults to no.
3196
3197      show-primary-uid-only
3198           Show only the primary user ID during signature verification.
3199           That is all the AKA lines as well as photo Ids are not shown
3200           with the signature verification status.
3201
3202      pka-lookups
3203           Enable PKA lookups to verify sender addresses.  Note that PKA
3204           is based on DNS, and so enabling this option may disclose
3205           information on when and what signatures are verified or to
3206           whom data is encrypted.  This is similar to the "web bug"
3207           described for the '--auto-key-retrieve' option.
3208
3209      pka-trust-increase
3210           Raise the trust in a signature to full if the signature passes
3211           PKA validation.  This option is only meaningful if pka-lookups
3212           is set.
3213
3214 '--enable-large-rsa'
3215 '--disable-large-rsa'
3216      With -generate-key and -batch, enable the creation of RSA secret
3217      keys as large as 8192 bit.  Note: 8192 bit is more than is
3218      generally recommended.  These large keys don't significantly
3219      improve security, but they are more expensive to use, and their
3220      signatures and certifications are larger.  This option is only
3221      available if the binary was build with large-secmem support.
3222
3223 '--enable-dsa2'
3224 '--disable-dsa2'
3225      Enable hash truncation for all DSA keys even for old DSA Keys up to
3226      1024 bit.  This is also the default with '--openpgp'.  Note that
3227      older versions of GnuPG also required this flag to allow the
3228      generation of DSA larger than 1024 bit.
3229
3230 '--photo-viewer string'
3231      This is the command line that should be run to view a photo ID.
3232      "%i" will be expanded to a filename containing the photo.  "%I"
3233      does the same, except the file will not be deleted once the viewer
3234      exits.  Other flags are "%k" for the key ID, "%K" for the long key
3235      ID, "%f" for the key fingerprint, "%t" for the extension of the
3236      image type (e.g.  "jpg"), "%T" for the MIME type of the image (e.g.
3237      "image/jpeg"), "%v" for the single-character calculated validity of
3238      the image being viewed (e.g.  "f"), "%V" for the calculated
3239      validity as a string (e.g.  "full"), "%U" for a base32 encoded hash
3240      of the user ID, and "%%" for an actual percent sign.  If neither %i
3241      or %I are present, then the photo will be supplied to the viewer on
3242      standard input.
3243
3244      The default viewer is "xloadimage -fork -quiet -title 'KeyID 0x%k'
3245      STDIN". Note that if your image viewer program is not secure, then
3246      executing it from GnuPG does not make it secure.
3247
3248 '--exec-path string'
3249      Sets a list of directories to search for photo viewers and
3250      keyserver helpers.  If not provided, keyserver helpers use the
3251      compiled-in default directory, and photo viewers use the 'PATH'
3252      environment variable.  Note, that on W32 system this value is
3253      ignored when searching for keyserver helpers.
3254
3255 '--keyring file'
3256      Add 'file' to the current list of keyrings.  If 'file' begins with
3257      a tilde and a slash, these are replaced by the $HOME directory.  If
3258      the filename does not contain a slash, it is assumed to be in the
3259      GnuPG home directory ("~/.gnupg" if '--homedir' or $GNUPGHOME is
3260      not used).
3261
3262      Note that this adds a keyring to the current list.  If the intent
3263      is to use the specified keyring alone, use '--keyring' along with
3264      '--no-default-keyring'.
3265
3266      If the the option '--no-keyring' has been used no keyrings will be
3267      used at all.
3268
3269 '--secret-keyring file'
3270      This is an obsolete option and ignored.  All secret keys are stored
3271      in the 'private-keys-v1.d' directory below the GnuPG home
3272      directory.
3273
3274 '--primary-keyring file'
3275      Designate 'file' as the primary public keyring.  This means that
3276      newly imported keys (via '--import' or keyserver '--recv-from')
3277      will go to this keyring.
3278
3279 '--trustdb-name file'
3280      Use 'file' instead of the default trustdb.  If 'file' begins with a
3281      tilde and a slash, these are replaced by the $HOME directory.  If
3282      the filename does not contain a slash, it is assumed to be in the
3283      GnuPG home directory ('~/.gnupg' if '--homedir' or $GNUPGHOME is
3284      not used).
3285
3286 '--homedir DIR'
3287      Set the name of the home directory to DIR.  If this option is not
3288      used, the home directory defaults to '~/.gnupg'.  It is only
3289      recognized when given on the command line.  It also overrides any
3290      home directory stated through the environment variable 'GNUPGHOME'
3291      or (on Windows systems) by means of the Registry entry
3292      HKCU\SOFTWARE\GNU\GNUPG:HOMEDIR.
3293
3294      On Windows systems it is possible to install GnuPG as a portable
3295      application.  In this case only this command line option is
3296      considered, all other ways to set a home directory are ignored.
3297
3298      To install GnuPG as a portable application under Windows, create an
3299      empty file named 'gpgconf.ctl' in the same directory as the tool
3300      'gpgconf.exe'.  The root of the installation is then that
3301      directory; or, if 'gpgconf.exe' has been installed directly below a
3302      directory named 'bin', its parent directory.  You also need to make
3303      sure that the following directories exist and are writable:
3304      'ROOT/home' for the GnuPG home and 'ROOT/usr/local/var/cache/gnupg'
3305      for internal cache files.
3306
3307 '--display-charset name'
3308      Set the name of the native character set.  This is used to convert
3309      some informational strings like user IDs to the proper UTF-8
3310      encoding.  Note that this has nothing to do with the character set
3311      of data to be encrypted or signed; GnuPG does not recode
3312      user-supplied data.  If this option is not used, the default
3313      character set is determined from the current locale.  A verbosity
3314      level of 3 shows the chosen set.  Valid values for 'name' are:
3315
3316      iso-8859-1
3317           This is the Latin 1 set.
3318
3319      iso-8859-2
3320           The Latin 2 set.
3321
3322      iso-8859-15
3323           This is currently an alias for the Latin 1 set.
3324
3325      koi8-r
3326           The usual Russian set (RFC-1489).
3327
3328      utf-8
3329           Bypass all translations and assume that the OS uses native
3330           UTF-8 encoding.
3331
3332 '--utf8-strings'
3333 '--no-utf8-strings'
3334      Assume that command line arguments are given as UTF-8 strings.  The
3335      default ('--no-utf8-strings') is to assume that arguments are
3336      encoded in the character set as specified by '--display-charset'.
3337      These options affect all following arguments.  Both options may be
3338      used multiple times.
3339
3340 '--options file'
3341      Read options from 'file' and do not try to read them from the
3342      default options file in the homedir (see '--homedir').  This option
3343      is ignored if used in an options file.
3344
3345 '--no-options'
3346      Shortcut for '--options /dev/null'.  This option is detected before
3347      an attempt to open an option file.  Using this option will also
3348      prevent the creation of a '~/.gnupg' homedir.
3349
3350 '-z n'
3351 '--compress-level n'
3352 '--bzip2-compress-level n'
3353      Set compression level to 'n' for the ZIP and ZLIB compression
3354      algorithms.  The default is to use the default compression level of
3355      zlib (normally 6).  '--bzip2-compress-level' sets the compression
3356      level for the BZIP2 compression algorithm (defaulting to 6 as
3357      well).  This is a different option from '--compress-level' since
3358      BZIP2 uses a significant amount of memory for each additional
3359      compression level.  '-z' sets both.  A value of 0 for 'n' disables
3360      compression.
3361
3362 '--bzip2-decompress-lowmem'
3363      Use a different decompression method for BZIP2 compressed files.
3364      This alternate method uses a bit more than half the memory, but
3365      also runs at half the speed.  This is useful under extreme low
3366      memory circumstances when the file was originally compressed at a
3367      high '--bzip2-compress-level'.
3368
3369 '--mangle-dos-filenames'
3370 '--no-mangle-dos-filenames'
3371      Older version of Windows cannot handle filenames with more than one
3372      dot.  '--mangle-dos-filenames' causes GnuPG to replace (rather than
3373      add to) the extension of an output filename to avoid this problem.
3374      This option is off by default and has no effect on non-Windows
3375      platforms.
3376
3377 '--ask-cert-level'
3378 '--no-ask-cert-level'
3379      When making a key signature, prompt for a certification level.  If
3380      this option is not specified, the certification level used is set
3381      via '--default-cert-level'.  See '--default-cert-level' for
3382      information on the specific levels and how they are used.
3383      '--no-ask-cert-level' disables this option.  This option defaults
3384      to no.
3385
3386 '--default-cert-level n'
3387      The default to use for the check level when signing a key.
3388
3389      0 means you make no particular claim as to how carefully you
3390      verified the key.
3391
3392      1 means you believe the key is owned by the person who claims to
3393      own it but you could not, or did not verify the key at all.  This
3394      is useful for a "persona" verification, where you sign the key of a
3395      pseudonymous user.
3396
3397      2 means you did casual verification of the key.  For example, this
3398      could mean that you verified the key fingerprint and checked the
3399      user ID on the key against a photo ID.
3400
3401      3 means you did extensive verification of the key.  For example,
3402      this could mean that you verified the key fingerprint with the
3403      owner of the key in person, and that you checked, by means of a
3404      hard to forge document with a photo ID (such as a passport) that
3405      the name of the key owner matches the name in the user ID on the
3406      key, and finally that you verified (by exchange of email) that the
3407      email address on the key belongs to the key owner.
3408
3409      Note that the examples given above for levels 2 and 3 are just
3410      that: examples.  In the end, it is up to you to decide just what
3411      "casual" and "extensive" mean to you.
3412
3413      This option defaults to 0 (no particular claim).
3414
3415 '--min-cert-level'
3416      When building the trust database, treat any signatures with a
3417      certification level below this as invalid.  Defaults to 2, which
3418      disregards level 1 signatures.  Note that level 0 "no particular
3419      claim" signatures are always accepted.
3420
3421 '--trusted-key long key ID'
3422      Assume that the specified key (which must be given as a full 8 byte
3423      key ID) is as trustworthy as one of your own secret keys.  This
3424      option is useful if you don't want to keep your secret keys (or one
3425      of them) online but still want to be able to check the validity of
3426      a given recipient's or signator's key.
3427
3428 '--trust-model pgp|classic|tofu|tofu+pgp|direct|always|auto'
3429      Set what trust model GnuPG should follow.  The models are:
3430
3431      pgp
3432           This is the Web of Trust combined with trust signatures as
3433           used in PGP 5.x and later.  This is the default trust model
3434           when creating a new trust database.
3435
3436      classic
3437           This is the standard Web of Trust as introduced by PGP 2.
3438
3439      tofu
3440           TOFU stands for Trust On First Use.  In this trust model, the
3441           first time a key is seen, it is memorized.  If later another
3442           key is seen with a user id with the same email address, a
3443           warning is displayed indicating that there is a conflict and
3444           that the key might be a forgery and an attempt at a
3445           man-in-the-middle attack.
3446
3447           Because a potential attacker is able to control the email
3448           address and thereby circumvent the conflict detection
3449           algorithm by using an email address that is similar in
3450           appearance to a trusted email address, whenever a message is
3451           verified, statistics about the number of messages signed with
3452           the key are shown.  In this way, a user can easily identify
3453           attacks using fake keys for regular correspondents.
3454
3455           When compared with the Web of Trust, TOFU offers significantly
3456           weaker security guarantees.  In particular, TOFU only helps
3457           ensure consistency (that is, that the binding between a key
3458           and email address doesn't change).  A major advantage of TOFU
3459           is that it requires little maintenance to use correctly.  To
3460           use the web of trust properly, you need to actively sign keys
3461           and mark users as trusted introducers.  This is a
3462           time-consuming process and anecdotal evidence suggests that
3463           even security-conscious users rarely take the time to do this
3464           thoroughly and instead rely on an ad-hoc TOFU process.
3465
3466           In the TOFU model, policies are associated with bindings
3467           between keys and email addresses (which are extracted from
3468           user ids and normalized).  There are five policies, which can
3469           be set manually using the '--tofu-policy' option.  The default
3470           policy can be set using the '--tofu-default-policy' option.
3471
3472           The TOFU policies are: 'auto', 'good', 'unknown', 'bad' and
3473           'ask'.  The 'auto' policy is used by default (unless
3474           overridden by '--tofu-default-policy') and marks a binding as
3475           marginally trusted.  The 'good', 'unknown' and 'bad' policies
3476           mark a binding as fully trusted, as having unknown trust or as
3477           having trust never, respectively.  The 'unknown' policy is
3478           useful for just using TOFU to detect conflicts, but to never
3479           assign positive trust to a binding.  The final policy, 'ask'
3480           prompts the user to indicate the binding's trust.  If batch
3481           mode is enabled (or input is inappropriate in the context),
3482           then the user is not prompted and the 'undefined' trust level
3483           is returned.
3484
3485      tofu+pgp
3486           This trust model combines TOFU with the Web of Trust.  This is
3487           done by computing the trust level for each model and then
3488           taking the maximum trust level where the trust levels are
3489           ordered as follows: 'unknown < undefined < marginal < fully <
3490           ultimate < expired < never'.
3491
3492           By setting '--tofu-default-policy=unknown', this model can be
3493           used to implement the web of trust with TOFU's conflict
3494           detection algorithm, but without its assignment of positive
3495           trust values, which some security-conscious users don't like.
3496
3497      direct
3498           Key validity is set directly by the user and not calculated
3499           via the Web of Trust.
3500
3501      always
3502           Skip key validation and assume that used keys are always fully
3503           valid.  You generally won't use this unless you are using some
3504           external validation scheme.  This option also suppresses the
3505           "[uncertain]" tag printed with signature checks when there is
3506           no evidence that the user ID is bound to the key.  Note that
3507           this trust model still does not allow the use of expired,
3508           revoked, or disabled keys.
3509
3510      auto
3511           Select the trust model depending on whatever the internal
3512           trust database says.  This is the default model if such a
3513           database already exists.
3514
3515 '--auto-key-locate parameters'
3516 '--no-auto-key-locate'
3517      GnuPG can automatically locate and retrieve keys as needed using
3518      this option.  This happens when encrypting to an email address (in
3519      the "user@example.com" form), and there are no user@example.com
3520      keys on the local keyring.  This option takes any number of the
3521      following mechanisms, in the order they are to be tried:
3522
3523      cert
3524           Locate a key using DNS CERT, as specified in RFC-4398.
3525
3526      pka
3527           Locate a key using DNS PKA.
3528
3529      dane
3530           Locate a key using DANE, as specified in
3531           draft-ietf-dane-openpgpkey-05.txt.
3532
3533      wkd
3534           Locate a key using the Web Key Directory protocol.  This is an
3535           experimental method and semantics may change.
3536
3537      ldap
3538           Using DNS Service Discovery, check the domain in question for
3539           any LDAP keyservers to use.  If this fails, attempt to locate
3540           the key using the PGP Universal method of checking
3541           'ldap://keys.(thedomain)'.
3542
3543      keyserver
3544           Locate a key using whatever keyserver is defined using the
3545           '--keyserver' option.
3546
3547      keyserver-URL
3548           In addition, a keyserver URL as used in the '--keyserver'
3549           option may be used here to query that particular keyserver.
3550
3551      local
3552           Locate the key using the local keyrings.  This mechanism
3553           allows the user to select the order a local key lookup is
3554           done.  Thus using '--auto-key-locate local' is identical to
3555           '--no-auto-key-locate'.
3556
3557      nodefault
3558           This flag disables the standard local key lookup, done before
3559           any of the mechanisms defined by the '--auto-key-locate' are
3560           tried.  The position of this mechanism in the list does not
3561           matter.  It is not required if 'local' is also used.
3562
3563      clear
3564           Clear all defined mechanisms.  This is useful to override
3565           mechanisms given in a config file.
3566
3567 '--auto-key-retrieve'
3568 '--no-auto-key-retrieve'
3569      This option enables the automatic retrieving of keys from a
3570      keyserver when verifying signatures made by keys that are not on
3571      the local keyring.
3572
3573      If the method "wkd" is included in the list of methods given to
3574      'auto-key-locate', the Signer's User ID is part of the signature,
3575      and the option '--disable-signer-uid' is not used, the "wkd" method
3576      may also be used to retrieve a key.
3577
3578      Note that this option makes a "web bug" like behavior possible.
3579      Keyserver or Web Key Directory operators can see which keys you
3580      request, so by sending you a message signed by a brand new key
3581      (which you naturally will not have on your local keyring), the
3582      operator can tell both your IP address and the time when you
3583      verified the signature.
3584
3585 '--keyid-format none|short|0xshort|long|0xlong'
3586      Select how to display key IDs.  "none" does not show the key ID at
3587      all but shows the fingerprint in a separate line.  "short" is the
3588      traditional 8-character key ID. "long" is the more accurate (but
3589      less convenient) 16-character key ID. Add an "0x" to either to
3590      include an "0x" at the beginning of the key ID, as in 0x99242560.
3591      Note that this option is ignored if the option '--with-colons' is
3592      used.
3593
3594 '--keyserver name'
3595      This option is deprecated - please use the '--keyserver' in
3596      'dirmngr.conf' instead.
3597
3598      Use 'name' as your keyserver.  This is the server that
3599      '--receive-keys', '--send-keys', and '--search-keys' will
3600      communicate with to receive keys from, send keys to, and search for
3601      keys on.  The format of the 'name' is a URI:
3602      'scheme:[//]keyservername[:port]' The scheme is the type of
3603      keyserver: "hkp" for the HTTP (or compatible) keyservers, "ldap"
3604      for the LDAP keyservers, or "mailto" for the Graff email keyserver.
3605      Note that your particular installation of GnuPG may have other
3606      keyserver types available as well.  Keyserver schemes are
3607      case-insensitive.  After the keyserver name, optional keyserver
3608      configuration options may be provided.  These are the same as the
3609      global '--keyserver-options' from below, but apply only to this
3610      particular keyserver.
3611
3612      Most keyservers synchronize with each other, so there is generally
3613      no need to send keys to more than one server.  The keyserver
3614      'hkp://keys.gnupg.net' uses round robin DNS to give a different
3615      keyserver each time you use it.
3616
3617 '--keyserver-options name=value'
3618      This is a space or comma delimited string that gives options for
3619      the keyserver.  Options can be prefixed with a 'no-' to give the
3620      opposite meaning.  Valid import-options or export-options may be
3621      used here as well to apply to importing ('--recv-key') or exporting
3622      ('--send-key') a key from a keyserver.  While not all options are
3623      available for all keyserver types, some common options are:
3624
3625      include-revoked
3626           When searching for a key with '--search-keys', include keys
3627           that are marked on the keyserver as revoked.  Note that not
3628           all keyservers differentiate between revoked and unrevoked
3629           keys, and for such keyservers this option is meaningless.
3630           Note also that most keyservers do not have cryptographic
3631           verification of key revocations, and so turning this option
3632           off may result in skipping keys that are incorrectly marked as
3633           revoked.
3634
3635      include-disabled
3636           When searching for a key with '--search-keys', include keys
3637           that are marked on the keyserver as disabled.  Note that this
3638           option is not used with HKP keyservers.
3639
3640      auto-key-retrieve
3641           This is the same as the option 'auto-key-retrieve'.
3642
3643      honor-keyserver-url
3644           When using '--refresh-keys', if the key in question has a
3645           preferred keyserver URL, then use that preferred keyserver to
3646           refresh the key from.  In addition, if auto-key-retrieve is
3647           set, and the signature being verified has a preferred
3648           keyserver URL, then use that preferred keyserver to fetch the
3649           key from.  Note that this option introduces a "web bug": The
3650           creator of the key can see when the keys is refreshed.  Thus
3651           this option is not enabled by default.
3652
3653      honor-pka-record
3654           If '--auto-key-retrieve' is used, and the signature being
3655           verified has a PKA record, then use the PKA information to
3656           fetch the key.  Defaults to "yes".
3657
3658      include-subkeys
3659           When receiving a key, include subkeys as potential targets.
3660           Note that this option is not used with HKP keyservers, as they
3661           do not support retrieving keys by subkey id.
3662
3663      timeout
3664           Tell the keyserver helper program how long (in seconds) to try
3665           and perform a keyserver action before giving up.  Note that
3666           performing multiple actions at the same time uses this timeout
3667           value per action.  For example, when retrieving multiple keys
3668           via '--receive-keys', the timeout applies separately to each
3669           key retrieval, and not to the '--receive-keys' command as a
3670           whole.  Defaults to 30 seconds.
3671
3672      http-proxy='value'
3673           This option is deprecated.  Set the proxy to use for HTTP and
3674           HKP keyservers.  This overrides any proxy defined in
3675           'dirmngr.conf'.
3676
3677      verbose
3678           This option has no more function since GnuPG 2.1.  Use the
3679           'dirmngr' configuration options instead.
3680
3681      debug
3682           This option has no more function since GnuPG 2.1.  Use the
3683           'dirmngr' configuration options instead.
3684
3685      check-cert
3686           This option has no more function since GnuPG 2.1.  Use the
3687           'dirmngr' configuration options instead.
3688
3689      ca-cert-file
3690           This option has no more function since GnuPG 2.1.  Use the
3691           'dirmngr' configuration options instead.
3692
3693 '--completes-needed n'
3694      Number of completely trusted users to introduce a new key signer
3695      (defaults to 1).
3696
3697 '--marginals-needed n'
3698      Number of marginally trusted users to introduce a new key signer
3699      (defaults to 3)
3700
3701 '--tofu-default-policy auto|good|unknown|bad|ask'
3702      The default TOFU policy (defaults to 'auto').  For more information
3703      about the meaning of this option, *note trust-model-tofu::.
3704
3705 '--max-cert-depth n'
3706      Maximum depth of a certification chain (default is 5).
3707
3708 '--no-sig-cache'
3709      Do not cache the verification status of key signatures.  Caching
3710      gives a much better performance in key listings.  However, if you
3711      suspect that your public keyring is not safe against write
3712      modifications, you can use this option to disable the caching.  It
3713      probably does not make sense to disable it because all kind of
3714      damage can be done if someone else has write access to your public
3715      keyring.
3716
3717 '--auto-check-trustdb'
3718 '--no-auto-check-trustdb'
3719      If GnuPG feels that its information about the Web of Trust has to
3720      be updated, it automatically runs the '--check-trustdb' command
3721      internally.  This may be a time consuming process.
3722      '--no-auto-check-trustdb' disables this option.
3723
3724 '--use-agent'
3725 '--no-use-agent'
3726      This is dummy option.  'gpg' always requires the agent.
3727
3728 '--gpg-agent-info'
3729      This is dummy option.  It has no effect when used with 'gpg'.
3730
3731 '--agent-program FILE'
3732      Specify an agent program to be used for secret key operations.  The
3733      default value is determined by running 'gpgconf' with the option
3734      '--list-dirs'.  Note that the pipe symbol ('|') is used for a
3735      regression test suite hack and may thus not be used in the file
3736      name.
3737
3738 '--dirmngr-program FILE'
3739      Specify a dirmngr program to be used for keyserver access.  The
3740      default value is '/usr/local/bin/dirmngr'.
3741
3742 '--no-autostart'
3743      Do not start the gpg-agent or the dirmngr if it has not yet been
3744      started and its service is required.  This option is mostly useful
3745      on machines where the connection to gpg-agent has been redirected
3746      to another machines.  If dirmngr is required on the remote machine,
3747      it may be started manually using 'gpgconf --launch dirmngr'.
3748
3749 '--lock-once'
3750      Lock the databases the first time a lock is requested and do not
3751      release the lock until the process terminates.
3752
3753 '--lock-multiple'
3754      Release the locks every time a lock is no longer needed.  Use this
3755      to override a previous '--lock-once' from a config file.
3756
3757 '--lock-never'
3758      Disable locking entirely.  This option should be used only in very
3759      special environments, where it can be assured that only one process
3760      is accessing those files.  A bootable floppy with a stand-alone
3761      encryption system will probably use this.  Improper usage of this
3762      option may lead to data and key corruption.
3763
3764 '--exit-on-status-write-error'
3765      This option will cause write errors on the status FD to immediately
3766      terminate the process.  That should in fact be the default but it
3767      never worked this way and thus we need an option to enable this, so
3768      that the change won't break applications which close their end of a
3769      status fd connected pipe too early.  Using this option along with
3770      '--enable-progress-filter' may be used to cleanly cancel long
3771      running gpg operations.
3772
3773 '--limit-card-insert-tries n'
3774      With 'n' greater than 0 the number of prompts asking to insert a
3775      smartcard gets limited to N-1.  Thus with a value of 1 gpg won't at
3776      all ask to insert a card if none has been inserted at startup.
3777      This option is useful in the configuration file in case an
3778      application does not know about the smartcard support and waits ad
3779      infinitum for an inserted card.
3780
3781 '--no-random-seed-file'
3782      GnuPG uses a file to store its internal random pool over
3783      invocations.  This makes random generation faster; however
3784      sometimes write operations are not desired.  This option can be
3785      used to achieve that with the cost of slower random generation.
3786
3787 '--no-greeting'
3788      Suppress the initial copyright message.
3789
3790 '--no-secmem-warning'
3791      Suppress the warning about "using insecure memory".
3792
3793 '--no-permission-warning'
3794      Suppress the warning about unsafe file and home directory
3795      ('--homedir') permissions.  Note that the permission checks that
3796      GnuPG performs are not intended to be authoritative, but rather
3797      they simply warn about certain common permission problems.  Do not
3798      assume that the lack of a warning means that your system is secure.
3799
3800      Note that the warning for unsafe '--homedir' permissions cannot be
3801      suppressed in the gpg.conf file, as this would allow an attacker to
3802      place an unsafe gpg.conf file in place, and use this file to
3803      suppress warnings about itself.  The '--homedir' permissions
3804      warning may only be suppressed on the command line.
3805
3806 '--no-mdc-warning'
3807      Suppress the warning about missing MDC integrity protection.
3808
3809 '--require-secmem'
3810 '--no-require-secmem'
3811      Refuse to run if GnuPG cannot get secure memory.  Defaults to no
3812      (i.e.  run, but give a warning).
3813
3814 '--require-cross-certification'
3815 '--no-require-cross-certification'
3816      When verifying a signature made from a subkey, ensure that the
3817      cross certification "back signature" on the subkey is present and
3818      valid.  This protects against a subtle attack against subkeys that
3819      can sign.  Defaults to '--require-cross-certification' for 'gpg'.
3820
3821 '--expert'
3822 '--no-expert'
3823      Allow the user to do certain nonsensical or "silly" things like
3824      signing an expired or revoked key, or certain potentially
3825      incompatible things like generating unusual key types.  This also
3826      disables certain warning messages about potentially incompatible
3827      actions.  As the name implies, this option is for experts only.  If
3828      you don't fully understand the implications of what it allows you
3829      to do, leave this off.  '--no-expert' disables this option.
3830
3831 \1f
3832 File: gnupg.info,  Node: GPG Key related Options,  Next: GPG Input and Output,  Prev: GPG Configuration Options,  Up: GPG Options
3833
3834 4.2.2 Key related options
3835 -------------------------
3836
3837 '--recipient NAME'
3838 '-r'
3839      Encrypt for user id NAME.  If this option or '--hidden-recipient'
3840      is not specified, GnuPG asks for the user-id unless
3841      '--default-recipient' is given.
3842
3843 '--hidden-recipient NAME'
3844 '-R'
3845      Encrypt for user ID NAME, but hide the key ID of this user's key.
3846      This option helps to hide the receiver of the message and is a
3847      limited countermeasure against traffic analysis.  If this option or
3848      '--recipient' is not specified, GnuPG asks for the user ID unless
3849      '--default-recipient' is given.
3850
3851 '--recipient-file FILE'
3852 '-f'
3853      This option is similar to '--recipient' except that it encrypts to
3854      a key stored in the given file.  FILE must be the name of a file
3855      containing exactly one key.  'gpg' assumes that the key in this
3856      file is fully valid.
3857
3858 '--hidden-recipient-file FILE'
3859 '-F'
3860      This option is similar to '--hidden-recipient' except that it
3861      encrypts to a key stored in the given file.  FILE must be the name
3862      of a file containing exactly one key.  'gpg' assumes that the key
3863      in this file is fully valid.
3864
3865 '--encrypt-to name'
3866      Same as '--recipient' but this one is intended for use in the
3867      options file and may be used with your own user-id as an
3868      "encrypt-to-self".  These keys are only used when there are other
3869      recipients given either by use of '--recipient' or by the asked
3870      user id.  No trust checking is performed for these user ids and
3871      even disabled keys can be used.
3872
3873 '--hidden-encrypt-to name'
3874      Same as '--hidden-recipient' but this one is intended for use in
3875      the options file and may be used with your own user-id as a hidden
3876      "encrypt-to-self".  These keys are only used when there are other
3877      recipients given either by use of '--recipient' or by the asked
3878      user id.  No trust checking is performed for these user ids and
3879      even disabled keys can be used.
3880
3881 '--no-encrypt-to'
3882      Disable the use of all '--encrypt-to' and '--hidden-encrypt-to'
3883      keys.
3884
3885 '--group name=value'
3886      Sets up a named group, which is similar to aliases in email
3887      programs.  Any time the group name is a recipient ('-r' or
3888      '--recipient'), it will be expanded to the values specified.
3889      Multiple groups with the same name are automatically merged into a
3890      single group.
3891
3892      The values are 'key IDs' or fingerprints, but any key description
3893      is accepted.  Note that a value with spaces in it will be treated
3894      as two different values.  Note also there is only one level of
3895      expansion -- you cannot make an group that points to another group.
3896      When used from the command line, it may be necessary to quote the
3897      argument to this option to prevent the shell from treating it as
3898      multiple arguments.
3899
3900 '--ungroup name'
3901      Remove a given entry from the '--group' list.
3902
3903 '--no-groups'
3904      Remove all entries from the '--group' list.
3905
3906 '--local-user NAME'
3907 '-u'
3908      Use NAME as the key to sign with.  Note that this option overrides
3909      '--default-key'.
3910
3911 '--sender MBOX'
3912      This option has two purposes.  MBOX must either be a complete user
3913      id with a proper mail address or just a mail address.  When
3914      creating a signature this option tells gpg the user id of a key
3915      used to make a signature if the key was not directly specified by a
3916      user id.  When verifying a signature the MBOX is used to restrict
3917      the information printed by the TOFU code to matching user ids.
3918
3919 '--try-secret-key NAME'
3920      For hidden recipients GPG needs to know the keys to use for trial
3921      decryption.  The key set with '--default-key' is always tried
3922      first, but this is often not sufficient.  This option allows
3923      setting more keys to be used for trial decryption.  Although any
3924      valid user-id specification may be used for NAME it makes sense to
3925      use at least the long keyid to avoid ambiguities.  Note that
3926      gpg-agent might pop up a pinentry for a lot keys to do the trial
3927      decryption.  If you want to stop all further trial decryption you
3928      may use close-window button instead of the cancel button.
3929
3930 '--try-all-secrets'
3931      Don't look at the key ID as stored in the message but try all
3932      secret keys in turn to find the right decryption key.  This option
3933      forces the behaviour as used by anonymous recipients (created by
3934      using '--throw-keyids' or '--hidden-recipient') and might come
3935      handy in case where an encrypted message contains a bogus key ID.
3936
3937 '--skip-hidden-recipients'
3938 '--no-skip-hidden-recipients'
3939      During decryption skip all anonymous recipients.  This option helps
3940      in the case that people use the hidden recipients feature to hide
3941      there own encrypt-to key from others.  If oneself has many secret
3942      keys this may lead to a major annoyance because all keys are tried
3943      in turn to decrypt something which was not really intended for it.
3944      The drawback of this option is that it is currently not possible to
3945      decrypt a message which includes real anonymous recipients.
3946
3947 \1f
3948 File: gnupg.info,  Node: GPG Input and Output,  Next: OpenPGP Options,  Prev: GPG Key related Options,  Up: GPG Options
3949
3950 4.2.3 Input and Output
3951 ----------------------
3952
3953 '--armor'
3954 '-a'
3955      Create ASCII armored output.  The default is to create the binary
3956      OpenPGP format.
3957
3958 '--no-armor'
3959      Assume the input data is not in ASCII armored format.
3960
3961 '--output FILE'
3962 '-o FILE'
3963      Write output to FILE.  To write to stdout use '-' as the filename.
3964
3965 '--max-output n'
3966      This option sets a limit on the number of bytes that will be
3967      generated when processing a file.  Since OpenPGP supports various
3968      levels of compression, it is possible that the plaintext of a given
3969      message may be significantly larger than the original OpenPGP
3970      message.  While GnuPG works properly with such messages, there is
3971      often a desire to set a maximum file size that will be generated
3972      before processing is forced to stop by the OS limits.  Defaults to
3973      0, which means "no limit".
3974
3975 '--input-size-hint N'
3976      This option can be used to tell GPG the size of the input data in
3977      bytes.  N must be a positive base-10 number.  This option is only
3978      useful if the input is not taken from a file.  GPG may use this
3979      hint to optimize its buffer allocation strategy.  It is also used
3980      by the '--status-fd' line "PROGRESS" to provide a value for "total"
3981      if that is not available by other means.
3982
3983 '--import-options parameters'
3984      This is a space or comma delimited string that gives options for
3985      importing keys.  Options can be prepended with a 'no-' to give the
3986      opposite meaning.  The options are:
3987
3988      import-local-sigs
3989           Allow importing key signatures marked as "local".  This is not
3990           generally useful unless a shared keyring scheme is being used.
3991           Defaults to no.
3992
3993      keep-ownertrust
3994           Normally possible still existing ownertrust values of a key
3995           are cleared if a key is imported.  This is in general
3996           desirable so that a formerly deleted key does not
3997           automatically gain an ownertrust values merely due to import.
3998           On the other hand it is sometimes necessary to re-import a
3999           trusted set of keys again but keeping already assigned
4000           ownertrust values.  This can be achieved by using this option.
4001
4002      repair-pks-subkey-bug
4003           During import, attempt to repair the damage caused by the PKS
4004           keyserver bug (pre version 0.9.6) that mangles keys with
4005           multiple subkeys.  Note that this cannot completely repair the
4006           damaged key as some crucial data is removed by the keyserver,
4007           but it does at least give you back one subkey.  Defaults to no
4008           for regular '--import' and to yes for keyserver
4009           '--receive-keys'.
4010
4011      import-show
4012           Show a listing of the key as imported right before it is
4013           stored.  This can be combined with the option '--dry-run' to
4014           only look at keys.
4015
4016      import-export
4017           Run the entire import code but instead of storing the key to
4018           the local keyring write it to the output.  The export options
4019           'export-pka' and 'export-dane' affect the output.  This option
4020           can be used to remove all invalid parts from a key without the
4021           need to store it.
4022
4023      merge-only
4024           During import, allow key updates to existing keys, but do not
4025           allow any new keys to be imported.  Defaults to no.
4026
4027      import-clean
4028           After import, compact (remove all signatures except the
4029           self-signature) any user IDs from the new key that are not
4030           usable.  Then, remove any signatures from the new key that are
4031           not usable.  This includes signatures that were issued by keys
4032           that are not present on the keyring.  This option is the same
4033           as running the '--edit-key' command "clean" after import.
4034           Defaults to no.
4035
4036      import-minimal
4037           Import the smallest key possible.  This removes all signatures
4038           except the most recent self-signature on each user ID. This
4039           option is the same as running the '--edit-key' command
4040           "minimize" after import.  Defaults to no.
4041
4042 '--import-filter NAME=EXPR'
4043 '--export-filter NAME=EXPR'
4044      These options define an import/export filter which are applied to
4045      the imported/exported keyblock right before it will be
4046      stored/written.  NAME defines the type of filter to use, EXPR the
4047      expression to evaluate.  The option can be used several times which
4048      then appends more expression to the same NAME.
4049
4050      The available filter types are:
4051
4052      keep-uid
4053           This filter will keep a user id packet and its dependent
4054           packets in the keyblock if the expression evaluates to true.
4055
4056      drop-subkey
4057           This filter drops the selected subkeys.  Currently only
4058           implemented for -export-filter.
4059
4060      drop-sig
4061           This filter drops the selected key signatures on user ids.
4062           Self-signatures are not considered.  Currently only
4063           implemented for -import-filter.
4064
4065      For the syntax of the expression see the chapter "FILTER
4066      EXPRESSIONS". The property names for the expressions depend on the
4067      actual filter type and are indicated in the following table.
4068
4069      The available properties are:
4070
4071      uid
4072           A string with the user id.  (keep-uid)
4073
4074      mbox
4075           The addr-spec part of a user id with mailbox or the empty
4076           string.  (keep-uid)
4077
4078      key_algo
4079           A number with the public key algorithm of a key or subkey
4080           packet.  (drop-subkey)
4081
4082      key_created
4083      key_created_d
4084           The first is the timestamp a public key or subkey packet was
4085           created.  The second is the same but given as an ISO string,
4086           e.g.  "2016-08-17".  (drop-subkey)
4087
4088      primary
4089           Boolean indicating whether the user id is the primary one.
4090           (keep-uid)
4091
4092      secret
4093           Boolean indicating whether a key or subkey is a secret one.
4094           drop-subkey)
4095
4096      sig_created
4097      sig_created_d
4098           The first is the timestamp a signature packet was created.
4099           The second is the same but given as an ISO string, e.g.
4100           "2016-08-17".  (drop-sig)
4101
4102      sig_algo
4103           A number with the public key algorithm of a signature packet.
4104           (drop-sig)
4105
4106      sig_digest_algo
4107           A number with the digest algorithm of a signature packet.
4108           (drop-sig)
4109
4110 '--export-options parameters'
4111      This is a space or comma delimited string that gives options for
4112      exporting keys.  Options can be prepended with a 'no-' to give the
4113      opposite meaning.  The options are:
4114
4115      export-local-sigs
4116           Allow exporting key signatures marked as "local".  This is not
4117           generally useful unless a shared keyring scheme is being used.
4118           Defaults to no.
4119
4120      export-attributes
4121           Include attribute user IDs (photo IDs) while exporting.  This
4122           is useful to export keys if they are going to be used by an
4123           OpenPGP program that does not accept attribute user IDs.
4124           Defaults to yes.
4125
4126      export-sensitive-revkeys
4127           Include designated revoker information that was marked as
4128           "sensitive".  Defaults to no.
4129
4130      export-clean
4131           Compact (remove all signatures from) user IDs on the key being
4132           exported if the user IDs are not usable.  Also, do not export
4133           any signatures that are not usable.  This includes signatures
4134           that were issued by keys that are not present on the keyring.
4135           This option is the same as running the '--edit-key' command
4136           "clean" before export except that the local copy of the key is
4137           not modified.  Defaults to no.
4138
4139      export-minimal
4140           Export the smallest key possible.  This removes all signatures
4141           except the most recent self-signature on each user ID. This
4142           option is the same as running the '--edit-key' command
4143           "minimize" before export except that the local copy of the key
4144           is not modified.  Defaults to no.
4145
4146      export-pka
4147           Instead of outputting the key material output PKA records
4148           suitable to put into DNS zone files.  An ORIGIN line is
4149           printed before each record to allow diverting the records to
4150           the corresponding zone file.
4151
4152      export-dane
4153           Instead of outputting the key material output OpenPGP DANE
4154           records suitable to put into DNS zone files.  An ORIGIN line
4155           is printed before each record to allow diverting the records
4156           to the corresponding zone file.
4157
4158 '--with-colons'
4159      Print key listings delimited by colons.  Note that the output will
4160      be encoded in UTF-8 regardless of any '--display-charset' setting.
4161      This format is useful when GnuPG is called from scripts and other
4162      programs as it is easily machine parsed.  The details of this
4163      format are documented in the file 'doc/DETAILS', which is included
4164      in the GnuPG source distribution.
4165
4166 '--fixed-list-mode'
4167      Do not merge primary user ID and primary key in '--with-colon'
4168      listing mode and print all timestamps as seconds since 1970-01-01.
4169      Since GnuPG 2.0.10, this mode is always used and thus this option
4170      is obsolete; it does not harm to use it though.
4171
4172 '--legacy-list-mode'
4173      Revert to the pre-2.1 public key list mode.  This only affects the
4174      human readable output and not the machine interface (i.e.
4175      '--with-colons').  Note that the legacy format does not convey
4176      suitable information for elliptic curves.
4177
4178 '--with-fingerprint'
4179      Same as the command '--fingerprint' but changes only the format of
4180      the output and may be used together with another command.
4181
4182 '--with-subkey-fingerprint'
4183      If a fingerprint is printed for the primary key, this option forces
4184      printing of the fingerprint for all subkeys.  This could also be
4185      achieved by using the '--with-fingerprint' twice but by using this
4186      option along with keyid-format "none" a compact fingerprint is
4187      printed.
4188
4189 '--with-icao-spelling'
4190      Print the ICAO spelling of the fingerprint in addition to the hex
4191      digits.
4192
4193 '--with-keygrip'
4194      Include the keygrip in the key listings.  In '--with-colons' mode
4195      this is implicitly enable for secret keys.
4196
4197 '--with-wkd-hash'
4198      Print a Web Key Directory identifier along with each user ID in key
4199      listings.  This is an experimental feature and semantics may
4200      change.
4201
4202 '--with-secret'
4203      Include info about the presence of a secret key in public key
4204      listings done with '--with-colons'.
4205
4206 \1f
4207 File: gnupg.info,  Node: OpenPGP Options,  Next: Compliance Options,  Prev: GPG Input and Output,  Up: GPG Options
4208
4209 4.2.4 OpenPGP protocol specific options
4210 ---------------------------------------
4211
4212 '-t, --textmode'
4213 '--no-textmode'
4214      Treat input files as text and store them in the OpenPGP canonical
4215      text form with standard "CRLF" line endings.  This also sets the
4216      necessary flags to inform the recipient that the encrypted or
4217      signed data is text and may need its line endings converted back to
4218      whatever the local system uses.  This option is useful when
4219      communicating between two platforms that have different line ending
4220      conventions (UNIX-like to Mac, Mac to Windows, etc).
4221      '--no-textmode' disables this option, and is the default.
4222
4223 '--force-v3-sigs'
4224 '--no-force-v3-sigs'
4225 '--force-v4-certs'
4226 '--no-force-v4-certs'
4227      These options are obsolete and have no effect since GnuPG 2.1.
4228
4229 '--force-mdc'
4230      Force the use of encryption with a modification detection code.
4231      This is always used with the newer ciphers (those with a blocksize
4232      greater than 64 bits), or if all of the recipient keys indicate MDC
4233      support in their feature flags.
4234
4235 '--disable-mdc'
4236      Disable the use of the modification detection code.  Note that by
4237      using this option, the encrypted message becomes vulnerable to a
4238      message modification attack.
4239
4240 '--disable-signer-uid'
4241      By default the user ID of the signing key is embedded in the data
4242      signature.  As of now this is only done if the signing key has been
4243      specified with 'local-user' using a mail address.  This information
4244      can be helpful for verifier to locate the key; see option
4245      '--auto-key-retrieve'.
4246
4247 '--personal-cipher-preferences string'
4248      Set the list of personal cipher preferences to 'string'.  Use 'gpg
4249      --version' to get a list of available algorithms, and use 'none' to
4250      set no preference at all.  This allows the user to safely override
4251      the algorithm chosen by the recipient key preferences, as GPG will
4252      only select an algorithm that is usable by all recipients.  The
4253      most highly ranked cipher in this list is also used for the
4254      '--symmetric' encryption command.
4255
4256 '--personal-digest-preferences string'
4257      Set the list of personal digest preferences to 'string'.  Use 'gpg
4258      --version' to get a list of available algorithms, and use 'none' to
4259      set no preference at all.  This allows the user to safely override
4260      the algorithm chosen by the recipient key preferences, as GPG will
4261      only select an algorithm that is usable by all recipients.  The
4262      most highly ranked digest algorithm in this list is also used when
4263      signing without encryption (e.g.  '--clear-sign' or '--sign').
4264
4265 '--personal-compress-preferences string'
4266      Set the list of personal compression preferences to 'string'.  Use
4267      'gpg --version' to get a list of available algorithms, and use
4268      'none' to set no preference at all.  This allows the user to safely
4269      override the algorithm chosen by the recipient key preferences, as
4270      GPG will only select an algorithm that is usable by all recipients.
4271      The most highly ranked compression algorithm in this list is also
4272      used when there are no recipient keys to consider (e.g.
4273      '--symmetric').
4274
4275 '--s2k-cipher-algo name'
4276      Use 'name' as the cipher algorithm for symmetric encryption with a
4277      passphrase if '--personal-cipher-preferences' and '--cipher-algo'
4278      are not given.  The default is AES-128.
4279
4280 '--s2k-digest-algo name'
4281      Use 'name' as the digest algorithm used to mangle the passphrases
4282      for symmetric encryption.  The default is SHA-1.
4283
4284 '--s2k-mode n'
4285      Selects how passphrases for symmetric encryption are mangled.  If
4286      'n' is 0 a plain passphrase (which is in general not recommended)
4287      will be used, a 1 adds a salt (which should not be used) to the
4288      passphrase and a 3 (the default) iterates the whole process a
4289      number of times (see '--s2k-count').
4290
4291 '--s2k-count n'
4292      Specify how many times the passphrases mangling for symmetric
4293      encryption is repeated.  This value may range between 1024 and
4294      65011712 inclusive.  The default is inquired from gpg-agent.  Note
4295      that not all values in the 1024-65011712 range are legal and if an
4296      illegal value is selected, GnuPG will round up to the nearest legal
4297      value.  This option is only meaningful if '--s2k-mode' is set to
4298      the default of 3.
4299
4300 \1f
4301 File: gnupg.info,  Node: Compliance Options,  Next: GPG Esoteric Options,  Prev: OpenPGP Options,  Up: GPG Options
4302
4303 4.2.5 Compliance options
4304 ------------------------
4305
4306 These options control what GnuPG is compliant to.  Only one of these
4307 options may be active at a time.  Note that the default setting of this
4308 is nearly always the correct one.  See the INTEROPERABILITY WITH OTHER
4309 OPENPGP PROGRAMS section below before using one of these options.
4310
4311 '--gnupg'
4312      Use standard GnuPG behavior.  This is essentially OpenPGP behavior
4313      (see '--openpgp'), but with some additional workarounds for common
4314      compatibility problems in different versions of PGP. This is the
4315      default option, so it is not generally needed, but it may be useful
4316      to override a different compliance option in the gpg.conf file.
4317
4318 '--openpgp'
4319      Reset all packet, cipher and digest options to strict OpenPGP
4320      behavior.  Use this option to reset all previous options like
4321      '--s2k-*', '--cipher-algo', '--digest-algo' and '--compress-algo'
4322      to OpenPGP compliant values.  All PGP workarounds are disabled.
4323
4324 '--rfc4880'
4325      Reset all packet, cipher and digest options to strict RFC-4880
4326      behavior.  Note that this is currently the same thing as
4327      '--openpgp'.
4328
4329 '--rfc4880bis'
4330      Enable experimental features from proposed updates to RFC-4880.
4331      This option can be used in addition to the other compliance
4332      options.  Warning: The behavior may change with any GnuPG release
4333      and created keys or data may not be usable with future GnuPG
4334      versions.
4335
4336 '--rfc2440'
4337      Reset all packet, cipher and digest options to strict RFC-2440
4338      behavior.
4339
4340 '--pgp6'
4341      Set up all options to be as PGP 6 compliant as possible.  This
4342      restricts you to the ciphers IDEA (if the IDEA plugin is
4343      installed), 3DES, and CAST5, the hashes MD5, SHA1 and RIPEMD160,
4344      and the compression algorithms none and ZIP. This also disables
4345      '--throw-keyids', and making signatures with signing subkeys as PGP
4346      6 does not understand signatures made by signing subkeys.
4347
4348      This option implies '--disable-mdc --escape-from-lines'.
4349
4350 '--pgp7'
4351      Set up all options to be as PGP 7 compliant as possible.  This is
4352      identical to '--pgp6' except that MDCs are not disabled, and the
4353      list of allowable ciphers is expanded to add AES128, AES192,
4354      AES256, and TWOFISH.
4355
4356 '--pgp8'
4357      Set up all options to be as PGP 8 compliant as possible.  PGP 8 is
4358      a lot closer to the OpenPGP standard than previous versions of PGP,
4359      so all this does is disable '--throw-keyids' and set
4360      '--escape-from-lines'.  All algorithms are allowed except for the
4361      SHA224, SHA384, and SHA512 digests.
4362
4363 '--compliance STRING'
4364      This option can be used instead of one of the options above.  Valid
4365      values for STRING are the above option names (without the double
4366      dash) and possibly others as shown when using "help" for VALUE.
4367
4368 \1f
4369 File: gnupg.info,  Node: GPG Esoteric Options,  Next: Deprecated Options,  Prev: Compliance Options,  Up: GPG Options
4370
4371 4.2.6 Doing things one usually doesn't want to do
4372 -------------------------------------------------
4373
4374 '-n'
4375 '--dry-run'
4376      Don't make any changes (this is not completely implemented).
4377
4378 '--list-only'
4379      Changes the behaviour of some commands.  This is like '--dry-run'
4380      but different in some cases.  The semantic of this option may be
4381      extended in the future.  Currently it only skips the actual
4382      decryption pass and therefore enables a fast listing of the
4383      encryption keys.
4384
4385 '-i'
4386 '--interactive'
4387      Prompt before overwriting any files.
4388
4389 '--debug-level LEVEL'
4390      Select the debug level for investigating problems.  LEVEL may be a
4391      numeric value or by a keyword:
4392
4393      'none'
4394           No debugging at all.  A value of less than 1 may be used
4395           instead of the keyword.
4396      'basic'
4397           Some basic debug messages.  A value between 1 and 2 may be
4398           used instead of the keyword.
4399      'advanced'
4400           More verbose debug messages.  A value between 3 and 5 may be
4401           used instead of the keyword.
4402      'expert'
4403           Even more detailed messages.  A value between 6 and 8 may be
4404           used instead of the keyword.
4405      'guru'
4406           All of the debug messages you can get.  A value greater than 8
4407           may be used instead of the keyword.  The creation of hash
4408           tracing files is only enabled if the keyword is used.
4409
4410      How these messages are mapped to the actual debugging flags is not
4411      specified and may change with newer releases of this program.  They
4412      are however carefully selected to best aid in debugging.
4413
4414 '--debug FLAGS'
4415      Set debugging flags.  All flags are or-ed and FLAGS may be given in
4416      C syntax (e.g.  0x0042) or as a comma separated list of flag names.
4417      To get a list of all supported flags the single word "help" can be
4418      used.
4419
4420 '--debug-all'
4421      Set all useful debugging flags.
4422
4423 '--debug-iolbf'
4424      Set stdout into line buffered mode.  This option is only honored
4425      when given on the command line.
4426
4427 '--faked-system-time EPOCH'
4428      This option is only useful for testing; it sets the system time
4429      back or forth to EPOCH which is the number of seconds elapsed since
4430      the year 1970.  Alternatively EPOCH may be given as a full ISO time
4431      string (e.g.  "20070924T154812").
4432
4433 '--enable-progress-filter'
4434      Enable certain PROGRESS status outputs.  This option allows
4435      frontends to display a progress indicator while gpg is processing
4436      larger files.  There is a slight performance overhead using it.
4437
4438 '--status-fd n'
4439      Write special status strings to the file descriptor 'n'.  See the
4440      file DETAILS in the documentation for a listing of them.
4441
4442 '--status-file file'
4443      Same as '--status-fd', except the status data is written to file
4444      'file'.
4445
4446 '--logger-fd n'
4447      Write log output to file descriptor 'n' and not to STDERR.
4448
4449 '--log-file file'
4450 '--logger-file file'
4451      Same as '--logger-fd', except the logger data is written to file
4452      'file'.  Use 'socket://' to log to socket.
4453
4454 '--attribute-fd n'
4455      Write attribute subpackets to the file descriptor 'n'.  This is
4456      most useful for use with '--status-fd', since the status messages
4457      are needed to separate out the various subpackets from the stream
4458      delivered to the file descriptor.
4459
4460 '--attribute-file file'
4461      Same as '--attribute-fd', except the attribute data is written to
4462      file 'file'.
4463
4464 '--comment string'
4465 '--no-comments'
4466      Use 'string' as a comment string in cleartext signatures and ASCII
4467      armored messages or keys (see '--armor').  The default behavior is
4468      not to use a comment string.  '--comment' may be repeated multiple
4469      times to get multiple comment strings.  '--no-comments' removes all
4470      comments.  It is a good idea to keep the length of a single comment
4471      below 60 characters to avoid problems with mail programs wrapping
4472      such lines.  Note that comment lines, like all other header lines,
4473      are not protected by the signature.
4474
4475 '--emit-version'
4476 '--no-emit-version'
4477      Force inclusion of the version string in ASCII armored output.  If
4478      given once only the name of the program and the major number is
4479      emitted, given twice the minor is also emitted, given thrice the
4480      micro is added, and given four times an operating system
4481      identification is also emitted.  '--no-emit-version' (default)
4482      disables the version line.
4483
4484 '--sig-notation name=value'
4485 '--cert-notation name=value'
4486 '-N, --set-notation name=value'
4487      Put the name value pair into the signature as notation data.
4488      'name' must consist only of printable characters or spaces, and
4489      must contain a '@' character in the form keyname@domain.example.com
4490      (substituting the appropriate keyname and domain name, of course).
4491      This is to help prevent pollution of the IETF reserved notation
4492      namespace.  The '--expert' flag overrides the '@' check.  'value'
4493      may be any printable string; it will be encoded in UTF-8, so you
4494      should check that your '--display-charset' is set correctly.  If
4495      you prefix 'name' with an exclamation mark (!), the notation data
4496      will be flagged as critical (rfc4880:5.2.3.16).  '--sig-notation'
4497      sets a notation for data signatures.  '--cert-notation' sets a
4498      notation for key signatures (certifications).  '--set-notation'
4499      sets both.
4500
4501      There are special codes that may be used in notation names.  "%k"
4502      will be expanded into the key ID of the key being signed, "%K" into
4503      the long key ID of the key being signed, "%f" into the fingerprint
4504      of the key being signed, "%s" into the key ID of the key making the
4505      signature, "%S" into the long key ID of the key making the
4506      signature, "%g" into the fingerprint of the key making the
4507      signature (which might be a subkey), "%p" into the fingerprint of
4508      the primary key of the key making the signature, "%c" into the
4509      signature count from the OpenPGP smartcard, and "%%" results in a
4510      single "%".  %k, %K, and %f are only meaningful when making a key
4511      signature (certification), and %c is only meaningful when using the
4512      OpenPGP smartcard.
4513
4514 '--sig-policy-url string'
4515 '--cert-policy-url string'
4516 '--set-policy-url string'
4517      Use 'string' as a Policy URL for signatures (rfc4880:5.2.3.20).  If
4518      you prefix it with an exclamation mark (!), the policy URL packet
4519      will be flagged as critical.  '--sig-policy-url' sets a policy url
4520      for data signatures.  '--cert-policy-url' sets a policy url for key
4521      signatures (certifications).  '--set-policy-url' sets both.
4522
4523      The same %-expandos used for notation data are available here as
4524      well.
4525
4526 '--sig-keyserver-url string'
4527      Use 'string' as a preferred keyserver URL for data signatures.  If
4528      you prefix it with an exclamation mark (!), the keyserver URL
4529      packet will be flagged as critical.
4530
4531      The same %-expandos used for notation data are available here as
4532      well.
4533
4534 '--set-filename string'
4535      Use 'string' as the filename which is stored inside messages.  This
4536      overrides the default, which is to use the actual filename of the
4537      file being encrypted.  Using the empty string for 'string'
4538      effectively removes the filename from the output.
4539
4540 '--for-your-eyes-only'
4541 '--no-for-your-eyes-only'
4542      Set the 'for your eyes only' flag in the message.  This causes
4543      GnuPG to refuse to save the file unless the '--output' option is
4544      given, and PGP to use a "secure viewer" with a claimed
4545      Tempest-resistant font to display the message.  This option
4546      overrides '--set-filename'.  '--no-for-your-eyes-only' disables
4547      this option.
4548
4549 '--use-embedded-filename'
4550 '--no-use-embedded-filename'
4551      Try to create a file with a name as embedded in the data.  This can
4552      be a dangerous option as it enables overwriting files.  Defaults to
4553      no.
4554
4555 '--cipher-algo name'
4556      Use 'name' as cipher algorithm.  Running the program with the
4557      command '--version' yields a list of supported algorithms.  If this
4558      is not used the cipher algorithm is selected from the preferences
4559      stored with the key.  In general, you do not want to use this
4560      option as it allows you to violate the OpenPGP standard.
4561      '--personal-cipher-preferences' is the safe way to accomplish the
4562      same thing.
4563
4564 '--digest-algo name'
4565      Use 'name' as the message digest algorithm.  Running the program
4566      with the command '--version' yields a list of supported algorithms.
4567      In general, you do not want to use this option as it allows you to
4568      violate the OpenPGP standard.  '--personal-digest-preferences' is
4569      the safe way to accomplish the same thing.
4570
4571 '--compress-algo name'
4572      Use compression algorithm 'name'.  "zlib" is RFC-1950 ZLIB
4573      compression.  "zip" is RFC-1951 ZIP compression which is used by
4574      PGP. "bzip2" is a more modern compression scheme that can compress
4575      some things better than zip or zlib, but at the cost of more memory
4576      used during compression and decompression.  "uncompressed" or
4577      "none" disables compression.  If this option is not used, the
4578      default behavior is to examine the recipient key preferences to see
4579      which algorithms the recipient supports.  If all else fails, ZIP is
4580      used for maximum compatibility.
4581
4582      ZLIB may give better compression results than ZIP, as the
4583      compression window size is not limited to 8k.  BZIP2 may give even
4584      better compression results than that, but will use a significantly
4585      larger amount of memory while compressing and decompressing.  This
4586      may be significant in low memory situations.  Note, however, that
4587      PGP (all versions) only supports ZIP compression.  Using any
4588      algorithm other than ZIP or "none" will make the message unreadable
4589      with PGP. In general, you do not want to use this option as it
4590      allows you to violate the OpenPGP standard.
4591      '--personal-compress-preferences' is the safe way to accomplish the
4592      same thing.
4593
4594 '--cert-digest-algo name'
4595      Use 'name' as the message digest algorithm used when signing a key.
4596      Running the program with the command '--version' yields a list of
4597      supported algorithms.  Be aware that if you choose an algorithm
4598      that GnuPG supports but other OpenPGP implementations do not, then
4599      some users will not be able to use the key signatures you make, or
4600      quite possibly your entire key.
4601
4602 '--disable-cipher-algo name'
4603      Never allow the use of 'name' as cipher algorithm.  The given name
4604      will not be checked so that a later loaded algorithm will still get
4605      disabled.
4606
4607 '--disable-pubkey-algo name'
4608      Never allow the use of 'name' as public key algorithm.  The given
4609      name will not be checked so that a later loaded algorithm will
4610      still get disabled.
4611
4612 '--throw-keyids'
4613 '--no-throw-keyids'
4614      Do not put the recipient key IDs into encrypted messages.  This
4615      helps to hide the receivers of the message and is a limited
4616      countermeasure against traffic analysis.(1)  On the receiving side,
4617      it may slow down the decryption process because all available
4618      secret keys must be tried.  '--no-throw-keyids' disables this
4619      option.  This option is essentially the same as using
4620      '--hidden-recipient' for all recipients.
4621
4622 '--not-dash-escaped'
4623      This option changes the behavior of cleartext signatures so that
4624      they can be used for patch files.  You should not send such an
4625      armored file via email because all spaces and line endings are
4626      hashed too.  You can not use this option for data which has 5
4627      dashes at the beginning of a line, patch files don't have this.  A
4628      special armor header line tells GnuPG about this cleartext
4629      signature option.
4630
4631 '--escape-from-lines'
4632 '--no-escape-from-lines'
4633      Because some mailers change lines starting with "From " to ">From "
4634      it is good to handle such lines in a special way when creating
4635      cleartext signatures to prevent the mail system from breaking the
4636      signature.  Note that all other PGP versions do it this way too.
4637      Enabled by default.  '--no-escape-from-lines' disables this option.
4638
4639 '--passphrase-repeat n'
4640      Specify how many times 'gpg' will request a new passphrase be
4641      repeated.  This is useful for helping memorize a passphrase.
4642      Defaults to 1 repetition.
4643
4644 '--passphrase-fd n'
4645      Read the passphrase from file descriptor 'n'.  Only the first line
4646      will be read from file descriptor 'n'.  If you use 0 for 'n', the
4647      passphrase will be read from STDIN. This can only be used if only
4648      one passphrase is supplied.
4649
4650      Note that this passphrase is only used if the option '--batch' has
4651      also been given.  This is different from GnuPG version 1.x.
4652
4653 '--passphrase-file file'
4654      Read the passphrase from file 'file'.  Only the first line will be
4655      read from file 'file'.  This can only be used if only one
4656      passphrase is supplied.  Obviously, a passphrase stored in a file
4657      is of questionable security if other users can read this file.
4658      Don't use this option if you can avoid it.  Note that this
4659      passphrase is only used if the option '--batch' has also been
4660      given.  This is different from GnuPG version 1.x.
4661
4662 '--passphrase string'
4663      Use 'string' as the passphrase.  This can only be used if only one
4664      passphrase is supplied.  Obviously, this is of very questionable
4665      security on a multi-user system.  Don't use this option if you can
4666      avoid it.  Note that this passphrase is only used if the option
4667      '--batch' has also been given.  This is different from GnuPG
4668      version 1.x.
4669
4670 '--pinentry-mode mode'
4671      Set the pinentry mode to 'mode'.  Allowed values for 'mode' are:
4672      default
4673           Use the default of the agent, which is 'ask'.
4674      ask
4675           Force the use of the Pinentry.
4676      cancel
4677           Emulate use of Pinentry's cancel button.
4678      error
4679           Return a Pinentry error ("No Pinentry").
4680      loopback
4681           Redirect Pinentry queries to the caller.  Note that in
4682           contrast to Pinentry the user is not prompted again if he
4683           enters a bad password.
4684
4685 '--command-fd n'
4686      This is a replacement for the deprecated shared-memory IPC mode.
4687      If this option is enabled, user input on questions is not expected
4688      from the TTY but from the given file descriptor.  It should be used
4689      together with '--status-fd'.  See the file doc/DETAILS in the
4690      source distribution for details on how to use it.
4691
4692 '--command-file file'
4693      Same as '--command-fd', except the commands are read out of file
4694      'file'
4695
4696 '--allow-non-selfsigned-uid'
4697 '--no-allow-non-selfsigned-uid'
4698      Allow the import and use of keys with user IDs which are not
4699      self-signed.  This is not recommended, as a non self-signed user ID
4700      is trivial to forge.  '--no-allow-non-selfsigned-uid' disables.
4701
4702 '--allow-freeform-uid'
4703      Disable all checks on the form of the user ID while generating a
4704      new one.  This option should only be used in very special
4705      environments as it does not ensure the de-facto standard format of
4706      user IDs.
4707
4708 '--ignore-time-conflict'
4709      GnuPG normally checks that the timestamps associated with keys and
4710      signatures have plausible values.  However, sometimes a signature
4711      seems to be older than the key due to clock problems.  This option
4712      makes these checks just a warning.  See also '--ignore-valid-from'
4713      for timestamp issues on subkeys.
4714
4715 '--ignore-valid-from'
4716      GnuPG normally does not select and use subkeys created in the
4717      future.  This option allows the use of such keys and thus exhibits
4718      the pre-1.0.7 behaviour.  You should not use this option unless
4719      there is some clock problem.  See also '--ignore-time-conflict' for
4720      timestamp issues with signatures.
4721
4722 '--ignore-crc-error'
4723      The ASCII armor used by OpenPGP is protected by a CRC checksum
4724      against transmission errors.  Occasionally the CRC gets mangled
4725      somewhere on the transmission channel but the actual content (which
4726      is protected by the OpenPGP protocol anyway) is still okay.  This
4727      option allows GnuPG to ignore CRC errors.
4728
4729 '--ignore-mdc-error'
4730      This option changes a MDC integrity protection failure into a
4731      warning.  This can be useful if a message is partially corrupt, but
4732      it is necessary to get as much data as possible out of the corrupt
4733      message.  However, be aware that a MDC protection failure may also
4734      mean that the message was tampered with intentionally by an
4735      attacker.
4736
4737 '--allow-weak-digest-algos'
4738      Signatures made with known-weak digest algorithms are normally
4739      rejected with an "invalid digest algorithm" message.  This option
4740      allows the verification of signatures made with such weak
4741      algorithms.  MD5 is the only digest algorithm considered weak by
4742      default.  See also '--weak-digest' to reject other digest
4743      algorithms.
4744
4745 '--weak-digest name'
4746      Treat the specified digest algorithm as weak.  Signatures made over
4747      weak digests algorithms are normally rejected.  This option can be
4748      supplied multiple times if multiple algorithms should be considered
4749      weak.  See also '--allow-weak-digest-algos' to disable rejection of
4750      weak digests.  MD5 is always considered weak, and does not need to
4751      be listed explicitly.
4752
4753 '--no-default-keyring'
4754      Do not add the default keyrings to the list of keyrings.  Note that
4755      GnuPG will not operate without any keyrings, so if you use this
4756      option and do not provide alternate keyrings via '--keyring' or
4757      '--secret-keyring', then GnuPG will still use the default public or
4758      secret keyrings.
4759
4760 '--no-keyring'
4761      Do not add use any keyrings even if specified as options.
4762
4763 '--skip-verify'
4764      Skip the signature verification step.  This may be used to make the
4765      decryption faster if the signature verification is not needed.
4766
4767 '--with-key-data'
4768      Print key listings delimited by colons (like '--with-colons') and
4769      print the public key data.
4770
4771 '--fast-list-mode'
4772      Changes the output of the list commands to work faster; this is
4773      achieved by leaving some parts empty.  Some applications don't need
4774      the user ID and the trust information given in the listings.  By
4775      using this options they can get a faster listing.  The exact
4776      behaviour of this option may change in future versions.  If you are
4777      missing some information, don't use this option.
4778
4779 '--no-literal'
4780      This is not for normal use.  Use the source to see for what it
4781      might be useful.
4782
4783 '--set-filesize'
4784      This is not for normal use.  Use the source to see for what it
4785      might be useful.
4786
4787 '--show-session-key'
4788      Display the session key used for one message.  See
4789      '--override-session-key' for the counterpart of this option.
4790
4791      We think that Key Escrow is a Bad Thing; however the user should
4792      have the freedom to decide whether to go to prison or to reveal the
4793      content of one specific message without compromising all messages
4794      ever encrypted for one secret key.
4795
4796      You can also use this option if you receive an encrypted message
4797      which is abusive or offensive, to prove to the administrators of
4798      the messaging system that the ciphertext transmitted corresponds to
4799      an inappropriate plaintext so they can take action against the
4800      offending user.
4801
4802 '--override-session-key string'
4803 '--override-session-key-fd fd'
4804      Don't use the public key but the session key 'string' respective
4805      the session key taken from the first line read from file descriptor
4806      'fd'.  The format of this string is the same as the one printed by
4807      '--show-session-key'.  This option is normally not used but comes
4808      handy in case someone forces you to reveal the content of an
4809      encrypted message; using this option you can do this without
4810      handing out the secret key.  Note that using
4811      '--override-session-key' may reveal the session key to all local
4812      users via the global process table.
4813
4814 '--ask-sig-expire'
4815 '--no-ask-sig-expire'
4816      When making a data signature, prompt for an expiration time.  If
4817      this option is not specified, the expiration time set via
4818      '--default-sig-expire' is used.  '--no-ask-sig-expire' disables
4819      this option.
4820
4821 '--default-sig-expire'
4822      The default expiration time to use for signature expiration.  Valid
4823      values are "0" for no expiration, a number followed by the letter d
4824      (for days), w (for weeks), m (for months), or y (for years) (for
4825      example "2m" for two months, or "5y" for five years), or an
4826      absolute date in the form YYYY-MM-DD. Defaults to "0".
4827
4828 '--ask-cert-expire'
4829 '--no-ask-cert-expire'
4830      When making a key signature, prompt for an expiration time.  If
4831      this option is not specified, the expiration time set via
4832      '--default-cert-expire' is used.  '--no-ask-cert-expire' disables
4833      this option.
4834
4835 '--default-cert-expire'
4836      The default expiration time to use for key signature expiration.
4837      Valid values are "0" for no expiration, a number followed by the
4838      letter d (for days), w (for weeks), m (for months), or y (for
4839      years) (for example "2m" for two months, or "5y" for five years),
4840      or an absolute date in the form YYYY-MM-DD. Defaults to "0".
4841
4842 '--default-new-key-algo STRING'
4843      This option can be used to change the default algorithms for key
4844      generation.  Note that the advanced key generation commands can
4845      always be used to specify a key algorithm directly.  Please consult
4846      the source code to learn the syntax of STRING.
4847
4848 '--allow-secret-key-import'
4849      This is an obsolete option and is not used anywhere.
4850
4851 '--allow-multiple-messages'
4852 '--no-allow-multiple-messages'
4853      Allow processing of multiple OpenPGP messages contained in a single
4854      file or stream.  Some programs that call GPG are not prepared to
4855      deal with multiple messages being processed together, so this
4856      option defaults to no.  Note that versions of GPG prior to 1.4.7
4857      always allowed multiple messages.
4858
4859      Warning: Do not use this option unless you need it as a temporary
4860      workaround!
4861
4862 '--enable-special-filenames'
4863      This option enables a mode in which filenames of the form '-&n',
4864      where n is a non-negative decimal number, refer to the file
4865      descriptor n and not to a file with that name.
4866
4867 '--no-expensive-trust-checks'
4868      Experimental use only.
4869
4870 '--preserve-permissions'
4871      Don't change the permissions of a secret keyring back to user
4872      read/write only.  Use this option only if you really know what you
4873      are doing.
4874
4875 '--default-preference-list string'
4876      Set the list of default preferences to 'string'.  This preference
4877      list is used for new keys and becomes the default for "setpref" in
4878      the edit menu.
4879
4880 '--default-keyserver-url name'
4881      Set the default keyserver URL to 'name'.  This keyserver will be
4882      used as the keyserver URL when writing a new self-signature on a
4883      key, which includes key generation and changing preferences.
4884
4885 '--list-config'
4886      Display various internal configuration parameters of GnuPG. This
4887      option is intended for external programs that call GnuPG to perform
4888      tasks, and is thus not generally useful.  See the file
4889      'doc/DETAILS' in the source distribution for the details of which
4890      configuration items may be listed.  '--list-config' is only usable
4891      with '--with-colons' set.
4892
4893 '--list-gcrypt-config'
4894      Display various internal configuration parameters of Libgcrypt.
4895
4896 '--gpgconf-list'
4897      This command is similar to '--list-config' but in general only
4898      internally used by the 'gpgconf' tool.
4899
4900 '--gpgconf-test'
4901      This is more or less dummy action.  However it parses the
4902      configuration file and returns with failure if the configuration
4903      file would prevent 'gpg' from startup.  Thus it may be used to run
4904      a syntax check on the configuration file.
4905
4906    ---------- Footnotes ----------
4907
4908    (1) Using a little social engineering anyone who is able to decrypt
4909 the message can check whether one of the other recipients is the one he
4910 suspects.
4911
4912 \1f
4913 File: gnupg.info,  Node: Deprecated Options,  Prev: GPG Esoteric Options,  Up: GPG Options
4914
4915 4.2.7 Deprecated options
4916 ------------------------
4917
4918 '--show-photos'
4919 '--no-show-photos'
4920      Causes '--list-keys', '--list-signatures', '--list-public-keys',
4921      '--list-secret-keys', and verifying a signature to also display the
4922      photo ID attached to the key, if any.  See also '--photo-viewer'.
4923      These options are deprecated.  Use '--list-options
4924      [no-]show-photos' and/or '--verify-options [no-]show-photos'
4925      instead.
4926
4927 '--show-keyring'
4928      Display the keyring name at the head of key listings to show which
4929      keyring a given key resides on.  This option is deprecated: use
4930      '--list-options [no-]show-keyring' instead.
4931
4932 '--always-trust'
4933      Identical to '--trust-model always'.  This option is deprecated.
4934
4935 '--show-notation'
4936 '--no-show-notation'
4937      Show signature notations in the '--list-signatures' or
4938      '--check-signatures' listings as well as when verifying a signature
4939      with a notation in it.  These options are deprecated.  Use
4940      '--list-options [no-]show-notation' and/or '--verify-options
4941      [no-]show-notation' instead.
4942
4943 '--show-policy-url'
4944 '--no-show-policy-url'
4945      Show policy URLs in the '--list-signatures' or '--check-signatures'
4946      listings as well as when verifying a signature with a policy URL in
4947      it.  These options are deprecated.  Use '--list-options
4948      [no-]show-policy-url' and/or '--verify-options
4949      [no-]show-policy-url' instead.
4950
4951 \1f
4952 File: gnupg.info,  Node: GPG Configuration,  Next: GPG Examples,  Prev: GPG Options,  Up: Invoking GPG
4953
4954 4.3 Configuration files
4955 =======================
4956
4957 There are a few configuration files to control certain aspects of
4958 'gpg''s operation.  Unless noted, they are expected in the current home
4959 directory (*note option --homedir::).
4960
4961 'gpg.conf'
4962      This is the standard configuration file read by 'gpg' on startup.
4963      It may contain any valid long option; the leading two dashes may
4964      not be entered and the option may not be abbreviated.  This default
4965      name may be changed on the command line (*note gpg-option
4966      --options::).  You should backup this file.
4967
4968    Note that on larger installations, it is useful to put predefined
4969 files into the directory '/etc/skel/.gnupg' so that newly created users
4970 start up with a working configuration.  For existing users a small
4971 helper script is provided to create these files (*note addgnupghome::).
4972
4973    For internal purposes 'gpg' creates and maintains a few other files;
4974 They all live in in the current home directory (*note option
4975 --homedir::).  Only the 'gpg' program may modify these files.
4976
4977 '~/.gnupg'
4978      This is the default home directory which is used if neither the
4979      environment variable 'GNUPGHOME' nor the option '--homedir' is
4980      given.
4981
4982 '~/.gnupg/pubring.gpg'
4983      The public keyring.  You should backup this file.
4984
4985 '~/.gnupg/pubring.gpg.lock'
4986      The lock file for the public keyring.
4987
4988 '~/.gnupg/pubring.kbx'
4989      The public keyring using a different format.  This file is shared
4990      with 'gpgsm'.  You should backup this file.
4991
4992 '~/.gnupg/pubring.kbx.lock'
4993      The lock file for 'pubring.kbx'.
4994
4995 '~/.gnupg/secring.gpg'
4996      A secret keyring as used by GnuPG versions before 2.1.  It is not
4997      used by GnuPG 2.1 and later.
4998
4999 '~/.gnupg/secring.gpg.lock'
5000      The lock file for the secret keyring.
5001
5002 '~/.gnupg/.gpg-v21-migrated'
5003      File indicating that a migration to GnuPG 2.1 has been done.
5004
5005 '~/.gnupg/trustdb.gpg'
5006      The trust database.  There is no need to backup this file; it is
5007      better to backup the ownertrust values (*note option
5008      --export-ownertrust::).
5009
5010 '~/.gnupg/trustdb.gpg.lock'
5011      The lock file for the trust database.
5012
5013 '~/.gnupg/random_seed'
5014      A file used to preserve the state of the internal random pool.
5015
5016 '~/.gnupg/openpgp-revocs.d/'
5017      This is the directory where gpg stores pre-generated revocation
5018      certificates.  The file name corresponds to the OpenPGP fingerprint
5019      of the respective key.  It is suggested to backup those
5020      certificates and if the primary private key is not stored on the
5021      disk to move them to an external storage device.  Anyone who can
5022      access theses files is able to revoke the corresponding key.  You
5023      may want to print them out.  You should backup all files in this
5024      directory and take care to keep this backup closed away.
5025
5026 '/usr/local/share/gnupg/options.skel'
5027      The skeleton options file.
5028
5029    Operation is further controlled by a few environment variables:
5030
5031 HOME
5032      Used to locate the default home directory.
5033
5034 GNUPGHOME
5035      If set directory used instead of "~/.gnupg".
5036
5037 GPG_AGENT_INFO
5038      This variable is obsolete; it was used by GnuPG versions before
5039      2.1.
5040
5041 PINENTRY_USER_DATA
5042      This value is passed via gpg-agent to pinentry.  It is useful to
5043      convey extra information to a custom pinentry.
5044
5045 COLUMNS
5046 LINES
5047      Used to size some displays to the full size of the screen.
5048
5049 LANGUAGE
5050      Apart from its use by GNU, it is used in the W32 version to
5051      override the language selection done through the Registry.  If used
5052      and set to a valid and available language name (LANGID), the file
5053      with the translation is loaded from 'GPGDIR/gnupg.nls/LANGID.mo'.
5054      Here GPGDIR is the directory out of which the gpg binary has been
5055      loaded.  If it can't be loaded the Registry is tried and as last
5056      resort the native Windows locale system is used.
5057
5058 \1f
5059 File: gnupg.info,  Node: GPG Examples,  Next: Unattended Usage of GPG,  Prev: GPG Configuration,  Up: Invoking GPG
5060
5061 4.4 Examples
5062 ============
5063
5064 gpg -se -r 'Bob' 'file'
5065      sign and encrypt for user Bob
5066
5067 gpg -clear-sign 'file'
5068      make a cleartext signature
5069
5070 gpg -sb 'file'
5071      make a detached signature
5072
5073 gpg -u 0x12345678 -sb 'file'
5074      make a detached signature with the key 0x12345678
5075
5076 gpg -list-keys 'user_ID'
5077      show keys
5078
5079 gpg -fingerprint 'user_ID'
5080      show fingerprint
5081
5082 gpg -verify 'pgpfile'
5083 gpg -verify 'sigfile' ['datafile']
5084      Verify the signature of the file but do not output the data unless
5085      requested.  The second form is used for detached signatures, where
5086      'sigfile' is the detached signature (either ASCII armored or
5087      binary) and 'datafile' are the signed data; if this is not given,
5088      the name of the file holding the signed data is constructed by
5089      cutting off the extension (".asc" or ".sig") of 'sigfile' or by
5090      asking the user for the filename.  If the option '--output' is also
5091      used the signed data is written to the file specified by that
5092      option; use '-' to write the signed data to stdout.
5093
5094 FILTER EXPRESSIONS
5095 ******************
5096
5097 The options '--import-filter' and '--export-filter' use expressions with
5098 this syntax (square brackets indicate an optional part and curly braces
5099 a repetition, white space between the elements are allowed):
5100
5101        [lc] {[{flag}] PROPNAME op VALUE [lc]}
5102
5103    The name of a property (PROPNAME) may only consist of letters, digits
5104 and underscores.  The description for the filter type describes which
5105 properties are defined.  If an undefined property is used it evaluates
5106 to the empty string.  Unless otherwise noted, the VALUE must always be
5107 given and may not be the empty string.  No quoting is defined for the
5108 value, thus the value may not contain the strings '&&' or '||', which
5109 are used as logical connection operators.  The flag '--' can be used to
5110 remove this restriction.
5111
5112    Numerical values are computed as long int; standard C notation
5113 applies.  LC is the logical connection operator; either '&&' for a
5114 conjunction or '||' for a disjunction.  A conjunction is assumed at the
5115 begin of an expression.  Conjunctions have higher precedence than
5116 disjunctions.  If VALUE starts with one of the characters used in any OP
5117 a space after the OP is required.
5118
5119 The supported operators (OP) are:
5120
5121 =~
5122      Substring must match.
5123
5124 !~
5125      Substring must not match.
5126
5127 =
5128      The full string must match.
5129
5130 <>
5131      The full string must not match.
5132
5133 ==
5134      The numerical value must match.
5135
5136 !=
5137      The numerical value must not match.
5138
5139 <=
5140      The numerical value of the field must be LE than the value.
5141
5142 <
5143      The numerical value of the field must be LT than the value.
5144
5145 >
5146      The numerical value of the field must be GT than the value.
5147
5148 >=
5149      The numerical value of the field must be GE than the value.
5150
5151 -le
5152      The string value of the field must be less or equal than the value.
5153
5154 -lt
5155      The string value of the field must be less than the value.
5156
5157 -gt
5158      The string value of the field must be greater than the value.
5159
5160 -ge
5161      The string value of the field must be greater or equal than the
5162      value.
5163
5164 -n
5165      True if value is not empty (no value allowed).
5166
5167 -z
5168      True if value is empty (no value allowed).
5169
5170 -t
5171      Alias for "PROPNAME != 0" (no value allowed).
5172
5173 -f
5174      Alias for "PROPNAME == 0" (no value allowed).
5175
5176 Values for FLAG must be space separated.  The supported flags are:
5177
5178 -
5179      VALUE spans to the end of the expression.
5180 -c
5181      The string match in this part is done case-sensitive.
5182
5183    The filter options concatenate several specifications for a filter of
5184 the same type.  For example the four options in this example:
5185
5186       --import-option keep-uid="uid =~ Alfa"
5187       --import-option keep-uid="&& uid !~ Test"
5188       --import-option keep-uid="|| uid =~ Alpha"
5189       --import-option keep-uid="uid !~ Test"
5190
5191 which is equivalent to
5192
5193       --import-option \
5194        keep-uid="uid =~ Alfa" && uid !~ Test" || uid =~ Alpha" && "uid !~ Test"
5195
5196    imports only the user ids of a key containing the strings "Alfa" or
5197 "Alpha" but not the string "test".
5198
5199 RETURN VALUE
5200 ************
5201
5202 The program returns 0 if everything was fine, 1 if at least a signature
5203 was bad, and other error codes for fatal errors.
5204
5205 WARNINGS
5206 ********
5207
5208 Use a *good* password for your user account and a *good* passphrase to
5209 protect your secret key.  This passphrase is the weakest part of the
5210 whole system.  Programs to do dictionary attacks on your secret keyring
5211 are very easy to write and so you should protect your "~/.gnupg/"
5212 directory very well.
5213
5214    Keep in mind that, if this program is used over a network (telnet),
5215 it is *very* easy to spy out your passphrase!
5216
5217    If you are going to verify detached signatures, make sure that the
5218 program knows about it; either give both filenames on the command line
5219 or use '-' to specify STDIN.
5220
5221 INTEROPERABILITY WITH OTHER OPENPGP PROGRAMS
5222 ********************************************
5223
5224 GnuPG tries to be a very flexible implementation of the OpenPGP
5225 standard.  In particular, GnuPG implements many of the optional parts of
5226 the standard, such as the SHA-512 hash, and the ZLIB and BZIP2
5227 compression algorithms.  It is important to be aware that not all
5228 OpenPGP programs implement these optional algorithms and that by forcing
5229 their use via the '--cipher-algo', '--digest-algo',
5230 '--cert-digest-algo', or '--compress-algo' options in GnuPG, it is
5231 possible to create a perfectly valid OpenPGP message, but one that
5232 cannot be read by the intended recipient.
5233
5234    There are dozens of variations of OpenPGP programs available, and
5235 each supports a slightly different subset of these optional algorithms.
5236 For example, until recently, no (unhacked) version of PGP supported the
5237 BLOWFISH cipher algorithm.  A message using BLOWFISH simply could not be
5238 read by a PGP user.  By default, GnuPG uses the standard OpenPGP
5239 preferences system that will always do the right thing and create
5240 messages that are usable by all recipients, regardless of which OpenPGP
5241 program they use.  Only override this safe default if you really know
5242 what you are doing.
5243
5244    If you absolutely must override the safe default, or if the
5245 preferences on a given key are invalid for some reason, you are far
5246 better off using the '--pgp6', '--pgp7', or '--pgp8' options.  These
5247 options are safe as they do not force any particular algorithms in
5248 violation of OpenPGP, but rather reduce the available algorithms to a
5249 "PGP-safe" list.
5250
5251 BUGS
5252 ****
5253
5254 On older systems this program should be installed as setuid(root).  This
5255 is necessary to lock memory pages.  Locking memory pages prevents the
5256 operating system from writing memory pages (which may contain
5257 passphrases or other sensitive material) to disk.  If you get no warning
5258 message about insecure memory your operating system supports locking
5259 without being root.  The program drops root privileges as soon as locked
5260 memory is allocated.
5261
5262    Note also that some systems (especially laptops) have the ability to
5263 "suspend to disk" (also known as "safe sleep" or "hibernate").  This
5264 writes all memory to disk before going into a low power or even powered
5265 off mode.  Unless measures are taken in the operating system to protect
5266 the saved memory, passphrases or other sensitive material may be
5267 recoverable from it later.
5268
5269    Before you report a bug you should first search the mailing list
5270 archives for similar problems and second check whether such a bug has
5271 already been reported to our bug tracker at http://bugs.gnupg.org .
5272
5273 \1f
5274 File: gnupg.info,  Node: Unattended Usage of GPG,  Prev: GPG Examples,  Up: Invoking GPG
5275
5276 4.5 Unattended Usage
5277 ====================
5278
5279 'gpg' is often used as a backend engine by other software.  To help with
5280 this a machine interface has been defined to have an unambiguous way to
5281 do this.  The options '--status-fd' and '--batch' are almost always
5282 required for this.
5283
5284 * Menu:
5285
5286 * Programmatic use of GnuPG:: Programmatic use of GnuPG
5287 * Ephemeral home directories:: Ephemeral home directories
5288 * The quick key manipulation interface:: The quick key manipulation interface
5289 * Unattended GPG key generation::  Unattended key generation
5290
5291 \1f
5292 File: gnupg.info,  Node: Programmatic use of GnuPG,  Next: Ephemeral home directories,  Up: Unattended Usage of GPG
5293
5294 4.5.1 Programmatic use of GnuPG
5295 -------------------------------
5296
5297 Please consider using GPGME instead of calling 'gpg' directly.  GPGME
5298 offers a stable, backend-independent interface for many cryptographic
5299 operations.  It supports OpenPGP and S/MIME, and also allows interaction
5300 with various GnuPG components.
5301
5302    GPGME provides a C-API, and comes with bindings for C++, Qt, and
5303 Python.  Bindings for other languages are available.
5304
5305 \1f
5306 File: gnupg.info,  Node: Ephemeral home directories,  Next: The quick key manipulation interface,  Prev: Programmatic use of GnuPG,  Up: Unattended Usage of GPG
5307
5308 4.5.2 Ephemeral home directories
5309 --------------------------------
5310
5311 Sometimes you want to contain effects of some operation, for example you
5312 want to import a key to inspect it, but you do not want this key to be
5313 added to your keyring.  In earlier versions of GnuPG, it was possible to
5314 specify alternate keyring files for both public and secret keys.  In
5315 modern GnuPG versions, however, we changed how secret keys are stored in
5316 order to better protect secret key material, and it was not possible to
5317 preserve this interface.
5318
5319    The preferred way to do this is to use ephemeral home directories.
5320 This technique works across all versions of GnuPG.
5321
5322    Create a temporary directory, create (or copy) a configuration that
5323 meets your needs, make 'gpg' use this directory either using the
5324 environment variable GNUPGHOME, or the option '--homedir'.  GPGME
5325 supports this too on a per-context basis, by modifying the engine info
5326 of contexts.  Now execute whatever operation you like, import and export
5327 key material as necessary.  Once finished, you can delete the directory.
5328 All GnuPG backend services that were started will detect this and shut
5329 down.
5330
5331 \1f
5332 File: gnupg.info,  Node: The quick key manipulation interface,  Next: Unattended GPG key generation,  Prev: Ephemeral home directories,  Up: Unattended Usage of GPG
5333
5334 4.5.3 The quick key manipulation interface
5335 ------------------------------------------
5336
5337 Recent versions of GnuPG have an interface to manipulate keys without
5338 using the interactive command '--edit-key'.  This interface was added
5339 mainly for the benefit of GPGME (please consider using GPGME, see the
5340 manual subsection "Programmatic use of GnuPG"). This interface is
5341 described in the subsection "How to manage your keys".
5342
5343 \1f
5344 File: gnupg.info,  Node: Unattended GPG key generation,  Prev: The quick key manipulation interface,  Up: Unattended Usage of GPG
5345
5346 4.5.4 Unattended key generation
5347 -------------------------------
5348
5349 The command '--generate-key' may be used along with the option '--batch'
5350 for unattended key generation.  This is the most flexible way of
5351 generating keys, but it is also the most complex one.  Consider using
5352 the quick key manipulation interface described in the previous
5353 subsection "The quick key manipulation interface".
5354
5355    The parameters for the key are either read from stdin or given as a
5356 file on the command line.  The format of the parameter file is as
5357 follows:
5358
5359    * Text only, line length is limited to about 1000 characters.
5360    * UTF-8 encoding must be used to specify non-ASCII characters.
5361    * Empty lines are ignored.
5362    * Leading and trailing while space is ignored.
5363    * A hash sign as the first non white space character indicates a
5364      comment line.
5365    * Control statements are indicated by a leading percent sign, the
5366      arguments are separated by white space from the keyword.
5367    * Parameters are specified by a keyword, followed by a colon.
5368      Arguments are separated by white space.
5369    * The first parameter must be 'Key-Type'; control statements may be
5370      placed anywhere.
5371    * The order of the parameters does not matter except for 'Key-Type'
5372      which must be the first parameter.  The parameters are only used
5373      for the generated keyblock (primary and subkeys); parameters from
5374      previous sets are not used.  Some syntactically checks may be
5375      performed.
5376    * Key generation takes place when either the end of the parameter
5377      file is reached, the next 'Key-Type' parameter is encountered or at
5378      the control statement '%commit' is encountered.
5379
5380 Control statements:
5381
5382 %echo TEXT
5383      Print TEXT as diagnostic.
5384
5385 %dry-run
5386      Suppress actual key generation (useful for syntax checking).
5387
5388 %commit
5389      Perform the key generation.  Note that an implicit commit is done
5390      at the next Key-Type parameter.
5391
5392 %pubring FILENAME
5393      Do not write the key to the default or commandline given keyring
5394      but to FILENAME.  This must be given before the first commit to
5395      take place, duplicate specification of the same filename is
5396      ignored, the last filename before a commit is used.  The filename
5397      is used until a new filename is used (at commit points) and all
5398      keys are written to that file.  If a new filename is given, this
5399      file is created (and overwrites an existing one).
5400
5401      See the previous subsection "Ephemeral home directories" for a more
5402      robust way to contain side-effects.
5403
5404 %secring FILENAME
5405      This option is a no-op for GnuPG 2.1 and later.
5406
5407      See the previous subsection "Ephemeral home directories".
5408
5409 %ask-passphrase
5410 %no-ask-passphrase
5411      This option is a no-op for GnuPG 2.1 and later.
5412
5413 %no-protection
5414      Using this option allows the creation of keys without any
5415      passphrase protection.  This option is mainly intended for
5416      regression tests.
5417
5418 %transient-key
5419      If given the keys are created using a faster and a somewhat less
5420      secure random number generator.  This option may be used for keys
5421      which are only used for a short time and do not require full
5422      cryptographic strength.  It takes only effect if used together with
5423      the control statement '%no-protection'.
5424
5425 General Parameters:
5426
5427 Key-Type: ALGO
5428      Starts a new parameter block by giving the type of the primary key.
5429      The algorithm must be capable of signing.  This is a required
5430      parameter.  ALGO may either be an OpenPGP algorithm number or a
5431      string with the algorithm name.  The special value 'default' may be
5432      used for ALGO to create the default key type; in this case a
5433      'Key-Usage' shall not be given and 'default' also be used for
5434      'Subkey-Type'.
5435
5436 Key-Length: NBITS
5437      The requested length of the generated key in bits.  The default is
5438      returned by running the command 'gpg --gpgconf-list'.
5439
5440 Key-Grip: HEXSTRING
5441      This is optional and used to generate a CSR or certificate for an
5442      already existing key.  Key-Length will be ignored when given.
5443
5444 Key-Usage: USAGE-LIST
5445      Space or comma delimited list of key usages.  Allowed values are
5446      'encrypt', 'sign', and 'auth'.  This is used to generate the key
5447      flags.  Please make sure that the algorithm is capable of this
5448      usage.  Note that OpenPGP requires that all primary keys are
5449      capable of certification, so no matter what usage is given here,
5450      the 'cert' flag will be on.  If no 'Key-Usage' is specified and the
5451      'Key-Type' is not 'default', all allowed usages for that particular
5452      algorithm are used; if it is not given but 'default' is used the
5453      usage will be 'sign'.
5454
5455 Subkey-Type: ALGO
5456      This generates a secondary key (subkey).  Currently only one subkey
5457      can be handled.  See also 'Key-Type' above.
5458
5459 Subkey-Length: NBITS
5460      Length of the secondary key (subkey) in bits.  The default is
5461      returned by running the command 'gpg --gpgconf-list'.
5462
5463 Subkey-Usage: USAGE-LIST
5464      Key usage lists for a subkey; similar to 'Key-Usage'.
5465
5466 Passphrase: STRING
5467      If you want to specify a passphrase for the secret key, enter it
5468      here.  Default is to use the Pinentry dialog to ask for a
5469      passphrase.
5470
5471 Name-Real: NAME
5472 Name-Comment: COMMENT
5473 Name-Email: EMAIL
5474      The three parts of a user name.  Remember to use UTF-8 encoding
5475      here.  If you don't give any of them, no user ID is created.
5476
5477 Expire-Date: ISO-DATE|(NUMBER[d|w|m|y])
5478      Set the expiration date for the key (and the subkey).  It may
5479      either be entered in ISO date format (e.g.  "20000815T145012") or
5480      as number of days, weeks, month or years after the creation date.
5481      The special notation "seconds=N" is also allowed to specify a
5482      number of seconds since creation.  Without a letter days are
5483      assumed.  Note that there is no check done on the overflow of the
5484      type used by OpenPGP for timestamps.  Thus you better make sure
5485      that the given value make sense.  Although OpenPGP works with time
5486      intervals, GnuPG uses an absolute value internally and thus the
5487      last year we can represent is 2105.
5488
5489 Creation-Date: ISO-DATE
5490      Set the creation date of the key as stored in the key information
5491      and which is also part of the fingerprint calculation.  Either a
5492      date like "1986-04-26" or a full timestamp like "19860426T042640"
5493      may be used.  The time is considered to be UTC. The special
5494      notation "seconds=N" may be used to directly specify a the number
5495      of seconds since Epoch (Unix time).  If it is not given the current
5496      time is used.
5497
5498 Preferences: STRING
5499      Set the cipher, hash, and compression preference values for this
5500      key.  This expects the same type of string as the sub-command
5501      'setpref' in the '--edit-key' menu.
5502
5503 Revoker: ALGO:FPR [sensitive]
5504      Add a designated revoker to the generated key.  Algo is the public
5505      key algorithm of the designated revoker (i.e.  RSA=1, DSA=17, etc.)
5506      FPR is the fingerprint of the designated revoker.  The optional
5507      'sensitive' flag marks the designated revoker as sensitive
5508      information.  Only v4 keys may be designated revokers.
5509
5510 Keyserver: STRING
5511      This is an optional parameter that specifies the preferred
5512      keyserver URL for the key.
5513
5514 Handle: STRING
5515      This is an optional parameter only used with the status lines
5516      KEY_CREATED and KEY_NOT_CREATED. STRING may be up to 100 characters
5517      and should not contain spaces.  It is useful for batch key
5518      generation to associate a key parameter block with a status line.
5519
5520 Here is an example on how to create a key in an ephemeral home
5521 directory:
5522      $ export GNUPGHOME="$(mktemp -d)"
5523      $ cat >foo <<EOF
5524           %echo Generating a basic OpenPGP key
5525           Key-Type: DSA
5526           Key-Length: 1024
5527           Subkey-Type: ELG-E
5528           Subkey-Length: 1024
5529           Name-Real: Joe Tester
5530           Name-Comment: with stupid passphrase
5531           Name-Email: joe@foo.bar
5532           Expire-Date: 0
5533           Passphrase: abc
5534           # Do a commit here, so that we can later print "done" :-)
5535           %commit
5536           %echo done
5537      EOF
5538      $ gpg --batch --generate-key foo
5539       [...]
5540      $ gpg --list-secret-keys
5541      /tmp/tmp.0NQxB74PEf/pubring.kbx
5542      -------------------------------
5543      sec   dsa1024 2016-12-16 [SCA]
5544            768E895903FC1C44045C8CB95EEBDB71E9E849D0
5545      uid           [ultimate] Joe Tester (with stupid passphrase) <joe@foo.bar>
5546      ssb   elg1024 2016-12-16 [E]
5547
5548 If you want to create a key with the default algorithms you would use
5549 these parameters:
5550           %echo Generating a default key
5551           Key-Type: default
5552           Subkey-Type: default
5553           Name-Real: Joe Tester
5554           Name-Comment: with stupid passphrase
5555           Name-Email: joe@foo.bar
5556           Expire-Date: 0
5557           Passphrase: abc
5558           # Do a commit here, so that we can later print "done" :-)
5559           %commit
5560           %echo done
5561
5562 \1f
5563 File: gnupg.info,  Node: Invoking GPGSM,  Next: Invoking SCDAEMON,  Prev: Invoking GPG,  Up: Top
5564
5565 5 Invoking GPGSM
5566 ****************
5567
5568 'gpgsm' is a tool similar to 'gpg' to provide digital encryption and
5569 signing services on X.509 certificates and the CMS protocol.  It is
5570 mainly used as a backend for S/MIME mail processing.  'gpgsm' includes a
5571 full featured certificate management and complies with all rules defined
5572 for the German Sphinx project.
5573
5574    *Note Option Index::, for an index to 'GPGSM''s commands and options.
5575
5576 * Menu:
5577
5578 * GPGSM Commands::        List of all commands.
5579 * GPGSM Options::         List of all options.
5580 * GPGSM Configuration::   Configuration files.
5581 * GPGSM Examples::        Some usage examples.
5582
5583 Developer information:
5584 * Unattended Usage::      Using 'gpgsm' from other programs.
5585 * GPGSM Protocol::        The protocol the server mode uses.
5586
5587 \1f
5588 File: gnupg.info,  Node: GPGSM Commands,  Next: GPGSM Options,  Up: Invoking GPGSM
5589
5590 5.1 Commands
5591 ============
5592
5593 Commands are not distinguished from options except for the fact that
5594 only one command is allowed.
5595
5596 * Menu:
5597
5598 * General GPGSM Commands::        Commands not specific to the functionality.
5599 * Operational GPGSM Commands::    Commands to select the type of operation.
5600 * Certificate Management::        How to manage certificates.
5601
5602 \1f
5603 File: gnupg.info,  Node: General GPGSM Commands,  Next: Operational GPGSM Commands,  Up: GPGSM Commands
5604
5605 5.1.1 Commands not specific to the function
5606 -------------------------------------------
5607
5608 '--version'
5609      Print the program version and licensing information.  Note that you
5610      cannot abbreviate this command.
5611
5612 '--help, -h'
5613      Print a usage message summarizing the most useful command-line
5614      options.  Note that you cannot abbreviate this command.
5615
5616 '--warranty'
5617      Print warranty information.  Note that you cannot abbreviate this
5618      command.
5619
5620 '--dump-options'
5621      Print a list of all available options and commands.  Note that you
5622      cannot abbreviate this command.
5623
5624 \1f
5625 File: gnupg.info,  Node: Operational GPGSM Commands,  Next: Certificate Management,  Prev: General GPGSM Commands,  Up: GPGSM Commands
5626
5627 5.1.2 Commands to select the type of operation
5628 ----------------------------------------------
5629
5630 '--encrypt'
5631      Perform an encryption.  The keys the data is encrypted to must be
5632      set using the option '--recipient'.
5633
5634 '--decrypt'
5635      Perform a decryption; the type of input is automatically
5636      determined.  It may either be in binary form or PEM encoded;
5637      automatic determination of base-64 encoding is not done.
5638
5639 '--sign'
5640      Create a digital signature.  The key used is either the fist one
5641      found in the keybox or those set with the '--local-user' option.
5642
5643 '--verify'
5644      Check a signature file for validity.  Depending on the arguments a
5645      detached signature may also be checked.
5646
5647 '--server'
5648      Run in server mode and wait for commands on the 'stdin'.
5649
5650 '--call-dirmngr COMMAND [ARGS]'
5651      Behave as a Dirmngr client issuing the request COMMAND with the
5652      optional list of ARGS.  The output of the Dirmngr is printed
5653      stdout.  Please note that file names given as arguments should have
5654      an absolute file name (i.e.  commencing with '/') because they are
5655      passed verbatim to the Dirmngr and the working directory of the
5656      Dirmngr might not be the same as the one of this client.  Currently
5657      it is not possible to pass data via stdin to the Dirmngr.  COMMAND
5658      should not contain spaces.
5659
5660      This is command is required for certain maintaining tasks of the
5661      dirmngr where a dirmngr must be able to call back to 'gpgsm'.  See
5662      the Dirmngr manual for details.
5663
5664 '--call-protect-tool ARGUMENTS'
5665      Certain maintenance operations are done by an external program call
5666      'gpg-protect-tool'; this is usually not installed in a directory
5667      listed in the PATH variable.  This command provides a simple
5668      wrapper to access this tool.  ARGUMENTS are passed verbatim to this
5669      command; use '--help' to get a list of supported operations.
5670
5671 \1f
5672 File: gnupg.info,  Node: Certificate Management,  Prev: Operational GPGSM Commands,  Up: GPGSM Commands
5673
5674 5.1.3 How to manage the certificates and keys
5675 ---------------------------------------------
5676
5677 '--generate-key'
5678 '--gen-key'
5679      This command allows the creation of a certificate signing request
5680      or a self-signed certificate.  It is commonly used along with the
5681      '--output' option to save the created CSR or certificate into a
5682      file.  If used with the '--batch' a parameter file is used to
5683      create the CSR or certificate and it is further possible to create
5684      non-self-signed certificates.
5685
5686 '--list-keys'
5687 '-k'
5688      List all available certificates stored in the local key database.
5689      Note that the displayed data might be reformatted for better human
5690      readability and illegal characters are replaced by safe
5691      substitutes.
5692
5693 '--list-secret-keys'
5694 '-K'
5695      List all available certificates for which a corresponding a secret
5696      key is available.
5697
5698 '--list-external-keys PATTERN'
5699      List certificates matching PATTERN using an external server.  This
5700      utilizes the 'dirmngr' service.
5701
5702 '--list-chain'
5703      Same as '--list-keys' but also prints all keys making up the chain.
5704
5705 '--dump-cert'
5706 '--dump-keys'
5707      List all available certificates stored in the local key database
5708      using a format useful mainly for debugging.
5709
5710 '--dump-chain'
5711      Same as '--dump-keys' but also prints all keys making up the chain.
5712
5713 '--dump-secret-keys'
5714      List all available certificates for which a corresponding a secret
5715      key is available using a format useful mainly for debugging.
5716
5717 '--dump-external-keys PATTERN'
5718      List certificates matching PATTERN using an external server.  This
5719      utilizes the 'dirmngr' service.  It uses a format useful mainly for
5720      debugging.
5721
5722 '--keydb-clear-some-cert-flags'
5723      This is a debugging aid to reset certain flags in the key database
5724      which are used to cache certain certificate stati.  It is
5725      especially useful if a bad CRL or a weird running OCSP responder
5726      did accidentally revoke certificate.  There is no security issue
5727      with this command because 'gpgsm' always make sure that the
5728      validity of a certificate is checked right before it is used.
5729
5730 '--delete-keys PATTERN'
5731      Delete the keys matching PATTERN.  Note that there is no command to
5732      delete the secret part of the key directly.  In case you need to do
5733      this, you should run the command 'gpgsm --dump-secret-keys KEYID'
5734      before you delete the key, copy the string of hex-digits in the
5735      "keygrip" line and delete the file consisting of these hex-digits
5736      and the suffix '.key' from the 'private-keys-v1.d' directory below
5737      our GnuPG home directory (usually '~/.gnupg').
5738
5739 '--export [PATTERN]'
5740      Export all certificates stored in the Keybox or those specified by
5741      the optional PATTERN.  Those pattern consist of a list of user ids
5742      (*note how-to-specify-a-user-id::).  When used along with the
5743      '--armor' option a few informational lines are prepended before
5744      each block.  There is one limitation: As there is no commonly
5745      agreed upon way to pack more than one certificate into an ASN.1
5746      structure, the binary export (i.e.  without using 'armor') works
5747      only for the export of one certificate.  Thus it is required to
5748      specify a PATTERN which yields exactly one certificate.  Ephemeral
5749      certificate are only exported if all PATTERN are given as
5750      fingerprints or keygrips.
5751
5752 '--export-secret-key-p12 KEY-ID'
5753      Export the private key and the certificate identified by KEY-ID in
5754      a PKCS#12 format.  When used with the '--armor' option a few
5755      informational lines are prepended to the output.  Note, that the
5756      PKCS#12 format is not very secure and this command is only provided
5757      if there is no other way to exchange the private key.  (*Note
5758      option --p12-charset::.)
5759
5760 '--export-secret-key-p8 KEY-ID'
5761 '--export-secret-key-raw KEY-ID'
5762      Export the private key of the certificate identified by KEY-ID with
5763      any encryption stripped.  The '...-raw' command exports in PKCS#1
5764      format; the '...-p8' command exports in PKCS#8 format.  When used
5765      with the '--armor' option a few informational lines are prepended
5766      to the output.  These commands are useful to prepare a key for use
5767      on a TLS server.
5768
5769 '--import [FILES]'
5770      Import the certificates from the PEM or binary encoded files as
5771      well as from signed-only messages.  This command may also be used
5772      to import a secret key from a PKCS#12 file.
5773
5774 '--learn-card'
5775      Read information about the private keys from the smartcard and
5776      import the certificates from there.  This command utilizes the
5777      'gpg-agent' and in turn the 'scdaemon'.
5778
5779 '--change-passphrase USER_ID'
5780 '--passwd USER_ID'
5781      Change the passphrase of the private key belonging to the
5782      certificate specified as USER_ID.  Note, that changing the
5783      passphrase/PIN of a smartcard is not yet supported.
5784
5785 \1f
5786 File: gnupg.info,  Node: GPGSM Options,  Next: GPGSM Configuration,  Prev: GPGSM Commands,  Up: Invoking GPGSM
5787
5788 5.2 Option Summary
5789 ==================
5790
5791 'GPGSM' features a bunch of options to control the exact behaviour and
5792 to change the default configuration.
5793
5794 * Menu:
5795
5796 * Configuration Options::   How to change the configuration.
5797 * Certificate Options::     Certificate related options.
5798 * Input and Output::        Input and Output.
5799 * CMS Options::             How to change how the CMS is created.
5800 * Esoteric Options::        Doing things one usually do not want to do.
5801
5802 \1f
5803 File: gnupg.info,  Node: Configuration Options,  Next: Certificate Options,  Up: GPGSM Options
5804
5805 5.2.1 How to change the configuration
5806 -------------------------------------
5807
5808 These options are used to change the configuration and are usually found
5809 in the option file.
5810
5811 '--options FILE'
5812      Reads configuration from FILE instead of from the default per-user
5813      configuration file.  The default configuration file is named
5814      'gpgsm.conf' and expected in the '.gnupg' directory directly below
5815      the home directory of the user.
5816
5817 '--homedir DIR'
5818      Set the name of the home directory to DIR.  If this option is not
5819      used, the home directory defaults to '~/.gnupg'.  It is only
5820      recognized when given on the command line.  It also overrides any
5821      home directory stated through the environment variable 'GNUPGHOME'
5822      or (on Windows systems) by means of the Registry entry
5823      HKCU\SOFTWARE\GNU\GNUPG:HOMEDIR.
5824
5825      On Windows systems it is possible to install GnuPG as a portable
5826      application.  In this case only this command line option is
5827      considered, all other ways to set a home directory are ignored.
5828
5829      To install GnuPG as a portable application under Windows, create an
5830      empty file named 'gpgconf.ctl' in the same directory as the tool
5831      'gpgconf.exe'.  The root of the installation is then that
5832      directory; or, if 'gpgconf.exe' has been installed directly below a
5833      directory named 'bin', its parent directory.  You also need to make
5834      sure that the following directories exist and are writable:
5835      'ROOT/home' for the GnuPG home and 'ROOT/usr/local/var/cache/gnupg'
5836      for internal cache files.
5837
5838 '-v'
5839 '--verbose'
5840      Outputs additional information while running.  You can increase the
5841      verbosity by giving several verbose commands to 'gpgsm', such as
5842      '-vv'.
5843
5844 '--policy-file FILENAME'
5845      Change the default name of the policy file to FILENAME.
5846
5847 '--agent-program FILE'
5848      Specify an agent program to be used for secret key operations.  The
5849      default value is determined by running the command 'gpgconf'.  Note
5850      that the pipe symbol ('|') is used for a regression test suite hack
5851      and may thus not be used in the file name.
5852
5853 '--dirmngr-program FILE'
5854      Specify a dirmngr program to be used for CRL checks.  The default
5855      value is '/usr/local/bin/dirmngr'.
5856
5857 '--prefer-system-dirmngr'
5858      If a system wide 'dirmngr' is running in daemon mode, first try to
5859      connect to this one.  Fallback to a pipe based server if this does
5860      not work.  Under Windows this option is ignored because the system
5861      dirmngr is always used.
5862
5863 '--disable-dirmngr'
5864      Entirely disable the use of the Dirmngr.
5865
5866 '--no-autostart'
5867      Do not start the gpg-agent or the dirmngr if it has not yet been
5868      started and its service is required.  This option is mostly useful
5869      on machines where the connection to gpg-agent has been redirected
5870      to another machines.  If dirmngr is required on the remote machine,
5871      it may be started manually using 'gpgconf --launch dirmngr'.
5872
5873 '--no-secmem-warning'
5874      Do not print a warning when the so called "secure memory" cannot be
5875      used.
5876
5877 '--log-file FILE'
5878      When running in server mode, append all logging output to FILE.
5879      Use 'socket://' to log to socket.
5880
5881 \1f
5882 File: gnupg.info,  Node: Certificate Options,  Next: Input and Output,  Prev: Configuration Options,  Up: GPGSM Options
5883
5884 5.2.2 Certificate related options
5885 ---------------------------------
5886
5887 '--enable-policy-checks'
5888 '--disable-policy-checks'
5889      By default policy checks are enabled.  These options may be used to
5890      change it.
5891
5892 '--enable-crl-checks'
5893 '--disable-crl-checks'
5894      By default the CRL checks are enabled and the DirMngr is used to
5895      check for revoked certificates.  The disable option is most useful
5896      with an off-line network connection to suppress this check.
5897
5898 '--enable-trusted-cert-crl-check'
5899 '--disable-trusted-cert-crl-check'
5900      By default the CRL for trusted root certificates are checked like
5901      for any other certificates.  This allows a CA to revoke its own
5902      certificates voluntary without the need of putting all ever issued
5903      certificates into a CRL. The disable option may be used to switch
5904      this extra check off.  Due to the caching done by the Dirmngr,
5905      there will not be any noticeable performance gain.  Note, that this
5906      also disables possible OCSP checks for trusted root certificates.
5907      A more specific way of disabling this check is by adding the
5908      "relax" keyword to the root CA line of the 'trustlist.txt'
5909
5910 '--force-crl-refresh'
5911      Tell the dirmngr to reload the CRL for each request.  For better
5912      performance, the dirmngr will actually optimize this by suppressing
5913      the loading for short time intervals (e.g.  30 minutes).  This
5914      option is useful to make sure that a fresh CRL is available for
5915      certificates hold in the keybox.  The suggested way of doing this
5916      is by using it along with the option '--with-validation' for a key
5917      listing command.  This option should not be used in a configuration
5918      file.
5919
5920 '--enable-ocsp'
5921 '--disable-ocsp'
5922      By default OCSP checks are disabled.  The enable option may be used
5923      to enable OCSP checks via Dirmngr.  If CRL checks are also enabled,
5924      CRLs will be used as a fallback if for some reason an OCSP request
5925      will not succeed.  Note, that you have to allow OCSP requests in
5926      Dirmngr's configuration too (option '--allow-ocsp') and configure
5927      Dirmngr properly.  If you do not do so you will get the error code
5928      'Not supported'.
5929
5930 '--auto-issuer-key-retrieve'
5931      If a required certificate is missing while validating the chain of
5932      certificates, try to load that certificate from an external
5933      location.  This usually means that Dirmngr is employed to search
5934      for the certificate.  Note that this option makes a "web bug" like
5935      behavior possible.  LDAP server operators can see which keys you
5936      request, so by sending you a message signed by a brand new key
5937      (which you naturally will not have on your local keybox), the
5938      operator can tell both your IP address and the time when you
5939      verified the signature.
5940
5941 '--validation-model NAME'
5942      This option changes the default validation model.  The only
5943      possible values are "shell" (which is the default), "chain" which
5944      forces the use of the chain model and "steed" for a new simplified
5945      model.  The chain model is also used if an option in the
5946      'trustlist.txt' or an attribute of the certificate requests it.
5947      However the standard model (shell) is in that case always tried
5948      first.
5949
5950 '--ignore-cert-extension OID'
5951      Add OID to the list of ignored certificate extensions.  The OID is
5952      expected to be in dotted decimal form, like '2.5.29.3'.  This
5953      option may be used more than once.  Critical flagged certificate
5954      extensions matching one of the OIDs in the list are treated as if
5955      they are actually handled and thus the certificate will not be
5956      rejected due to an unknown critical extension.  Use this option
5957      with care because extensions are usually flagged as critical for a
5958      reason.
5959
5960 \1f
5961 File: gnupg.info,  Node: Input and Output,  Next: CMS Options,  Prev: Certificate Options,  Up: GPGSM Options
5962
5963 5.2.3 Input and Output
5964 ----------------------
5965
5966 '--armor'
5967 '-a'
5968      Create PEM encoded output.  Default is binary output.
5969
5970 '--base64'
5971      Create Base-64 encoded output; i.e.  PEM without the header lines.
5972
5973 '--assume-armor'
5974      Assume the input data is PEM encoded.  Default is to autodetect the
5975      encoding but this is may fail.
5976
5977 '--assume-base64'
5978      Assume the input data is plain base-64 encoded.
5979
5980 '--assume-binary'
5981      Assume the input data is binary encoded.
5982
5983 '--p12-charset NAME'
5984      'gpgsm' uses the UTF-8 encoding when encoding passphrases for
5985      PKCS#12 files.  This option may be used to force the passphrase to
5986      be encoded in the specified encoding NAME.  This is useful if the
5987      application used to import the key uses a different encoding and
5988      thus will not be able to import a file generated by 'gpgsm'.
5989      Commonly used values for NAME are 'Latin1' and 'CP850'.  Note that
5990      'gpgsm' itself automagically imports any file with a passphrase
5991      encoded to the most commonly used encodings.
5992
5993 '--default-key USER_ID'
5994      Use USER_ID as the standard key for signing.  This key is used if
5995      no other key has been defined as a signing key.  Note, that the
5996      first '--local-users' option also sets this key if it has not yet
5997      been set; however '--default-key' always overrides this.
5998
5999 '--local-user USER_ID'
6000 '-u USER_ID'
6001      Set the user(s) to be used for signing.  The default is the first
6002      secret key found in the database.
6003
6004 '--recipient NAME'
6005 '-r'
6006      Encrypt to the user id NAME.  There are several ways a user id may
6007      be given (*note how-to-specify-a-user-id::).
6008
6009 '--output FILE'
6010 '-o FILE'
6011      Write output to FILE.  The default is to write it to stdout.
6012
6013 '--with-key-data'
6014      Displays extra information with the '--list-keys' commands.
6015      Especially a line tagged 'grp' is printed which tells you the
6016      keygrip of a key.  This string is for example used as the file name
6017      of the secret key.
6018
6019 '--with-validation'
6020      When doing a key listing, do a full validation check for each key
6021      and print the result.  This is usually a slow operation because it
6022      requires a CRL lookup and other operations.
6023
6024      When used along with '--import', a validation of the certificate to
6025      import is done and only imported if it succeeds the test.  Note
6026      that this does not affect an already available certificate in the
6027      DB. This option is therefore useful to simply verify a certificate.
6028
6029 '--with-md5-fingerprint'
6030      For standard key listings, also print the MD5 fingerprint of the
6031      certificate.
6032
6033 '--with-keygrip'
6034      Include the keygrip in standard key listings.  Note that the
6035      keygrip is always listed in '--with-colons' mode.
6036
6037 '--with-secret'
6038      Include info about the presence of a secret key in public key
6039      listings done with '--with-colons'.
6040
6041 \1f
6042 File: gnupg.info,  Node: CMS Options,  Next: Esoteric Options,  Prev: Input and Output,  Up: GPGSM Options
6043
6044 5.2.4 How to change how the CMS is created
6045 ------------------------------------------
6046
6047 '--include-certs N'
6048      Using N of -2 includes all certificate except for the root cert, -1
6049      includes all certs, 0 does not include any certs, 1 includes only
6050      the signers cert and all other positive values include up to N
6051      certificates starting with the signer cert.  The default is -2.
6052
6053 '--cipher-algo OID'
6054      Use the cipher algorithm with the ASN.1 object identifier OID for
6055      encryption.  For convenience the strings '3DES', 'AES' and 'AES256'
6056      may be used instead of their OIDs.  The default is 'AES'
6057      (2.16.840.1.101.3.4.1.2).
6058
6059 '--digest-algo name'
6060      Use 'name' as the message digest algorithm.  Usually this algorithm
6061      is deduced from the respective signing certificate.  This option
6062      forces the use of the given algorithm and may lead to severe
6063      interoperability problems.
6064
6065 \1f
6066 File: gnupg.info,  Node: Esoteric Options,  Prev: CMS Options,  Up: GPGSM Options
6067
6068 5.2.5 Doing things one usually do not want to do
6069 ------------------------------------------------
6070
6071 '--extra-digest-algo NAME'
6072      Sometimes signatures are broken in that they announce a different
6073      digest algorithm than actually used.  'gpgsm' uses a one-pass data
6074      processing model and thus needs to rely on the announced digest
6075      algorithms to properly hash the data.  As a workaround this option
6076      may be used to tell 'gpgsm' to also hash the data using the
6077      algorithm NAME; this slows processing down a little bit but allows
6078      verification of such broken signatures.  If 'gpgsm' prints an error
6079      like "digest algo 8 has not been enabled" you may want to try this
6080      option, with 'SHA256' for NAME.
6081
6082 '--faked-system-time EPOCH'
6083      This option is only useful for testing; it sets the system time
6084      back or forth to EPOCH which is the number of seconds elapsed since
6085      the year 1970.  Alternatively EPOCH may be given as a full ISO time
6086      string (e.g.  "20070924T154812").
6087
6088 '--with-ephemeral-keys'
6089      Include ephemeral flagged keys in the output of key listings.  Note
6090      that they are included anyway if the key specification for a
6091      listing is given as fingerprint or keygrip.
6092
6093 '--debug-level LEVEL'
6094      Select the debug level for investigating problems.  LEVEL may be a
6095      numeric value or by a keyword:
6096
6097      'none'
6098           No debugging at all.  A value of less than 1 may be used
6099           instead of the keyword.
6100      'basic'
6101           Some basic debug messages.  A value between 1 and 2 may be
6102           used instead of the keyword.
6103      'advanced'
6104           More verbose debug messages.  A value between 3 and 5 may be
6105           used instead of the keyword.
6106      'expert'
6107           Even more detailed messages.  A value between 6 and 8 may be
6108           used instead of the keyword.
6109      'guru'
6110           All of the debug messages you can get.  A value greater than 8
6111           may be used instead of the keyword.  The creation of hash
6112           tracing files is only enabled if the keyword is used.
6113
6114      How these messages are mapped to the actual debugging flags is not
6115      specified and may change with newer releases of this program.  They
6116      are however carefully selected to best aid in debugging.
6117
6118 '--debug FLAGS'
6119      This option is only useful for debugging and the behaviour may
6120      change at any time without notice; using '--debug-levels' is the
6121      preferred method to select the debug verbosity.  FLAGS are bit
6122      encoded and may be given in usual C-Syntax.  The currently defined
6123      bits are:
6124
6125      '0 (1)'
6126           X.509 or OpenPGP protocol related data
6127      '1 (2)'
6128           values of big number integers
6129      '2 (4)'
6130           low level crypto operations
6131      '5 (32)'
6132           memory allocation
6133      '6 (64)'
6134           caching
6135      '7 (128)'
6136           show memory statistics
6137      '9 (512)'
6138           write hashed data to files named 'dbgmd-000*'
6139      '10 (1024)'
6140           trace Assuan protocol
6141
6142      Note, that all flags set using this option may get overridden by
6143      '--debug-level'.
6144
6145 '--debug-all'
6146      Same as '--debug=0xffffffff'
6147
6148 '--debug-allow-core-dump'
6149      Usually 'gpgsm' tries to avoid dumping core by well written code
6150      and by disabling core dumps for security reasons.  However, bugs
6151      are pretty durable beasts and to squash them it is sometimes useful
6152      to have a core dump.  This option enables core dumps unless the Bad
6153      Thing happened before the option parsing.
6154
6155 '--debug-no-chain-validation'
6156      This is actually not a debugging option but only useful as such.
6157      It lets 'gpgsm' bypass all certificate chain validation checks.
6158
6159 '--debug-ignore-expiration'
6160      This is actually not a debugging option but only useful as such.
6161      It lets 'gpgsm' ignore all notAfter dates, this is used by the
6162      regression tests.
6163
6164 '--passphrase-fd n'
6165      Read the passphrase from file descriptor 'n'.  Only the first line
6166      will be read from file descriptor 'n'.  If you use 0 for 'n', the
6167      passphrase will be read from STDIN. This can only be used if only
6168      one passphrase is supplied.
6169
6170      Note that this passphrase is only used if the option '--batch' has
6171      also been given.
6172
6173 '--pinentry-mode mode'
6174      Set the pinentry mode to 'mode'.  Allowed values for 'mode' are:
6175      default
6176           Use the default of the agent, which is 'ask'.
6177      ask
6178           Force the use of the Pinentry.
6179      cancel
6180           Emulate use of Pinentry's cancel button.
6181      error
6182           Return a Pinentry error ("No Pinentry").
6183      loopback
6184           Redirect Pinentry queries to the caller.  Note that in
6185           contrast to Pinentry the user is not prompted again if he
6186           enters a bad password.
6187
6188 '--no-common-certs-import'
6189      Suppress the import of common certificates on keybox creation.
6190
6191    All the long options may also be given in the configuration file
6192 after stripping off the two leading dashes.
6193
6194 \1f
6195 File: gnupg.info,  Node: GPGSM Configuration,  Next: GPGSM Examples,  Prev: GPGSM Options,  Up: Invoking GPGSM
6196
6197 5.3 Configuration files
6198 =======================
6199
6200 There are a few configuration files to control certain aspects of
6201 'gpgsm''s operation.  Unless noted, they are expected in the current
6202 home directory (*note option --homedir::).
6203
6204 'gpgsm.conf'
6205      This is the standard configuration file read by 'gpgsm' on startup.
6206      It may contain any valid long option; the leading two dashes may
6207      not be entered and the option may not be abbreviated.  This default
6208      name may be changed on the command line (*note gpgsm-option
6209      --options::).  You should backup this file.
6210
6211 'policies.txt'
6212      This is a list of allowed CA policies.  This file should list the
6213      object identifiers of the policies line by line.  Empty lines and
6214      lines starting with a hash mark are ignored.  Policies missing in
6215      this file and not marked as critical in the certificate will print
6216      only a warning; certificates with policies marked as critical and
6217      not listed in this file will fail the signature verification.  You
6218      should backup this file.
6219
6220      For example, to allow only the policy 2.289.9.9, the file should
6221      look like this:
6222
6223           # Allowed policies
6224           2.289.9.9
6225
6226 'qualified.txt'
6227      This is the list of root certificates used for qualified
6228      certificates.  They are defined as certificates capable of creating
6229      legally binding signatures in the same way as handwritten
6230      signatures are.  Comments start with a hash mark and empty lines
6231      are ignored.  Lines do have a length limit but this is not a
6232      serious limitation as the format of the entries is fixed and
6233      checked by 'gpgsm': A non-comment line starts with optional
6234      whitespace, followed by exactly 40 hex characters, white space and
6235      a lowercased 2 letter country code.  Additional data delimited with
6236      by a white space is current ignored but might late be used for
6237      other purposes.
6238
6239      Note that even if a certificate is listed in this file, this does
6240      not mean that the certificate is trusted; in general the
6241      certificates listed in this file need to be listed also in
6242      'trustlist.txt'.
6243
6244      This is a global file an installed in the data directory (e.g.
6245      '/usr/local/share/gnupg/qualified.txt').  GnuPG installs a suitable
6246      file with root certificates as used in Germany.  As new Root-CA
6247      certificates may be issued over time, these entries may need to be
6248      updated; new distributions of this software should come with an
6249      updated list but it is still the responsibility of the
6250      Administrator to check that this list is correct.
6251
6252      Every time 'gpgsm' uses a certificate for signing or verification
6253      this file will be consulted to check whether the certificate under
6254      question has ultimately been issued by one of these CAs.  If this
6255      is the case the user will be informed that the verified signature
6256      represents a legally binding ("qualified") signature.  When
6257      creating a signature using such a certificate an extra prompt will
6258      be issued to let the user confirm that such a legally binding
6259      signature shall really be created.
6260
6261      Because this software has not yet been approved for use with such
6262      certificates, appropriate notices will be shown to indicate this
6263      fact.
6264
6265 'help.txt'
6266      This is plain text file with a few help entries used with
6267      'pinentry' as well as a large list of help items for 'gpg' and
6268      'gpgsm'.  The standard file has English help texts; to install
6269      localized versions use filenames like 'help.LL.txt' with LL
6270      denoting the locale.  GnuPG comes with a set of predefined help
6271      files in the data directory (e.g.
6272      '/usr/local/share/gnupg/gnupg/help.de.txt') and allows overriding
6273      of any help item by help files stored in the system configuration
6274      directory (e.g.  '/etc/gnupg/help.de.txt').  For a reference of the
6275      help file's syntax, please see the installed 'help.txt' file.
6276
6277 'com-certs.pem'
6278      This file is a collection of common certificates used to populated
6279      a newly created 'pubring.kbx'.  An administrator may replace this
6280      file with a custom one.  The format is a concatenation of PEM
6281      encoded X.509 certificates.  This global file is installed in the
6282      data directory (e.g.  '/usr/local/share/gnupg/com-certs.pem').
6283
6284    Note that on larger installations, it is useful to put predefined
6285 files into the directory '/etc/skel/.gnupg/' so that newly created users
6286 start up with a working configuration.  For existing users a small
6287 helper script is provided to create these files (*note addgnupghome::).
6288
6289    For internal purposes 'gpgsm' creates and maintains a few other
6290 files; they all live in in the current home directory (*note option
6291 --homedir::).  Only 'gpgsm' may modify these files.
6292
6293 'pubring.kbx'
6294      This a database file storing the certificates as well as meta
6295      information.  For debugging purposes the tool 'kbxutil' may be used
6296      to show the internal structure of this file.  You should backup
6297      this file.
6298
6299 'random_seed'
6300      This content of this file is used to maintain the internal state of
6301      the random number generator across invocations.  The same file is
6302      used by other programs of this software too.
6303
6304 'S.gpg-agent'
6305      If this file exists 'gpgsm' will first try to connect to this
6306      socket for accessing 'gpg-agent' before starting a new 'gpg-agent'
6307      instance.  Under Windows this socket (which in reality be a plain
6308      file describing a regular TCP listening port) is the standard way
6309      of connecting the 'gpg-agent'.
6310
6311 \1f
6312 File: gnupg.info,  Node: GPGSM Examples,  Next: Unattended Usage,  Prev: GPGSM Configuration,  Up: Invoking GPGSM
6313
6314 5.4 Examples
6315 ============
6316
6317      $ gpgsm -er goo@bar.net <plaintext >ciphertext
6318
6319 \1f
6320 File: gnupg.info,  Node: Unattended Usage,  Next: GPGSM Protocol,  Prev: GPGSM Examples,  Up: Invoking GPGSM
6321
6322 5.5 Unattended Usage
6323 ====================
6324
6325 'gpgsm' is often used as a backend engine by other software.  To help
6326 with this a machine interface has been defined to have an unambiguous
6327 way to do this.  This is most likely used with the '--server' command
6328 but may also be used in the standard operation mode by using the
6329 '--status-fd' option.
6330
6331 * Menu:
6332
6333 * Automated signature checking::  Automated signature checking.
6334 * CSR and certificate creation::  CSR and certificate creation.
6335
6336 \1f
6337 File: gnupg.info,  Node: Automated signature checking,  Next: CSR and certificate creation,  Up: Unattended Usage
6338
6339 5.5.1 Automated signature checking
6340 ----------------------------------
6341
6342 It is very important to understand the semantics used with signature
6343 verification.  Checking a signature is not as simple as it may sound and
6344 so the operation is a bit complicated.  In most cases it is required to
6345 look at several status lines.  Here is a table of all cases a signed
6346 message may have:
6347
6348 The signature is valid
6349      This does mean that the signature has been successfully verified,
6350      the certificates are all sane.  However there are two subcases with
6351      important information: One of the certificates may have expired or
6352      a signature of a message itself as expired.  It is a sound practise
6353      to consider such a signature still as valid but additional
6354      information should be displayed.  Depending on the subcase 'gpgsm'
6355      will issue these status codes:
6356      signature valid and nothing did expire
6357           'GOODSIG', 'VALIDSIG', 'TRUST_FULLY'
6358      signature valid but at least one certificate has expired
6359           'EXPKEYSIG', 'VALIDSIG', 'TRUST_FULLY'
6360      signature valid but expired
6361           'EXPSIG', 'VALIDSIG', 'TRUST_FULLY' Note, that this case is
6362           currently not implemented.
6363
6364 The signature is invalid
6365      This means that the signature verification failed (this is an
6366      indication of a transfer error, a program error or tampering with
6367      the message).  'gpgsm' issues one of these status codes sequences:
6368      'BADSIG'
6369      'GOODSIG, VALIDSIG TRUST_NEVER'
6370
6371 Error verifying a signature
6372      For some reason the signature could not be verified, i.e.  it
6373      cannot be decided whether the signature is valid or invalid.  A
6374      common reason for this is a missing certificate.
6375
6376 \1f
6377 File: gnupg.info,  Node: CSR and certificate creation,  Prev: Automated signature checking,  Up: Unattended Usage
6378
6379 5.5.2 CSR and certificate creation
6380 ----------------------------------
6381
6382 The command '--generate-key' may be used along with the option '--batch'
6383 to either create a certificate signing request (CSR) or an X.509
6384 certificate.  This is controlled by a parameter file; the format of this
6385 file is as follows:
6386
6387    * Text only, line length is limited to about 1000 characters.
6388    * UTF-8 encoding must be used to specify non-ASCII characters.
6389    * Empty lines are ignored.
6390    * Leading and trailing while space is ignored.
6391    * A hash sign as the first non white space character indicates a
6392      comment line.
6393    * Control statements are indicated by a leading percent sign, the
6394      arguments are separated by white space from the keyword.
6395    * Parameters are specified by a keyword, followed by a colon.
6396      Arguments are separated by white space.
6397    * The first parameter must be 'Key-Type', control statements may be
6398      placed anywhere.
6399    * The order of the parameters does not matter except for 'Key-Type'
6400      which must be the first parameter.  The parameters are only used
6401      for the generated CSR/certificate; parameters from previous sets
6402      are not used.  Some syntactically checks may be performed.
6403    * Key generation takes place when either the end of the parameter
6404      file is reached, the next 'Key-Type' parameter is encountered or at
6405      the control statement '%commit' is encountered.
6406
6407 Control statements:
6408
6409 %echo TEXT
6410      Print TEXT as diagnostic.
6411
6412 %dry-run
6413      Suppress actual key generation (useful for syntax checking).
6414
6415 %commit
6416      Perform the key generation.  Note that an implicit commit is done
6417      at the next Key-Type parameter.
6418
6419 General Parameters:
6420
6421 Key-Type: ALGO
6422      Starts a new parameter block by giving the type of the primary key.
6423      The algorithm must be capable of signing.  This is a required
6424      parameter.  The only supported value for ALGO is 'rsa'.
6425
6426 Key-Length: NBITS
6427      The requested length of a generated key in bits.  Defaults to 2048.
6428
6429 Key-Grip: HEXSTRING
6430      This is optional and used to generate a CSR or certificate for an
6431      already existing key.  Key-Length will be ignored when given.
6432
6433 Key-Usage: USAGE-LIST
6434      Space or comma delimited list of key usage, allowed values are
6435      'encrypt', 'sign' and 'cert'.  This is used to generate the
6436      keyUsage extension.  Please make sure that the algorithm is capable
6437      of this usage.  Default is to allow encrypt and sign.
6438
6439 Name-DN: SUBJECT-NAME
6440      This is the Distinguished Name (DN) of the subject in RFC-2253
6441      format.
6442
6443 Name-Email: STRING
6444      This is an email address for the altSubjectName.  This parameter is
6445      optional but may occur several times to add several email addresses
6446      to a certificate.
6447
6448 Name-DNS: STRING
6449      The is an DNS name for the altSubjectName.  This parameter is
6450      optional but may occur several times to add several DNS names to a
6451      certificate.
6452
6453 Name-URI: STRING
6454      This is an URI for the altSubjectName.  This parameter is optional
6455      but may occur several times to add several URIs to a certificate.
6456
6457 Additional parameters used to create a certificate (in contrast to a
6458 certificate signing request):
6459
6460 Serial: SN
6461      If this parameter is given an X.509 certificate will be generated.
6462      SN is expected to be a hex string representing an unsigned integer
6463      of arbitrary length.  The special value 'random' can be used to
6464      create a 64 bit random serial number.
6465
6466 Issuer-DN: ISSUER-NAME
6467      This is the DN name of the issuer in RFC-2253 format.  If it is not
6468      set it will default to the subject DN and a special GnuPG extension
6469      will be included in the certificate to mark it as a standalone
6470      certificate.
6471
6472 Creation-Date: ISO-DATE
6473 Not-Before: ISO-DATE
6474      Set the notBefore date of the certificate.  Either a date like
6475      '1986-04-26' or '1986-04-26 12:00' or a standard ISO timestamp like
6476      '19860426T042640' may be used.  The time is considered to be UTC.
6477      If it is not given the current date is used.
6478
6479 Expire-Date: ISO-DATE
6480 Not-After: ISO-DATE
6481      Set the notAfter date of the certificate.  Either a date like
6482      '2063-04-05' or '2063-04-05 17:00' or a standard ISO timestamp like
6483      '20630405T170000' may be used.  The time is considered to be UTC.
6484      If it is not given a default value in the not too far future is
6485      used.
6486
6487 Signing-Key: KEYGRIP
6488      This gives the keygrip of the key used to sign the certificate.  If
6489      it is not given a self-signed certificate will be created.  For
6490      compatibility with future versions, it is suggested to prefix the
6491      keygrip with a '&'.
6492
6493 Hash-Algo: HASH-ALGO
6494      Use HASH-ALGO for this CSR or certificate.  The supported hash
6495      algorithms are: 'sha1', 'sha256', 'sha384' and 'sha512'; they may
6496      also be specified with uppercase letters.  The default is 'sha256'.
6497
6498 \1f
6499 File: gnupg.info,  Node: GPGSM Protocol,  Prev: Unattended Usage,  Up: Invoking GPGSM
6500
6501 5.6 The Protocol the Server Mode Uses
6502 =====================================
6503
6504 Description of the protocol used to access 'GPGSM'.  'GPGSM' does
6505 implement the Assuan protocol and in addition provides a regular command
6506 line interface which exhibits a full client to this protocol (but uses
6507 internal linking).  To start 'gpgsm' as a server the command line the
6508 option '--server' must be used.  Additional options are provided to
6509 select the communication method (i.e.  the name of the socket).
6510
6511    We assume that the connection has already been established; see the
6512 Assuan manual for details.
6513
6514 * Menu:
6515
6516 * GPGSM ENCRYPT::         Encrypting a message.
6517 * GPGSM DECRYPT::         Decrypting a message.
6518 * GPGSM SIGN::            Signing a message.
6519 * GPGSM VERIFY::          Verifying a message.
6520 * GPGSM GENKEY::          Generating a key.
6521 * GPGSM LISTKEYS::        List available keys.
6522 * GPGSM EXPORT::          Export certificates.
6523 * GPGSM IMPORT::          Import certificates.
6524 * GPGSM DELETE::          Delete certificates.
6525 * GPGSM GETAUDITLOG::     Retrieve an audit log.
6526 * GPGSM GETINFO::         Information about the process
6527 * GPGSM OPTION::          Session options.
6528
6529 \1f
6530 File: gnupg.info,  Node: GPGSM ENCRYPT,  Next: GPGSM DECRYPT,  Up: GPGSM Protocol
6531
6532 5.6.1 Encrypting a Message
6533 --------------------------
6534
6535 Before encryption can be done the recipient must be set using the
6536 command:
6537
6538        RECIPIENT USERID
6539
6540    Set the recipient for the encryption.  USERID should be the internal
6541 representation of the key; the server may accept any other way of
6542 specification.  If this is a valid and trusted recipient the server does
6543 respond with OK, otherwise the return is an ERR with the reason why the
6544 recipient cannot be used, the encryption will then not be done for this
6545 recipient.  If the policy is not to encrypt at all if not all recipients
6546 are valid, the client has to take care of this.  All 'RECIPIENT'
6547 commands are cumulative until a 'RESET' or an successful 'ENCRYPT'
6548 command.
6549
6550        INPUT FD[=N] [--armor|--base64|--binary]
6551
6552    Set the file descriptor for the message to be encrypted to N.
6553 Obviously the pipe must be open at that point, the server establishes
6554 its own end.  If the server returns an error the client should consider
6555 this session failed.  If N is not given, this commands uses the last
6556 file descriptor passed to the application.  *Note the assuan_sendfd
6557 function: (assuan)fun-assuan_sendfd, on how to do descriptor passing.
6558
6559    The '--armor' option may be used to advice the server that the input
6560 data is in PEM format, '--base64' advices that a raw base-64 encoding is
6561 used, '--binary' advices of raw binary input (BER).  If none of these
6562 options is used, the server tries to figure out the used encoding, but
6563 this may not always be correct.
6564
6565        OUTPUT FD[=N] [--armor|--base64]
6566
6567    Set the file descriptor to be used for the output (i.e.  the
6568 encrypted message).  Obviously the pipe must be open at that point, the
6569 server establishes its own end.  If the server returns an error the
6570 client should consider this session failed.
6571
6572    The option '--armor' encodes the output in PEM format, the '--base64'
6573 option applies just a base-64 encoding.  No option creates binary output
6574 (BER).
6575
6576    The actual encryption is done using the command
6577
6578        ENCRYPT
6579
6580    It takes the plaintext from the 'INPUT' command, writes to the
6581 ciphertext to the file descriptor set with the 'OUTPUT' command, take
6582 the recipients from all the recipients set so far.  If this command
6583 fails the clients should try to delete all output currently done or
6584 otherwise mark it as invalid.  'GPGSM' does ensure that there will not
6585 be any security problem with leftover data on the output in this case.
6586
6587    This command should in general not fail, as all necessary checks have
6588 been done while setting the recipients.  The input and output pipes are
6589 closed.
6590
6591 \1f
6592 File: gnupg.info,  Node: GPGSM DECRYPT,  Next: GPGSM SIGN,  Prev: GPGSM ENCRYPT,  Up: GPGSM Protocol
6593
6594 5.6.2 Decrypting a message
6595 --------------------------
6596
6597 Input and output FDs are set the same way as in encryption, but 'INPUT'
6598 refers to the ciphertext and 'OUTPUT' to the plaintext.  There is no
6599 need to set recipients.  'GPGSM' automatically strips any S/MIME headers
6600 from the input, so it is valid to pass an entire MIME part to the INPUT
6601 pipe.
6602
6603    The decryption is done by using the command
6604
6605        DECRYPT
6606
6607    It performs the decrypt operation after doing some check on the
6608 internal state (e.g.  that all needed data has been set).  Because it
6609 utilizes the GPG-Agent for the session key decryption, there is no need
6610 to ask the client for a protecting passphrase - GpgAgent takes care of
6611 this by requesting this from the user.
6612
6613 \1f
6614 File: gnupg.info,  Node: GPGSM SIGN,  Next: GPGSM VERIFY,  Prev: GPGSM DECRYPT,  Up: GPGSM Protocol
6615
6616 5.6.3 Signing a Message
6617 -----------------------
6618
6619 Signing is usually done with these commands:
6620
6621        INPUT FD[=N] [--armor|--base64|--binary]
6622
6623    This tells 'GPGSM' to read the data to sign from file descriptor N.
6624
6625        OUTPUT FD[=M] [--armor|--base64]
6626
6627    Write the output to file descriptor M.  If a detached signature is
6628 requested, only the signature is written.
6629
6630        SIGN [--detached]
6631
6632    Sign the data set with the 'INPUT' command and write it to the sink
6633 set by 'OUTPUT'.  With '--detached', a detached signature is created
6634 (surprise).
6635
6636    The key used for signing is the default one or the one specified in
6637 the configuration file.  To get finer control over the keys, it is
6638 possible to use the command
6639
6640        SIGNER USERID
6641
6642    to set the signer's key.  USERID should be the internal
6643 representation of the key; the server may accept any other way of
6644 specification.  If this is a valid and trusted recipient the server does
6645 respond with OK, otherwise the return is an ERR with the reason why the
6646 key cannot be used, the signature will then not be created using this
6647 key.  If the policy is not to sign at all if not all keys are valid, the
6648 client has to take care of this.  All 'SIGNER' commands are cumulative
6649 until a 'RESET' is done.  Note that a 'SIGN' does not reset this list of
6650 signers which is in contrast to the 'RECIPIENT' command.
6651
6652 \1f
6653 File: gnupg.info,  Node: GPGSM VERIFY,  Next: GPGSM GENKEY,  Prev: GPGSM SIGN,  Up: GPGSM Protocol
6654
6655 5.6.4 Verifying a Message
6656 -------------------------
6657
6658 To verify a message the command:
6659
6660        VERIFY
6661
6662    is used.  It does a verify operation on the message send to the input
6663 FD. The result is written out using status lines.  If an output FD was
6664 given, the signed text will be written to that.  If the signature is a
6665 detached one, the server will inquire about the signed material and the
6666 client must provide it.
6667
6668 \1f
6669 File: gnupg.info,  Node: GPGSM GENKEY,  Next: GPGSM LISTKEYS,  Prev: GPGSM VERIFY,  Up: GPGSM Protocol
6670
6671 5.6.5 Generating a Key
6672 ----------------------
6673
6674 This is used to generate a new keypair, store the secret part in the PSE
6675 and the public key in the key database.  We will probably add optional
6676 commands to allow the client to select whether a hardware token is used
6677 to store the key.  Configuration options to 'GPGSM' can be used to
6678 restrict the use of this command.
6679
6680        GENKEY
6681
6682    'GPGSM' checks whether this command is allowed and then does an
6683 INQUIRY to get the key parameters, the client should then send the key
6684 parameters in the native format:
6685
6686          S: INQUIRE KEY_PARAM native
6687          C: D foo:fgfgfg
6688          C: D bar
6689          C: END
6690
6691    Please note that the server may send Status info lines while reading
6692 the data lines from the client.  After this the key generation takes
6693 place and the server eventually does send an ERR or OK response.  Status
6694 lines may be issued as a progress indicator.
6695
6696 \1f
6697 File: gnupg.info,  Node: GPGSM LISTKEYS,  Next: GPGSM EXPORT,  Prev: GPGSM GENKEY,  Up: GPGSM Protocol
6698
6699 5.6.6 List available keys
6700 -------------------------
6701
6702 To list the keys in the internal database or using an external key
6703 provider, the command:
6704
6705        LISTKEYS  PATTERN
6706
6707    is used.  To allow multiple patterns (which are ORed during the
6708 search) quoting is required: Spaces are to be translated into "+" or
6709 into "%20"; in turn this requires that the usual escape quoting rules
6710 are done.
6711
6712        LISTSECRETKEYS PATTERN
6713
6714    Lists only the keys where a secret key is available.
6715
6716    The list commands are affected by the option
6717
6718        OPTION list-mode=MODE
6719
6720    where mode may be:
6721 '0'
6722      Use default (which is usually the same as 1).
6723 '1'
6724      List only the internal keys.
6725 '2'
6726      List only the external keys.
6727 '3'
6728      List internal and external keys.
6729
6730    Note that options are valid for the entire session.
6731
6732 \1f
6733 File: gnupg.info,  Node: GPGSM EXPORT,  Next: GPGSM IMPORT,  Prev: GPGSM LISTKEYS,  Up: GPGSM Protocol
6734
6735 5.6.7 Export certificates
6736 -------------------------
6737
6738 To export certificate from the internal key database the command:
6739
6740        EXPORT [--data [--armor] [--base64]] [--] PATTERN
6741
6742    is used.  To allow multiple patterns (which are ORed) quoting is
6743 required: Spaces are to be translated into "+" or into "%20"; in turn
6744 this requires that the usual escape quoting rules are done.
6745
6746    If the '--data' option has not been given, the format of the output
6747 depends on what was set with the 'OUTPUT' command.  When using PEM
6748 encoding a few informational lines are prepended.
6749
6750    If the '--data' has been given, a target set via 'OUTPUT' is ignored
6751 and the data is returned inline using standard 'D'-lines.  This avoids
6752 the need for an extra file descriptor.  In this case the options
6753 '--armor' and '--base64' may be used in the same way as with the
6754 'OUTPUT' command.
6755
6756 \1f
6757 File: gnupg.info,  Node: GPGSM IMPORT,  Next: GPGSM DELETE,  Prev: GPGSM EXPORT,  Up: GPGSM Protocol
6758
6759 5.6.8 Import certificates
6760 -------------------------
6761
6762 To import certificates into the internal key database, the command
6763
6764        IMPORT [--re-import]
6765
6766    is used.  The data is expected on the file descriptor set with the
6767 'INPUT' command.  Certain checks are performed on the certificate.  Note
6768 that the code will also handle PKCS#12 files and import private keys; a
6769 helper program is used for that.
6770
6771    With the option '--re-import' the input data is expected to a be a
6772 linefeed separated list of fingerprints.  The command will re-import the
6773 corresponding certificates; that is they are made permanent by removing
6774 their ephemeral flag.
6775
6776 \1f
6777 File: gnupg.info,  Node: GPGSM DELETE,  Next: GPGSM GETAUDITLOG,  Prev: GPGSM IMPORT,  Up: GPGSM Protocol
6778
6779 5.6.9 Delete certificates
6780 -------------------------
6781
6782 To delete a certificate the command
6783
6784        DELKEYS PATTERN
6785
6786    is used.  To allow multiple patterns (which are ORed) quoting is
6787 required: Spaces are to be translated into "+" or into "%20"; in turn
6788 this requires that the usual escape quoting rules are done.
6789
6790    The certificates must be specified unambiguously otherwise an error
6791 is returned.
6792
6793 \1f
6794 File: gnupg.info,  Node: GPGSM GETAUDITLOG,  Next: GPGSM GETINFO,  Prev: GPGSM DELETE,  Up: GPGSM Protocol
6795
6796 5.6.10 Retrieve an audit log
6797 ----------------------------
6798
6799 This command is used to retrieve an audit log.
6800
6801      GETAUDITLOG [--data] [--html]
6802
6803    If '--data' is used, the audit log is send using D-lines instead of
6804 being sent to the file descriptor given by an 'OUTPUT' command.  If
6805 '--html' is used, the output is formatted as an XHTML block.  This is
6806 designed to be incorporated into a HTML document.
6807
6808 \1f
6809 File: gnupg.info,  Node: GPGSM GETINFO,  Next: GPGSM OPTION,  Prev: GPGSM GETAUDITLOG,  Up: GPGSM Protocol
6810
6811 5.6.11 Return information about the process
6812 -------------------------------------------
6813
6814 This is a multipurpose function to return a variety of information.
6815
6816      GETINFO WHAT
6817
6818    The value of WHAT specifies the kind of information returned:
6819 'version'
6820      Return the version of the program.
6821 'pid'
6822      Return the process id of the process.
6823 'agent-check'
6824      Return OK if the agent is running.
6825 'cmd_has_option CMD OPT'
6826      Return OK if the command CMD implements the option OPT.  The
6827      leading two dashes usually used with OPT shall not be given.
6828 'offline'
6829      Return OK if the connection is in offline mode.  This may be either
6830      due to a 'OPTION offline=1' or due to 'gpgsm' being started with
6831      option '--disable-dirmngr'.
6832
6833 \1f
6834 File: gnupg.info,  Node: GPGSM OPTION,  Prev: GPGSM GETINFO,  Up: GPGSM Protocol
6835
6836 5.6.12 Session options
6837 ----------------------
6838
6839 The standard Assuan option handler supports these options.
6840
6841      OPTION NAME[=VALUE]
6842
6843    These NAMEs are recognized:
6844
6845 'putenv'
6846      Change the session's environment to be passed via gpg-agent to
6847      Pinentry.  VALUE is a string of the form '<KEY>[=[<STRING>]]'.  If
6848      only '<KEY>' is given the environment variable '<KEY>' is removed
6849      from the session environment, if '<KEY>=' is given that environment
6850      variable is set to the empty string, and if '<STRING>' is given it
6851      is set to that string.
6852
6853 'display'
6854      Set the session environment variable 'DISPLAY' is set to VALUE.
6855 'ttyname'
6856      Set the session environment variable 'GPG_TTY' is set to VALUE.
6857 'ttytype'
6858      Set the session environment variable 'TERM' is set to VALUE.
6859 'lc-ctype'
6860      Set the session environment variable 'LC_CTYPE' is set to VALUE.
6861 'lc-messages'
6862      Set the session environment variable 'LC_MESSAGES' is set to VALUE.
6863 'xauthority'
6864      Set the session environment variable 'XAUTHORITY' is set to VALUE.
6865 'pinentry-user-data'
6866      Set the session environment variable 'PINENTRY_USER_DATA' is set to
6867      VALUE.
6868
6869 'include-certs'
6870      This option overrides the command line option '--include-certs'.  A
6871      VALUE of -2 includes all certificates except for the root
6872      certificate, -1 includes all certicates, 0 does not include any
6873      certicates, 1 includes only the signers certicate and all other
6874      positive values include up to VALUE certificates starting with the
6875      signer cert.
6876
6877 'list-mode'
6878      *Note gpgsm-cmd listkeys::.
6879
6880 'list-to-output'
6881      If VALUE is true the output of the list commands (*note gpgsm-cmd
6882      listkeys::) is written to the file descriptor set with the last
6883      'OUTPUT' command.  If VALUE is false the output is written via data
6884      lines; this is the default.
6885
6886 'with-validation'
6887      If VALUE is true for each listed certificate the validation status
6888      is printed.  This may result in the download of a CRL or the user
6889      being asked about the trustworthiness of a root certificate.  The
6890      default is given by a command line option (*note gpgsm-option
6891      --with-validation::).
6892
6893 'with-secret'
6894      If VALUE is true certificates with a corresponding private key are
6895      marked by the list commands.
6896
6897 'validation-model'
6898      This option overrides the command line option 'validation-model'
6899      for the session.  (*Note gpgsm-option --validation-model::.)
6900
6901 'with-key-data'
6902      This option globally enables the command line option
6903      '--with-key-data'.  (*Note gpgsm-option --with-key-data::.)
6904
6905 'enable-audit-log'
6906      If VALUE is true data to write an audit log is gathered.  (*Note
6907      gpgsm-cmd getauditlog::.)
6908
6909 'allow-pinentry-notify'
6910      If this option is used notifications about the launch of a Pinentry
6911      are passed back to the client.
6912
6913 'with-ephemeral-keys'
6914      If VALUE is true ephemeral certificates are included in the output
6915      of the list commands.
6916
6917 'no-encrypt-to'
6918      If this option is used all keys set by the command line option
6919      '--encrypt-to' are ignored.
6920
6921 'offline'
6922      If VALUE is true or VALUE is not given all network access is
6923      disabled for this session.  This is the same as the command line
6924      option '--disable-dirmngr'.
6925
6926 \1f
6927 File: gnupg.info,  Node: Invoking SCDAEMON,  Next: Specify a User ID,  Prev: Invoking GPGSM,  Up: Top
6928
6929 6 Invoking the SCDAEMON
6930 ***********************
6931
6932 The 'scdaemon' is a daemon to manage smartcards.  It is usually invoked
6933 by 'gpg-agent' and in general not used directly.
6934
6935    *Note Option Index::, for an index to 'scdaemon''s commands and
6936 options.
6937
6938 * Menu:
6939
6940 * Scdaemon Commands::      List of all commands.
6941 * Scdaemon Options::       List of all options.
6942 * Card applications::      Description of card applications.
6943 * Scdaemon Configuration:: Configuration files.
6944 * Scdaemon Examples::      Some usage examples.
6945 * Scdaemon Protocol::      The protocol the daemon uses.
6946
6947 \1f
6948 File: gnupg.info,  Node: Scdaemon Commands,  Next: Scdaemon Options,  Up: Invoking SCDAEMON
6949
6950 6.1 Commands
6951 ============
6952
6953 Commands are not distinguished from options except for the fact that
6954 only one command is allowed.
6955
6956 '--version'
6957      Print the program version and licensing information.  Note that you
6958      cannot abbreviate this command.
6959
6960 '--help, -h'
6961      Print a usage message summarizing the most useful command-line
6962      options.  Note that you cannot abbreviate this command.
6963
6964 '--dump-options'
6965      Print a list of all available options and commands.  Note that you
6966      cannot abbreviate this command.
6967
6968 '--server'
6969      Run in server mode and wait for commands on the 'stdin'.  The
6970      default mode is to create a socket and listen for commands there.
6971
6972 '--multi-server'
6973      Run in server mode and wait for commands on the 'stdin' as well as
6974      on an additional Unix Domain socket.  The server command 'GETINFO'
6975      may be used to get the name of that extra socket.
6976
6977 '--daemon'
6978      Run the program in the background.  This option is required to
6979      prevent it from being accidentally running in the background.
6980
6981 \1f
6982 File: gnupg.info,  Node: Scdaemon Options,  Next: Card applications,  Prev: Scdaemon Commands,  Up: Invoking SCDAEMON
6983
6984 6.2 Option Summary
6985 ==================
6986
6987 '--options FILE'
6988      Reads configuration from FILE instead of from the default per-user
6989      configuration file.  The default configuration file is named
6990      'scdaemon.conf' and expected in the '.gnupg' directory directly
6991      below the home directory of the user.
6992
6993 '--homedir DIR'
6994      Set the name of the home directory to DIR.  If this option is not
6995      used, the home directory defaults to '~/.gnupg'.  It is only
6996      recognized when given on the command line.  It also overrides any
6997      home directory stated through the environment variable 'GNUPGHOME'
6998      or (on Windows systems) by means of the Registry entry
6999      HKCU\SOFTWARE\GNU\GNUPG:HOMEDIR.
7000
7001      On Windows systems it is possible to install GnuPG as a portable
7002      application.  In this case only this command line option is
7003      considered, all other ways to set a home directory are ignored.
7004
7005      To install GnuPG as a portable application under Windows, create an
7006      empty file named 'gpgconf.ctl' in the same directory as the tool
7007      'gpgconf.exe'.  The root of the installation is then that
7008      directory; or, if 'gpgconf.exe' has been installed directly below a
7009      directory named 'bin', its parent directory.  You also need to make
7010      sure that the following directories exist and are writable:
7011      'ROOT/home' for the GnuPG home and 'ROOT/usr/local/var/cache/gnupg'
7012      for internal cache files.
7013
7014 '-v'
7015 '--verbose'
7016      Outputs additional information while running.  You can increase the
7017      verbosity by giving several verbose commands to 'gpgsm', such as
7018      '-vv'.
7019
7020 '--debug-level LEVEL'
7021      Select the debug level for investigating problems.  LEVEL may be a
7022      numeric value or a keyword:
7023
7024      'none'
7025           No debugging at all.  A value of less than 1 may be used
7026           instead of the keyword.
7027      'basic'
7028           Some basic debug messages.  A value between 1 and 2 may be
7029           used instead of the keyword.
7030      'advanced'
7031           More verbose debug messages.  A value between 3 and 5 may be
7032           used instead of the keyword.
7033      'expert'
7034           Even more detailed messages.  A value between 6 and 8 may be
7035           used instead of the keyword.
7036      'guru'
7037           All of the debug messages you can get.  A value greater than 8
7038           may be used instead of the keyword.  The creation of hash
7039           tracing files is only enabled if the keyword is used.
7040
7041      How these messages are mapped to the actual debugging flags is not
7042      specified and may change with newer releases of this program.  They
7043      are however carefully selected to best aid in debugging.
7044
7045           Note: All debugging options are subject to change and thus
7046           should not be used by any application program.  As the name
7047           says, they are only used as helpers to debug problems.
7048
7049 '--debug FLAGS'
7050      This option is only useful for debugging and the behavior may
7051      change at any time without notice.  FLAGS are bit encoded and may
7052      be given in usual C-Syntax.  The currently defined bits are:
7053
7054      '0 (1)'
7055           command I/O
7056      '1 (2)'
7057           values of big number integers
7058      '2 (4)'
7059           low level crypto operations
7060      '5 (32)'
7061           memory allocation
7062      '6 (64)'
7063           caching
7064      '7 (128)'
7065           show memory statistics
7066      '9 (512)'
7067           write hashed data to files named 'dbgmd-000*'
7068      '10 (1024)'
7069           trace Assuan protocol.  See also option
7070           '--debug-assuan-log-cats'.
7071      '11 (2048)'
7072           trace APDU I/O to the card.  This may reveal sensitive data.
7073      '12 (4096)'
7074           trace some card reader related function calls.
7075
7076 '--debug-all'
7077      Same as '--debug=0xffffffff'
7078
7079 '--debug-wait N'
7080      When running in server mode, wait N seconds before entering the
7081      actual processing loop and print the pid.  This gives time to
7082      attach a debugger.
7083
7084 '--debug-ccid-driver'
7085      Enable debug output from the included CCID driver for smartcards.
7086      Using this option twice will also enable some tracing of the T=1
7087      protocol.  Note that this option may reveal sensitive data.
7088
7089 '--debug-disable-ticker'
7090      This option disables all ticker functions like checking for card
7091      insertions.
7092
7093 '--debug-allow-core-dump'
7094      For security reasons we won't create a core dump when the process
7095      aborts.  For debugging purposes it is sometimes better to allow
7096      core dump.  This option enables it and also changes the working
7097      directory to '/tmp' when running in '--server' mode.
7098
7099 '--debug-log-tid'
7100      This option appends a thread ID to the PID in the log output.
7101
7102 '--debug-assuan-log-cats CATS'
7103      Changes the active Libassuan logging categories to CATS.  The value
7104      for CATS is an unsigned integer given in usual C-Syntax.  A value
7105      of of 0 switches to a default category.  If this option is not used
7106      the categories are taken from the environment variable
7107      'ASSUAN_DEBUG'.  Note that this option has only an effect if the
7108      Assuan debug flag has also been with the option '--debug'.  For a
7109      list of categories see the Libassuan manual.
7110
7111 '--no-detach'
7112      Don't detach the process from the console.  This is mainly useful
7113      for debugging.
7114
7115 '--log-file FILE'
7116      Append all logging output to FILE.  This is very helpful in seeing
7117      what the agent actually does.  Use 'socket://' to log to socket.
7118
7119 '--pcsc-driver LIBRARY'
7120      Use LIBRARY to access the smartcard reader.  The current default is
7121      'libpcsclite.so'.  Instead of using this option you might also want
7122      to install a symbolic link to the default file name (e.g.  from
7123      'libpcsclite.so.1').
7124
7125 '--ctapi-driver LIBRARY'
7126      Use LIBRARY to access the smartcard reader.  The current default is
7127      'libtowitoko.so'.  Note that the use of this interface is
7128      deprecated; it may be removed in future releases.
7129
7130 '--disable-ccid'
7131      Disable the integrated support for CCID compliant readers.  This
7132      allows falling back to one of the other drivers even if the
7133      internal CCID driver can handle the reader.  Note, that CCID
7134      support is only available if libusb was available at build time.
7135
7136 '--reader-port NUMBER_OR_STRING'
7137      This option may be used to specify the port of the card terminal.
7138      A value of 0 refers to the first serial device; add 32768 to access
7139      USB devices.  The default is 32768 (first USB device).  PC/SC or
7140      CCID readers might need a string here; run the program in verbose
7141      mode to get a list of available readers.  The default is then the
7142      first reader found.
7143
7144      To get a list of available CCID readers you may use this command:
7145             echo scd getinfo reader_list \
7146               | gpg-connect-agent --decode | awk '/^D/ {print $2}'
7147
7148 '--card-timeout N'
7149      If N is not 0 and no client is actively using the card, the card
7150      will be powered down after N seconds.  Powering down the card
7151      avoids a potential risk of damaging a card when used with certain
7152      cheap readers.  This also allows applications that are not aware of
7153      Scdaemon to access the card.  The disadvantage of using a card
7154      timeout is that accessing the card takes longer and that the user
7155      needs to enter the PIN again after the next power up.
7156
7157      Note that with the current version of Scdaemon the card is powered
7158      down immediately at the next timer tick for any value of N other
7159      than 0.
7160
7161 '--enable-pinpad-varlen'
7162      Please specify this option when the card reader supports variable
7163      length input for pinpad (default is no).  For known readers (listed
7164      in ccid-driver.c and apdu.c), this option is not needed.  Note that
7165      if your card reader doesn't supports variable length input but you
7166      want to use it, you need to specify your pinpad request on your
7167      card.
7168
7169 '--disable-pinpad'
7170      Even if a card reader features a pinpad, do not try to use it.
7171
7172 '--deny-admin'
7173      This option disables the use of admin class commands for card
7174      applications where this is supported.  Currently we support it for
7175      the OpenPGP card.  This option is useful to inhibit accidental
7176      access to admin class command which could ultimately lock the card
7177      through wrong PIN numbers.  Note that GnuPG versions older than
7178      2.0.11 featured an '--allow-admin' option which was required to use
7179      such admin commands.  This option has no more effect today because
7180      the default is now to allow admin commands.
7181
7182 '--disable-application NAME'
7183      This option disables the use of the card application named NAME.
7184      This is mainly useful for debugging or if a application with lower
7185      priority should be used by default.
7186
7187    All the long options may also be given in the configuration file
7188 after stripping off the two leading dashes.
7189
7190 \1f
7191 File: gnupg.info,  Node: Card applications,  Next: Scdaemon Configuration,  Prev: Scdaemon Options,  Up: Invoking SCDAEMON
7192
7193 6.3 Description of card applications
7194 ====================================
7195
7196 'scdaemon' supports the card applications as described below.
7197
7198 * Menu:
7199
7200 * OpenPGP Card::          The OpenPGP card application
7201 * NKS Card::              The Telesec NetKey card application
7202 * DINSIG Card::           The DINSIG card application
7203 * PKCS#15 Card::          The PKCS#15 card application
7204 * Geldkarte Card::        The Geldkarte application
7205 * SmartCard-HSM::         The SmartCard-HSM application
7206 * Undefined Card::        The Undefined stub application
7207
7208 \1f
7209 File: gnupg.info,  Node: OpenPGP Card,  Next: NKS Card,  Up: Card applications
7210
7211 6.3.1 The OpenPGP card application "openpgp"
7212 --------------------------------------------
7213
7214 This application is currently only used by 'gpg' but may in future also
7215 be useful with 'gpgsm'.  Version 1 and version 2 of the card is
7216 supported.
7217
7218 The specifications for these cards are available at
7219 <http://g10code.com/docs/openpgp-card-1.0.pdf> and
7220 <http://g10code.com/docs/openpgp-card-2.0.pdf>.
7221
7222 \1f
7223 File: gnupg.info,  Node: NKS Card,  Next: DINSIG Card,  Prev: OpenPGP Card,  Up: Card applications
7224
7225 6.3.2 The Telesec NetKey card "nks"
7226 -----------------------------------
7227
7228 This is the main application of the Telesec cards as available in
7229 Germany.  It is a superset of the German DINSIG card.  The card is used
7230 by 'gpgsm'.
7231
7232 \1f
7233 File: gnupg.info,  Node: DINSIG Card,  Next: PKCS#15 Card,  Prev: NKS Card,  Up: Card applications
7234
7235 6.3.3 The DINSIG card application "dinsig"
7236 ------------------------------------------
7237
7238 This is an application as described in the German draft standard _DIN V
7239 66291-1_.  It is intended to be used by cards supporting the German
7240 signature law and its bylaws (SigG and SigV).
7241
7242 \1f
7243 File: gnupg.info,  Node: PKCS#15 Card,  Next: Geldkarte Card,  Prev: DINSIG Card,  Up: Card applications
7244
7245 6.3.4 The PKCS#15 card application "p15"
7246 ----------------------------------------
7247
7248 This is common framework for smart card applications.  It is used by
7249 'gpgsm'.
7250
7251 \1f
7252 File: gnupg.info,  Node: Geldkarte Card,  Next: SmartCard-HSM,  Prev: PKCS#15 Card,  Up: Card applications
7253
7254 6.3.5 The Geldkarte card application "geldkarte"
7255 ------------------------------------------------
7256
7257 This is a simple application to display information of a German
7258 Geldkarte.  The Geldkarte is a small amount debit card application which
7259 comes with almost all German banking cards.
7260
7261 \1f
7262 File: gnupg.info,  Node: SmartCard-HSM,  Next: Undefined Card,  Prev: Geldkarte Card,  Up: Card applications
7263
7264 6.3.6 The SmartCard-HSM card application "sc-hsm"
7265 -------------------------------------------------
7266
7267 This application adds read-only support for keys and certificates stored
7268 on a SmartCard-HSM (http://www.smartcard-hsm.com).
7269
7270    To generate keys and store certifiates you may use OpenSC
7271 (https://github.com/OpenSC/OpenSC/wiki/SmartCardHSM) or the tools from
7272 OpenSCDP (http://www.openscdp.org).
7273
7274    The SmartCard-HSM cards requires a card reader that supports Extended
7275 Length APDUs.
7276
7277 \1f
7278 File: gnupg.info,  Node: Undefined Card,  Prev: SmartCard-HSM,  Up: Card applications
7279
7280 6.3.7 The Undefined card application "undefined"
7281 ------------------------------------------------
7282
7283 This is a stub application to allow the use of the APDU command even if
7284 no supported application is found on the card.  This application is not
7285 used automatically but must be explicitly requested using the SERIALNO
7286 command.
7287
7288 \1f
7289 File: gnupg.info,  Node: Scdaemon Configuration,  Next: Scdaemon Examples,  Prev: Card applications,  Up: Invoking SCDAEMON
7290
7291 6.4 Configuration files
7292 =======================
7293
7294 There are a few configuration files to control certain aspects of
7295 'scdaemons''s operation.  Unless noted, they are expected in the current
7296 home directory (*note option --homedir::).
7297
7298 'scdaemon.conf'
7299      This is the standard configuration file read by 'scdaemon' on
7300      startup.  It may contain any valid long option; the leading two
7301      dashes may not be entered and the option may not be abbreviated.
7302      This default name may be changed on the command line (*note option
7303      --options::).
7304
7305 'scd-event'
7306      If this file is present and executable, it will be called on every
7307      card reader's status change.  An example of this script is provided
7308      with the distribution
7309
7310 'reader_N.status'
7311      This file is created by 'scdaemon' to let other applications now
7312      about reader status changes.  Its use is now deprecated in favor of
7313      'scd-event'.
7314