~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-updates

« back to all changes in this revision

Viewing changes to doc/tools.texi

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
@c Copyright (C) 2004 Free Software Foundation, Inc.
 
1
@c Copyright (C) 2004, 2008 Free Software Foundation, Inc.
2
2
@c This is part of the GnuPG manual.
3
3
@c For copying conditions, see the file GnuPG.texi.
4
4
 
9
9
 
10
10
@menu
11
11
* watchgnupg::            Read logs from a socket.
 
12
* gpgv::                  Verify OpenPGP signatures.
12
13
* addgnupghome::          Create .gnupg home directories.
13
14
* gpgconf::               Modify .gnupg home directories.
 
15
* applygnupgdefaults::    Run gpgconf for all users.
14
16
* gpgsm-gencert.sh::      Generate an X.509 certificate request.
15
17
* gpg-preset-passphrase:: Put a passphrase into the cache.
16
18
* gpg-connect-agent::     Communicate with a running agent.
25
27
@node watchgnupg
26
28
@section Read logs from a socket
27
29
@ifset manverb
28
 
 watchgnupg \-  Read and print logs from a socket
 
30
.B watchgnupg
 
31
\- Read and print logs from a socket
 
32
@end ifset
 
33
 
 
34
@mansect synopsis
 
35
@ifset manverb
 
36
.B  watchgnupg
 
37
.RB [ \-\-force ]
 
38
.RB [ \-\-verbose ]
 
39
.I socketname
29
40
@end ifset
30
41
 
31
42
@mansect description
35
46
stamp and makes sure that long lines are not interspersed with log
36
47
output from other utilities.
37
48
 
38
 
@manpause
39
49
@noindent
40
50
@command{watchgnupg} is commonly invoked as
41
51
 
42
 
@mansect synopsis
43
52
@example
44
53
watchgnupg --force ~/.gnupg/S.log
45
54
@end example
49
58
This starts it on the current terminal for listening on the socket
50
59
@file{~/.gnupg/S.log}.  
51
60
 
 
61
@mansect options
52
62
@noindent
53
63
@command{watchgnupg} understands these options:
54
64
 
55
65
@table @gnupgtabopt
56
 
@mansect options
57
66
 
58
67
@item --force 
59
68
@opindex force
71
80
@opindex help
72
81
Display a brief help page and exit
73
82
 
74
 
@manpause
75
83
@end table
76
84
 
 
85
@mansect see also
 
86
@ifset isman
 
87
@command{gpg}(1), 
 
88
@command{gpgsm}(1), 
 
89
@command{gpg-agent}(1), 
 
90
@command{scdaemon}(1)
 
91
@end ifset
 
92
@include see-also-note.texi
 
93
 
 
94
 
 
95
@c
 
96
@c  GPGV
 
97
@c
 
98
@include gpgv.texi
 
99
 
77
100
 
78
101
@c
79
102
@c    ADDGNUPGHOME
82
105
@node addgnupghome
83
106
@section Create .gnupg home directories.
84
107
@ifset manverb
85
 
 addgnupghome \-  Create .gnupg home directories
 
108
.B addgnupghome 
 
109
\- Create .gnupg home directories
 
110
@end ifset
 
111
 
 
112
@mansect synopsis
 
113
@ifset manverb
 
114
.B  addgnupghome
 
115
.I account_1
 
116
.IR account_2 ... account_n
86
117
@end ifset
87
118
 
88
119
@mansect description
94
125
directories of the accounts given on the command line.  It takes care
95
126
not to overwrite existing GnuPG home directories.
96
127
 
97
 
@manpause
98
128
@noindent
99
129
@command{addgnupghome} is invoked by root as:
100
130
 
101
 
@mansect synopsis
102
131
@example
103
132
addgnupghome account1 account2 ... accountn
104
133
@end example
111
140
@node gpgconf
112
141
@section Modify .gnupg home directories.
113
142
@ifset manverb
114
 
  gpgconf \- Modify .gnupg home directories
115
 
@end ifset
 
143
.B gpgconf
 
144
\- Modify .gnupg home directories
 
145
@end ifset
 
146
 
 
147
@mansect synopsis
 
148
@ifset manverb
 
149
.B gpgconf
 
150
.RI [ options ]
 
151
.B \-\-list-components
 
152
.br
 
153
.B gpgconf
 
154
.RI [ options ]
 
155
.B \-\-list-options 
 
156
.I component
 
157
.br
 
158
.B gpgconf
 
159
.RI [ options ]
 
160
.B \-\-change-options
 
161
.I component
 
162
@end ifset
 
163
 
116
164
 
117
165
@mansect description
118
166
The @command{gpgconf} is a utility to automatically and reasonable
148
196
program that uses @command{gpgconf} in this way will be called GUI
149
197
throughout this section.
150
198
 
151
 
