Imported Upstream version 2.1.1
[platform/upstream/gpg2.git] / doc / tools.texi
1 @c Copyright (C) 2004, 2008 Free Software Foundation, Inc.
2 @c This is part of the GnuPG manual.
3 @c For copying conditions, see the file GnuPG.texi.
4
5 @node Helper Tools
6 @chapter Helper Tools
7
8 GnuPG comes with a couple of smaller tools:
9
10 @menu
11 * watchgnupg::            Read logs from a socket.
12 * gpgv::                  Verify OpenPGP signatures.
13 * addgnupghome::          Create .gnupg home directories.
14 * gpgconf::               Modify .gnupg home directories.
15 * applygnupgdefaults::    Run gpgconf for all users.
16 * gpgsm-gencert.sh::      Generate an X.509 certificate request.
17 * gpg-preset-passphrase:: Put a passphrase into the cache.
18 * gpg-connect-agent::     Communicate with a running agent.
19 @ifset gpgtwoone
20 * dirmngr-client::        How to use the Dirmngr client tool.
21 @end ifset
22 * gpgparsemail::          Parse a mail message into an annotated format
23 * symcryptrun::           Call a simple symmetric encryption tool.
24 * gpg-zip::               Encrypt or sign files into an archive.
25 @end menu
26
27 @c
28 @c  WATCHGNUPG
29 @c
30 @manpage watchgnupg.1
31 @node watchgnupg
32 @section Read logs from a socket
33 @ifset manverb
34 .B watchgnupg
35 \- Read and print logs from a socket
36 @end ifset
37
38 @mansect synopsis
39 @ifset manverb
40 .B  watchgnupg
41 .RB [ \-\-force ]
42 .RB [ \-\-verbose ]
43 .I socketname
44 @end ifset
45
46 @mansect description
47 Most of the main utilities are able to write their log files to a Unix
48 Domain socket if configured that way.  @command{watchgnupg} is a simple
49 listener for such a socket.  It ameliorates the output with a time stamp
50 and makes sure that long lines are not interspersed with log output from
51 other utilities.  This tool is not available for Windows.
52
53
54 @noindent
55 @command{watchgnupg} is commonly invoked as
56
57 @example
58 watchgnupg --force ~/.gnupg/S.log
59 @end example
60 @manpause
61
62 @noindent
63 This starts it on the current terminal for listening on the socket
64 @file{~/.gnupg/S.log}.
65
66 @mansect options
67 @noindent
68 @command{watchgnupg} understands these options:
69
70 @table @gnupgtabopt
71
72 @item --force
73 @opindex force
74 Delete an already existing socket file.
75
76 @anchor{option watchgnupg --tcp}
77 @item --tcp @var{n}
78 Instead of reading from a local socket, listen for connects on TCP port
79 @var{n}.
80
81 @item --verbose
82 @opindex verbose
83 Enable extra informational output.
84
85 @item --version
86 @opindex version
87 Print version of the program and exit.
88
89 @item --help
90 @opindex help
91 Display a brief help page and exit.
92
93 @end table
94
95 @noindent
96 @mansect examples
97 @chapheading Examples
98
99 @example
100 $ watchgnupg --force /home/foo/.gnupg/S.log
101 @end example
102
103 This waits for connections on the local socket
104 @file{/home/foo/.gnupg/S.log} and shows all log entries.  To make this
105 work the option @option{log-file} needs to be used with all modules
106 which logs are to be shown.  The value for that option must be given
107 with a special prefix (e.g. in the conf file):
108
109 @example
110 log-file socket:///home/foo/.gnupg/S.log
111 @end example
112
113 For debugging purposes it is also possible to do remote logging.  Take
114 care if you use this feature because the information is send in the
115 clear over the network.  Use this syntax in the conf files:
116
117 @example
118 log-file tcp://192.168.1.1:4711
119 @end example
120
121 You may use any port and not just 4711 as shown above; only IP addresses
122 are supported (v4 and v6) and no host names.  You need to start
123 @command{watchgnupg} with the @option{tcp} option.  Note that under
124 Windows the registry entry @var{HKCU\Software\GNU\GnuPG:DefaultLogFile}
125 can be used to change the default log output from @code{stderr} to
126 whatever is given by that entry.  However the only useful entry is a TCP
127 name for remote debugging.
128
129
130 @mansect see also
131 @ifset isman
132 @command{gpg}(1),
133 @command{gpgsm}(1),
134 @command{gpg-agent}(1),
135 @command{scdaemon}(1)
136 @end ifset
137 @include see-also-note.texi
138
139
140 @c
141 @c  GPGV
142 @c
143 @include gpgv.texi
144
145
146 @c
147 @c    ADDGNUPGHOME
148 @c
149 @manpage addgnupghome.8
150 @node addgnupghome
151 @section Create .gnupg home directories.
152 @ifset manverb
153 .B addgnupghome
154 \- Create .gnupg home directories
155 @end ifset
156
157 @mansect synopsis
158 @ifset manverb
159 .B  addgnupghome
160 .I account_1
161 .IR account_2 ... account_n
162 @end ifset
163
164 @mansect description
165 If GnuPG is installed on a system with existing user accounts, it is
166 sometimes required to populate the GnuPG home directory with existing
167 files.  Especially a @file{trustlist.txt} and a keybox with some
168 initial certificates are often desired.  This scripts help to do this
169 by copying all files from @file{/etc/skel/.gnupg} to the home
170 directories of the accounts given on the command line.  It takes care
171 not to overwrite existing GnuPG home directories.
172
173 @noindent
174 @command{addgnupghome} is invoked by root as:
175
176 @example
177 addgnupghome account1 account2 ... accountn
178 @end example
179
180
181 @c
182 @c   GPGCONF
183 @c
184 @manpage gpgconf.1
185 @node gpgconf
186 @section Modify .gnupg home directories.
187 @ifset manverb
188 .B gpgconf
189 \- Modify .gnupg home directories
190 @end ifset
191
192 @mansect synopsis
193 @ifset manverb
194 .B gpgconf
195 .RI [ options ]
196 .B \-\-list-components
197 .br
198 .B gpgconf
199 .RI [ options ]
200 .B \-\-list-options
201 .I component
202 .br
203 .B gpgconf
204 .RI [ options ]
205 .B \-\-change-options
206 .I component
207 @end ifset
208
209
210 @mansect description
211 The @command{gpgconf} is a utility to automatically and reasonable
212 safely query and modify configuration files in the @file{.gnupg} home
213 directory.  It is designed not to be invoked manually by the user, but
214 automatically by graphical user interfaces (GUI).@footnote{Please note
215 that currently no locking is done, so concurrent access should be
216 avoided.  There are some precautions to avoid corruption with
217 concurrent usage, but results may be inconsistent and some changes may
218 get lost.  The stateless design makes it difficult to provide more
219 guarantees.}
220
221 @command{gpgconf} provides access to the configuration of one or more
222 components of the GnuPG system.  These components correspond more or
223 less to the programs that exist in the GnuPG framework, like GnuPG,
224 GPGSM, DirMngr, etc.  But this is not a strict one-to-one
225 relationship.  Not all configuration options are available through
226 @command{gpgconf}.  @command{gpgconf} provides a generic and abstract
227 method to access the most important configuration options that can
228 feasibly be controlled via such a mechanism.
229
230 @command{gpgconf} can be used to gather and change the options
231 available in each component, and can also provide their default
232 values.  @command{gpgconf} will give detailed type information that
233 can be used to restrict the user's input without making an attempt to
234 commit the changes.
235
236 @command{gpgconf} provides the backend of a configuration editor.  The
237 configuration editor would usually be a graphical user interface
238 program, that allows to display the current options, their default
239 values, and allows the user to make changes to the options.  These
240 changes can then be made active with @command{gpgconf} again.  Such a
241 program that uses @command{gpgconf} in this way will be called GUI
242 throughout this section.
243
244 @menu
245 * Invoking gpgconf::       List of all commands and options.
246 * Format conventions::     Formatting conventions relevant for all commands.
247 * Listing components::     List all gpgconf components.
248 * Checking programs::      Check all programs know to gpgconf.
249 * Listing options::        List all options of a component.
250 * Changing options::       Changing options of a component.
251 * Listing global options:: List all global options.
252 * Files used by gpgconf::  What files are used by gpgconf.
253 @end menu
254
255 @manpause
256 @node Invoking gpgconf
257 @subsection Invoking gpgconf
258
259 @mansect commands
260 One of the following commands must be given:
261
262 @table @gnupgtabopt
263
264 @item --list-components
265 List all components.  This is the default command used if none is
266 specified.
267
268 @item --check-programs
269 List all available backend programs and test whether they are runnable.
270
271 @item --list-options @var{component}
272 List all options of the component @var{component}.
273
274 @item --change-options @var{component}
275 Change the options of the component @var{component}.
276
277 @item --check-options @var{component}
278 Check the options for the component @var{component}.
279
280 @item --apply-defaults
281 Update all configuration files with values taken from the global
282 configuration file (usually @file{/etc/gnupg/gpgconf.conf}).
283
284 @item --list-dirs
285 Lists the directories used by @command{gpgconf}.  One directory is
286 listed per line, and each line consists of a colon-separated list where
287 the first field names the directory type (for example @code{sysconfdir})
288 and the second field contains the percent-escaped directory.  Although
289 they are not directories, the socket file names used by
290 @command{gpg-agent} and @command{dirmngr} are printed as well.  Note
291 that the socket file names and the @code{homedir} lines are the default
292 names and they may be overridden by command line switches.
293
294 @item --list-config [@var{filename}]
295 List the global configuration file in a colon separated format.  If
296 @var{filename} is given, check that file instead.
297
298 @item --check-config [@var{filename}]
299 Run a syntax check on the global configuration file.  If @var{filename}
300 is given, check that file instead.
301
302 @item --reload [@var{component}]
303 @opindex reload
304 Reload all or the given component. This is basically the same as sending
305 a SIGHUP to the component.  Components which don't support reloading are
306 ignored.
307
308 @ifset gpgtwoone
309 @item --launch [@var{component}]
310 @opindex launch
311 If the @var{component} is not already running, start it.
312 @command{component} must be a daemon.  This is in general not required
313 because the system starts these daemons as needed.  However, external
314 software making direct use of @command{gpg-agent} or @command{dirmngr}
315 may use this command to ensure that they are started.
316
317 @item --kill [@var{component}]
318 @opindex kill
319 Kill the given component.  Components which support killing are
320 gpg-agent and scdaemon.  Components which don't support reloading are
321 ignored.  Note that as of now reload and kill have the same effect for
322 scdaemon.
323 @end ifset
324
325 @end table
326
327
328 @mansect options
329
330 The following options may be used:
331
332 @table @gnupgtabopt
333 @c FIXME: Not yet supported.
334 @c @item -o @var{file}
335 @c @itemx --output @var{file}
336 @c Use @var{file} as output file.
337
338 @item -v
339 @itemx --verbose
340 Outputs additional information while running.  Specifically, this
341 extends numerical field values by human-readable descriptions.
342
343 @item -n
344 @itemx --dry-run
345 Do not actually change anything.  This is currently only implemented
346 for @code{--change-options} and can be used for testing purposes.
347
348 @item -r
349 @itemx --runtime
350 Only used together with @code{--change-options}.  If one of the
351 modified options can be changed in a running daemon process, signal
352 the running daemon to ask it to reparse its configuration file after
353 changing.
354
355 This means that the changes will take effect at run-time, as far as
356 this is possible.  Otherwise, they will take effect at the next start
357 of the respective backend programs.
358 @manpause
359 @end table
360
361
362 @node Format conventions
363 @subsection Format conventions
364
365 Some lines in the output of @command{gpgconf} contain a list of
366 colon-separated fields.  The following conventions apply:
367
368 @itemize @bullet
369 @item
370 The GUI program is required to strip off trailing newline and/or
371 carriage return characters from the output.
372
373 @item
374 @command{gpgconf} will never leave out fields.  If a certain version
375 provides a certain field, this field will always be present in all
376 @command{gpgconf} versions from that time on.
377
378 @item
379 Future versions of @command{gpgconf} might append fields to the list.
380 New fields will always be separated from the previously last field by
381 a colon separator.  The GUI should be prepared to parse the last field
382 it knows about up until a colon or end of line.
383
384 @item
385 Not all fields are defined under all conditions.  You are required to
386 ignore the content of undefined fields.
387 @end itemize
388
389 There are several standard types for the content of a field:
390
391 @table @asis
392 @item verbatim
393 Some fields contain strings that are not escaped in any way.  Such
394 fields are described to be used @emph{verbatim}.  These fields will
395 never contain a colon character (for obvious reasons).  No de-escaping
396 or other formatting is required to use the field content.  This is for
397 easy parsing of the output, when it is known that the content can
398 never contain any special characters.
399
400 @item percent-escaped
401 Some fields contain strings that are described to be
402 @emph{percent-escaped}.  Such strings need to be de-escaped before
403 their content can be presented to the user.  A percent-escaped string
404 is de-escaped by replacing all occurrences of @code{%XY} by the byte
405 that has the hexadecimal value @code{XY}.  @code{X} and @code{Y} are
406 from the set @code{0-9a-f}.
407
408 @item localised
409 Some fields contain strings that are described to be @emph{localised}.
410 Such strings are translated to the active language and formatted in
411 the active character set.
412
413 @item @w{unsigned number}
414 Some fields contain an @emph{unsigned number}.  This number will
415 always fit into a 32-bit unsigned integer variable.  The number may be
416 followed by a space, followed by a human readable description of that
417 value (if the verbose option is used).  You should ignore everything
418 in the field that follows the number.
419
420 @item @w{signed number}
421 Some fields contain a @emph{signed number}.  This number will always
422 fit into a 32-bit signed integer variable.  The number may be followed
423 by a space, followed by a human readable description of that value (if
424 the verbose option is used).  You should ignore everything in the
425 field that follows the number.
426
427 @item @w{boolean value}
428 Some fields contain a @emph{boolean value}.  This is a number with
429 either the value 0 or 1.  The number may be followed by a space,
430 followed by a human readable description of that value (if the verbose
431 option is used).  You should ignore everything in the field that follows
432 the number; checking just the first character is sufficient in this
433 case.
434
435 @item option
436 Some fields contain an @emph{option} argument.  The format of an
437 option argument depends on the type of the option and on some flags:
438
439 @table @asis
440 @item no argument
441 The simplest case is that the option does not take an argument at all
442 (@var{type} @code{0}).  Then the option argument is an unsigned number
443 that specifies how often the option occurs.  If the @code{list} flag
444 is not set, then the only valid number is @code{1}.  Options that do
445 not take an argument never have the @code{default} or @code{optional
446 arg} flag set.
447
448 @item number
449 If the option takes a number argument (@var{alt-type} is @code{2} or
450 @code{3}), and it can only occur once (@code{list} flag is not set),
451 then the option argument is either empty (only allowed if the argument
452 is optional), or it is a number.  A number is a string that begins
453 with an optional minus character, followed by one or more digits.  The
454 number must fit into an integer variable (unsigned or signed,
455 depending on @var{alt-type}).
456
457 @item number list
458 If the option takes a number argument and it can occur more than once,
459 then the option argument is either empty, or it is a comma-separated
460 list of numbers as described above.
461
462 @item string
463 If the option takes a string argument (@var{alt-type} is 1), and it
464 can only occur once (@code{list} flag is not set) then the option
465 argument is either empty (only allowed if the argument is optional),
466 or it starts with a double quote character (@code{"}) followed by a
467 percent-escaped string that is the argument value.  Note that there is
468 only a leading double quote character, no trailing one.  The double
469 quote character is only needed to be able to differentiate between no
470 value and the empty string as value.
471
472 @item string list
473 If the option takes a number argument and it can occur more than once,
474 then the option argument is either empty, or it is a comma-separated
475 list of string arguments as described above.
476 @end table
477 @end table
478
479 The active language and character set are currently determined from
480 the locale environment of the @command{gpgconf} program.
481
482 @c FIXME: Document the active language and active character set.  Allow
483 @c to change it via the command line?
484
485
486 @mansect usage
487 @node Listing components
488 @subsection Listing components
489
490 The command @code{--list-components} will list all components that can
491 be configured with @command{gpgconf}.  Usually, one component will
492 correspond to one GnuPG-related program and contain the options of
493 that programs configuration file that can be modified using
494 @command{gpgconf}.  However, this is not necessarily the case.  A
495 component might also be a group of selected options from several
496 programs, or contain entirely virtual options that have a special
497 effect rather than changing exactly one option in one configuration
498 file.
499
500 A component is a set of configuration options that semantically belong
501 together.  Furthermore, several changes to a component can be made in
502 an atomic way with a single operation.  The GUI could for example
503 provide a menu with one entry for each component, or a window with one
504 tabulator sheet per component.
505
506 The command argument @code{--list-components} lists all available
507 components, one per line.  The format of each line is:
508
509 @code{@var{name}:@var{description}:@var{pgmname}:}
510
511 @table @var
512 @item name
513 This field contains a name tag of the component.  The name tag is used
514 to specify the component in all communication with @command{gpgconf}.
515 The name tag is to be used @emph{verbatim}.  It is thus not in any
516 escaped format.
517
518 @item description
519 The @emph{string} in this field contains a human-readable description
520 of the component.  It can be displayed to the user of the GUI for
521 informational purposes.  It is @emph{percent-escaped} and
522 @emph{localized}.
523
524 @item pgmname
525 The @emph{string} in this field contains the absolute name of the
526 program's file.  It can be used to unambiguously invoke that program.
527 It is @emph{percent-escaped}.
528 @end table
529
530 Example:
531 @example
532 $ gpgconf --list-components
533 gpg:GPG for OpenPGP:/usr/local/bin/gpg2:
534 gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:
535 scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:
536 gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:
537 dirmngr:Directory Manager:/usr/local/bin/dirmngr:
538 @end example
539
540
541
542 @node Checking programs
543 @subsection Checking programs
544
545 The command @code{--check-programs} is similar to
546 @code{--list-components} but works on backend programs and not on
547 components.  It runs each program to test whether it is installed and
548 runnable.  This also includes a syntax check of all config file options
549 of the program.
550
551 The command argument @code{--check-programs} lists all available
552 programs, one per line.  The format of each line is:
553
554 @code{@var{name}:@var{description}:@var{pgmname}:@var{avail}:@var{okay}:@var{cfgfile}:@var{line}:@var{error}:}
555
556 @table @var
557 @item name
558 This field contains a name tag of the program which is identical to the
559 name of the component.  The name tag is to be used @emph{verbatim}.  It
560 is thus not in any escaped format.  This field may be empty to indicate
561 a continuation of error descriptions for the last name.  The description
562 and pgmname fields are then also empty.
563
564 @item description
565 The @emph{string} in this field contains a human-readable description
566 of the component.  It can be displayed to the user of the GUI for
567 informational purposes.  It is @emph{percent-escaped} and
568 @emph{localized}.
569
570 @item pgmname
571 The @emph{string} in this field contains the absolute name of the
572 program's file.  It can be used to unambiguously invoke that program.
573 It is @emph{percent-escaped}.
574
575 @item avail
576 The @emph{boolean value} in this field indicates whether the program is
577 installed and runnable.
578
579 @item okay
580 The @emph{boolean value} in this field indicates whether the program's
581 config file is syntactically okay.
582
583 @item cfgfile
584 If an error occurred in the configuration file (as indicated by a false
585 value in the field @code{okay}), this field has the name of the failing
586 configuration file.  It is @emph{percent-escaped}.
587
588 @item line
589 If an error occurred in the configuration file, this field has the line
590 number of the failing statement in the configuration file.
591 It is an @emph{unsigned number}.
592
593 @item error
594 If an error occurred in the configuration file, this field has the error
595 text of the failing statement in the configuration file.  It is
596 @emph{percent-escaped} and @emph{localized}.
597
598 @end table
599
600 @noindent
601 In the following example the @command{dirmngr} is not runnable and the
602 configuration file of @command{scdaemon} is not okay.
603
604 @example
605 $ gpgconf --check-programs
606 gpg:GPG for OpenPGP:/usr/local/bin/gpg2:1:1:
607 gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:1:1:
608 scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:1:0:
609 gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:1:1:
610 dirmngr:Directory Manager:/usr/local/bin/dirmngr:0:0:
611 @end example
612
613 @noindent
614 The command @w{@code{--check-options @var{component}}} will verify the
615 configuration file in the same manner as @code{--check-programs}, but
616 only for the component @var{component}.
617
618
619 @node Listing options
620 @subsection Listing options
621
622 Every component contains one or more options.  Options may be gathered
623 into option groups to allow the GUI to give visual hints to the user
624 about which options are related.
625
626 The command argument @code{@w{--list-options @var{component}}} lists
627 all options (and the groups they belong to) in the component
628 @var{component}, one per line.  @var{component} must be the string in
629 the field @var{name} in the output of the @code{--list-components}
630 command.
631
632 There is one line for each option and each group.  First come all
633 options that are not in any group.  Then comes a line describing a
634 group.  Then come all options that belong into each group.  Then comes
635 the next group and so on.  There does not need to be any group (and in
636 this case the output will stop after the last non-grouped option).
637
638 The format of each line is:
639
640 @code{@var{name}:@var{flags}:@var{level}:@var{description}:@var{type}:@var{alt-type}:@var{argname}:@var{default}:@var{argdef}:@var{value}}
641
642 @table @var
643 @item name
644 This field contains a name tag for the group or option.  The name tag
645 is used to specify the group or option in all communication with
646 @command{gpgconf}.  The name tag is to be used @emph{verbatim}.  It is
647 thus not in any escaped format.
648
649 @item flags
650 The flags field contains an @emph{unsigned number}.  Its value is the
651 OR-wise combination of the following flag values:
652
653 @table @code
654 @item group (1)
655 If this flag is set, this is a line describing a group and not an
656 option.
657 @end table
658
659 The following flag values are only defined for options (that is, if
660 the @code{group} flag is not used).
661
662 @table @code
663 @item optional arg (2)
664 If this flag is set, the argument is optional.  This is never set for
665 @var{type} @code{0} (none) options.
666
667 @item list (4)
668 If this flag is set, the option can be given multiple times.
669
670 @item runtime (8)
671 If this flag is set, the option can be changed at runtime.
672
673 @item default (16)
674 If this flag is set, a default value is available.
675
676 @item default desc (32)
677 If this flag is set, a (runtime) default is available.  This and the
678 @code{default} flag are mutually exclusive.
679
680 @item no arg desc (64)
681 If this flag is set, and the @code{optional arg} flag is set, then the
682 option has a special meaning if no argument is given.
683
684 @item no change (128)
685 If this flag is set, gpgconf ignores requests to change the value.  GUI
686 frontends should grey out this option.  Note, that manual changes of the
687 configuration files are still possible.
688 @end table
689
690 @item level
691 This field is defined for options and for groups.  It contains an
692 @emph{unsigned number} that specifies the expert level under which
693 this group or option should be displayed.  The following expert levels
694 are defined for options (they have analogous meaning for groups):
695
696 @table @code
697 @item basic (0)
698 This option should always be offered to the user.
699
700 @item advanced (1)
701 This option may be offered to advanced users.
702
703 @item expert (2)
704 This option should only be offered to expert users.
705
706 @item invisible (3)
707 This option should normally never be displayed, not even to expert
708 users.
709
710 @item internal (4)
711 This option is for internal use only.  Ignore it.
712 @end table
713
714 The level of a group will always be the lowest level of all options it
715 contains.
716
717 @item description
718 This field is defined for options and groups.  The @emph{string} in
719 this field contains a human-readable description of the option or
720 group.  It can be displayed to the user of the GUI for informational
721 purposes.  It is @emph{percent-escaped} and @emph{localized}.
722
723 @item type
724 This field is only defined for options.  It contains an @emph{unsigned
725 number} that specifies the type of the option's argument, if any.  The
726 following types are defined:
727
728 Basic types:
729
730 @table @code
731 @item none (0)
732 No argument allowed.
733
734 @item string (1)
735 An @emph{unformatted string}.
736
737 @item int32 (2)
738 A @emph{signed number}.
739
740 @item uint32 (3)
741 An @emph{unsigned number}.
742 @end table
743
744 Complex types:
745
746 @table @code
747 @item pathname (32)
748 A @emph{string} that describes the pathname of a file.  The file does
749 not necessarily need to exist.
750
751 @item ldap server (33)
752 A @emph{string} that describes an LDAP server in the format:
753
754 @code{@var{hostname}:@var{port}:@var{username}:@var{password}:@var{base_dn}}
755
756 @item key fingerprint (34)
757 A @emph{string} with a 40 digit fingerprint specifying a certificate.
758
759 @item pub key (35)
760 A @emph{string} that describes a certificate by user ID, key ID or
761 fingerprint.
762
763 @item sec key (36)
764 A @emph{string} that describes a certificate with a key by user ID,
765 key ID or fingerprint.
766
767 @item alias list (37)
768 A @emph{string} that describes an alias list, like the one used with
769 gpg's group option.  The list consists of a key, an equal sign and space
770 separated values.
771 @end table
772
773 More types will be added in the future.  Please see the @var{alt-type}
774 field for information on how to cope with unknown types.
775
776 @item alt-type
777 This field is identical to @var{type}, except that only the types
778 @code{0} to @code{31} are allowed.  The GUI is expected to present the
779 user the option in the format specified by @var{type}.  But if the
780 argument type @var{type} is not supported by the GUI, it can still
781 display the option in the more generic basic type @var{alt-type}.  The
782 GUI must support all the defined basic types to be able to display all
783 options.  More basic types may be added in future versions.  If the
784 GUI encounters a basic type it doesn't support, it should report an
785 error and abort the operation.
786
787 @item argname
788 This field is only defined for options with an argument type
789 @var{type} that is not @code{0}.  In this case it may contain a
790 @emph{percent-escaped} and @emph{localised string} that gives a short
791 name for the argument.  The field may also be empty, though, in which
792 case a short name is not known.
793
794 @item default
795 This field is defined only for options for which the @code{default} or
796 @code{default desc} flag is set.  If the @code{default} flag is set,
797 its format is that of an @emph{option argument} (@xref{Format
798 conventions}, for details).  If the default value is empty, then no
799 default is known.  Otherwise, the value specifies the default value
800 for this option.  If the @code{default desc} flag is set, the field is
801 either empty or contains a description of the effect if the option is
802 not given.
803
804 @item argdef
805 This field is defined only for options for which the @code{optional
806 arg} flag is set.  If the @code{no arg desc} flag is not set, its
807 format is that of an @emph{option argument} (@xref{Format
808 conventions}, for details).  If the default value is empty, then no
809 default is known.  Otherwise, the value specifies the default argument
810 for this option.  If the @code{no arg desc} flag is set, the field is
811 either empty or contains a description of the effect of this option if
812 no argument is given.
813
814 @item value
815 This field is defined only for options.  Its format is that of an
816 @emph{option argument}.  If it is empty, then the option is not
817 explicitly set in the current configuration, and the default applies
818 (if any).  Otherwise, it contains the current value of the option.
819 Note that this field is also meaningful if the option itself does not
820 take a real argument (in this case, it contains the number of times
821 the option appears).
822 @end table
823
824
825 @node Changing options
826 @subsection Changing options
827
828 The command @w{@code{--change-options @var{component}}} will attempt
829 to change the options of the component @var{component} to the
830 specified values.  @var{component} must be the string in the field
831 @var{name} in the output of the @code{--list-components} command.  You
832 have to provide the options that shall be changed in the following
833 format on standard input:
834
835 @code{@var{name}:@var{flags}:@var{new-value}}
836
837 @table @var
838 @item name
839 This is the name of the option to change.  @var{name} must be the
840 string in the field @var{name} in the output of the
841 @code{--list-options} command.
842
843 @item flags
844 The flags field contains an @emph{unsigned number}.  Its value is the
845 OR-wise combination of the following flag values:
846
847 @table @code
848 @item default (16)
849 If this flag is set, the option is deleted and the default value is
850 used instead (if applicable).
851 @end table
852
853 @item new-value
854 The new value for the option.  This field is only defined if the
855 @code{default} flag is not set.  The format is that of an @emph{option
856 argument}.  If it is empty (or the field is omitted), the default
857 argument is used (only allowed if the argument is optional for this
858 option).  Otherwise, the option will be set to the specified value.
859 @end table
860
861 @noindent
862 The output of the command is the same as that of
863 @code{--check-options} for the modified configuration file.
864
865 Examples:
866
867 To set the force option, which is of basic type @code{none (0)}:
868
869 @example
870 $ echo 'force:0:1' | gpgconf --change-options dirmngr
871 @end example
872
873 To delete the force option:
874
875 @example
876 $ echo 'force:16:' | gpgconf --change-options dirmngr
877 @end example
878
879 The @code{--runtime} option can influence when the changes take
880 effect.
881
882
883 @node Listing global options
884 @subsection Listing global options
885
886 Sometimes it is useful for applications to look at the global options
887 file @file{gpgconf.conf}.
888 The colon separated listing format is record oriented and uses the first
889 field to identify the record type:
890
891 @table @code
892 @item k
893 This describes a key record to start the definition of a new ruleset for
894 a user/group.  The format of a key record is:
895
896   @code{k:@var{user}:@var{group}:}
897
898 @table @var
899 @item user
900 This is the user field of the key.  It is percent escaped.  See the
901 definition of the gpgconf.conf format for details.
902
903 @item group
904 This is the group field of the key.  It is percent escaped.
905 @end table
906
907 @item r
908 This describes a rule record. All rule records up to the next key record
909 make up a rule set for that key.  The format of a rule record is:
910
911   @code{r:::@var{component}:@var{option}:@var{flags}:@var{value}:}
912
913 @table @var
914 @item component
915 This is the component part of a rule.  It is a plain string.
916
917 @item option
918 This is the option part of a rule.  It is a plain string.
919
920 @item flag
921 This is the flags part of a rule.  There may be only one flag per rule
922 but by using the same component and option, several flags may be
923 assigned to an option.  It is a plain string.
924
925 @item value
926 This is the optional value for the option.  It is a percent escaped
927 string with a single quotation mark to indicate a string.  The quotation
928 mark is only required to distinguish between no value specified and an
929 empty string.
930 @end table
931
932 @end table
933
934 @noindent
935 Unknown record types should be ignored.  Note that there is intentionally
936 no feature to change the global option file through @command{gpgconf}.
937
938
939
940 @mansect files
941 @node Files used by gpgconf
942 @subsection Files used by gpgconf
943
944 @table @file
945
946 @item /etc/gnupg/gpgconf.conf
947 @cindex gpgconf.conf
948   If this file exists, it is processed as a global configuration file.
949   A commented example can be found in the @file{examples} directory of
950   the distribution.
951 @end table
952
953
954 @mansect see also
955 @ifset isman
956 @command{gpg}(1),
957 @command{gpgsm}(1),
958 @command{gpg-agent}(1),
959 @command{scdaemon}(1),
960 @command{dirmngr}(1)
961 @end ifset
962 @include see-also-note.texi
963
964
965
966 @c
967 @c    APPLYGNUPGDEFAULTS
968 @c
969 @manpage applygnupgdefaults.8
970 @node applygnupgdefaults
971 @section Run gpgconf for all users.
972 @ifset manverb
973 .B applygnupgdefaults
974 \- Run gpgconf --apply-defaults for all users.
975 @end ifset
976
977 @mansect synopsis
978 @ifset manverb
979 .B  applygnupgdefaults
980 @end ifset
981
982 @mansect description
983 This script is a wrapper around @command{gpgconf} to run it with the
984 command @code{--apply-defaults} for all real users with an existing
985 GnuPG home directory.  Admins might want to use this script to update he
986 GnuPG configuration files for all users after
987 @file{/etc/gnupg/gpgconf.conf} has been changed.  This allows to enforce
988 certain policies for all users.  Note, that this is not a bulletproof of
989 forcing a user to use certain options.  A user may always directly edit
990 the configuration files and bypass gpgconf.
991
992 @noindent
993 @command{applygnupgdefaults} is invoked by root as:
994
995 @example
996 applygnupgdefaults
997 @end example
998
999
1000 @c
1001 @c    GPGSM-GENCERT.SH
1002 @c
1003 @node gpgsm-gencert.sh
1004 @section Generate an X.509 certificate request
1005 @manpage gpgsm-gencert.sh.1
1006 @ifset manverb
1007 .B gpgsm-gencert.sh
1008 \- Generate an X.509 certificate request
1009 @end ifset
1010
1011 @mansect synopsis
1012 @ifset manverb
1013 .B  gpgsm-gencert.sh
1014 @end ifset
1015
1016 @mansect description
1017 This is a simple tool to interactively generate a certificate request
1018 which will be printed to stdout.
1019
1020 @manpause
1021 @noindent
1022 @command{gpgsm-gencert.sh} is invoked as:
1023
1024 @samp{gpgsm-cencert.sh}
1025
1026 @mansect see also
1027 @ifset isman
1028 @command{gpgsm}(1),
1029 @command{gpg-agent}(1),
1030 @command{scdaemon}(1)
1031 @end ifset
1032 @include see-also-note.texi
1033
1034
1035
1036 @c
1037 @c   GPG-PRESET-PASSPHRASE
1038 @c
1039 @node gpg-preset-passphrase
1040 @section Put a passphrase into the cache.
1041 @manpage gpg-preset-passphrase.1
1042 @ifset manverb
1043 .B gpg-preset-passphrase
1044 \- Put a passphrase into gpg-agent's cache
1045 @end ifset
1046
1047 @mansect synopsis
1048 @ifset manverb
1049 .B  gpg-preset-passphrase
1050 .RI [ options ]
1051 .RI [ command ]
1052 .I cache-id
1053 @end ifset
1054
1055 @mansect description
1056 The @command{gpg-preset-passphrase} is a utility to seed the internal
1057 cache of a running @command{gpg-agent} with passphrases.  It is mainly
1058 useful for unattended machines, where the usual @command{pinentry} tool
1059 may not be used and the passphrases for the to be used keys are given at
1060 machine startup.
1061
1062 Passphrases set with this utility don't expire unless the
1063 @option{--forget} option is used to explicitly clear them from the
1064 cache --- or @command{gpg-agent} is either restarted or reloaded (by
1065 sending a SIGHUP to it).  Note that the maximum cache time as set with
1066 @option{--max-cache-ttl} is still honored.  It is necessary to allow
1067 this passphrase presetting by starting @command{gpg-agent} with the
1068 @option{--allow-preset-passphrase}.
1069
1070 @menu
1071 * Invoking gpg-preset-passphrase::   List of all commands and options.
1072 @end menu
1073
1074 @manpause
1075 @node Invoking gpg-preset-passphrase
1076 @subsection List of all commands and options.
1077 @mancont
1078
1079 @noindent
1080 @command{gpg-preset-passphrase} is invoked this way:
1081
1082 @example
1083 gpg-preset-passphrase [options] [command] @var{cacheid}
1084 @end example
1085
1086 @var{cacheid} is either a 40 character keygrip of hexadecimal
1087 characters identifying the key for which the passphrase should be set
1088 or cleared.  The keygrip is listed along with the key when running the
1089 command: @code{gpgsm --dump-secret-keys}.  Alternatively an arbitrary
1090 string may be used to identify a passphrase; it is suggested that such
1091 a string is prefixed with the name of the application (e.g
1092 @code{foo:12346}).
1093
1094 @noindent
1095 One of the following command options must be given:
1096
1097 @table @gnupgtabopt
1098 @item --preset
1099 @opindex preset
1100 Preset a passphrase. This is what you usually will
1101 use. @command{gpg-preset-passphrase} will then read the passphrase from
1102 @code{stdin}.
1103
1104 @item --forget
1105 @opindex forget
1106 Flush the passphrase for the given cache ID from the cache.
1107
1108 @end table
1109
1110 @noindent
1111 The following additional options may be used:
1112
1113 @table @gnupgtabopt
1114 @item -v
1115 @itemx --verbose
1116 @opindex verbose
1117 Output additional information while running.
1118
1119 @item -P @var{string}
1120 @itemx --passphrase @var{string}
1121 @opindex passphrase
1122 Instead of reading the passphrase from @code{stdin}, use the supplied
1123 @var{string} as passphrase.  Note that this makes the passphrase visible
1124 for other users.
1125 @end table
1126
1127 @mansect see also
1128 @ifset isman
1129 @command{gpg}(1),
1130 @command{gpgsm}(1),
1131 @command{gpg-agent}(1),
1132 @command{scdaemon}(1)
1133 @end ifset
1134 @include see-also-note.texi
1135
1136
1137
1138
1139 @c
1140 @c   GPG-CONNECT-AGENT
1141 @c
1142 @node gpg-connect-agent
1143 @section Communicate with a running agent.
1144 @manpage gpg-connect-agent.1
1145 @ifset manverb
1146 .B gpg-connect-agent
1147 \- Communicate with a running agent
1148 @end ifset
1149
1150 @mansect synopsis
1151 @ifset manverb
1152 .B  gpg-connect-agent
1153 .RI [ options ] [commands]
1154 @end ifset
1155
1156 @mansect description
1157 The @command{gpg-connect-agent} is a utility to communicate with a
1158 running @command{gpg-agent}.  It is useful to check out the commands
1159 gpg-agent provides using the Assuan interface.  It might also be useful
1160 for scripting simple applications.  Input is expected at stdin and out
1161 put gets printed to stdout.
1162
1163 It is very similar to running @command{gpg-agent} in server mode; but
1164 here we connect to a running instance.
1165
1166 @menu
1167 * Invoking gpg-connect-agent::       List of all options.
1168 * Controlling gpg-connect-agent::    Control commands.
1169 @end menu
1170
1171 @manpause
1172 @node Invoking gpg-connect-agent
1173 @subsection List of all options.
1174
1175 @noindent
1176 @command{gpg-connect-agent} is invoked this way:
1177
1178 @example
1179 gpg-connect-agent [options] [commands]
1180 @end example
1181 @mancont
1182
1183 @noindent
1184 The following options may be used:
1185
1186 @table @gnupgtabopt
1187 @item -v
1188 @itemx --verbose
1189 @opindex verbose
1190 Output additional information while running.
1191
1192 @item -q
1193 @item --quiet
1194 @opindex q
1195 @opindex quiet
1196 Try to be as quiet as possible.
1197
1198 @include opt-homedir.texi
1199
1200 @item --agent-program @var{file}
1201 @opindex agent-program
1202 Specify the agent program to be started if none is running.  The
1203 default value is determined by running @command{gpgconf} with the
1204 option @option{--list-dirs}.  Note that the pipe symbol (@code{|}) is
1205 used for a regression test suite hack and may thus not be used in the
1206 file name.
1207
1208 @ifset gpgtwoone
1209 @item --dirmngr-program @var{file}
1210 @opindex dirmngr-program
1211 Specify the directory manager (keyserver client) program to be started
1212 if none is running.  This has only an effect if used together with the
1213 option @option{--dirmngr}.
1214
1215 @item --dirmngr
1216 @opindex dirmngr
1217 Connect to a running directory manager (keyserver client) instead of
1218 to the gpg-agent.  If a dirmngr is not running, start it.
1219 @end ifset
1220
1221 @item -S
1222 @itemx --raw-socket @var{name}
1223 @opindex raw-socket
1224 Connect to socket @var{name} assuming this is an Assuan style server.
1225 Do not run any special initializations or environment checks.  This may
1226 be used to directly connect to any Assuan style socket server.
1227
1228 @item -E
1229 @itemx --exec
1230 @opindex exec
1231 Take the rest of the command line as a program and it's arguments and
1232 execute it as an assuan server. Here is how you would run @command{gpgsm}:
1233 @smallexample
1234  gpg-connect-agent --exec gpgsm --server
1235 @end smallexample
1236 Note that you may not use options on the command line in this case.
1237
1238 @item --no-ext-connect
1239 @opindex no-ext-connect
1240 When using @option{-S} or @option{--exec}, @command{gpg-connect-agent}
1241 connects to the assuan server in extended mode to allow descriptor
1242 passing.  This option makes it use the old mode.
1243
1244 @item --no-autostart
1245 @opindex no-autostart
1246 Do not start the gpg-agent or the dirmngr if it has not yet been
1247 started.
1248
1249 @item --run @var{file}
1250 @opindex run
1251 Run the commands from @var{file} at startup and then continue with the
1252 regular input method.  Note, that commands given on the command line are
1253 executed after this file.
1254
1255 @item -s
1256 @itemx --subst
1257 @opindex subst
1258 Run the command @code{/subst} at startup.
1259
1260 @item --hex
1261 @opindex hex
1262 Print data lines in a hex format and the ASCII representation of
1263 non-control characters.
1264
1265 @item --decode
1266 @opindex decode
1267 Decode data lines.  That is to remove percent escapes but make sure that
1268 a new line always starts with a D and a space.
1269
1270 @end table
1271
1272 @mansect control commands
1273 @node Controlling gpg-connect-agent
1274 @subsection Control commands.
1275
1276 While reading Assuan commands, gpg-agent also allows a few special
1277 commands to control its operation.  These control commands all start
1278 with a slash (@code{/}).
1279
1280 @table @code
1281
1282 @item /echo @var{args}
1283 Just print @var{args}.
1284
1285 @item /let @var{name} @var{value}
1286 Set the variable @var{name} to @var{value}.  Variables are only
1287 substituted on the input if the @command{/subst} has been used.
1288 Variables are referenced by prefixing the name with a dollar sign and
1289 optionally include the name in curly braces.  The rules for a valid name
1290 are identically to those of the standard bourne shell.  This is not yet
1291 enforced but may be in the future.  When used with curly braces no
1292 leading or trailing white space is allowed.
1293
1294 If a variable is not found, it is searched in the environment and if
1295 found copied to the table of variables.
1296
1297 Variable functions are available: The name of the function must be
1298 followed by at least one space and the at least one argument.  The
1299 following functions are available:
1300
1301 @table @code
1302 @item get
1303 Return a value described by the argument.  Available arguments are:
1304
1305 @table @code
1306 @item cwd
1307 The current working directory.
1308 @item homedir
1309 The gnupg homedir.
1310 @item sysconfdir
1311 GnuPG's system configuration directory.
1312 @item bindir
1313 GnuPG's binary directory.
1314 @item libdir
1315 GnuPG's library directory.
1316 @item libexecdir
1317 GnuPG's library directory for executable files.
1318 @item datadir
1319 GnuPG's data directory.
1320 @item serverpid
1321 The PID of the current server. Command @command{/serverpid} must
1322 have been given to return a useful value.
1323 @end table
1324
1325 @item unescape @var{args}
1326 Remove C-style escapes from @var{args}.  Note that @code{\0} and
1327 @code{\x00} terminate the returned string implicitly.  The string to be
1328 converted are the entire arguments right behind the delimiting space of
1329 the function name.
1330
1331 @item unpercent @var{args}
1332 @itemx unpercent+ @var{args}
1333 Remove percent style escaping from @var{args}.  Note that @code{%00}
1334 terminates the string implicitly.  The string to be converted are the
1335 entire arguments right behind the delimiting space of the function
1336 name. @code{unpercent+} also maps plus signs to a spaces.
1337
1338 @item percent @var{args}
1339 @itemx percent+ @var{args}
1340 Escape the @var{args} using percent style escaping.  Tabs, formfeeds,
1341 linefeeds, carriage returns and colons are escaped. @code{percent+} also
1342 maps spaces to plus signs.
1343
1344 @item errcode @var{arg}
1345 @itemx errsource @var{arg}
1346 @itemx errstring @var{arg}
1347 Assume @var{arg} is an integer and evaluate it using @code{strtol}.  Return
1348 the gpg-error error code, error source or a formatted string with the
1349 error code and error source.
1350
1351
1352 @item +
1353 @itemx -
1354 @itemx *
1355 @itemx /
1356 @itemx %
1357 Evaluate all arguments as long integers using @code{strtol} and apply
1358 this operator.  A division by zero yields an empty string.
1359
1360 @item !
1361 @itemx |
1362 @itemx &
1363 Evaluate all arguments as long integers using @code{strtol} and apply
1364 the logical oeprators NOT, OR or AND.  The NOT operator works on the
1365 last argument only.
1366
1367
1368 @end table
1369
1370
1371 @item /definq @var{name} @var{var}
1372 Use content of the variable @var{var} for inquiries with @var{name}.
1373 @var{name} may be an asterisk (@code{*}) to match any inquiry.
1374
1375
1376 @item /definqfile @var{name} @var{file}
1377 Use content of @var{file} for inquiries with @var{name}.
1378 @var{name} may be an asterisk (@code{*}) to match any inquiry.
1379
1380 @item /definqprog @var{name} @var{prog}
1381 Run @var{prog} for inquiries matching @var{name} and pass the
1382 entire line to it as command line arguments.
1383
1384 @item /datafile @var{name}
1385 Write all data lines from the server to the file @var{name}.  The file
1386 is opened for writing and created if it does not exists.  An existing
1387 file is first truncated to 0.  The data written to the file fully
1388 decoded.  Using a single dash for @var{name} writes to stdout.  The
1389 file is kept open until a new file is set using this command or this
1390 command is used without an argument.
1391
1392 @item /showdef
1393 Print all definitions
1394
1395 @item /cleardef
1396 Delete all definitions
1397
1398 @item /sendfd @var{file} @var{mode}
1399 Open @var{file} in @var{mode} (which needs to be a valid @code{fopen}
1400 mode string) and send the file descriptor to the server.  This is
1401 usually followed by a command like @code{INPUT FD} to set the
1402 input source for other commands.
1403
1404 @item /recvfd
1405 Not yet implemented.
1406
1407 @item /open @var{var} @var{file} [@var{mode}]
1408 Open @var{file} and assign the file descriptor to @var{var}.  Warning:
1409 This command is experimental and might change in future versions.
1410
1411 @item /close @var{fd}
1412 Close the file descriptor @var{fd}.  Warning: This command is
1413 experimental and might change in future versions.
1414
1415 @item /showopen
1416 Show a list of open files.
1417
1418 @item /serverpid
1419 Send the Assuan command @command{GETINFO pid} to the server and store
1420 the returned PID for internal purposes.
1421
1422 @item /sleep
1423 Sleep for a second.
1424
1425 @item /hex
1426 @itemx /nohex
1427 Same as the command line option @option{--hex}.
1428
1429 @item /decode
1430 @itemx /nodecode
1431 Same as the command line option @option{--decode}.
1432
1433 @item /subst
1434 @itemx /nosubst
1435 Enable and disable variable substitution.  It defaults to disabled
1436 unless the command line option @option{--subst} has been used.
1437 If /subst as been enabled once, leading whitespace is removed from
1438 input lines which makes scripts easier to read.
1439
1440 @item /while @var{condition}
1441 @itemx /end
1442 These commands provide a way for executing loops.  All lines between
1443 the @code{while} and the corresponding @code{end} are executed as long
1444 as the evaluation of @var{condition} yields a non-zero value or is the
1445 string @code{true} or @code{yes}.  The evaluation is done by passing
1446 @var{condition} to the @code{strtol} function.  Example:
1447
1448 @smallexample
1449   /subst
1450   /let i 3
1451   /while $i
1452     /echo loop couter is $i
1453     /let i $@{- $i 1@}
1454   /end
1455 @end smallexample
1456
1457 @item /if @var{condition}
1458 @itemx /end
1459 These commands provide a way for conditional execution.  All lines between
1460 the @code{if} and the corresponding @code{end} are executed only if
1461 the evaluation of @var{condition} yields a non-zero value or is the
1462 string @code{true} or @code{yes}.  The evaluation is done by passing
1463 @var{condition} to the @code{strtol} function.
1464
1465 @item /run @var{file}
1466 Run commands from @var{file}.
1467
1468 @item /bye
1469 Terminate the connection and the program
1470
1471 @item /help
1472 Print a list of available control commands.
1473
1474 @end table
1475
1476
1477 @ifset isman
1478 @mansect see also
1479 @command{gpg-agent}(1),
1480 @command{scdaemon}(1)
1481 @include see-also-note.texi
1482 @end ifset
1483
1484 @ifset gpgtwoone
1485 @c
1486 @c   DIRMNGR-CLIENT
1487 @c
1488 @node dirmngr-client
1489 @section The Dirmngr Client Tool
1490
1491 @manpage dirmngr-client.1
1492 @ifset manverb
1493 .B dirmngr-client
1494 \- Tool to access the Dirmngr services
1495 @end ifset
1496
1497 @mansect synopsis
1498 @ifset manverb
1499 .B  dirmngr-client
1500 .RI [ options ]
1501 .RI [ certfile | pattern ]
1502 @end ifset
1503
1504 @mansect description
1505 The @command{dirmngr-client} is a simple tool to contact a running
1506 dirmngr and test whether a certificate has been revoked --- either by
1507 being listed in the corresponding CRL or by running the OCSP protocol.
1508 If no dirmngr is running, a new instances will be started but this is
1509 in general not a good idea due to the huge performance overhead.
1510
1511 @noindent
1512 The usual way to run this tool is either:
1513
1514 @example
1515 dirmngr-client @var{acert}
1516 @end example
1517
1518 @noindent
1519 or
1520
1521 @example
1522 dirmngr-client <@var{acert}
1523 @end example
1524
1525 Where @var{acert} is one DER encoded (binary) X.509 certificates to be
1526 tested.
1527 @ifclear isman
1528 The return value of this command is
1529 @end ifclear
1530
1531 @mansect return value
1532 @ifset isman
1533 @command{dirmngr-client} returns these values:
1534 @end ifset
1535 @table @code
1536
1537 @item 0
1538 The certificate under question is valid; i.e. there is a valid CRL
1539 available and it is not listed tehre or teh OCSP request returned that
1540 that certificate is valid.
1541
1542 @item 1
1543 The certificate has been revoked
1544
1545 @item 2 (and other values)
1546 There was a problem checking the revocation state of the certificate.
1547 A message to stderr has given more detailed information.  Most likely
1548 this is due to a missing or expired CRL or due to a network problem.
1549
1550 @end table
1551
1552 @mansect options
1553 @noindent
1554 @command{dirmngr-client} may be called with the following options:
1555
1556
1557 @table @gnupgtabopt
1558 @item --version
1559 @opindex version
1560 Print the program version and licensing information.  Note that you cannot
1561 abbreviate this command.
1562
1563 @item --help, -h
1564 @opindex help
1565 Print a usage message summarizing the most useful command-line options.
1566 Note that you cannot abbreviate this command.
1567
1568 @item --quiet, -q
1569 @opindex quiet
1570 Make the output extra brief by suppressing any informational messages.
1571
1572 @item -v
1573 @item --verbose
1574 @opindex v
1575 @opindex verbose
1576 Outputs additional information while running.
1577 You can increase the verbosity by giving several
1578 verbose commands to @sc{dirmngr}, such as @samp{-vv}.
1579
1580 @item --pem
1581 @opindex pem
1582 Assume that the given certificate is in PEM (armored) format.
1583
1584 @item --ocsp
1585 @opindex ocsp
1586 Do the check using the OCSP protocol and ignore any CRLs.
1587
1588 @item --force-default-responder
1589 @opindex force-default-responder
1590 When checking using the OCSP protocl, force the use of the default OCSP
1591 responder.  That is not to use the Reponder as given by the certificate.
1592
1593 @item --ping
1594 @opindex ping
1595 Check whether the dirmngr daemon is up and running.
1596
1597 @item --cache-cert
1598 @opindex cache-cert
1599 Put the given certificate into the cache of a running dirmngr.  This is
1600 mainly useful for debugging.
1601
1602 @item --validate
1603 @opindex validate
1604 Validate the given certificate using dirmngr's internal validation code.
1605 This is mainly useful for debugging.
1606
1607 @item --load-crl
1608 @opindex load-crl
1609 This command expects a list of filenames with DER encoded CRL files.
1610 With the option @option{--url} URLs are expected in place of filenames
1611 and they are loaded directly from the given location.  All CRLs will be
1612 validated and then loaded into dirmngr's cache.
1613
1614 @item --lookup
1615 @opindex lookup
1616 Take the remaining arguments and run a lookup command on each of them.
1617 The results are Base-64 encoded outputs (without header lines).  This
1618 may be used to retrieve certificates from a server. However the output
1619 format is not very well suited if more than one certificate is returned.
1620
1621 @item --url
1622 @itemx -u
1623 @opindex url
1624 Modify the @command{lookup} and @command{load-crl} commands to take an URL.
1625
1626 @item --local
1627 @itemx -l
1628 @opindex url
1629 Let the @command{lookup} command only search the local cache.
1630
1631 @item --squid-mode
1632 @opindex squid-mode
1633 Run @sc{dirmngr-client} in a mode suitable as a helper program for
1634 Squid's @option{external_acl_type} option.
1635
1636
1637 @end table
1638
1639 @ifset isman
1640 @mansect see also
1641 @command{dirmngr}(8),
1642 @command{gpgsm}(1)
1643 @include see-also-note.texi
1644 @end ifset
1645 @end ifset
1646
1647 @c
1648 @c   GPGPARSEMAIL
1649 @c
1650 @node gpgparsemail
1651 @section Parse a mail message into an annotated format
1652
1653 @manpage gpgparsemail.1
1654 @ifset manverb
1655 .B gpgparsemail
1656 \- Parse a mail message into an annotated format
1657 @end ifset
1658
1659 @mansect synopsis
1660 @ifset manverb
1661 .B  gpgparsemail
1662 .RI [ options ]
1663 .RI [ file ]
1664 @end ifset
1665
1666 @mansect description
1667 The @command{gpgparsemail} is a utility currently only useful for
1668 debugging.  Run it with @code{--help} for usage information.
1669
1670
1671
1672 @c
1673 @c   SYMCRYPTRUN
1674 @c
1675 @node symcryptrun
1676 @section Call a simple symmetric encryption tool.
1677 @manpage symcryptrun.1
1678 @ifset manverb
1679 .B symcryptrun
1680 \- Call a simple symmetric encryption tool
1681 @end ifset
1682
1683 @mansect synopsis
1684 @ifset manverb
1685 .B  symcryptrun
1686 .B \-\-class
1687 .I class
1688 .B \-\-program
1689 .I program
1690 .B \-\-keyfile
1691 .I keyfile
1692 .RB [ --decrypt | --encrypt ]
1693 .RI [ inputfile ]
1694 @end ifset
1695
1696 @mansect description
1697 Sometimes simple encryption tools are already in use for a long time and
1698 there might be a desire to integrate them into the GnuPG framework.  The
1699 protocols and encryption methods might be non-standard or not even
1700 properly documented, so that a full-fledged encryption tool with an
1701 interface like gpg is not doable.  @command{symcryptrun} provides a
1702 solution: It operates by calling the external encryption/decryption
1703 module and provides a passphrase for a key using the standard
1704 @command{pinentry} based mechanism through @command{gpg-agent}.
1705
1706 Note, that @command{symcryptrun} is only available if GnuPG has been
1707 configured with @samp{--enable-symcryptrun} at build time.
1708
1709 @menu
1710 * Invoking symcryptrun::   List of all commands and options.
1711 @end menu
1712
1713 @manpause
1714 @node Invoking symcryptrun
1715 @subsection List of all commands and options.
1716
1717 @noindent
1718 @command{symcryptrun} is invoked this way:
1719
1720 @example
1721 symcryptrun --class CLASS --program PROGRAM --keyfile KEYFILE
1722    [--decrypt | --encrypt] [inputfile]
1723 @end example
1724 @mancont
1725
1726 For encryption, the plain text must be provided on STDIN or as the
1727 argument @var{inputfile}, and the ciphertext will be output to STDOUT.
1728 For decryption vice versa.
1729
1730 @var{CLASS} describes the calling conventions of the external tool.
1731 Currently it must be given as @samp{confucius}.  @var{PROGRAM} is
1732 the full filename of that external tool.
1733
1734 For the class @samp{confucius} the option @option{--keyfile} is
1735 required; @var{keyfile} is the name of a file containing the secret key,
1736 which may be protected by a passphrase.  For detailed calling
1737 conventions, see the source code.
1738
1739 @noindent
1740 Note, that @command{gpg-agent} must be running before starting
1741 @command{symcryptrun}.
1742
1743 @noindent
1744 The following additional options may be used:
1745
1746 @table @gnupgtabopt
1747 @item -v
1748 @itemx --verbose
1749 @opindex verbose
1750 Output additional information while running.
1751
1752 @item -q
1753 @item --quiet
1754 @opindex q
1755 @opindex quiet
1756 Try to be as quiet as possible.
1757
1758 @include opt-homedir.texi
1759
1760
1761 @item --log-file @var{file}
1762 @opindex log-file
1763 Append all logging output to @var{file}.  Default is to write logging
1764 information to STDERR.
1765
1766 @end table
1767
1768 @noindent
1769 The possible exit status codes of @command{symcryptrun} are:
1770
1771 @table @code
1772 @item 0
1773         Success.
1774 @item 1
1775         Some error occured.
1776 @item 2
1777         No valid passphrase was provided.
1778 @item 3
1779         The operation was canceled by the user.
1780
1781 @end table
1782
1783 @mansect see also
1784 @ifset isman
1785 @command{gpg}(1),
1786 @command{gpgsm}(1),
1787 @command{gpg-agent}(1),
1788 @end ifset
1789 @include see-also-note.texi
1790
1791
1792 @c
1793 @c  GPG-ZIP
1794 @c
1795 @c The original manpage on which this section is based was written
1796 @c by Colin Tuckley  <colin@tuckley.org> and Daniel Leidert
1797 @c <daniel.leidert@wgdd.de> for the Debian distribution (but may be used by
1798 @c others).
1799 @manpage gpg-zip.1
1800 @node gpg-zip
1801 @section Encrypt or sign files into an archive
1802 @ifset manverb
1803 .B gpg-zip \- Encrypt or sign files into an archive
1804 @end ifset
1805
1806 @mansect synopsis
1807 @ifset manverb
1808 .B  gpg-zip
1809 .RI [ options ]
1810 .I filename1
1811 .I [ filename2, ... ]
1812 .I directory1
1813 .I [ directory2, ... ]
1814 @end ifset
1815
1816 @mansect description
1817 @command{gpg-zip} encrypts or signs files into an archive.  It is an
1818 gpg-ized tar using the same format as used by PGP's PGP Zip.
1819
1820 @manpause
1821 @noindent
1822 @command{gpg-zip} is invoked this way:
1823
1824 @example
1825 gpg-zip [options] @var{filename1} [@var{filename2}, ...] @var{directory} [@var{directory2}, ...]
1826 @end example
1827
1828 @mansect options
1829 @noindent
1830 @command{gpg-zip} understands these options:
1831
1832 @table @gnupgtabopt
1833
1834 @item --encrypt
1835 @itemx -e
1836 @opindex encrypt
1837 Encrypt data.  This option may be combined with @option{--symmetric} (for  output that may be decrypted via a secret key or a passphrase).
1838
1839 @item --decrypt
1840 @itemx -d
1841 @opindex decrypt
1842 Decrypt data.
1843
1844 @item --symmetric
1845 @itemx -c
1846 Encrypt with a symmetric cipher using a passphrase.  The default
1847 symmetric cipher used is CAST5, but may be chosen with the
1848 @option{--cipher-algo} option to @command{gpg}.
1849
1850 @item --sign
1851 @itemx -s
1852 Make a signature.  See @command{gpg}.
1853
1854 @item --recipient @var{user}
1855 @itemx -r @var{user}
1856 @opindex recipient
1857 Encrypt for user id @var{user}. See @command{gpg}.
1858
1859 @item --local-user @var{user}
1860 @itemx -u @var{user}
1861 @opindex local-user
1862 Use @var{user} as the key to sign with.  See @command{gpg}.
1863
1864 @item --list-archive
1865 @opindex list-archive
1866 List the contents of the specified archive.
1867
1868 @item --output @var{file}
1869 @itemx -o @var{file}
1870 @opindex output
1871 Write output to specified file @var{file}.
1872
1873 @item --gpg @var{gpgcmd}
1874 @opindex gpg
1875 Use the specified command @var{gpgcmd} instead of @command{gpg}.
1876
1877 @item --gpg-args @var{args}
1878 @opindex gpg-args
1879 Pass the specified options to @command{gpg}.
1880
1881 @item --tar @var{tarcmd}
1882 @opindex tar
1883 Use the specified command @var{tarcmd} instead of @command{tar}.
1884
1885 @item --tar-args @var{args}
1886 @opindex tar-args
1887 Pass the specified options to @command{tar}.
1888
1889 @item --version
1890 @opindex version
1891 Print version of the program and exit.
1892
1893 @item --help
1894 @opindex help
1895 Display a brief help page and exit.
1896
1897 @end table
1898
1899 @mansect diagnostics
1900 @noindent
1901 The program returns 0 if everything was fine, 1 otherwise.
1902
1903
1904 @mansect examples
1905 @ifclear isman
1906 @noindent
1907 Some examples:
1908
1909 @end ifclear
1910 @noindent
1911 Encrypt the contents of directory @file{mydocs} for user Bob to file
1912 @file{test1}:
1913
1914 @example
1915 gpg-zip --encrypt --output test1 --gpg-args  -r Bob mydocs
1916 @end example
1917
1918 @noindent
1919 List the contents of archive @file{test1}:
1920
1921 @example
1922 gpg-zip --list-archive test1
1923 @end example
1924
1925
1926 @mansect see also
1927 @ifset isman
1928 @command{gpg}(1),
1929 @command{tar}(1),
1930 @end ifset
1931 @include see-also-note.texi