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