@manpause
152
199
@menu
153
 
* Invoking gpgconf::      List of all commands and options.
154
 
* Format conventions::    Formatting conventions relevant for all commands.
155
 
* Listing components::    List all gpgconf components.
156
 
* Listing options::       List all options of a component.
157
 
* Changing options::      Changing options of a component.
 
200
* Invoking gpgconf::       List of all commands and options.
 
201
* Format conventions::     Formatting conventions relevant for all commands.
 
202
* Listing components::     List all gpgconf components.
 
203
* Checking programs::      Check all programs know to gpgconf.
 
204
* Listing options::        List all options of a component.
 
205
* Changing options::       Changing options of a component.
 
206
* Listing global options:: List all global options.
 
207
* Files used by gpgconf::  What files are used by gpgconf.
158
208
@end menu
159
209
 
160
 
 
 
210
@manpause
161
211
@node Invoking gpgconf
162
212
@subsection Invoking gpgconf
163
213
 
164
214
@mansect commands
165
215
One of the following commands must be given:
166
216
 
167
 
@manpause
168
217
@table @gnupgtabopt
169
 
@mancont
170
218
 
171
219
@item --list-components
172
220
List all components.  This is the default command used if none is
173
221
specified.
174
222
 
 
223
@item --check-programs
 
224
List all available backend programs and test whether they are runnable.
 
225
 
175
226
@item --list-options @var{component}
176
227
List all options of the component @var{component}.
177
228
 
178
229
@item --change-options @var{component}
179
230
Change the options of the component @var{component}.
180
 
@manpause
 
231
 
 
232
@item --apply-defaults
 
233
Update all configuration files with values taken from the global
 
234
configuration file (usually @file{/etc/gnupg/gpgconf.conf}).
 
235
 
 
236
@item --list-config [@var{filename}]
 
237
List the global configuration file in a colon separated format.  If
 
238
@var{filename} is given, check that file instead.
 
239
 
 
240
@item --check-config [@var{filename}]
 
241
Run a syntax check on the global configuration file.  If @var{filename}
 
242
is given, check that file instead.
 
243
 
181
244
@end table
182
245
 
 
246
 
183
247
@mansect options
184
248
 
185
249
The following options may be used:
186
250
 
187
 
@manpause
188
251
@table @gnupgtabopt
189
 
@mancont
190
252
@c FIXME: Not yet supported.
191
253
@c @item -o @var{file}
192
254
@c @itemx --output @var{file}
282
344
the verbose option is used).  You should ignore everything in the
283
345
field that follows the number.
284
346
 
 
347
@item @w{boolean value}
 
348
Some fields contain a @emph{boolean value}.  This is a number with
 
349
either the value 0 or 1.  The number may be followed by a space,
 
350
followed by a human readable description of that value (if the verbose
 
351
option is used).  You should ignore everything in the field that follows
 
352
the number; checking just the first character is sufficient in this
 
353
case.
 
354
 
285
355
@item option
286
356
Some fields contain an @emph{option} argument.  The format of an
287
357
option argument depends on the type of the option and on some flags:
356
426
The command argument @code{--list-components} lists all available
357
427
components, one per line.  The format of each line is:
358
428
 
359
 
@code{@var{name}:@var{description}}
 
429
@code{@var{name}:@var{description}:@var{pgmname}:}
360
430
 
361
431
@table @var
362
432
@item name
370
440
of the component.  It can be displayed to the user of the GUI for
371
441
informational purposes.  It is @emph{percent-escaped} and
372
442
@emph{localized}.
 
443
 
 
444
@item pgmname
 
445
The @emph{string} in this field contains the absolute name of the
 
446
program's file.  It can be used to unambiguously invoke that program.
 
447
It is @emph{percent-escaped}.
373
448
@end table
374
449
 
375
450
Example:
376
451
@example
377
452
$ gpgconf --list-components
378
 
gpg:GPG for OpenPGP
379
 
gpg-agent:GPG Agent
380
 
scdaemon:Smartcard Daemon
381
 
gpgsm:GPG for S/MIME
382
 
dirmngr:Directory Manager
 
453
gpg:GPG for OpenPGP:/usr/local/bin/gpg2:
 
454
gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:
 
455
scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:
 
456
gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:
 
457
dirmngr:Directory Manager:/usr/local/bin/dirmngr:
 
458
@end example
 
459
 
 
460
 
 
461
 
 
462
@node Checking programs
 
463
@subsection Checking programs
 
464
 
 
465
The command @code{--check-programs} is similar to
 
466
@code{--list-components} but works on backend programs and not on
 
467
components.  It runs each program to test wether it is installed and
 
468
runnable.  This also includes a syntax check of all config file options
 
469
of the program.
 
470
 
 
471
The command argument @code{--check-programs} lists all available
 
472
programs, one per line.  The format of each line is:
 
