1GPG-CONNECT-AGENT(1) GNU Privacy Guard GPG-CONNECT-AGENT(1)
2
3
4
6 gpg-connect-agent - Communicate with a running agent
7
9 gpg-connect-agent [options]
10
11
13 The gpg-connect-agent is a utility to communicate with a running gpg-
14 agent. It is useful to check out the commands gpg-agent provides using
15 the Assuan interface. It might also be useful for scripting simple
16 applications. Inputis expected at stdin and out put gets printed to
17 stdout.
18
19 It is very similar to running gpg-agent in server mode; but here we
20 connect to a running instance.
21
22
23
24
25 The following options may be used:
26
27
28 -v
29
30 --verbose
31 Output additional information while running.
32
33
34 -q
35
36 --quiet
37 Try to be as quiet as possible.
38
39
40 --homedir dir
41 Set the name of the home directory to dir. If his option is not
42 used, the home directory defaults to `~/.gnupg'. It is only
43 recognized when given on the command line. It also overrides
44 any home directory stated through the environment variable
45 `GNUPGHOME' or (on W32 systems) by means on the Registry entry
46 HKCU\Software\GNU\GnuPG:HomeDir.
47
48
49 -S
50
51 --raw-socket name
52 Connect to socket name assuming this is an Assuan style server.
53 Do not run any special initializations or environment checks.
54 This may be used to directly connect to any Assuan style socket
55 server.
56
57
58 -E
59
60 --exec Take the rest of the command line as a program and it's argu‐
61 ments and execute it as an assuan server. Here is how you would
62 run gpgsm:
63 gpg-connect-agent --exec gpgsm --server
64
65
66
67 --no-ext-connect
68 When using -S or --exec, gpg-connect-agent connects to the
69 assuan server in extended mode to allow descriptor passing.
70 This option makes it use the old mode.
71
72
73 --run file
74 Run the commands from file at startup and then continue with the
75 regular input method.
76
77
78 -s
79
80 --subst
81 Run the command /subst at startup.
82
83
84 --hex Print data lines in a hex format and the ASCII representation of
85 non-control characters.
86
87
88 --decode
89 Decode data lines. That is to remove percent escapes but make
90 sure that a new line always starts with a D and a space.
91
92
93
95 While reading Assuan commands, gpg-agent also allows a few special com‐
96 mands to control its operation. These control commands all start with
97 a slash (/).
98
99
100
101 /echo args
102 Just print args.
103
104
105 /let name value
106 Set the variable name to value. Variables are only substituted
107 on the input if the /subst has been used. Variables are refer‐
108 enced by prefixing the name with a dollr sign and optionally
109 include the name in curly braces. The rules for a valid name
110 are idnetically to those of the standard bourne shell. This is
111 not yet enforced but may be in the future. When used with curly
112 braces no leading or trailing white space is allowed.
113
114 If a variable is not found, it is searched in the environment
115 and if found copied to the table of variables.
116
117 Variable functions are available: The name of the function must
118 be followed by at least one space and the at least one argument.
119 The following functions are available:
120
121
122 get Return a value described by the argument. Available
123 arguments are:
124
125
126 cwd The current working directory.
127
128 homedir
129 The gnupg homedir.
130
131 sysconfdir
132 GnuPG's system configuration directory.
133
134 bindir GnuPG's binary directory.
135
136 libdir GnuPG's library directory.
137
138 libexecdir
139 GnuPG's library directory for executable files.
140
141 datadir
142 GnuPG's data directory.
143
144 serverpid
145 The PID of the current server. Command /serverpid
146 must have been given to return a useful value.
147
148
149 unescape args
150 Remove C-style escapes from args. Note that and 0 ter‐
151 minate the returned string implictly. The string to be
152 converted are the entire arguments right behind the
153 delimiting space of the function name.
154
155
156 unpercent args
157
158 unpercent+ args
159 Remove percent style ecaping from args. Note that %00
160 terminates the string implicitly. The string to be con‐
161 verted are the entire arguments right behind the delimit‐
162 ing space of the function name. unpercent+ also maps plus
163 signs to a spaces.
164
165
166 percent args
167
168 percent+ args
169 Escape the args using percent style ecaping. Tabs, form‐
170 feeds, linefeeds, carriage returns and colons are
171 escaped. percent+ also maps spaces to plus signs.
172
173
174 +
175
176 -
177
178 *
179
180 /
181
182 % Evaluate all arguments as long integers using strtol and
183 apply this operator. A division by zero yields an empty
184 string.
185
186
187
188
189
190 /definq name var
191 Use content of the variable var for inquiries with name. name
192 may be an asterisk (*) to match any inquiry.
193
194
195
196 /definqfile name file
197 Use content of file for inquiries with name. name may be an
198 asterisk (*) to match any inquiry.
199
200
201 /definqprog name prog
202 Run prog for inquiries matching name and pass the entire line to
203 it as command line arguments.
204
205
206 /showdef
207 Print all definitions
208
209
210 /cleardef
211 Delete all definitions
212
213
214 /sendfd file mode
215 Open file in mode (which needs to be a valid fopen mode string)
216 and send the file descriptor to the server. This is usually
217 followed by a command like INPUT FD to set the input source for
218 other commands.
219
220
221 /recvfd
222 Not yet implemented.
223
224
225 /open var file [mode]
226 Open file and assign the file descriptor to var. Warning: This
227 command is experimental and might change in future versions.
228
229
230 /close fd
231 Close the file descriptor fd. Warning: This command is experi‐
232 mental and might change in future versions.
233
234
235 /showopen
236 Show a listy of open files.
237
238
239 /serverpid
240 Send the Assuan command GETINFO pid to the server and store the
241 returned PID for internal purposes.
242
243
244 /sleep Sleep for a second.
245
246
247 /hex
248
249 /nohex Same as the command line option --hex.
250
251
252 /decode
253
254 /nodecode
255 Same as the command line option --decode.
256
257
258 /subst
259
260 /nosubst
261 Enable and disable variable substitution. It defaults to dis‐
262 abled unless the command line option --subst has been used. If
263 /subst as been enabled once, leading white spaces are removed
264 from input lines which makes scripts easier to read.
265
266
267 /while condition
268
269 /end These commands provide a way for executing loops. All lines
270 between the while and the corresponding end are executed as long
271 as the evaluation of condition yields a non-zero value. The
272 evaluation is done by passing condition to the strtol function.
273 Example:
274
275 /subst
276 /let i 3
277 /while $i
278 /echo loop couter is $i
279 /let i ${- $i 1}
280 /end
281
282
283
284 /run file
285 Run commands from file.
286
287
288 /bye Terminate the connection and the program
289
290
291 /help Print a list of available control commands.
292
293
294
295
297 gpg-agent(1), scdaemon(1)
298
299 The full documentation for this tool is maintained as a Texinfo manual.
300 If GnuPG and the info program are properly installed at your site, the
301 command
302
303 info gnupg
304
305 should give you access to the complete manual including a menu struc‐
306 ture and an index.
307
308
309
310
311
312
313GnuPG 2.0.8 2008-01-24 GPG-CONNECT-AGENT(1)