473
 
 
474
@code{@var{name}:@var{description}:@var{pgmname}:@var{avail}:@var{okay}:@var{cfgfile}:@var{line}:@var{error}:}
 
475
 
 
476
@table @var
 
477
@item name
 
478
This field contains a name tag of the program which is identical to the
 
479
name of the component.  The name tag is to be used @emph{verbatim}.  It
 
480
is thus not in any escaped format.  This field may be empty to indicate
 
481
a continuation of error descriptions for the last name.  The description
 
482
and pgmname fields are then also empty.
 
483
 
 
484
@item description
 
485
The @emph{string} in this field contains a human-readable description
 
486
of the component.  It can be displayed to the user of the GUI for
 
487
informational purposes.  It is @emph{percent-escaped} and
 
488
@emph{localized}.
 
489
 
 
490
@item pgmname
 
491
The @emph{string} in this field contains the absolute name of the
 
492
program's file.  It can be used to unambiguously invoke that program.
 
493
It is @emph{percent-escaped}.
 
494
 
 
495
@item avail
 
496
The @emph{boolean value} in this field indicates whether the program is
 
497
installed and runnable.
 
498
 
 
499
@item okay
 
500
The @emph{boolean value} in this field indicates whether the program's
 
501
config file is syntactically okay.
 
502
 
 
503
@item cfgfile
 
504
If an error occured in the configuraion file (as indicated by a false
 
505
value in the field @code{okay}), this field has the name of the failing
 
506
configuration file.  It is @emph{percent-escaped}.
 
507
 
 
508
@item line
 
509
If an error occured in the configuration file, this field has the line
 
510
number of the failing statement in the configuration file.  
 
511
It is an @emph{unsigned number}.
 
512
 
 
513
@item error
 
514
If an error occured in the configuration file, this field has the error
 
515
text of the failing statement in the configuration file.  It is
 
516
@emph{percent-escaped} and @emph{localized}.
 
517
 
 
518
@end table
 
519
 
 
520
@noindent
 
521
In the following example the @command{dirmngr} is not runnable and the
 
522
configuration file of @command{scdaemon} is not okay.
 
523
 
 
524
@example
 
525
$ gpgconf --check-programs
 
526
gpg:GPG for OpenPGP:/usr/local/bin/gpg2:1:1:
 
527
gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:1:1:
 
528
scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:1:0:
 
529
gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:1:1:
 
530
dirmngr:Directory Manager:/usr/local/bin/dirmngr:0:0:
383
531
@end example
384
532
 
385
533
 
447
595
@item no arg desc (64)
448
596
If this flag is set, and the @code{optional arg} flag is set, then the
449
597
option has a special meaning if no argument is given.
 
598
 
 
599
@item no change (128)
 
600
If this flag is set, gpgconf ignores requests to change the value.  GUI
 
601
frontends should grey out this option.  Note, that manual changes of the
 
602
configuration files are still possible.
450
603
@end table
451
604
 
452
605
@item level
514
667
A @emph{string} that describes an LDAP server in the format:
515
668
 
516
669
@code{@var{hostname}:@var{port}:@var{username}:@var{password}:@var{base_dn}}
 
670
 
 
671
@item key fingerprint (34)
 
672
A @emph{string} with a 40 digit fingerprint specifying a certificate.
 
673
 
 
674
@item pub key (35)
 
675
A @emph{string} that describes a certificate by user ID, key ID or
 
676
fingerprint.
 
677
 
 
678
@item sec key (36)
 
679
A @emph{string} that describes a certificate with a key by user ID,
 
680
key ID or fingerprint.
517
681
@end table
518
682
 
519
683
More types will be added in the future.  Please see the @var{alt-type}
538
702
case a short name is not known.
539
703
 
540
704
@item default
541
 
This field is defined only for options.  Its format is that of an
542
 
@emph{option argument} (@xref{Format conventions}, for details).  If
543
 
the default value is empty, then no default is known.  Otherwise, the
544
 
value specifies the default value for this option.  Note that this
545
 
field is also meaningful if the option itself does not take a real
546
 
argument.
 
705
This field is defined only for options for which the @code{default} or
 
706
@code{default desc} flag is set.  If the @code{default} flag is set,
 
707
its format is that of an @emph{option argument} (@xref{Format
 
708
conventions}, for details).  If the default value is empty, then no
 
709
default is known.  Otherwise, the value specifies the default value
 
710
for this option.  If the @code{default desc} flag is set, the field is
 
711
either empty or contains a description of the effect if the option is
 
712
not given.
547
713
 
548
714
@item argdef
549
715
This field is defined only for options for which the @code{optional
550
716
arg} flag is set.  If the @code{no arg desc} flag is not set, its
551
717
format is that of an @emph{option argument} (@xref{Format
552
718
conventions}, for details).  If the default value is empty, then no
553
 
default is known.  Otherwise, the value specifies the default value
 
719
default is known.  Otherwise, the value specifies the default argument
554
720
for this option.  If the @code{no arg desc} flag is set, the field is
555
721
either empty or contains a description of the effect of this option if
556
 
no argument is given.  Note that this field is also meaningful if the
557
 
option itself does not take a real argument.
 
722
no argument is given.
558
723
 
559
724
@item value
560
725
This field is defined only for options.  Its format is that of an
562
727
explicitely set in the current configuration, and the default applies
563
728
(if any).  Otherwise, it contains the current value of the option.
564
729
Note that this field is also meaningful if the option itself does not
565
 
take a real argument.
 
730
take a real argument (in this case, it contains the number of times
 
731
the option appears).
566
732
@end table
567
733
 
568
734
 
619
785
The @code{--runtime} option can influence when the changes take
620
786
effect.
621
787
 
622
 
@manpause
 
788
 
 
789
@node Listing global options
 
790
@subsection Listing global options
 
791
 
 
792
Sometimes it is useful for applications to look at the global options
 
793
file @file{gpgconf.conf}. 
 
794
The colon separated listing format is record oriented and uses the first
 
795
field to identify the record type:
 
796
 
 
797
@table @code
 
798
@item k
 
799
This describes a key record to start the definition of a new ruleset for
 
800
a user/group.  The format of a key record is:
 
801
 
 
802
  @code{k:@var{user}:@var{group}:}
 
803
 
 
804
@table @var
 
805
@item user
 
806
This is the user field of the key.  It is percent escaped.  See the
 
807
definition of the gpgconf.conf format for details.
 
808
 
 
809
@item group
 
810
This is the group field of the key.  It is percent escaped.
 
811
@end table
 
812
 
 
813
@item r
 
814
This describes a rule record. All rule records up to the next key record
 
815
make up a rule set for that key.  The format of a rule record is:
 
816
 
 
817
  @code{r:::@var{component}:@var{option}:@var{flags}:@var{value}:}
 
818
 
 
819
@table @var
 
820
@item component
 
821
This is the component part of a rule.  It is a plain string.
 
822
 
 
823
@item option
 
824
This is the option part of a rule.  It is a plain string.
 
825
 
 
826
@item flag
 
827
This is the flags part of a rule.  There may be only one flag per rule
 
828
but by using the same component and option, several flags may be
 
829
assigned to an option.  It is a plain string.
 
830
 
 
831
@item value
 
832
This is the optional value for the option.  It is a percent escaped
 
833
string with a single quotation mark to indicate a string.  The quotation
 
834
mark is only required to distinguish between no value specified and an
 
835
empty string.
 
836
@end table
 
837
 
 
838
@end table
 
839
 
 
840
@noindent
 
841
Unknown record typs should be ignored.  Note that there is intentionally
 
842
no feature to change the global option file through @command{gpgconf}.
 
843
 
 
844
 
 
845
 
 
846
@mansect files
 
847
@node Files used by gpgconf
 
848
@subsection Files used by gpgconf
 
849
 
 
850
@table @file
 
851
 
 
852
@item /etc/gnupg/gpgconf.conf
 
853
@cindex gpgconf.conf
 
854
  If this file exists, it is processed as a global configuration file.
 
855
  A commented example can be found in the @file{examples} directory of
 
856
  the distribution.
 
857
@end table
 
858
 
 
859
 
 
860
@mansect see also
 
861
@ifset isman
 
862
@command{gpg}(1), 
 
863
@command{gpgsm}(1), 
 
864
@command{gpg-agent}(1), 
 
865
@command{scdaemon}(1),
 
866
@command{dirmngr}(1)
 
867
@end ifset
 
868
@include see-also-note.texi
 
869
 
 
870
 
 
871
 
 
872
@c
 
873
@c    APPLYGNUPGDEFAULTS
 
874
@c
 
875
@manpage applygnupgdefaults.8
 
876
@node applygnupgdefaults
 
877
@section Run gpgconf for all users.
 
878
@ifset manverb
 
879
.B applygnupgdefaults
 
880
\- Run gpgconf --apply-defaults for all users.
 
881
@end ifset
 
882
 
 
883
@mansect synopsis
 
884
@ifset manverb
 
885
.B  applygnupgdefaults
 
886
@end ifset
 
887
 
 
888
@mansect description
 
889
This script is a wrapper around @command{gpgconf} to run it with the
 
890
command @code{--apply-defaults} for all real users with an existing
 
891
GnuPG home directory.  Admins might want to use this script to update he
 
892
GnuPG configuration files for all users after
 
893
@file{/etc/gnupg/gpgconf.conf} has been changed.  This allows to enforce
 
894
certain policies for all users.  Note, that this is not a bulletproof of
 
895
forcing a user to use certain options.  A user may always directly edit
 
896
the configuration files and bypass gpgconf.
 
897
 
 
898
@noindent
 
899
@command{applygnupgdefaults} is invoked by root as:
 
900
 
 
901
@example
 
902
applygnupgdefaults
 
903
@end example
 
904
 
 
905
 
623
906
@c
624
907
@c    GPGSM-GENCERT.SH
625
908
@c
626
909
@node gpgsm-gencert.sh
627
910
@section Generate an X.509 certificate request
628
 
 
 
911
@manpage gpgsm-gencert.sh.1
 
912
@ifset manverb
 
913
.B gpgsm-gencert.sh
 
914
\- Generate an X.509 certificate request
 
915
@end ifset 
 
916
 
 
917
@mansect synopsis
 
918
@ifset manverb
 
919
.B  gpgsm-gencert.sh
 
920
@end ifset
 
921
 
 
922
@mansect description
629
923
This is a simple tool to interactivly generate a certificate request
630
924
which will be printed to stdout.
631
925
 
 
926
@manpause
632
927
@noindent
633
928
@command{gpgsm-gencert.sh} is invoked as:
634
929
 
635
930
@samp{gpgsm-cencert.sh}
636
931
 
 
932
@mansect see also
 
933
@ifset isman
 
934
@command{gpgsm}(1), 
 
935
@command{gpg-agent}(1), 
 
936
@command{scdaemon}(1)
 
937
@end ifset
 
938
@include see-also-note.texi
 
939
 
637
940
 
638
941
 
639
942
@c
641
944
@c
642
945
@node gpg-preset-passphrase
643
946
@section Put a passphrase into the cache.
644
 
 
 
947
@manpage gpg-preset-passphrase.1
 
948
@ifset manverb
 
949
.B gpg-preset-passphrase
 
950
\- Put a passphrase into gpg-agent's cache
 
951
@end ifset
 
952
 
 
953
@mansect synopsis
 
954
@ifset manverb
 
955
.B  gpg-preset-passphrase
 
956
.RI [ options ]
 
957
.RI [ command ]
 
958
.I keygrip
 
959
@end ifset
 
960
 
 
961
@mansect description
645
962
The @command{gpg-preset-passphrase} is a utility to seed the internal
646
963
cache of a running @command{gpg-agent} with passphrases.  It is mainly
647
964
useful for unattended machines, where the usual @command{pinentry} tool
659
976
* Invoking gpg-preset-passphrase::   List of all commands and options.
660
977
@end menu
661
978
 
662
 
 
 
979
@manpause
663
980
@node Invoking gpg-preset-passphrase
664
981
@subsection List of all commands and options.
 
982
@mancont
665
983
 
666
984
@noindent
667
985
@command{gpg-preset-passphrase} is invoked this way:
678
996
 
679
997
@table @gnupgtabopt
680
998
@item --preset
 
999
@opindex preset
681
1000
Preset a passphrase. This is what you usually will
682
1001
use. @command{gpg-preset-passphrase} will then read the passphrase from
683
1002
@code{stdin}.
684
1003
 
685
1004
@item --forget
 
1005
@opindex forget
686
1006
Flush the passphrase for the given keygrip from the cache.
687
1007
 
688
1008
@end table
704
1024
for other users.
705
1025
@end table
706
1026
 
 
1027
@mansect see also
 
1028
@ifset isman
 
1029
@command{gpg}(1), 
 
1030
@command{gpgsm}(1), 
 
1031
@command{gpg-agent}(1), 
 
1032
@command{scdaemon}(1)
 
1033
@end ifset
 
1034
@include see-also-note.texi
707
1035
 
708
1036
 
709
1037
 
712
1040
@c   GPG-CONNECT-AGENT
713
1041
@c
714
1042
@node gpg-connect-agent
715
 
@section Communicate with a runnig agent.
716
 
 
 
1043
@section Communicate with a running agent.
 
1044
@manpage gpg-connect-agent.1
 
1045
@ifset manverb
 
1046
.B gpg-connect-agent
 
1047
\- Communicate with a running agent
 
1048
@end ifset
 
1049
 
 
1050
@mansect synopsis
 
1051
@ifset manverb
 
1052
.B  gpg-connect-agent
 
1053
.RI [ options ]
 
1054
@end ifset
 
1055
 
 
1056
@mansect description
717
1057
The @command{gpg-connect-agent} is a utility to communicate with a
718
1058
running @command{gpg-agent}.  It is useful to check out the commands
719
1059
gpg-agent provides using the Assuan interface.  It might also be useful
724
1064
here we connect to a running instance.
725
1065
 
726
1066
@menu
727
 
* Invoking gpg-connect-agent::   List of all commands and options.
 
1067
* Invoking gpg-connect-agent::       List of all options.
 
1068
* Controlling gpg-connect-agent::    Control commands.
728
1069
@end menu
729
1070
 
730
 
 
 
1071
@manpause
731
1072
@node Invoking gpg-connect-agent
732
 
@subsection List of all commands and options.
 
1073
@subsection List of all options.
733
1074
 
734
1075
@noindent
735
1076
@command{gpg-connect-agent} is invoked this way:
737
1078
@example
738
1079
gpg-connect-agent [options]
739
1080
@end example
 
1081
@mancont
740
1082
 
741
1083
@noindent
742
1084
The following options may be used:
753
1095
@opindex quiet
754
1096
Try to be as quiet as possible.
755
1097
 
756
 
@item --homedir @var{dir}
757
 
@opindex homedir
758
 
Set the name of the home directory to @var{dir}. If his option is not
759
 
used, the home directory defaults to @file{~/.gnupg}.  It is only
760
 
recognized when given on the command line.  It also overrides any home
761
 
directory stated through the environment variable @env{GNUPGHOME} or
762
 
(on W32 systems) by means on the Registry entry
763
 
@var{HKCU\Software\GNU\GnuPG:HomeDir}.
764
 
 
 
1098
@include opt-homedir.texi
765
1099
 
766
1100
@item -S
767
1101
@itemx --raw-socket @var{name}
771
1105
Do not run any special initializations or environment checks.  This may
772
1106
be used to directly connect to any Assuan style socket server.
773
1107
 
774
 
 
775
 
@end table
 
1108
@item -E
 
1109
@itemx --exec
 
1110
@opindex exec
 
1111
Take the rest of the command line as a program and it's arguments and
 
1112
execute it as an assuan server. Here is how you would run @command{gpgsm}:
 
1113
@smallexample
 
1114
 gpg-connect-agent --exec gpgsm --server
 
1115
@end smallexample
 
1116
 
 
1117
 
 
1118
@item --no-ext-connect
 
1119
@opindex no-ext-connect
 
1120
When using @option{-S} or @option{--exec}, @command{gpg-connect-agent}
 
1121
connects to the assuan server in extended mode to allow descriptor
 
1122
passing.  This option makes it use the old mode.
 
1123
 
 
1124
@item --run @var{file}
 
1125
@opindex run 
 
1126
Run the commands from @var{file} at startup and then continue with the
 
1127
regular input method.
 
1128
 
 
1129
@item -s
 
1130
@itemx --subst
 
1131
@opindex subst
 
1132
Run the command @code{/subst} at startup.
 
1133
 
 
1134
@item --hex
 
1135
@opindex hex
 
1136
Print data lines in a hex format and the ASCII representation of
 
1137
non-control characters.
 
1138
 
 
1139
@item --decode
 
1140
@opindex decode
 
1141
Decode data lines.  That is to remove percent escapes but make sure that
 
1142
a new line always starts with a D and a space.
 
1143
 
 
1144
@end table
 
1145
 
 
1146
@mansect control commands
 
1147
@node Controlling gpg-connect-agent
 
1148
@subsection Control commands.
 
1149
 
 
1150
While reading Assuan commands, gpg-agent also allows a few special
 
1151
commands to control its operation.  These control commands all start
 
1152
with a slash (@code{/}).
 
1153
 
 
1154
@table @code
 
1155
 
 
1156
@item /echo @var{args}
 
1157
Just print @var{args}.
 
1158
 
 
1159
@item /let @var{name} @var{value}
 
1160
Set the variable @var{name} to @var{value}.  Variables are only
 
1161
substituted on the input if the @command{/subst} has been used.
 
1162
Variables are referenced by prefixing the name with a dollr sign and
 
1163
optionally include the name in curly braces.  The rules for a valid name
 
1164
are idnetically to those of the standard bourne shell.  This is not yet
 
1165
enforced but may be in the future.  When used with curly braces no
 
1166
leading or trailing white space is allowed. 
 
1167
 
 
1168
If a variable is not found, it is searched in the environment and if
 
1169
found copied to the table of variables.
 
1170
 
 
1171
Variable functions are available: The name of the function must be
 
1172
followed by at least one space and the at least one argument.  The
 
1173
following functions are available:
 
1174
 
 
1175
@table @code
 
1176
@item get
 
1177
Return a value described by the argument.  Available arguments are:
 
1178
 
 
1179
@table @code    
 
1180
@item cwd
 
1181
The current working directory.
 
1182
@item homedir
 
1183
The gnupg homedir.
 
1184
@item sysconfdir
 
1185
GnuPG's system configuration directory.
 
1186
@item bindir
 
1187
GnuPG's binary directory.
 
1188
@item libdir
 
1189
GnuPG's library directory.
 
1190
@item libexecdir
 
1191
GnuPG's library directory for executable files.
 
1192
@item datadir
 
1193
GnuPG's data directory.
 
1194
@item serverpid
 
1195
The PID of the current server. Command @command{/serverpid} must
 
1196
have been given to return a useful value.
 
1197
@end table
 
1198
 
 
1199
@item unescape @var{args}
 
1200
Remove C-style escapes from @var{args}.  Note that @code{\0} and
 
1201
@code{\x00} terminate the returned string implicitly.  The string to be
 
1202
converted are the entire arguments right behind the delimiting space of
 
1203
the function name.
 
1204
 
 
1205
@item unpercent @var{args}
 
1206
@itemx unpercent+ @var{args}
 
1207
Remove percent style ecaping from @var{args}.  Note that @code{%00}
 
1208
terminates the string implicitly.  The string to be converted are the
 
1209
entire arguments right behind the delimiting space of the function
 
1210
name. @code{unpercent+} also maps plus signs to a spaces.
 
1211
 
 
1212
@item percent @var{args}
 
1213
@itemx percent+ @var{args}
 
1214
Escape the @var{args} using percent style ecaping.  Tabs, formfeeds,
 
1215
linefeeds, carriage returns and colons are escaped. @code{percent+} also
 
1216
maps spaces to plus signs.
 
1217
 
 
1218
@item errcode @var{arg}
 
1219
@itemx errsource @var{arg}
 
1220
@itemx errstring @var{arg}
 
1221
Assume @var{arg} is an integer and evaluate it using @code{strtol}.  Return
 
1222
the gpg-error error code, error source or a formatted string with the
 
1223
error code and error source.
 
1224
 
 
1225
 
 
1226
@item +
 
1227
@itemx -
 
1228
@itemx *
 
1229
@itemx /
 
1230
@itemx %
 
1231
Evaluate all arguments as long integers using @code{strtol} and apply
 
1232
this operator.  A division by zero yields an empty string.
 
1233
 
 
1234
@item !
 
1235
@itemx |
 
1236
@itemx &
 
1237
Evaluate all arguments as long integers using @code{strtol} and apply
 
1238
the logical oeprators NOT, OR or AND.  The NOT operator works on the
 
1239
last argument only.
 
1240
 
 
1241
 
 
1242
@end table
 
1243
 
 
1244
 
 
1245
@item /definq @var{name} @var{var}
 
1246
Use content of the variable @var{var} for inquiries with @var{name}.
 
1247
@var{name} may be an asterisk (@code{*}) to match any inquiry.
 
1248
 
 
1249
 
 
1250
@item /definqfile @var{name} @var{file}
 
1251
Use content of @var{file} for inquiries with @var{name}.
 
1252
@var{name} may be an asterisk (@code{*}) to match any inquiry.
 
1253
 
 
1254
@item /definqprog @var{name} @var{prog}
 
1255
Run @var{prog} for inquiries matching @var{name} and pass the
 
1256
entire line to it as command line arguments.
 
1257
 
 
1258
@item /showdef
 
1259
Print all definitions
 
1260
 
 
1261
@item /cleardef
 
1262
Delete all definitions
 
1263
 
 
1264
@item /sendfd @var{file} @var{mode}
 
1265
Open @var{file} in @var{mode} (which needs to be a valid @code{fopen}
 
1266
mode string) and send the file descriptor to the server.  This is
 
1267
usually followed by a command like @code{INPUT FD} to set the
 
1268
input source for other commands.
 
1269
 
 
1270
@item /recvfd
 
1271
Not yet implemented.
 
1272
 
 
1273
@item /open @var{var} @var{file} [@var{mode}]
 
1274
Open @var{file} and assign the file descriptor to @var{var}.  Warning:
 
1275
This command is experimental and might change in future versions.
 
1276
 
 
1277
@item /close @var{fd}
 
1278
Close the file descriptor @var{fd}.  Warning: This command is
 
1279
experimental and might change in future versions.
 
1280
 
 
1281
@item /showopen
 
1282
Show a listy of open files.
 
1283
 
 
1284
@item /serverpid
 
1285
Send the Assuan command @command{GETINFO pid} to the server and store
 
1286
the returned PID for internal purposes.
 
1287
 
 
1288
@item /sleep
 
1289
Sleep for a second.
 
1290
 
 
1291
@item /hex
 
1292
@itemx /nohex
 
1293
Same as the command line option @option{--hex}.
 
1294
 
 
1295
@item /decode
 
1296
@itemx /nodecode
 
1297
Same as the command line option @option{--decode}.
 
1298
 
 
1299
@item /subst
 
1300
@itemx /nosubst
 
1301
Enable and disable variable substitution.  It defaults to disabled
 
1302
unless the command line option @option{--subst} has been used.
 
1303
If /subst as been enabled once, leading whitespace is removed from
 
1304
input lines which makes scripts easier to read.
 
1305
 
 
1306
@item /while @var{condition}
 
1307
@itemx /end
 
1308
These commands provide a way for executing loops.  All lines between the
 
1309
@code{while} and the corresponding @code{end} are executed as long as
 
1310
the evaluation of @var{condition} yields a non-zero value.  The
 
1311
evaluation is done by passing @var{condition} to the @code{strtol}
 
1312
function.  Example:
 
1313
 
 
1314
@smallexample
 
1315
  /subst
 
1316
  /let i 3
 
1317
  /while $i
 
1318
    /echo loop couter is $i
 
1319
    /let i $@{- $i 1@}
 
1320
  /end
 
1321
@end smallexample
 
1322
 
 
1323
 
 
1324
@item /run @var{file}
 
1325
Run commands from @var{file}.
 
1326
 
 
1327
@item /bye
 
1328
Terminate the connection and the program
 
1329
 
 
1330
@item /help
 
1331
Print a list of available control commands.
 
1332
 
 
1333
@end table
 
1334
 
 
1335
 
 
1336
@ifset isman
 
1337
@mansect see also
 
1338
@command{gpg-agent}(1), 
 
1339
@command{scdaemon}(1)
 
1340
@include see-also-note.texi
 
1341
@end ifset
 
1342
 
776
1343
 
777
1344
@c
778
1345
@c   GPGPARSEMAIL
780
1347
@node gpgparsemail
781
1348
@section Parse a mail message into an annotated format
782
1349
 
783
 
The @command{gpgparsemail} is a utility currentlu only useful for
 
1350
@manpage gpgparsemail.1
 
1351
@ifset manverb
 
1352
.B gpgparsemail
 
1353
\- Parse a mail message into an annotated format
 
1354
@end ifset
 
1355
 
 
1356
@mansect synopsis
 
1357
@ifset manverb
 
1358
.B  gpgparsemail
 
1359
.RI [ options ]
 
1360
.RI [ file ]
 
1361
@end ifset
 
1362
 
 
1363
@mansect description
 
1364
The @command{gpgparsemail} is a utility currently only useful for
784
1365
debugging.  Run it with @code{--help} for usage information.
785
1366
 
786
1367
 
790
1371
@c
791
1372
@node symcryptrun
792
1373
@section Call a simple symmetric encryption tool.
793
 
 
 
1374
@manpage symcryptrun.1
 
1375
@ifset manverb
 
1376
.B symcryptrun
 
1377
\- Call a simple symmetric encryption tool
 
1378
@end ifset
 
1379
 
 
1380
@mansect synopsis
 
1381
@ifset manverb
 
1382
.B  symcryptrun
 
1383
.B \-\-class
 
1384
.I class
 
1385
.B \-\-program
 
1386
.I program
 
1387
.B \-\-keyfile
 
1388
.I keyfile
 
1389
.RB [ --decrypt | --encrypt ]
 
1390
.RI [ inputfile ]
 
1391
@end ifset
 
1392
 
 
1393
@mansect description
794
1394
Sometimes simple encryption tools are already in use for a long time and
795
1395
there might be a desire to integrate them into the GnuPG framework.  The
796
1396
protocols and encryption methods might be non-standard or not even
807
1407
* Invoking symcryptrun::   List of all commands and options.
808
1408
@end menu
809
1409
 
810
 
 
 
1410
@manpause
811
1411
@node Invoking symcryptrun
812
1412
@subsection List of all commands and options.
813
1413
 
818
1418
symcryptrun --class CLASS --program PROGRAM --keyfile KEYFILE 
819
1419
   [--decrypt | --encrypt] [inputfile]
820
1420
@end example
 
1421
@mancont
821
1422
 
822
1423
For encryption, the plain text must be provided on STDIN or as the
823
1424
argument @var{inputfile}, and the ciphertext will be output to STDOUT.
851
1452
@opindex quiet
852
1453
Try to be as quiet as possible.
853
1454
 
854
 
@item --homedir @var{dir}
855
 
@opindex homedir
856
 
Set the name of the home directory to @var{dir}. If his option is not
857
 
used, the home directory defaults to @file{~/.gnupg}.  It is only
858
 
recognized when given on the command line.  It also overrides any home
859
 
directory stated through the environment variable @env{GNUPGHOME} or
860
 
(on W32 systems) by means on the Registry entry
861
 
@var{HKCU\Software\GNU\GnuPG:HomeDir}.
 
1455
@include opt-homedir.texi
 
1456
 
862
1457
 
863
1458
@item --log-file @var{file}
864
1459
@opindex log-file
882
1477
 
883
1478
@end table
884
1479
 
 
1480
@mansect see also
 
1481
@ifset isman
 
1482
@command{gpg}(1), 
 
1483
@command{gpgsm}(1), 
 
1484
@command{gpg-agent}(1), 
 
1485
@end ifset
 
1486
@include see-also-note.texi
 
1487