acl: Don't check command path for other UID's.
[pwmd.git] / doc / pwmd.html
blob8ab77f408d2b9a504b5dedc3a3dc502e6e0a04ef
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>PWMD Manual</title>
8 <meta name="description" content="PWMD Manual">
9 <meta name="keywords" content="PWMD Manual">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="#Top" rel="start" title="Top">
14 <link href="#SEC_Contents" rel="contents" title="Table of Contents">
15 <link href="dir.html#Top" rel="up" title="(dir)">
16 <style type="text/css">
17 <!--
18 a.summary-letter {text-decoration: none}
19 blockquote.indentedblock {margin-right: 0em}
20 div.display {margin-left: 3.2em}
21 div.example {margin-left: 3.2em}
22 div.lisp {margin-left: 3.2em}
23 kbd {font-style: oblique}
24 pre.display {font-family: inherit}
25 pre.format {font-family: inherit}
26 pre.menu-comment {font-family: serif}
27 pre.menu-preformatted {font-family: serif}
28 span.nolinebreak {white-space: nowrap}
29 span.roman {font-family: initial; font-weight: normal}
30 span.sansserif {font-family: sans-serif; font-weight: normal}
31 ul.no-bullet {list-style: none}
32 -->
33 </style>
36 </head>
38 <body lang="en">
39 <h1 class="settitle" align="center">PWMD Manual</h1>
44 <span id="Top"></span><div class="header">
45 <p>
46 Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
47 </div>
48 <h1 class="node-heading">Top</h1>
51 <table class="menu" border="0" cellspacing="0">
52 <tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Overview of pwmd.
53 </td></tr>
54 <tr><td align="left" valign="top">&bull; <a href="#Access-Control" accesskey="2">Access Control</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ACL of a single XML element.
55 </td></tr>
56 <tr><td align="left" valign="top">&bull; <a href="#Cache-Control" accesskey="3">Cache Control</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Key and data file cache handling.
57 </td></tr>
58 <tr><td align="left" valign="top">&bull; <a href="#Invoking" accesskey="4">Invoking</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Command line options.
59 </td></tr>
60 <tr><td align="left" valign="top">&bull; <a href="#Configuration" accesskey="5">Configuration</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Configuration file options.
61 </td></tr>
62 <tr><td align="left" valign="top">&bull; <a href="#Commands" accesskey="6">Commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Protocol commands.
63 </td></tr>
64 <tr><td align="left" valign="top">&bull; <a href="#Bulk-Commands" accesskey="7">Bulk Commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Running multiple commands in sequence.
65 </td></tr>
66 <tr><td align="left" valign="top">&bull; <a href="#Status-Messages" accesskey="8">Status Messages</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Status lines and their meaning.
67 </td></tr>
68 <tr><td align="left" valign="top">&bull; <a href="#Target-Attribute" accesskey="9">Target Attribute</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A kind of symbolic link.
69 </td></tr>
70 <tr><td align="left" valign="top">&bull; <a href="#Other-Attributes">Other Attributes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Other attributes specially handled by pwmd.
71 </td></tr>
72 <tr><td align="left" valign="top">&bull; <a href="#Key-Expiration">Key Expiration</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">What to do when a key expires.
73 </td></tr>
74 <tr><td align="left" valign="top">&bull; <a href="#Signals">Signals</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Signals known to pwmd.
75 </td></tr>
76 <tr><td align="left" valign="top">&bull; <a href="#Concept-Index">Concept Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Index of concepts.
77 </td></tr>
78 </table>
80 <hr>
81 <span id="Introduction"></span><div class="header">
82 <p>
83 Next: <a href="#Access-Control" accesskey="n" rel="next">Access Control</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
84 </div>
85 <span id="Overview-of-pwmd"></span><h2 class="chapter">1 Overview of <code>pwmd</code></h2>
92 <p><em>Password Manager Daemon</em> (or <code>pwmd</code>) is a server that
93 applications connect to and send commands to put and get data
94 that is stored in an OpenPGP encrypted XML document. It mimics a
95 filesystem in a lot of ways including per element ACL&rsquo;s, but also has
96 the advantage of remote connections over TLS and a document cache. The
97 document cache is needed for a data file encrypted with keys stored on a
98 smartcard.
99 </p>
100 <p>The server uses the Assuan protocol (See <a href="https://www.gnupg.org/documentation/manuals/assuan/Implementation.html#Implementation">(assuan)Implementation</a>) which
101 is the same used by <code>gpg-agent</code>, <code>pinentry</code> and
102 <code>scdaemon</code>. It also uses <cite>libgpg-error</cite> for error reporting with
103 <var>GPG_ERR_SOURCE_USER_1</var> being the error source.
104 </p>
106 <p>The XML document uses the following DTD:
107 </p>
108 <div class="example">
109 <pre class="example"> &lt;?xml version=&quot;1.0&quot;?&gt;
110 &lt;!DOCTYPE pwmd [
111 &lt;!ELEMENT pwmd (element*)&gt;
112 &lt;!ATTLIST element _name CDATA #REQUIRED&gt;
113 ]&gt;
114 </pre></div>
116 <p>The <code>pwmd</code> element is the document root node while all other elements
117 of the document have the name <code>element</code> with an attribute <code>_name</code>
118 whose value uniquely identifies the element at the current element tree depth.
119 It is done this way to avoid XML parsing errors for commonly used
120 characters. A URL for example would be an invalid XML element
121 since the URI contains a &lsquo;<samp>:</samp>&rsquo; which is also the XML
122 namespace separator.
123 </p>
124 <p>As mentioned, an element name must be unique for the current element tree
125 depth. You cannot have two elements containing the same <code>_name</code> attribute
126 value. <code>pwmd</code> will stop searching for an element of an <em>element
127 path</em> at the first match then continue searching for the next element of the
128 element path beginning at the child node of the matched element.
129 </p>
130 <p>An <em>element path</em> is a <code>TAB</code> delimited character string where each
131 <code>TAB</code> separates each element in the path. For example, the element path
132 <code>a<code>TAB</code>b<code>TAB</code>c</code> has the following XML document structure:
133 </p>
134 <div class="example">
135 <pre class="example"> &lt;pwmd&gt;
136 &lt;element _name=&quot;a&quot;&gt;
137 &lt;element _name=&quot;b&quot;&gt;
138 &lt;element _name=&quot;c&quot;&gt;
139 [... element value or content ...]
140 &lt;/element&gt;
141 &lt;/element&gt;
142 &lt;/element&gt;
143 &lt;/pwmd&gt;
144 </pre></div>
146 <p>The only restriction of an element name is that it contain no whitespace
147 characters.
148 </p>
149 <hr>
150 <span id="Access-Control"></span><div class="header">
152 Next: <a href="#Cache-Control" accesskey="n" rel="next">Cache Control</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
153 </div>
154 <span id="Access-Control-1"></span><h2 class="chapter">2 Access Control</h2>
156 <p>Like a filesystem has an ACL to grant or limit access to directories or
157 files for a specific user or group, <code>pwmd</code> can limit a local user,
158 group or a TLS connection to a specific element path. This is done by
159 storing an ACL in the element attribute <var>_acl</var>. Its syntax is
160 similar to the <var>allowed</var> configuration parameter (see <a href="#Configuration">Configuration</a>)
161 with the exception that a TLS fingerprint hash is prefixed with a
162 <code>#</code>.
163 </p>
164 <p>Access is denied for all users that are not in the ACL of an element
165 with the exception of an invoking user (see the <var>invoking_user</var>). The
166 connected client must be in the ACL for each element in an element path
167 otherwise an error is returned. As an example:
168 </p>
169 <div class="example">
170 <pre class="example">&lt;element _name=&quot;test&quot; _acl=&quot;username,-@wheel,root,#ABCDEF&quot;&gt;
171 &lt;element _name=&quot;child&quot;/&gt;
172 &lt;/element&gt;
173 </pre></div>
175 <p>The user <code>username</code> would be allowed access to the <code>test</code> element
176 but not if it is a member of the <code>wheel</code> group although, the <code>root</code>
177 user, who may be a member of the <code>wheel</code> group, is allowed. The SHA-256
178 TLS fingerprint hash <code>#ABCDEF</code> is also allowed. No users other than an
179 <var>invoking_user</var> are allowed access to the <code>child</code> element.
180 </p>
181 <p>The first user listed in the ACL is considered the owner of the
182 element. This determines which clients may modify an <var>_acl</var> attribute and
183 store content for an element. An <var>invoking_user</var> may always modify an
184 ACL.
185 </p>
186 <hr>
187 <span id="Cache-Control"></span><div class="header">
189 Next: <a href="#Invoking" accesskey="n" rel="next">Invoking</a>, Previous: <a href="#Access-Control" accesskey="p" rel="prev">Access Control</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
190 </div>
191 <span id="Cache-Control-1"></span><h2 class="chapter">3 Cache Control</h2>
195 <p>While <code>pwmd</code> has its own cache settings for an XML document,
196 <code>gpg-agent</code> has cache settings for the keys used for crypto operations
197 of a data file. Specifically the <samp>ignore-cache-for-signing</samp>,
198 <samp>default-cache-ttl</samp> and <samp>max-cache-ttl</samp> options. These
199 <code>gpg-agent</code> options may need to be adjusted depending on your usage
200 needs. For example, the <code>OPEN</code> command may not require a passphrase to
201 open a data file do to the gpg-agent having a cached key even though the
202 <code>ISCACHED</code> command returns an error indicating the data file is not
203 cached; which usually means a passphrase would be required. Keys for symmetric
204 data files are never kept in the <code>gpg-agent</code> cache regardless of
205 <code>gpg-agent</code> cache settings.
206 </p>
207 <p>A copy-on-write operation is done for commands that modify the document; the
208 client that invoked the command will work on a copy of the in-memory document.
209 The first client to <code>SAVE</code> the changes to disk will require other clients
210 to reopen the data file do to the checksum being updated.
211 </p>
212 <hr>
213 <span id="Invoking"></span><div class="header">
215 Next: <a href="#Configuration" accesskey="n" rel="next">Configuration</a>, Previous: <a href="#Cache-Control" accesskey="p" rel="prev">Cache Control</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
216 </div>
217 <span id="Invoking-pwmd"></span><h2 class="chapter">4 Invoking <code>pwmd</code></h2>
220 <p><code>pwmd</code> uses GpgME for encryption, decryption and signing of the
221 OpenPGP data file. GpgME itself makes use of <code>gpg</code> for these
222 operations so some configuration of <code>gpg</code> may be needed. Pwmd spawns
223 a separate <code>gpg-agent</code> process when <var>gpg_homedir</var>
224 (see <a href="#Configuration">Configuration</a>) is not set to an instance of an already running
225 gpg-agent. Any <code>gpg</code> configuration options that you need set should be
226 put in <var>~/.pwmd/.gnupg/gpg.conf</var> or the <var>gpg.conf</var> file located in
227 <var>gpg_homedir</var>. The same is true for the <var>gpg-agent.conf</var> file to set
228 any required <code>gpg-agent</code> options.
229 </p>
230 <p>It is recommended to pass the <samp>--allow-preset-passphrase</samp>
231 option to <code>gpg-agent</code>. Doing so allows <code>pwmd</code>
232 cache pushing on startup. It is also recommended to pass the
233 <samp>--allow-loopback-pinentry</samp> to <code>gpg-agent</code> (this is the default
234 as of gnupg-2.1.15). This option allows a passphrase to be inquired from
235 <code>pwmd</code> when a <code>pinentry</code> is unavailable to the client
236 (see <a href="#TLS">TLS</a>).
237 </p>
238 <p>If you would like to use a keypair from your default gnupg keyring located in
239 ~/.gnupg, but would still like to use a separate gpg-agent process (the
240 default), you would need to first export the public key from the default
241 keyring then import it into the keyring that pwmd uses. You can do this by
242 first exporting the public key, then use the <samp>--homedir ~/.pwmd/.gnupg</samp>
243 option of <code>gpg</code> to import it into the new keyring. For private keys,
244 you would need to copy the private key associated with the exported public key
245 to <var>~/.pwmd/.gnupg/private-keys-v1.d</var>. If the private key is stored on
246 a smartcard you can also use the <code>KEYINFO --learn</code> command
247 (see <a href="#KEYINFO">KEYINFO</a>).
248 </p>
249 <span id="index-Running-pwmd"></span>
250 <p><code>pwmd</code> is executed as follows:
251 </p>
252 <div class="example">
253 <pre class="example">pwmd <var>options</var> [ file1 ] [ &hellip; ]
254 </pre></div>
256 <p>Non-option arguments are data files to cache upon startup. When the data file
257 requires a passphrase for decryption a <code>pinentry</code> will prompt either
258 on the current TTY or from an X11 window when the <code>DISPLAY</code>
259 environment variable is set. See <a href="#Pinentry">Pinentry</a>.
260 </p>
261 <span id="index-Options"></span>
262 <span id="index-Arguments"></span>
263 <p>The following command line options are supported:
264 </p>
265 <span id="index-Getting-help"></span>
266 <dl compact="compact">
267 <dt>&lsquo;<samp>--debug protocol:level[,protocol:level]</samp>&rsquo;</dt>
268 <dd><p>Enable debugging output. This option can output sensitive information such as
269 passphrases and secret keys so care should be taken where the output gets
270 written to. The <var>protocol</var> is a single character representing the protocol
271 to log. Use <code>a</code> for <code>libassuan</code> with <var>level</var> being one or more
272 character flags: <code>i</code> for init, <code>x</code> for context, <code>e</code> for engine,
273 <code>d</code> for data, <code>s</code> for system IO or <code>c</code> for control. To debug
274 <code>gpgme</code> use <code>g</code> as the <var>protocol</var> with <var>level</var> being an
275 integer from <code>1</code> to <code>9</code>. To enable <acronym>TLS</acronym> debugging output
276 use <code>t</code> as the <var>protocol</var> with <var>level</var> being an integer from
277 <code>1</code> to <code>9</code>. A value over <code>10</code> will enable all <acronym>TLS</acronym>
278 debugging output with <code>1</code> being the default.
279 </p>
280 </dd>
281 <dt>&lsquo;<samp>--homedir directory</samp>&rsquo;</dt>
282 <dd><p>The root directory where pwmd will store its data and temporary files. The
283 default is <samp>~/.pwmd</samp>.
284 </p>
285 </dd>
286 <dt>&lsquo;<samp>--rcfile, -f rcfile</samp>&rsquo;</dt>
287 <dd><p>Specify an alternate configuration file. The default is
288 <samp>~/.pwmd/config</samp>.
289 </p>
290 </dd>
291 <dt>&lsquo;<samp>--kill</samp>&rsquo;</dt>
292 <dd><p>Terminate an existing instance of pwmd. The process to terminate is determined
293 from the <samp>--homedir</samp> and <samp>--rcfile</samp> options.
294 </p>
295 </dd>
296 <dt>&lsquo;<samp>--import, -I filename|-</samp>&rsquo;</dt>
297 <dd><p>Imports the XML <var>filename</var>. When <var>filename</var> is <code>-</code> the
298 XML is read from stdin. The XML file should be in conformance to
299 the <code>pwmd</code> DTD (see <a href="#Introduction">Introduction</a>). You will be prompted for
300 a passphrase to encrypt with. The output is written to the filename specified
301 with <samp>--outfile</samp>. To make use of the imported data, place the output
302 file in <samp>~/.pwmd/data</samp>.
303 </p>
304 </dd>
305 <dt>&lsquo;<samp>--output, -o filename|-</samp>&rsquo;</dt>
306 <dd><p>When importing, write the encrypted data file to <var>filename</var>. When
307 <var>filename</var> is <code>-</code> output will be written to stdout.
308 </p>
309 </dd>
310 <dt>&lsquo;<samp>--passphrase-file, -k filename&quot;</samp>&rsquo;</dt>
311 <dd><p>Obtain the passphrase to use when importing from the specified <var>filename</var>.
312 </p>
313 </dd>
314 <dt>&lsquo;<samp>--keyid fingerprint[,fingerprint]</samp>&rsquo;</dt>
315 <dd><p>Specifies the fingerprint of the encryption key to use as a recipient when
316 importing. When not specified a new key-pair will be created.
317 </p>
318 </dd>
319 <dt>&lsquo;<samp>--sign-keyid fingerprint</samp>&rsquo;</dt>
320 <dd><p>Specifies the fingerprint of the signing key to use for signing of the data
321 file when importing. When not specified the signing key of the generated
322 key-pair or the signing key of the <samp>--keyid</samp> option will be used.
323 </p>
324 </dd>
325 <dt>&lsquo;<samp>--symmetric, -s</samp>&rsquo;</dt>
326 <dd><p>Use symmetric or conventional encryption rather than pubic key encryption when
327 importing. Signing is still possible by using the <samp>--sign-keyid</samp>
328 option. By default no signing is done when specifying this option.
329 </p>
330 </dd>
331 <dt>&lsquo;<samp>--userid string</samp>&rsquo;</dt>
332 <dd><p>When importing, the user id used to identify the generated key. This should be
333 in the form <code>First Last &lt;email&gt;</code>.
334 </p>
335 </dd>
336 <dt>&lsquo;<samp>--algo string</samp>&rsquo;</dt>
337 <dd><p>When importing, the algorithm to use when generating the new key pair. The
338 default is determined by <code>gpg</code>.
339 </p>
340 </dd>
341 <dt>&lsquo;<samp>--expire seconds</samp>&rsquo;</dt>
342 <dd><p>When importing, the time, in seconds since epoch, when the generated key will
343 expire. Specifying <code>0</code> will never expire the key. The default is three
344 years.
345 </p>
346 </dd>
347 <dt>&lsquo;<samp>--no-passphrase</samp>&rsquo;</dt>
348 <dd><p>When importing, don&rsquo;t require a passphrase for the generated key.
349 </p>
350 </dd>
351 <dt>&lsquo;<samp>--disable-dump</samp>&rsquo;</dt>
352 <dd><p>Disable the <code>XPATH</code>, <code>XPATHATTR</code>, <code>LIST</code> and <code>DUMP</code>
353 protocol commands (see <a href="#Commands">Commands</a>). This overrides any
354 <var>disable_list_and_dump</var> configuration parameter (see <a href="#Configuration">Configuration</a>).
355 </p>
356 </dd>
357 <dt>&lsquo;<samp>--no-fork, -n</samp>&rsquo;</dt>
358 <dd><p>Run as a foreground process and do not fork into the background.
359 </p>
360 </dd>
361 <dt>&lsquo;<samp>--ignore, --force</samp>&rsquo;</dt>
362 <dd><p>Ignore cache pushing failures on startup. By default, <code>pwmd</code> will exit
363 if an error occurred do to an invalid passphrase or other error.
364 </p>
365 </dd>
366 <dt>&lsquo;<samp>--version</samp>&rsquo;</dt>
367 <dd><p>Show the version, copyright and compile time features and exit.
368 </p>
369 </dd>
370 <dt>&lsquo;<samp>--help</samp>&rsquo;</dt>
371 <dd><p>Print a summary of options.
372 </p></dd>
373 </dl>
376 <hr>
377 <span id="Configuration"></span><div class="header">
379 Next: <a href="#TLS" accesskey="n" rel="next">TLS</a>, Previous: <a href="#Invoking" accesskey="p" rel="prev">Invoking</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
380 </div>
381 <span id="pwmd-configuration-file-options"></span><h2 class="chapter">5 <code>pwmd</code> configuration file options</h2>
384 <p>If no configuration file is specified with the <code>pwmd</code> <samp>-f</samp>
385 command line option, <code>pwmd</code> will read <samp>~/.pwmd/config</samp> if it
386 exists, and if not, will use defaults. Blank lines and lines beginning with
387 &lsquo;<samp>#</samp>&rsquo; are ignored. Some parameters may have data file specific settings by
388 placing them in a file section. A file section is declared by surrounding the
389 filename with braces (i.e., &lsquo;<samp>[filename]</samp>&rsquo;). Global options may be
390 specified in the <code>global</code> section &lsquo;<samp>e.g., [global]</samp>&rsquo; and are the
391 default options for new or unspecified file sections.
392 </p>
393 <p>A tilde <code>~</code> will be expanded to the home directory of the user starting
394 <code>pwmd</code> when contained in a parameter whose value is a filename.
395 </p>
396 <span id="index-Reloading-the-configuration-file"></span>
397 <p>The configuration file can be reloaded by sending the <em>SIGHUP</em> signal to
398 a <code>pwmd</code> process. Some security sensitive settings may not be changed
399 until <code>pwmd</code> is restarted.
400 </p>
401 <span id="index-Global-configuration-options"></span>
402 <p>The following options are only for use in the <code>[global]</code> section:
403 </p>
404 <dl compact="compact">
405 <dt>&lsquo;<samp>socket_path = /path/to/socket</samp>&rsquo;</dt>
406 <dd><p>Listen on the specified socket. The default is <samp>~/.pwmd/socket</samp>.
407 </p>
408 </dd>
409 <dt>&lsquo;<samp>socket_perms = octal_mode</samp>&rsquo;</dt>
410 <dd><p>Permissions to set after creating the socket. This will override any
411 <cite>umask(2)</cite> setting.
412 </p>
413 </dd>
414 <dt>&lsquo;<samp>backlog = integer</samp>&rsquo;</dt>
415 <dd><p>The number of connections to queue. When this limit is reached then new
416 connections will be refused. The default is <code>128</code>.
417 </p>
418 </dd>
419 <dt>&lsquo;<samp>invoking_user = [-!]user,[-!]@group,[-!]#SHA-256,...</samp>&rsquo;</dt>
420 <dd><p>This parameter is not to be confused with setuid or setguid upon startup. It&rsquo;s
421 syntax is the same as the <code>allowed</code> parameter except that it is a list of
422 local usernames, group names and TLS fingerprint hashes that may use the
423 <code>XPATH</code>, <code>XPATHATTR</code> and <code>DUMP</code> commands (except when
424 disabled with the <code>disable_list_and_dump</code> option) and also who may modify
425 elements that have no <code>_acl</code> attribute or is not listed in an
426 <code>_acl</code>. It is similar to the system administrator root account but for a
427 data file and element paths (see <a href="#Access-Control">Access Control</a>). The default is the user
428 the executes <code>pwmd</code>.
429 </p>
430 </dd>
431 <dt>&lsquo;<samp>invoking_file = filename</samp>&rsquo;</dt>
432 <dd><p>A file containing one entry per line. An entry has the same syntax as the
433 <code>invoking_user</code> parameter. When both this parameter and the
434 <code>invoking_user</code> parameter are specified then the <code>invoking_user</code>
435 parameter will behave as if the <code>invoking_file</code> entries have been
436 appended to the <code>invoking_user</code> parameter value.
437 </p>
438 </dd>
439 <dt>&lsquo;<samp>strict_open = boolean</samp>&rsquo;</dt>
440 <dd><p>When <code>true</code>, disallow creation of a new data file when the current client
441 is not an <code>invoking_user</code>. The default is <code>false</code>.
442 </p>
443 </dd>
444 <dt>&lsquo;<samp>strict_kill = boolean</samp>&rsquo;</dt>
445 <dd><p>When <code>false</code>, the <code>KILL</code> command (see <a href="#KILL">KILL</a>) will allow killing
446 another client that is not of the same <code>UID</code> or TLS fingerprint of
447 the current client and when not an <code>invoking_user</code>. The default us
448 <code>false</code>.
449 </p>
450 </dd>
451 <dt>&lsquo;<samp>allowed = [-!]user,[-!]@group,/path/to/exec,[+,][-!]#SHA-256,...</samp>&rsquo;</dt>
452 <dd><p>A comma separated list of local user names, group names or TLS
453 fingerprint SHA-256 hashes (in the case of a remote client) who are
454 allowed to connect. Groups should be prefixed with a &lsquo;<samp>@</samp>&rsquo;. When not
455 specified only the user who started <code>pwmd</code> may connect. A username,
456 group name or hash may also be prefixed with a <code>-</code> or <code>!</code> to prevent
457 access to a specific user or group in the list. The order of the list is
458 important since a user may be a member of multiple groups.
459 </p>
460 <p>Connections from local clients may also be limited by command name. A command
461 name is the full path to the execuatble on the filesystem. The command check
462 is done after all other user and group name checks. When no command is
463 specified all commands are valid. When the connecting client is not of the
464 same <acronym>UID</acronym> as the user that invoked <code>pwmd</code> this feature is
465 ignored.
466 </p>
467 <p>This parameter may also be specified in a filename section to allow or deny a
468 client to <code>OPEN</code> (see <a href="#OPEN">OPEN</a>) a data file. It also affects the cache
469 commands <code>CLEARCACHE</code> (see <a href="#CLEARCACHE">CLEARCACHE</a>) and <code>CACHETIMEOUT</code>
470 (see <a href="#CACHETIMEOUT">CACHETIMEOUT</a>). When not specified in a file section, any user that
471 can connect may also open any filename (provided they can decrypt it).
472 </p>
473 <p>The following example would deny all users in group <code>primary</code> but
474 allow <code>username</code> who may be a member of <code>primary</code>. It will also
475 allow any TLS client except for the client with TLS fingerprint hash
476 <code>#ABCDEF</code>. For the local connections, the connecting client must be using
477 the /usr/bin/pwmc program:
478 </p>
479 <div class="example">
480 <pre class="example">allowed=-@primary,username,+,!#ABCDEF,/usr/bin/pwmc
481 </pre></div>
483 </dd>
484 <dt>&lsquo;<samp>allowed_file = filename</samp>&rsquo;</dt>
485 <dd><p>A file containing one entry per line. An entry has the same syntax as the
486 <code>allowed</code> parameter. When both this parameter and the <code>allowed</code>
487 parameter are specified then the <code>allowed_file</code> entries will be appended
488 to the <code>allowed</code> parameter value.
489 </p>
490 </dd>
491 <dt>&lsquo;<samp>encrypt_to = boolean</samp>&rsquo;</dt>
492 <dd><p>When <code>true</code> and <code>SAVE</code>&rsquo;ing a data file, allow <code>gpg</code> to
493 append it&rsquo;s configured key to the list of recipients. The default is
494 <code>false</code> meaning that only keys specified with <code>SAVE</code>
495 <samp>--keyid</samp> are recipients.
496 </p>
497 </dd>
498 <dt>&lsquo;<samp>always_trust = boolean</samp>&rsquo;</dt>
499 <dd><p>When <code>true</code>, allow encrypting to untrusted recipients or public
500 encryption keys. The default is <code>false</code>.
501 </p>
502 </dd>
503 <dt>&lsquo;<samp>gpg_homedir = path</samp>&rsquo;</dt>
504 <dd><p>The location where <code>gpg</code> will store its public and private keys and
505 configuration. The default is <samp>HOMEDIR/.gnupg</samp> where <var>HOMEDIR</var> is the
506 default (<samp>~/.pwmd</samp>) or the value specified on the command line with the
507 <samp>--homedir</samp> command line option (see <a href="#Invoking">Invoking</a>). If you want to use
508 your standard <code>gpg</code> keyring then set this to <samp>~/.gnupg</samp>. Note
509 that a new instance of <code>gpg-agent</code> will be started when <em>not</em>
510 using the standard keyring and that any configuration options for
511 <code>gpg-agent</code> will need to placed in
512 <samp>HOMEDIR/.gnupg/gpg-agent.conf</samp>.
513 </p>
514 </dd>
515 <dt>&lsquo;<samp>disable_mlockall = boolean</samp>&rsquo;</dt>
516 <dd><p>When set to <code>false</code>, <cite>mlockall(2)</cite> will be called on startup. This
517 will use more physical memory but may also be more secure since no swapping to
518 disk will occur. The default is <var>true</var>. If possible, use an encrypted swap
519 file or partition and leave this set to <var>true</var>.
520 </p>
521 </dd>
522 <dt>&lsquo;<samp>log_path = /path/to/logfile</samp>&rsquo;</dt>
523 <dd><p>Logs informational messages to the specified file. The default is
524 <samp>~/.pwmd/log</samp>.
525 </p>
526 </dd>
527 <dt>&lsquo;<samp>enable_logging = boolean</samp>&rsquo;</dt>
528 <dd><p>Enable or disable logging to <var>log_path</var>. The default is <code>false</code>.
529 </p>
530 </dd>
531 <dt>&lsquo;<samp>log_keepopen = boolean</samp>&rsquo;</dt>
532 <dd><p>When set to <code>false</code>, the log file specified with <var>log_path</var> will be
533 closed after writing each line. The default is <code>true</code>.
534 </p>
535 </dd>
536 <dt>&lsquo;<samp>syslog = boolean</samp>&rsquo;</dt>
537 <dd><p>Enable logging to <cite>syslog(8)</cite> with facility <em>LOG_DAEMON</em> and priority
538 <em>LOG_INFO</em>. The default is <code>false</code>.
539 </p>
540 </dd>
541 <dt>&lsquo;<samp>log_level = level</samp>&rsquo;</dt>
542 <dd><p>When <code>0</code>, only connections and errors are logged. When <code>1</code>, data
543 file recipients and signers are logged during <code>OPEN</code> (see <a href="#OPEN">OPEN</a>) and
544 <code>SAVE</code> (see <a href="#SAVE">SAVE</a>). When <code>2</code>, client commands are also logged.
545 The default is <code>0</code>.
546 </p>
547 </dd>
548 <dt>&lsquo;<samp>kill_scd = boolean</samp>&rsquo;</dt>
549 <dd><p>Attempt to kill <code>scdaemon</code> after a client disconnects. The default is
550 <code>false</code>.
551 </p>
552 </dd>
553 <dt>&lsquo;<samp>disable_list_and_dump = boolean</samp>&rsquo;</dt>
554 <dd><p>When <code>true</code>, the <code>XPATH</code>, <code>XPATHATTR</code>, <code>LIST</code> and
555 <code>DUMP</code> protocol commands (see <a href="#Commands">Commands</a>) will be disabled.
556 </p>
557 </dd>
558 <dt>&lsquo;<samp>cache_push = file1,file2</samp>&rsquo;</dt>
559 <dd><p>A comma separated list of filenames that will be pushed into the file cache
560 upon startup. <code>pwmd</code> will prompt for the passphrase for each file
561 unless specified with <var>passphrase_file</var> parameter in a matching file
562 section.
563 </p>
564 </dd>
565 <dt>&lsquo;<samp>priority = integer</samp>&rsquo;</dt>
566 <dd><p>The priority, or niceness, of the server. The default is inherited from the
567 parent process.
568 </p>
569 </dd>
570 <dt>&lsquo;<samp>lock_timeout = integer</samp>&rsquo;</dt>
571 <dd><p>The default timeout in tenths of a second before giving up waiting for a file
572 lock and returning an error. The default is <code>50</code>.
573 </p>
574 </dd>
575 </dl>
577 <span id="index-Data-file-configuration-options"></span>
578 <p>The following options are defaults for new files when specified in the
579 &lsquo;<samp>global</samp>&rsquo; section. When placed in a data file section they are options
580 specific to that data file only.
581 </p>
582 <dl compact="compact">
583 <dt>&lsquo;<samp>require_save_key = boolean</samp>&rsquo;</dt>
584 <dd><p>Require the passphrase needed for signing before writing changes of the
585 document to disk regardless of the key cache status. The default is
586 <code>true</code>. This option compliments <code>gpg-agent</code> option
587 <samp>--ignore-cache-for-signing</samp> and is used as a fail-safe.
588 </p>
589 </dd>
590 <dt>&lsquo;<samp>backup = boolean</samp>&rsquo;</dt>
591 <dd><p>Whether to create a backup of the data file when saving. The backup filename
592 has the <samp>.backup</samp> extension appended to the opened file. The default is
593 <code>true</code>.
594 </p>
595 </dd>
596 <dt>&lsquo;<samp>cache_timeout = seconds</samp>&rsquo;</dt>
597 <dd><p>The number of seconds to keep the cache entry for this file. If <code>-1</code>, the
598 cache entry is kept forever. If <code>0</code>, each time an encrypted file is
599 <code>OPEN</code>ed (see <a href="#OPEN">OPEN</a>) a passphrase will be required. The default
600 is <code>600</code> or 10 minutes.
601 </p>
602 </dd>
603 <dt>&lsquo;<samp>passphrase_file = /path/to/filename</samp>&rsquo;</dt>
604 <dd><p>Obtain the passphrase to open the data file from <var>filename</var>. If specified
605 in the &lsquo;<samp>global</samp>&rsquo; section then the <var>passphrase_file</var> is a default for
606 all data files. Note that if a client changes the passphrase for this data
607 file then the <var>passphrase_file</var> will need to be updated with the new
608 passphrase.
609 </p>
610 </dd>
611 <dt>&lsquo;<samp>recursion_depth = integer</samp>&rsquo;</dt>
612 <dd><p>The maximum number of times to resolve a <code>_target</code> attribute for an
613 element in an element path (see <a href="#Target-Attribute">Target Attribute</a>). An error is returned
614 when this value is exceeded. The default is <code>100</code> but can be disabled by
615 setting to <code>0</code> (<em>not recommended</em>).
616 </p>
617 </dd>
618 <dt>&lsquo;<samp>allowed = [-]user,[-]@group,[!]#TLSFINGERPRINT,...</samp>&rsquo;</dt>
619 <dd><p>Same parameter value as the <code>allowed</code> parameter mentioned above in
620 the &lsquo;<samp>[global]</samp>&rsquo; section but grants or denies a client from opening a
621 specific data file. The default is to allow any client that is allowed to
622 connect.
623 </p>
624 </dd>
625 </dl>
626 <table class="menu" border="0" cellspacing="0">
627 <tr><td align="left" valign="top">&bull; <a href="#TLS" accesskey="1">TLS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Remote connections over TLS.
628 </td></tr>
629 <tr><td align="left" valign="top">&bull; <a href="#Pinentry" accesskey="2">Pinentry</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Configuration file and defaults.
630 </td></tr>
631 </table>
633 <hr>
634 <span id="TLS"></span><div class="header">
636 Next: <a href="#Pinentry" accesskey="n" rel="next">Pinentry</a>, Previous: <a href="#Configuration" accesskey="p" rel="prev">Configuration</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
637 </div>
638 <span id="Configuring-remote-connections-over-TLS_002e"></span><h2 class="chapter">6 Configuring remote connections over TLS.</h2>
639 <p>Remote connections can also be made to <code>pwmd</code> over TLS.
640 Authentication is done by using X.509 client certificates that are signed with
641 the same Certificate Authority (CA) as the server certificate.
642 </p>
643 <p>The CA certificate is expected to be found in
644 <samp>~/.pwmd/ca-cert.pem</samp> while the <code>pwmd</code> server certificate and key
645 file should be put in <samp>~/.pwmd/server-cert.pem</samp> and
646 <samp>~/.pwmd/server-key.pem</samp>, respectively.
647 </p>
648 <p>See the documentation of <code>certtool</code> or <code>openssl</code> for details
649 about creating self-signed certificates.
650 </p>
651 <p>The following TLS configuration options are available:
652 </p>
653 <dl compact="compact">
654 <dt>&lsquo;<samp>enable_tcp = boolean</samp>&rsquo;</dt>
655 <dd><p>Whether to enable TCP/TLS server support. If enabled, both TCP and the local
656 unix domain socket will listen for connections. The default is
657 <code>false</code>.
658 </p>
659 </dd>
660 <dt>&lsquo;<samp>tcp_port = integer</samp>&rsquo;</dt>
661 <dd><p>The TCP port to listen on when <var>enable_tcp</var> is <code>true</code>. The default is
662 <code>6466</code>.
663 </p>
664 </dd>
665 <dt>&lsquo;<samp>tcp_bind = string</samp>&rsquo;</dt>
666 <dd><p>The internet protocol to listen with. Must be one of <code>ipv4</code>, <code>ipv6</code>
667 or <code>any</code> to listen for both IPv4 and IPv6 connections. The default is
668 <code>any</code>.
669 </p>
670 </dd>
671 <dt>&lsquo;<samp>tcp_interface = string</samp>&rsquo;</dt>
672 <dd><p>Only useful if running as root.
673 </p>
674 </dd>
675 <dt>&lsquo;<samp>tls_timeout = seconds</samp>&rsquo;</dt>
676 <dd><p>The number of seconds to wait for a read() or write() call on a
677 TLS client file descriptor to complete before returning an
678 error. The default is <var>300</var>.
679 </p>
680 </dd>
681 <dt>&lsquo;<samp>keepalive_interval = seconds</samp>&rsquo;</dt>
682 <dd><p>Send a keepalive status message to an idle remote client. An idle
683 client is one that is not in a command. The purpose of this status
684 message is to disconnect a hung remote client and release any file mutex
685 locks so another client may open the same data file. The default is <code>60</code>.
686 </p>
687 </dd>
688 <dt>&lsquo;<samp>tcp_require_key = boolean</samp>&rsquo;</dt>
689 <dd><p>When <code>true</code>, require the remote client to provide the passphrase to open
690 a data file even if the file is cached. This option is a default for all
691 files when specified in the &lsquo;<samp>[global]</samp>&rsquo; section. The default is
692 <code>false</code>.
693 </p>
694 </dd>
695 <dt>&lsquo;<samp>tls_cipher_suite = string</samp>&rsquo;</dt>
696 <dd><p>The GnuTLS cipher suite and protocol to use. See the GnuTLS documentation for
697 information about the format of this string. The default is
698 <code>SECURE256:SECURE192:SECURE128:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-AES-128-CBC:-AES-256-CBC</code>.
699 </p>
700 </dd>
701 <dt>&lsquo;<samp>tls_dh_params_file = filename</samp>&rsquo;</dt>
702 <dd><p>The PEM encoded filename containing DH parameters. If not specified
703 then DH algorithms will not be available to the client. See the
704 <code>openssl dhparam</code> or <code>certtool</code> manual pages for details about
705 generating this file.
706 </p>
707 <p>Note that SIGHUP will not reload this file once TLS support has been enabled.
708 You will need to restart <code>pwmd</code> for changes to take effect.
709 </p>
710 </dd>
711 <dt>&lsquo;<samp>tls_use_crl = boolean</samp>&rsquo;</dt>
712 <dd><p>When <code>true</code>, enabling reading of <samp>~/.pwmd/crl.pem</samp>. This
713 file is an X.509 Certificate Revocation List and can be used to deny clients
714 by adding client certificates to it. The default is <code>false</code>.
715 <code>pwmd</code> will need to be restarted to recognize any changes to this
716 file.
717 </p></dd>
718 </dl>
720 <hr>
721 <span id="Pinentry"></span><div class="header">
723 Next: <a href="#Commands" accesskey="n" rel="next">Commands</a>, Previous: <a href="#TLS" accesskey="p" rel="prev">TLS</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
724 </div>
725 <span id="Pinentry-configuration"></span><h2 class="chapter">7 Pinentry configuration</h2>
727 <p>The <code>pinentry</code> program is used to prompt the user for passphrase
728 input or as a confirmation dialog; it needs to know where to prompt for
729 the input, beit from a terminal or an X11 display.
730 </p>
731 <p>It is the responsibility of the client to tell <code>pinentry</code> about the
732 terminal or X11 display before requiring the input. This is done with the
733 <code>OPTION</code> command (see <a href="#OPTION">OPTION</a>) to either set or unset needed
734 <code>pwmd</code> environment variables and by using the
735 <code>gpg-connect-agent</code> program. Please read it&rsquo;s documentation about the
736 <em>UPDATESTARTUPTTY</em> command.
737 </p>
738 <hr>
739 <span id="Commands"></span><div class="header">
741 Next: <a href="#Bulk-Commands" accesskey="n" rel="next">Bulk Commands</a>, Previous: <a href="#Pinentry" accesskey="p" rel="prev">Pinentry</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
742 </div>
743 <span id="Protocol-commands-and-their-syntax"></span><h2 class="chapter">8 Protocol commands and their syntax</h2>
744 <table class="menu" border="0" cellspacing="0">
745 <tr><td align="left" valign="top">&bull; <a href="#ATTR" accesskey="1">ATTR</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Modifying element attributes.
746 </td></tr>
747 <tr><td align="left" valign="top">&bull; <a href="#BULK" accesskey="2">BULK</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Run a series of commands in sequence.
748 </td></tr>
749 <tr><td align="left" valign="top">&bull; <a href="#CACHETIMEOUT" accesskey="3">CACHETIMEOUT</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Setting the cache timeout.
750 </td></tr>
751 <tr><td align="left" valign="top">&bull; <a href="#CLEARCACHE" accesskey="4">CLEARCACHE</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Removing a cache entry.
752 </td></tr>
753 <tr><td align="left" valign="top">&bull; <a href="#COPY" accesskey="5">COPY</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Copying an element.
754 </td></tr>
755 <tr><td align="left" valign="top">&bull; <a href="#DELETE" accesskey="6">DELETE</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Deleting an element.
756 </td></tr>
757 <tr><td align="left" valign="top">&bull; <a href="#DELETEKEY" accesskey="7">DELETEKEY</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Deleting a key from the key ring.
758 </td></tr>
759 <tr><td align="left" valign="top">&bull; <a href="#DUMP" accesskey="8">DUMP</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Showing the XML document.
760 </td></tr>
761 <tr><td align="left" valign="top">&bull; <a href="#GENKEY" accesskey="9">GENKEY</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Generating a new key.
762 </td></tr>
763 <tr><td align="left" valign="top">&bull; <a href="#GET">GET</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Getting the content of an element.
764 </td></tr>
765 <tr><td align="left" valign="top">&bull; <a href="#GETCONFIG">GETCONFIG</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Obtaining a configuration value.
766 </td></tr>
767 <tr><td align="left" valign="top">&bull; <a href="#GETINFO">GETINFO</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Obtaining server and client information.
768 </td></tr>
769 <tr><td align="left" valign="top">&bull; <a href="#HELP">HELP</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Showing available commands.
770 </td></tr>
771 <tr><td align="left" valign="top">&bull; <a href="#IMPORT">IMPORT</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Creating elements from XML.
772 </td></tr>
773 <tr><td align="left" valign="top">&bull; <a href="#ISCACHED">ISCACHED</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Testing cache status.
774 </td></tr>
775 <tr><td align="left" valign="top">&bull; <a href="#KEYINFO">KEYINFO</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Showing keys used for the current data file.
776 </td></tr>
777 <tr><td align="left" valign="top">&bull; <a href="#KILL">KILL</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Terminating another client.
778 </td></tr>
779 <tr><td align="left" valign="top">&bull; <a href="#LIST">LIST</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Showing document elements.
780 </td></tr>
781 <tr><td align="left" valign="top">&bull; <a href="#LISTKEYS">LISTKEYS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Listing keys in the key ring.
782 </td></tr>
783 <tr><td align="left" valign="top">&bull; <a href="#LOCK">LOCK</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Locking the current data file.
784 </td></tr>
785 <tr><td align="left" valign="top">&bull; <a href="#LS">LS</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Showing available data files.
786 </td></tr>
787 <tr><td align="left" valign="top">&bull; <a href="#MOVE">MOVE</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Moving an element.
788 </td></tr>
789 <tr><td align="left" valign="top">&bull; <a href="#NOP">NOP</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Testing the connection.
790 </td></tr>
791 <tr><td align="left" valign="top">&bull; <a href="#OPEN">OPEN</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Opening a data file.
792 </td></tr>
793 <tr><td align="left" valign="top">&bull; <a href="#OPTION">OPTION</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Setting various client parameters.
794 </td></tr>
795 <tr><td align="left" valign="top">&bull; <a href="#PASSWD">PASSWD</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Changing the passphrase for a key.
796 </td></tr>
797 <tr><td align="left" valign="top">&bull; <a href="#REALPATH">REALPATH</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Resolving an element.
798 </td></tr>
799 <tr><td align="left" valign="top">&bull; <a href="#RENAME">RENAME</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Renaming an element.
800 </td></tr>
801 <tr><td align="left" valign="top">&bull; <a href="#RESET">RESET</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Resetting the client state.
802 </td></tr>
803 <tr><td align="left" valign="top">&bull; <a href="#SAVE">SAVE</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Saving document changes to disk.
804 </td></tr>
805 <tr><td align="left" valign="top">&bull; <a href="#STORE">STORE</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Modifying the content of an element.
806 </td></tr>
807 <tr><td align="left" valign="top">&bull; <a href="#UNLOCK">UNLOCK</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Removing a data file lock.
808 </td></tr>
809 <tr><td align="left" valign="top">&bull; <a href="#XPATH">XPATH</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Modifying more than one element.
810 </td></tr>
811 <tr><td align="left" valign="top">&bull; <a href="#XPATHATTR">XPATHATTR</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Modifying more than one element&rsquo;s attributes.
812 </td></tr>
813 </table>
814 <hr>
815 <span id="ATTR"></span><div class="header">
817 Next: <a href="#BULK" accesskey="n" rel="next">BULK</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
818 </div>
819 <span id="Modifying-element-attributes_002e"></span><h2 class="chapter">9 Modifying element attributes.</h2>
820 <span id="index-ATTR-command"></span>
821 <p>Syntax:
822 </p><div class="example">
823 <pre class="example">ATTR [--inquire] SET|GET|DELETE|LIST [&lt;attribute&gt;] element[&lt;TAB&gt;child[..]] ..
824 </pre></div>
826 <dl compact="compact">
827 <dt>ATTR SET attribute element[&lt;TAB&gt;child[..]] [value]</dt>
828 <dd><p>Stores or updates an <var>attribute</var> name and optional <var>value</var> of an
829 element. When no <var>value</var> is specified any existing value will be removed.
830 <br><br>
831 </p></dd>
832 <dt>ATTR DELETE attribute element[&lt;TAB&gt;child[..]]</dt>
833 <dd><p>Removes an attribute from an element. If <var>attribute</var> is <code>_name</code>
834 or <code>target</code> an error is returned. Use the <code>DELETE</code> command
835 (see <a href="#DELETE">DELETE</a>) instead.
836 <br><br>
837 </p></dd>
838 <dt>ATTR LIST element[&lt;TAB&gt;child[..]]</dt>
839 <dd><p>Retrieves a newline separated list of attributes names and values
840 from the specified element. Each attribute name and value is space delimited.
841 <br><br>
842 </p></dd>
843 <dt>ATTR GET attribute element[&lt;TAB&gt;child[..]]</dt>
844 <dd><p>Retrieves the value of an <var>attribute</var> from an element.
845 </p></dd>
846 </dl>
847 <br><br>
848 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
849 arguments are retrieved via a server <em>INQUIRE</em>.
850 <br><br>
851 See <a href="#Target-Attribute">Target Attribute</a>, for details about this special attribute and also
852 see <a href="#Other-Attributes">Other Attributes</a> for other attributes that are handled specially
853 by <code>pwmd</code>.
854 </p>
856 <hr>
857 <span id="BULK"></span><div class="header">
859 Next: <a href="#CACHETIMEOUT" accesskey="n" rel="next">CACHETIMEOUT</a>, Previous: <a href="#ATTR" accesskey="p" rel="prev">ATTR</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
860 </div>
861 <span id="Run-a-series-of-commands-in-sequence_002e"></span><h2 class="chapter">10 Run a series of commands in sequence.</h2>
862 <span id="index-BULK-command"></span>
863 <p>Syntax:
864 </p><div class="example">
865 <pre class="example">BULK [--inquire]
866 </pre></div>
868 <p>Parses a semi-canonical s-expression representing a series of protocol
869 commands to be run in sequence (see <a href="#Bulk-Commands">Bulk Commands</a>). Returns a canonical
870 s-expression containing each commands id, return value and result data
871 (if any).
872 <br><br>
873 When the <samp>--inquire</samp> option is passed then all remaining non-option
874 arguments are retrieved via a server <em>INQUIRE</em>.
875 </p>
877 <hr>
878 <span id="CACHETIMEOUT"></span><div class="header">
880 Next: <a href="#CLEARCACHE" accesskey="n" rel="next">CLEARCACHE</a>, Previous: <a href="#BULK" accesskey="p" rel="prev">BULK</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
881 </div>
882 <span id="Setting-the-cache-timeout_002e"></span><h2 class="chapter">11 Setting the cache timeout.</h2>
883 <span id="index-CACHETIMEOUT-command"></span>
884 <p>Syntax:
885 </p><div class="example">
886 <pre class="example">CACHETIMEOUT &lt;seconds&gt;
887 </pre></div>
889 <p>The time in <var>seconds</var> until the currently opened data file will be
890 removed from the cache. <code>-1</code> will keep the cache entry forever,
891 <code>0</code> will require the passphrase for each <code>OPEN</code> command
892 (see <a href="#OPEN">OPEN</a>) or <code>SAVE</code> (see <a href="#SAVE">SAVE</a>) command. See <a href="#Configuration">Configuration</a>,
893 and the <code>cache_timeout</code> parameter.
894 </p>
896 <hr>
897 <span id="CLEARCACHE"></span><div class="header">
899 Next: <a href="#COPY" accesskey="n" rel="next">COPY</a>, Previous: <a href="#CACHETIMEOUT" accesskey="p" rel="prev">CACHETIMEOUT</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
900 </div>
901 <span id="Removing-a-cache-entry_002e"></span><h2 class="chapter">12 Removing a cache entry.</h2>
902 <span id="index-CLEARCACHE-command"></span>
903 <p>Syntax:
904 </p><div class="example">
905 <pre class="example">CLEARCACHE [&lt;filename&gt;]
906 </pre></div>
908 <p>Clears a file cache entry for all or the specified <var>filename</var>. Note that
909 this will also clear any <code>gpg-agent</code> cached keys which may cause
910 problems if another data file shares the same keys as <var>filename</var>.
911 <br><br>
912 When clearing all cache entries a permissions test is done against the
913 current client based on the <var>allowed</var> configuration parameter in a
914 <var>filename</var> section. Both a cache entry may be cleared and an error
915 returned depending on cached data files and client permissions.
916 </p>
918 <hr>
919 <span id="COPY"></span><div class="header">
921 Next: <a href="#DELETE" accesskey="n" rel="next">DELETE</a>, Previous: <a href="#CLEARCACHE" accesskey="p" rel="prev">CLEARCACHE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
922 </div>
923 <span id="Copying-an-element_002e"></span><h2 class="chapter">13 Copying an element.</h2>
924 <span id="index-COPY-command"></span>
925 <p>Syntax:
926 </p><div class="example">
927 <pre class="example">COPY [--inquire] source[&lt;TAB&gt;child[..]] dest[&lt;TAB&gt;child[..]]
928 </pre></div>
930 <p>Copies the entire element tree starting from the child node of the source
931 element, to the destination element path. If the destination element path
932 does not exist then it will be created; otherwise it is overwritten.
933 <br><br>
934 Note that attributes from the source element are merged into the
935 destination element when the destination element path exists. When an
936 attribute of the same name exists in both the source and destination
937 elements then the destination attribute will be updated to the source
938 attribute value.
939 <br><br>
940 When the <samp>--inquire</samp> option is passed then all remaining non-option
941 arguments are retrieved via a server <em>INQUIRE</em>.
942 </p>
944 <hr>
945 <span id="DELETE"></span><div class="header">
947 Next: <a href="#DELETEKEY" accesskey="n" rel="next">DELETEKEY</a>, Previous: <a href="#COPY" accesskey="p" rel="prev">COPY</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
948 </div>
949 <span id="Deleting-an-element_002e"></span><h2 class="chapter">14 Deleting an element.</h2>
950 <span id="index-DELETE-command"></span>
951 <p>Syntax:
952 </p><div class="example">
953 <pre class="example">DELETE [--inquire] element[&lt;TAB&gt;child[..]]
954 </pre></div>
956 <p>Removes the specified element path and all of its children. This may break
957 an element with a <code>target</code> attribute (see <a href="#Target-Attribute">Target Attribute</a>) that
958 refers to this element or any of its children.
959 <br><br>
960 When the <samp>--inquire</samp> option is passed then all remaining non-option
961 arguments are retrieved via a server <em>INQUIRE</em>.
962 </p>
964 <hr>
965 <span id="DELETEKEY"></span><div class="header">
967 Next: <a href="#DUMP" accesskey="n" rel="next">DUMP</a>, Previous: <a href="#DELETE" accesskey="p" rel="prev">DELETE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
968 </div>
969 <span id="Deleting-a-key-from-the-key-ring_002e"></span><h2 class="chapter">15 Deleting a key from the key ring.</h2>
970 <span id="index-DELETEKEY-command"></span>
971 <p>Syntax:
972 </p><div class="example">
973 <pre class="example">DELETEKEY &lt;keyid&gt;
974 </pre></div>
976 <p>Deletes the public and secret key associated with key <var>keyid</var> from the
977 keyring. The <var>keyid</var> must be one associated with the currently opened
978 data file.
979 Note that no confirmation occurs. Also note that when the key is deleted,
980 the current or other data files using this key will no longer be able to be
981 opened.
982 </p>
984 <hr>
985 <span id="DUMP"></span><div class="header">
987 Next: <a href="#GENKEY" accesskey="n" rel="next">GENKEY</a>, Previous: <a href="#DELETEKEY" accesskey="p" rel="prev">DELETEKEY</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
988 </div>
989 <span id="Showing-the-XML-document_002e"></span><h2 class="chapter">16 Showing the XML document.</h2>
990 <span id="index-DUMP-command"></span>
991 <p>Syntax:
992 </p><div class="example">
993 <pre class="example">DUMP
994 </pre></div>
996 <p>Shows the in memory <abbr>XML</abbr> document with indenting. See <a href="#XPATH">XPATH</a>, for
997 dumping a specific node.
998 </p>
1000 <hr>
1001 <span id="GENKEY"></span><div class="header">
1003 Next: <a href="#GET" accesskey="n" rel="next">GET</a>, Previous: <a href="#DUMP" accesskey="p" rel="prev">DUMP</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1004 </div>
1005 <span id="Generating-a-new-key_002e"></span><h2 class="chapter">17 Generating a new key.</h2>
1006 <span id="index-GENKEY-command"></span>
1007 <p>Syntax:
1008 </p><div class="example">
1009 <pre class="example">GENKEY --subkey-of=fpr | --userid=&quot;str&quot; [--no-expire | --expire=N] [--algo=&quot;str&quot;] [--no-passphrase] [--usage=&quot;default|sign|encrypt&quot;]
1010 </pre></div>
1012 <p>Generates a new key based on option arguments. One of
1013 <samp>--subkey-of</samp> or <samp>--userid</samp> is
1014 required. The <samp>--subkey-of</samp> option will generate a subkey for the key
1015 of the specified fingerprint.
1016 </p>
1018 <hr>
1019 <span id="GET"></span><div class="header">
1021 Next: <a href="#GETCONFIG" accesskey="n" rel="next">GETCONFIG</a>, Previous: <a href="#GENKEY" accesskey="p" rel="prev">GENKEY</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1022 </div>
1023 <span id="Getting-the-content-of-an-element_002e"></span><h2 class="chapter">18 Getting the content of an element.</h2>
1024 <span id="index-GET-command"></span>
1025 <p>Syntax:
1026 </p><div class="example">
1027 <pre class="example">GET [--inquire] element[&lt;TAB&gt;child[..]]
1028 </pre></div>
1030 <p>Retrieves the content of the specified element. The content is returned
1031 with a data response.
1032 <br><br>
1033 When the <samp>--inquire</samp> option is passed then all remaining non-option
1034 arguments are retrieved via a server <em>INQUIRE</em>.
1035 </p>
1037 <hr>
1038 <span id="GETCONFIG"></span><div class="header">
1040 Next: <a href="#GETINFO" accesskey="n" rel="next">GETINFO</a>, Previous: <a href="#GET" accesskey="p" rel="prev">GET</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1041 </div>
1042 <span id="Obtaining-a-configuration-value_002e"></span><h2 class="chapter">19 Obtaining a configuration value.</h2>
1043 <span id="index-GETCONFIG-command"></span>
1044 <p>Syntax:
1045 </p><div class="example">
1046 <pre class="example">GETCONFIG [filename] &lt;parameter&gt;
1047 </pre></div>
1049 <p>Returns the value of a <code>pwmd</code> configuration <var>parameter</var> with a
1050 data response. If no file has been opened then the value for <var>filename</var>
1051 or the default from the <var>global</var> section will be returned. If a file
1052 has been opened and no <var>filename</var> is specified, the value previously
1053 set with the <code>OPTION</code> command (see <a href="#OPTION">OPTION</a>) will be returned.
1054 </p>
1056 <hr>
1057 <span id="GETINFO"></span><div class="header">
1059 Next: <a href="#HELP" accesskey="n" rel="next">HELP</a>, Previous: <a href="#GETCONFIG" accesskey="p" rel="prev">GETCONFIG</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1060 </div>
1061 <span id="Obtaining-server-and-client-information_002e"></span><h2 class="chapter">20 Obtaining server and client information.</h2>
1062 <span id="index-GETINFO-command"></span>
1063 <p>Syntax:
1064 </p><div class="example">
1065 <pre class="example">GETINFO [--data] [--verbose] CACHE | CLIENTS | PID | USER | LAST_ERROR | VERSION
1066 </pre></div>
1068 <p>Get server and other information. The information is returned via a status
1069 message (see <a href="#Status-Messages">Status Messages</a>) unless otherwise noted or <samp>--data</samp>
1070 is specified.
1071 <br><br>
1072 <var>CACHE</var> returns the number of cached documents.
1073 <br><br>
1074 <var>CLIENTS</var> returns the number of
1075 connected clients via a status message or a list of connected clients when
1076 the <samp>--verbose</samp> parameter is used (implies <samp>--data</samp>). A
1077 verbose line of a client list contains
1078 space delimited
1079 fields: the thread ID, client name, opened file (<code>/</code> if none opened),
1080 IP address if remote, file lock status, whether the current client is self
1081 or not, client state (see below),
1082 user ID or TLS fingerprint of the connected client, username if the
1083 client is a local one else <code>-</code>, and finally the time stamp of when the
1084 client connected.
1085 <br><br>
1086 Client state <code>0</code> is an unknown client state, state <code>1</code> indicates
1087 the client has connected but hasn&rsquo;t completed initializing, state <code>2</code>
1088 indicates that the client is idle, state <code>3</code> means the
1089 client is in a command and state <code>4</code> means the client is disconnecting.
1090 <br><br>
1091 <var>PID</var> returns the process ID number of the server via a data response.
1092 <br><br>
1093 <var>VERSION</var> returns the server version number and compile-time features
1094 via a data response with each being space delimited.
1095 <br><br>
1096 <var>LAST_ERROR</var> returns a detailed description of the last failed command
1097 via a data response, when available.
1098 <br><br>
1099 <var>USER</var> returns the username or <abbr>TLS</abbr> hash of the connected client
1100 via a data response.
1101 </p>
1103 <hr>
1104 <span id="HELP"></span><div class="header">
1106 Next: <a href="#IMPORT" accesskey="n" rel="next">IMPORT</a>, Previous: <a href="#GETINFO" accesskey="p" rel="prev">GETINFO</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1107 </div>
1108 <span id="Showing-available-commands_002e"></span><h2 class="chapter">21 Showing available commands.</h2>
1109 <span id="index-HELP-command"></span>
1110 <p>Syntax:
1111 </p><div class="example">
1112 <pre class="example">HELP [--html] [&lt;COMMAND&gt;]
1113 </pre></div>
1115 <p>Show available commands or command specific help text.
1116 <br><br>
1117 The <samp>--html</samp> option will output the help text in HTML format.
1118 </p>
1120 <hr>
1121 <span id="IMPORT"></span><div class="header">
1123 Next: <a href="#ISCACHED" accesskey="n" rel="next">ISCACHED</a>, Previous: <a href="#HELP" accesskey="p" rel="prev">HELP</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1124 </div>
1125 <span id="Creating-elements-from-XML_002e"></span><h2 class="chapter">22 Creating elements from XML.</h2>
1126 <span id="index-IMPORT-command"></span>
1127 <p>Syntax:
1128 </p><div class="example">
1129 <pre class="example">IMPORT [--root=element[&lt;TAB&gt;child[..]]]
1130 </pre></div>
1132 <p>This command uses a server <em>INQUIRE</em> to retrieve data from the client.
1133 <br><br>
1134 Like the <code>STORE</code> command (see <a href="#STORE">STORE</a>), but the <var>content</var>
1135 argument is raw <abbr>XML</abbr> data. The content is created as a child of
1136 the element path specified with the <samp>--root</samp> option or at the
1137 document root when not specified. Existing elements of the same name will
1138 be overwritten.
1139 <br><br>
1140 The content must begin with an <abbr>XML</abbr> element node. See <a href="#Introduction">Introduction</a>,
1141 for details.
1142 </p>
1144 <hr>
1145 <span id="ISCACHED"></span><div class="header">
1147 Next: <a href="#KEYINFO" accesskey="n" rel="next">KEYINFO</a>, Previous: <a href="#IMPORT" accesskey="p" rel="prev">IMPORT</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1148 </div>
1149 <span id="Testing-cache-status_002e"></span><h2 class="chapter">23 Testing cache status.</h2>
1150 <span id="index-ISCACHED-command"></span>
1151 <p>Syntax:
1152 </p><div class="example">
1153 <pre class="example">ISCACHED [--lock] [--agent [--sign]] &lt;filename&gt;
1154 </pre></div>
1156 <p>Determines the file cache status of the specified <var>filename</var>.
1157 The default is to test whether the filename is cached in memory. Passing
1158 option <samp>--agent</samp> will test the <code>gpg-agent</code> cache for at most
1159 one cached key used for opening the data file (see <a href="#OPEN">OPEN</a>). To test if
1160 a signing key is cached, pass <samp>--sign</samp> along with <samp>--agent</samp>.
1161 Both the <samp>--agent</samp> and <samp>--sign</samp> options require an opened data
1162 file.
1163 <br><br>
1164 An <em>OK</em> response is returned if the specified <var>filename</var> is found
1165 in the cache. If not found in the cache but exists on the filesystem
1166 then <code>GPG_ERR_NO_DATA</code> is returned. Otherwise a filesystem error is
1167 returned.
1168 <br><br>
1169 The <samp>--lock</samp> option will lock the file mutex of <var>filename</var> when
1170 the file exists; it does not need to be opened nor cached. The lock will be
1171 released when the client exits or sends the <code>UNLOCK</code> command
1172 (see <a href="#UNLOCK">UNLOCK</a>). When this option is passed the current data file is closed.
1173 </p>
1175 <hr>
1176 <span id="KEYINFO"></span><div class="header">
1178 Next: <a href="#KILL" accesskey="n" rel="next">KILL</a>, Previous: <a href="#ISCACHED" accesskey="p" rel="prev">ISCACHED</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1179 </div>
1180 <span id="Showing-keys-used-for-the-current-data-file_002e"></span><h2 class="chapter">24 Showing keys used for the current data file.</h2>
1181 <span id="index-KEYINFO-command"></span>
1182 <p>Syntax:
1183 </p><div class="example">
1184 <pre class="example">KEYINFO [--learn]
1185 </pre></div>
1187 <p>Returns a new line separated list of key ID&rsquo;s that the currently opened
1188 data file has recipients and signers for. If the key is a signing key it
1189 will be prefixed with an <code>S</code>. If the file is a new one, or has no
1190 signers in the case of being symmetrically encrypted, the error code
1191 <code>GPG_ERR_NO_DATA</code> is returned.
1192 <br><br>
1193 When the <samp>--learn</samp> option is passed, keys on a smartcard will be
1194 imported.
1195 </p>
1197 <hr>
1198 <span id="KILL"></span><div class="header">
1200 Next: <a href="#LIST" accesskey="n" rel="next">LIST</a>, Previous: <a href="#KEYINFO" accesskey="p" rel="prev">KEYINFO</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1201 </div>
1202 <span id="Terminating-another-client_002e"></span><h2 class="chapter">25 Terminating another client.</h2>
1203 <span id="index-KILL-command"></span>
1204 <p>Syntax:
1205 </p><div class="example">
1206 <pre class="example">KILL &lt;thread_id&gt;
1207 </pre></div>
1209 <p>Terminates the client identified by <var>thread_id</var> and releases any file
1210 lock or other resources it has held. See <code>GETINFO</code> (see <a href="#GETINFO">GETINFO</a>)
1211 for details about listing connected clients. An <code>invoking_user</code>
1212 (see <a href="#Configuration">Configuration</a>) may kill any client while others may only kill
1213 clients of the same <code>UID</code> or <abbr>TLS</abbr> fingerprint.
1214 </p>
1216 <hr>
1217 <span id="LIST"></span><div class="header">
1219 Next: <a href="#LISTKEYS" accesskey="n" rel="next">LISTKEYS</a>, Previous: <a href="#KILL" accesskey="p" rel="prev">KILL</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1220 </div>
1221 <span id="Showing-document-elements_002e"></span><h2 class="chapter">26 Showing document elements.</h2>
1222 <span id="index-LIST-command"></span>
1223 <p>Syntax:
1224 </p><div class="example">
1225 <pre class="example">LIST [--inquire] [--recurse] [element[&lt;TAB&gt;child[..]]]
1226 </pre></div>
1228 <p>If no element path is given then a newline separated list of root elements
1229 is returned with a data response. If given, then children of the specified
1230 element path are returned.
1231 <br><br>
1232 Each element path
1233 returned will have zero or more flags appened to it. These flags are
1234 delimited from the element path by a single space character. A flag itself
1235 is a single character. Flag <code>P</code> indicates that access to the element
1236 is denied. Flag <code>+</code> indicates that there are child nodes of
1237 the current element path. Flag <code>E</code> indicates that an element of the
1238 element path contained in a <var>target</var> attribute could not be found. Flag
1239 <code>O</code> indicates that a <var>target</var> attribute recursion limit was reached
1240 (see <a href="#Configuration">Configuration</a>). Flag <code>T</code>, followed by a single space character,
1241 then an element path, is the element path of the <var>target</var> attribute
1242 contained in the current element.
1243 <br><br>
1244 When a specified element path contains an error, beit from the final
1245 element in the path or any previous element, the path is still shown but
1246 will contain the error flag for the element with the error. Determining
1247 the actual element which contains the error is up to the client. This can be
1248 done by traversing the final element up to parent elements that contain the
1249 same error flag.
1250 <br><br>
1251 The option <samp>--recurse</samp> may be used to list the entire element tree
1252 for a specified element path or the entire tree for all root elements.
1253 <br><br>
1254 When the <samp>--inquire</samp> option is passed then all remaining non-option
1255 arguments are retrieved via a server <em>INQUIRE</em>.
1256 </p>
1258 <hr>
1259 <span id="LISTKEYS"></span><div class="header">
1261 Next: <a href="#LOCK" accesskey="n" rel="next">LOCK</a>, Previous: <a href="#LIST" accesskey="p" rel="prev">LIST</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1262 </div>
1263 <span id="Listing-keys-in-the-key-ring_002e"></span><h2 class="chapter">27 Listing keys in the key ring.</h2>
1264 <span id="index-LISTKEYS-command"></span>
1265 <p>Syntax:
1266 </p><div class="example">
1267 <pre class="example">LISTKEYS [--secret-only] [pattern[,&lt;pattern&gt;]]
1268 </pre></div>
1270 <p>Returns a new line separated list of key information matching a comma
1271 separated list of <var>pattern</var>&rsquo;s. When option <samp>--secret-only</samp> is
1272 specified, only keys matching <var>pattern</var> that also have a secret key
1273 available will be returned.
1274 </p>
1276 <hr>
1277 <span id="LOCK"></span><div class="header">
1279 Next: <a href="#LS" accesskey="n" rel="next">LS</a>, Previous: <a href="#LISTKEYS" accesskey="p" rel="prev">LISTKEYS</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1280 </div>
1281 <span id="Locking-the-current-data-file_002e"></span><h2 class="chapter">28 Locking the current data file.</h2>
1282 <span id="index-LOCK-command"></span>
1283 <p>Syntax:
1284 </p><div class="example">
1285 <pre class="example">LOCK
1286 </pre></div>
1288 <p>Locks the mutex associated with the opened file. This prevents other clients
1289 from sending commands to the same opened file until the client
1290 that sent this command either disconnects or sends the <code>UNLOCK</code>
1291 command. See <a href="#UNLOCK">UNLOCK</a>.
1292 </p>
1294 <hr>
1295 <span id="LS"></span><div class="header">
1297 Next: <a href="#MOVE" accesskey="n" rel="next">MOVE</a>, Previous: <a href="#LOCK" accesskey="p" rel="prev">LOCK</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1298 </div>
1299 <span id="Showing-available-data-files_002e"></span><h2 class="chapter">29 Showing available data files.</h2>
1300 <span id="index-LS-command"></span>
1301 <p>Syntax:
1302 </p><div class="example">
1303 <pre class="example">LS [--verbose]
1304 </pre></div>
1306 <p>Returns a newline separated list of data files stored in the data directory
1307 <samp>HOMEDIR/data</samp> (see <a href="#Invoking">Invoking</a>) with a data response. When the
1308 <var>&ndash;verbose</var> option is passed, the space-separated filesystem inode
1309 access, modification and change times are appended to the line.
1310 </p>
1312 <hr>
1313 <span id="MOVE"></span><div class="header">
1315 Next: <a href="#NOP" accesskey="n" rel="next">NOP</a>, Previous: <a href="#LS" accesskey="p" rel="prev">LS</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1316 </div>
1317 <span id="Moving-an-element_002e"></span><h2 class="chapter">30 Moving an element.</h2>
1318 <span id="index-MOVE-command"></span>
1319 <p>Syntax:
1320 </p><div class="example">
1321 <pre class="example">MOVE [--inquire] source[&lt;TAB&gt;child[..]] [dest[&lt;TAB&gt;child[..]]]
1322 </pre></div>
1324 <p>Moves the source element path to the destination element path. If the
1325 destination is not specified then it will be moved to the root node of the
1326 document. If the destination is specified and exists then it will be
1327 overwritten; otherwise non-existing elements of the destination element
1328 path will be created.
1329 <br><br>
1330 When the <samp>--inquire</samp> option is passed then all remaining non-option
1331 arguments are retrieved via a server <em>INQUIRE</em>.
1332 </p>
1334 <hr>
1335 <span id="NOP"></span><div class="header">
1337 Next: <a href="#OPEN" accesskey="n" rel="next">OPEN</a>, Previous: <a href="#MOVE" accesskey="p" rel="prev">MOVE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1338 </div>
1339 <span id="Testing-the-connection_002e"></span><h2 class="chapter">31 Testing the connection.</h2>
1340 <span id="index-NOP-command"></span>
1341 <p>Syntax:
1342 </p><div class="example">
1343 <pre class="example">NOP
1344 </pre></div>
1346 <p>This command does nothing. It is useful for testing the connection for a
1347 timeout condition.
1348 </p>
1350 <hr>
1351 <span id="OPEN"></span><div class="header">
1353 Next: <a href="#OPTION" accesskey="n" rel="next">OPTION</a>, Previous: <a href="#NOP" accesskey="p" rel="prev">NOP</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1354 </div>
1355 <span id="Opening-a-data-file_002e"></span><h2 class="chapter">32 Opening a data file.</h2>
1356 <span id="index-OPEN-command"></span>
1357 <p>Syntax:
1358 </p><div class="example">
1359 <pre class="example">OPEN [--lock] &lt;filename&gt;
1360 </pre></div>
1362 <p>Opens <var>filename</var>. When the <var>filename</var> is not found on the
1363 file-system then a new in-memory document will be created. If the file is
1364 found, it is looked for in the file cache and when found no passphrase will
1365 be required to open it. When not cached, <cite>pinentry(1)</cite> will be used to
1366 retrieve the passphrase for decryption unless <samp>disable-pinentry</samp>
1367 (see <a href="#OPTION">OPTION</a>) was specified in which case <code>pwmd</code> will
1368 <em>INQUIRE</em> the client for the passphrase. Note than when configuration
1369 option <samp>strict_open</samp> is enabled and the client is not an
1370 <samp>invoking_user</samp>, an error will be returned when the data file does
1371 not exist.
1372 <br><br>
1373 When the <samp>--lock</samp> option is passed then the file mutex will be
1374 locked as if the <code>LOCK</code> command (see <a href="#LOCK">LOCK</a>) had been sent after the
1375 file had been opened.
1376 </p>
1378 <hr>
1379 <span id="OPTION"></span><div class="header">
1381 Next: <a href="#PASSWD" accesskey="n" rel="next">PASSWD</a>, Previous: <a href="#OPEN" accesskey="p" rel="prev">OPEN</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1382 </div>
1383 <span id="Setting-various-client-parameters_002e"></span><h2 class="chapter">33 Setting various client parameters.</h2>
1384 <span id="index-OPTION-command"></span>
1385 <p>Syntax:
1386 </p><div class="example">
1387 <pre class="example">OPTION &lt;NAME&gt;=[&lt;VALUE&gt;]
1388 </pre></div>
1390 <p>Sets a client option <var>name</var> to <var>value</var>. The value for an option is
1391 kept for the duration of the connection with the exception of the
1392 <code>pinentry</code> options which are defaults for all future connections
1393 (see <a href="#Pinentry">Pinentry</a>). When <var>value</var> is empty the option is unset.
1394 <br><br>
1395 </p><dl compact="compact">
1396 <dt>DISABLE-PINENTRY</dt>
1397 <dd><p>Disable use of <code>pinentry</code> for passphrase retrieval. When <code>1</code>, a
1398 server inquire is sent to the client to obtain the passphrase. This option
1399 may be set as needed before the <code>OPEN</code> (see <a href="#OPEN">OPEN</a>), <code>PASSWD</code>
1400 (see <a href="#PASSWD">PASSWD</a>) and <code>SAVE</code> (see <a href="#SAVE">SAVE</a>) commands. Set to <code>0</code>
1401 to use a <code>pinentry</code>.
1402 <br><br>
1403 </p></dd>
1404 <dt>DISPLAY</dt>
1405 <dd><p>Set or unset the X11 display to use when prompting for a passphrase.
1406 <br><br>
1407 </p></dd>
1408 <dt>TTYNAME</dt>
1409 <dd><p>Set the terminal device path to use when prompting for a passphrase.
1410 <br><br>
1411 </p></dd>
1412 <dt>TTYTYPE</dt>
1413 <dd><p>Set the terminal type for use with <samp>TTYNAME</samp>.
1414 <br><br>
1415 </p></dd>
1416 <dt>NAME</dt>
1417 <dd><p>Associates the thread ID of the connection with the specified textual
1418 representation. Useful for debugging log messages. May not contain whitespace.
1419 <br><br>
1420 </p></dd>
1421 <dt>LOCK-TIMEOUT</dt>
1422 <dd><p>When not <code>0</code>, the duration in tenths of a second to wait for the file
1423 mutex which has been locked by another thread to be released before returning
1424 an error. When <code>-1</code> the error will be returned immediately.
1425 <br><br>
1426 </p></dd>
1427 <dt>CLIENT-STATE</dt>
1428 <dd><p>When set to <code>1</code> then client state status messages for other clients are
1429 sent to the current client. The default is <code>0</code>.
1430 </p></dd>
1431 </dl>
1434 <hr>
1435 <span id="PASSWD"></span><div class="header">
1437 Next: <a href="#REALPATH" accesskey="n" rel="next">REALPATH</a>, Previous: <a href="#OPTION" accesskey="p" rel="prev">OPTION</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1438 </div>
1439 <span id="Changing-the-passphrase-for-a-key_002e"></span><h2 class="chapter">34 Changing the passphrase for a key.</h2>
1440 <span id="index-PASSWD-command"></span>
1441 <p>Syntax:
1442 </p><div class="example">
1443 <pre class="example">PASSWD
1444 </pre></div>
1446 <p>Changes the passphrase of the secret key required to open the current
1447 data file. If the data file is symmetrically encrypted, the error
1448 <code>GPG_ERR_NOT_SUPPORTED</code> is returned. When symmetrically encrypted,
1449 the <code>SAVE</code> command (see <a href="#SAVE">SAVE</a>) should be used instead to prevent
1450 this command saving any unwanted changes to the <abbr>XML</abbr> document.
1451 <br><br>
1452 Note that when the current data file has been either encrypted or signed
1453 with a key stored on a smartcard this command will return an error. In this
1454 case you should instead use <code>gpg --card-edit</code> to change the
1455 pin of the smartcard or <code>gpg --edit-key</code> to change the passphrase
1456 of the key used to sign or encrypt the data file.
1457 <br><br>
1458 This command is not available to non-invoking clients
1459 (see <a href="#Access-Control">Access Control</a>).
1460 </p>
1462 <hr>
1463 <span id="REALPATH"></span><div class="header">
1465 Next: <a href="#RENAME" accesskey="n" rel="next">RENAME</a>, Previous: <a href="#PASSWD" accesskey="p" rel="prev">PASSWD</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1466 </div>
1467 <span id="Resolving-an-element_002e"></span><h2 class="chapter">35 Resolving an element.</h2>
1468 <span id="index-REALPATH-command"></span>
1469 <p>Syntax:
1470 </p><div class="example">
1471 <pre class="example">REALPATH [--inquire] element[&lt;TAB&gt;child[..]]
1472 </pre></div>
1474 <p>Resolves all <code>target</code> attributes of the specified element path and
1475 returns the result with a data response. See <a href="#Target-Attribute">Target Attribute</a>, for details.
1476 <br><br>
1477 When the <samp>--inquire</samp> option is passed then all remaining non-option
1478 arguments are retrieved via a server <em>INQUIRE</em>.
1479 </p>
1481 <hr>
1482 <span id="RENAME"></span><div class="header">
1484 Next: <a href="#RESET" accesskey="n" rel="next">RESET</a>, Previous: <a href="#REALPATH" accesskey="p" rel="prev">REALPATH</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1485 </div>
1486 <span id="Renaming-an-element_002e"></span><h2 class="chapter">36 Renaming an element.</h2>
1487 <span id="index-RENAME-command"></span>
1488 <p>Syntax:
1489 </p><div class="example">
1490 <pre class="example">RENAME [--inquire] element[&lt;TAB&gt;child[..]] &lt;value&gt;
1491 </pre></div>
1493 <p>Renames the specified <var>element</var> to the new <var>value</var>. If an element of
1494 the same name as the <var>value</var> already exists it will be overwritten.
1495 <br><br>
1496 When the <samp>--inquire</samp> option is passed then all remaining non-option
1497 arguments are retrieved via a server <em>INQUIRE</em>.
1498 </p>
1500 <hr>
1501 <span id="RESET"></span><div class="header">
1503 Next: <a href="#SAVE" accesskey="n" rel="next">SAVE</a>, Previous: <a href="#RENAME" accesskey="p" rel="prev">RENAME</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1504 </div>
1505 <span id="Resetting-the-client-state_002e"></span><h2 class="chapter">37 Resetting the client state.</h2>
1506 <span id="index-RESET-command"></span>
1507 <p>Syntax:
1508 </p><div class="example">
1509 <pre class="example">RESET
1510 </pre></div>
1512 <p>Closes the currently opened file but keeps any previously set client options
1513 (see <a href="#OPTION">OPTION</a>).
1514 </p>
1516 <hr>
1517 <span id="SAVE"></span><div class="header">
1519 Next: <a href="#STORE" accesskey="n" rel="next">STORE</a>, Previous: <a href="#RESET" accesskey="p" rel="prev">RESET</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1520 </div>
1521 <span id="Saving-document-changes-to-disk_002e"></span><h2 class="chapter">38 Saving document changes to disk.</h2>
1522 <span id="index-SAVE-command"></span>
1523 <p>Syntax:
1524 </p><div class="example">
1525 <pre class="example">SAVE [--sign-keyid=[&lt;fpr&gt;]] [--symmetric | --keyid=&lt;fpr&gt;[,..] | --inquire-keyid]
1526 </pre></div>
1528 <p>Writes the in-memory <abbr>XML</abbr> document to disk. The file written to is the
1529 file that was opened when using the <code>OPEN</code> command (see <a href="#OPEN">OPEN</a>).
1530 <br><br>
1531 If the file is a new one, one of <samp>--symmetric</samp>, <samp>--keyid</samp> or
1532 <samp>--inquire-keyid</samp> is required. When not <samp>--symmetric</samp>, option
1533 <samp>--sign-keyid</samp> is also required, but optional otherwise.
1534 <br><br>
1535 You can encrypt the data file to a recipient other than the one that it
1536 was originally encrypted with by passing the <samp>--keyid</samp> or
1537 <samp>--inquire-keyid</samp> option with a comma separated list of
1538 public encryption key fingerprints as its argument. Use the
1539 <code>LISTKEYS</code> command (see <a href="#LISTKEYS">LISTKEYS</a>) to show key information by
1540 pattern. The <samp>--sign-keyid</samp> option may also be used to sign the data
1541 file with an alternate key by specifying the fingerprint of a signing key.
1542 Only one signing key is supported unlike the <samp>--keyid</samp> option.
1543 A passphrase to decrypt the data file
1544 will be required when one or more of the original encryption keys or signing
1545 key are not found in either of these two options&rsquo; arguments or when the data
1546 file is symmetrically encrypted regardless of the <code>require_save_key</code>
1547 configuration parameter. The original encryption keys and signing key will be
1548 used when neither of these options are specified.
1549 <br><br>
1550 The <samp>--keyid</samp> and <samp>--sign-keyid</samp> options are not available
1551 to non-invoking clients
1552 (see <a href="#Access-Control">Access Control</a>) when the recipients or signer do not match those
1553 that were used when the file was <code>OPEN</code>&rsquo;ed.
1554 <br><br>
1555 The <samp>--symmetric</samp> option specifies that a new data file be
1556 conventionally encrypted. These types of data files do not use a recipient
1557 public key but may optionally be signed by using the <samp>--sign-keyid</samp>
1558 option. To remove the signing key from a symmtrically encrypted data file,
1559 leave the option value empty.
1560 <br><br>
1561 Note that you cannot change encryption schemes once a data file has been
1562 saved.
1563 </p>
1565 <hr>
1566 <span id="STORE"></span><div class="header">
1568 Next: <a href="#UNLOCK" accesskey="n" rel="next">UNLOCK</a>, Previous: <a href="#SAVE" accesskey="p" rel="prev">SAVE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1569 </div>
1570 <span id="Modifying-the-content-of-an-element_002e"></span><h2 class="chapter">39 Modifying the content of an element.</h2>
1571 <span id="index-STORE-command"></span>
1572 <p>Syntax:
1573 </p><div class="example">
1574 <pre class="example">STORE element[&lt;TAB&gt;child[..]]&lt;TAB&gt;[content]
1575 </pre></div>
1577 <p>This command uses a server <em>INQUIRE</em> to retrieve data from the client.
1578 <br><br>
1579 Creates a new element path or modifies the <var>content</var> of an existing
1580 element. If only a single element is specified then a new root element is
1581 created. Otherwise, elements are <tt class="key">TAB</tt> delimited and the content will be
1582 set to the final <tt class="key">TAB</tt> delimited element. If no <var>content</var> is
1583 specified after the final <tt class="key">TAB</tt>, then the content of the existing
1584 element will be removed; or will be empty if creating a new element.
1585 <br><br>
1586 The only restriction of an element name is that it not contain whitespace
1587 characters. There is no other whitespace between the <tt class="key">TAB</tt> delimited
1588 elements. It is recommended that the content of an element be base64 encoded
1589 when it contains control or <tt class="key">TAB</tt> characters to prevent <abbr>XML</abbr>
1590 parsing and <code>pwmd</code> syntax errors.
1591 </p>
1593 <hr>
1594 <span id="UNLOCK"></span><div class="header">
1596 Next: <a href="#XPATH" accesskey="n" rel="next">XPATH</a>, Previous: <a href="#STORE" accesskey="p" rel="prev">STORE</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1597 </div>
1598 <span id="Removing-a-data-file-lock_002e"></span><h2 class="chapter">40 Removing a data file lock.</h2>
1599 <span id="index-UNLOCK-command"></span>
1600 <p>Syntax:
1601 </p><div class="example">
1602 <pre class="example">UNLOCK
1603 </pre></div>
1605 <p>Unlocks the file mutex which was locked with the <code>LOCK</code> command or
1606 a commands&rsquo; <samp>--lock</samp> option (see <a href="#LOCK">LOCK</a>, see <a href="#OPEN">OPEN</a>,
1607 see <a href="#ISCACHED">ISCACHED</a>).
1608 </p>
1610 <hr>
1611 <span id="XPATH"></span><div class="header">
1613 Next: <a href="#XPATHATTR" accesskey="n" rel="next">XPATHATTR</a>, Previous: <a href="#UNLOCK" accesskey="p" rel="prev">UNLOCK</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1614 </div>
1615 <span id="Modifying-more-than-one-element_002e"></span><h2 class="chapter">41 Modifying more than one element.</h2>
1616 <span id="index-XPATH-command"></span>
1617 <p>Syntax:
1618 </p><div class="example">
1619 <pre class="example">XPATH [--inquire] &lt;expression&gt;[&lt;TAB&gt;[value]]
1620 </pre></div>
1622 <p>Evaluates an XPath <var>expression</var>. If no <var>value</var> argument is
1623 specified it is assumed the expression is a request to return a result.
1624 Otherwise, the result is set to the <var>value</var> argument and the document is
1625 updated. If there is no <var>value</var> after the <tt class="key">TAB</tt> character, the value
1626 is assumed to be empty and the document is updated. For example:
1627 </p><br>
1628 <div class="example">
1629 <pre class="example">XPATH //element[@_name='password']<span class="key">TAB</span>
1630 </pre></div>
1631 <br>
1632 <p>would clear the content of all <var>password</var> elements in the data file
1633 while leaving off the trailing <tt class="key">TAB</tt> would return all <var>password</var>
1634 elements in <abbr>XML</abbr> format.
1635 <br><br>
1636 When the <samp>--inquire</samp> option is passed then all remaining non-option
1637 arguments are retrieved via a server <em>INQUIRE</em>.
1638 <br><br>
1639 See <a href="http://www.w3schools.com/xpath/xpath_syntax.asp">http://www.w3schools.com/xpath/xpath_syntax.asp</a> for <abbr>XPATH</abbr>
1640 expression syntax.
1641 </p>
1643 <hr>
1644 <span id="XPATHATTR"></span><div class="header">
1646 Previous: <a href="#XPATH" accesskey="p" rel="prev">XPATH</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1647 </div>
1648 <span id="Modifying-more-than-one-element_0027s-attributes_002e"></span><h2 class="chapter">42 Modifying more than one element&rsquo;s attributes.</h2>
1649 <span id="index-XPATHATTR-command"></span>
1650 <p>Syntax:
1651 </p><div class="example">
1652 <pre class="example">XPATHATTR [--inquire] SET|DELETE &lt;name&gt; &lt;expression&gt;[&lt;TAB&gt;[&lt;value&gt;]]
1653 </pre></div>
1655 <p>Like the <code>XPATH</code> command (see <a href="#XPATH">XPATH</a>) but operates on element
1656 attributes and does not return a result. For the <var>SET</var> operation the
1657 <var>value</var> is optional but the field is required. If not specified then
1658 the attribute value will be empty. For example:
1659 </p><br>
1660 <div class="example">
1661 <pre class="example">XPATHATTR SET password //element[@_name='password']<span class="key">TAB</span>
1662 </pre></div>
1663 <br>
1664 <p>would create a <var>password</var> attribute for each <var>password</var> element
1665 found in the document. The attribute value will be empty but still exist.
1666 <br><br>
1667 When the <samp>--inquire</samp> option is passed then all remaining non-option
1668 arguments are retrieved via a server <em>INQUIRE</em>.
1669 <br><br>
1670 See <a href="http://www.w3schools.com/xpath/xpath_syntax.asp">http://www.w3schools.com/xpath/xpath_syntax.asp</a> for <abbr>XPATH</abbr>
1671 expression syntax.
1672 </p>
1675 <hr>
1676 <span id="Bulk-Commands"></span><div class="header">
1678 Next: <a href="#Status-Messages" accesskey="n" rel="next">Status Messages</a>, Previous: <a href="#Commands" accesskey="p" rel="prev">Commands</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1679 </div>
1680 <span id="Running-multiple-commands-in-sequence"></span><h2 class="chapter">43 Running multiple commands in sequence</h2>
1681 <p>Multiple commands may be run in sequence by using the <code>BULK</code> command
1682 (see <a href="#BULK">BULK</a>). Using this feature may speed up remote connections since less
1683 socket IO is needed. The <code>BULK</code> command uses an <em>INQUIRE</em> to obtain
1684 an canonical s-expression of commands to be run. The s-expression syntax is as
1685 follows:
1686 </p>
1687 <div class="example">
1688 <pre class="example">(2:id&lt;I&gt;:&lt;id&gt; &lt;P&gt;:&lt;prot&gt;&lt;D&gt;:[&lt;data&gt;] [2:rc&lt;R&gt;:&lt;code&gt;[|&lt;code&gt;...](2:id...) | 2:id...])
1689 </pre></div>
1691 <p>Each token is prefixed with an unsigned integer that specifies the length of
1692 the token, followed by a colon &rsquo;<code>:</code>&rsquo;, followed by the token itself. Pwmd
1693 uses token pairs to create a <em>name=value</em> relationship. Whitespace is
1694 allowed between token pairs. For example, the following is valid:
1695 </p>
1696 <div class="example">
1697 <pre class="example">( 2:id 7:FirstID 4:LIST0: 2:rc 1:0 (2:id6:Second 7:GETINFO7:version))
1698 </pre></div>
1700 <p>The <code>id</code> token begins a new command and requires an <var>&lt;id&gt;</var> token
1701 of length <var>&lt;I&gt;</var> to uniquely identify this command. The next token pair is
1702 the protocol command name, without any command arguments, of length <var>&lt;P&gt;</var>
1703 to run followed by a colon &rsquo;<code>:</code>&rsquo;, followed by the command <var>&lt;prot&gt;</var>
1704 itself, followed by the length <var>&lt;D&gt;</var> of both command arguments and data,
1705 followed by a colon &rsquo;<code>:</code>&rsquo; and finally the <var>&lt;data&gt;</var> itself. If no
1706 arguments or data are needed for the command, set the length of the data
1707 <var>&lt;D&gt;</var> to <code>0</code> and append the required colon &rsquo;<code>:</code>&rsquo;.
1708 </p>
1709 <p>A new command enclosed in parentheses may be run when the previous command
1710 returns an error code that matches the <var>&lt;code&gt;</var> token of length <var>&lt;R&gt;</var>
1711 by appending <var>rc</var> tokens to the end of the previous commands <var>&lt;data&gt;</var>
1712 token. You may also test another return code for the previous command by
1713 placing the next <var>rc</var> token at the end of the closing parentheses of the
1714 previous return code command.
1715 </p>
1716 <p>Multiple <code>rc</code> <var>code</var>&rsquo;s may be specified for a single command by
1717 separating them with a pipe <code>|</code> character. This lets you specify an
1718 <em>if-this-and-that</em> expression for a commands return code.
1719 </p>
1720 <p>If another command is to be run after the previous and does not specify an
1721 <var>rc</var> token, the return value is ignored for the previous command and the
1722 next command is run. There is no limit on the number of commands or
1723 sub-commands except for system memory.
1724 </p>
1725 <p>After inquiring the commands to be run, <code>BULK</code> will run each command with
1726 <var>&lt;data&gt;</var> as its argument and store the result code and data of the command
1727 in a <code>bulk-result</code> canonical s-expression of the syntax:
1728 </p>
1729 <div class="example">
1730 <pre class="example">(11:bulk-result2:id&lt;I&gt;:&lt;id&gt;2:rc&lt;R&gt;:&lt;code&gt;&lt;D&gt;:[&lt;data&gt;][2:id...])
1731 </pre></div>
1733 <p>The <code>11:bulk-result</code> token begins the result of all commands. The
1734 <var>&lt;id&gt;</var> token of length <var>&lt;I&gt;</var> is the same that was associated with the
1735 command from the <em>INQUIRE</em>&rsquo;d syntax and is prefixed with <code>2:id</code>. The
1736 return code of the command is prefixed with <code>2:rc</code> followed by the length
1737 <var>&lt;R&gt;</var> of the unsigned integer <var>&lt;code&gt;</var> then the return <var>&lt;code&gt;</var>
1738 itself. If the command returned any <var>&lt;data&gt;</var>, it is prefixed with a
1739 length <var>&lt;D&gt;</var> and immediately following the return <var>&lt;code&gt;</var>. Otherwise,
1740 <var>&lt;D&gt;</var> will be <code>0</code> and followed by a colon &rsquo;<code>:</code>&rsquo;.
1741 </p>
1743 <hr>
1744 <span id="Status-Messages"></span><div class="header">
1746 Next: <a href="#Target-Attribute" accesskey="n" rel="next">Target Attribute</a>, Previous: <a href="#Bulk-Commands" accesskey="p" rel="prev">Bulk Commands</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1747 </div>
1748 <span id="Status-messages-and-their-meanings"></span><h2 class="chapter">44 Status messages and their meanings</h2>
1749 <p>Some commands send status messages to inform the client about certain
1750 operations or as a progress indicator. Status messages begin with a
1751 <code>KEYWORD</code> followed by a status description for status messages that
1752 require it. What status messages are sent, when, and how often may depend on
1753 configuration settings (see <a href="#Configuration">Configuration</a>).
1754 </p>
1755 <table>
1756 <thead><tr><th width="20%">Message</th><th width="25%">Parameters</th><th width="55%">Description</th></tr></thead>
1757 <tr><td width="20%">CACHE
1758 <span id="index-CACHE"></span></td><td width="25%"><code>&lt;integer&gt;</code></td><td width="55%">The number of cached documents. Sent to each client after connecting
1759 (see <a href="#GETINFO">GETINFO</a>) and after every cache modification.</td></tr>
1760 <tr><td width="20%">CLIENTS
1761 <span id="index-CLIENTS"></span></td><td width="25%"><code>&lt;integer&gt;</code></td><td width="55%">The number of connected clients (see <a href="#GETINFO">GETINFO</a>). Sent to each client
1762 when another client either connects or disconnects.</td></tr>
1763 <tr><td width="20%">DECRYPT
1764 <span id="index-DECRYPT"></span></td><td width="25%"></td><td width="55%">Sent to the current client during a decrypt operation. How often this
1765 status message is sent is determined by the <code>keepalive_interval</code>
1766 (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1767 <tr><td width="20%">ENCRYPT
1768 <span id="index-ENCRYPT"></span></td><td width="25%"></td><td width="55%">Sent to the current client during an encrypt operation. How often this
1769 status message is sent is determined by the <code>keepalive_interval</code>
1770 (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1771 <tr><td width="20%">GENKEY
1772 <span id="index-GENKEY"></span></td><td width="25%"><code>[&lt;sigkey_fpr&gt; &lt;pubkey_fpr&gt;]</code></td><td width="55%">Sent to the current client during key generation. How often this
1773 status message is sent is determined by the <code>keepalive_interval</code>
1774 (see <a href="#Configuration">Configuration</a>) setting. The <var>sigkey_fpr</var> and <var>pubkey_fpr</var>
1775 parameters are added when key generation has completed.</td></tr>
1776 <tr><td width="20%">INQUIRE_MAXLEN
1777 <span id="index-INQUIRE_005fMAXLEN"></span></td><td width="25%"><code>&lt;bytes&gt;</code></td><td width="55%">Sent to the client from <code>gpg-agent</code> when inquiring data. This
1778 specifies the maximum number of bytes allowed for the client to send and
1779 should not be exceeded.</td></tr>
1780 <tr><td width="20%">KEEPALIVE
1781 <span id="index-KEEPALIVE"></span></td><td width="25%"></td><td width="55%">Sent to each idle client every <var>keepalive_interval</var>
1782 (see <a href="#Configuration">Configuration</a>) seconds.</td></tr>
1783 <tr><td width="20%">LOCKED
1784 <span id="index-LOCKED"></span></td><td width="25%"></td><td width="55%">Sent to the current client when another client is holding the lock for
1785 the mutex associated with a file. How often this status message is sent is
1786 determined by the <code>keepalive_interval</code> (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1787 <tr><td width="20%">NEWFILE
1788 <span id="index-NEWFILE"></span></td><td width="25%"></td><td width="55%">Sent to the current client when the opened (see <a href="#OPEN">OPEN</a>) file does not
1789 exist on the file-system.</td></tr>
1790 <tr><td width="20%">XFER
1791 <span id="index-XFER"></span></td><td width="25%"><code>&lt;sent&gt; &lt;total&gt;</code></td><td width="55%">Sent to the current client when transferring data. It has two space
1792 delimited arguments. The first being the current amount of bytes transferred
1793 and the other being the total bytes to be transferred. Note that since version
1794 <code>3.1.1</code> of <code>pwmd</code> this status message is sent only once and
1795 before the transfer begins with the <var>total</var> argument set to the size of the
1796 data and the <var>sent</var> argument set to <code>0</code> leaving it to the client to
1797 determine the progress of the transfer as the data is received.</td></tr>
1798 <tr><td width="20%">STATE
1799 <span id="index-STATE"></span></td><td width="25%"><code>&lt;client_id&gt; &lt;state&gt;</code></td><td width="55%">Sent to each client to indicate that <var>client_id</var> has changed to
1800 <var>state</var> (see <a href="#GETINFO">GETINFO</a> for client states). For a client to receive
1801 another clients state the option <var>CLIENT-STATE</var> must be set.
1802 See <a href="#OPTION">OPTION</a> command.</td></tr>
1803 <tr><td width="20%">EXPIRE
1804 <span id="index-EXPIRE"></span></td><td width="25%"><code>&lt;epoch_seconds&gt; &lt;epoch_future&gt;|0</code></td><td width="55%">Sent to the current client when <code>GET</code> (see <a href="#GET">GET</a>) encounters an
1805 <code>_expire</code> (see <a href="#Other-Attributes">Other Attributes</a>) attribute that is in the past or when
1806 <code>STORE</code> (see <a href="#STORE">STORE</a>) updates the <code>_expire</code> attribute from the
1807 <code>_age</code> attribute value. The second field will be <code>0</code> when <code>GET</code>
1808 sends this status message. Otherwise the second field is the time the next
1809 expiry will be.</td></tr>
1810 <tr><td width="20%">PASSPHRASE_HINT
1811 <span id="index-PASSPHRASE_005fHINT"></span></td><td width="25%">&lt;keyid&gt; &lt;userid&gt;</td><td width="55%">Forwarded from <code>GpgME</code>. Contains information that is useful in a
1812 <code>pinentry</code>. Only sent when pinentry is disabled (see <a href="#OPTION">OPTION</a>).</td></tr>
1813 <tr><td width="20%">PASSPHRASE_INFO
1814 <span id="index-PASSPHRASE_005fINFO"></span></td><td width="25%">&lt;flags&gt; ...</td><td width="55%">Forwarded from <code>GpgME</code>. Contains information that is useful in a
1815 <code>pinentry</code>. Only sent when pinentry is disabled (see <a href="#OPTION">OPTION</a>).</td></tr>
1816 <tr><td width="20%">REHANDSHAKE
1817 <span id="index-REHANDSHAKE"></span></td><td width="25%"></td><td width="55%">Sent to each TLS client just before performing a cipher renegotiation
1818 after a SIGHUP signal was received.</td></tr>
1819 <tr><td width="20%">BULK
1820 <span id="index-BULK"></span></td><td width="25%"><code>BEGIN|END &lt;command id&gt;</code></td><td width="55%">Sent to the current client before and after the <code>BULK</code> command
1821 (see <a href="#BULK">BULK</a>) runs each command. The <var>&lt;command id&gt;</var> is the same that was
1822 associated with the command in the s-expression syntax.</td></tr>
1823 </table>
1825 <hr>
1826 <span id="Target-Attribute"></span><div class="header">
1828 Next: <a href="#Other-Attributes" accesskey="n" rel="next">Other Attributes</a>, Previous: <a href="#Status-Messages" accesskey="p" rel="prev">Status Messages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1829 </div>
1830 <span id="The-target-attribute"></span><h2 class="chapter">45 The <code>target</code> attribute</h2>
1831 <span id="index-target-attribute"></span>
1832 <p>A <em>case sensitive</em> attribute named <code>_target</code> is treated specially
1833 when found in each element of an element path. This attribute, like other
1834 element attributes, is created or modified with the <code>ATTR</code> command
1835 (see <a href="#ATTR">ATTR</a>). The value of this attribute is an existing element path
1836 somewhere in the document. If you are familiar with XML entities or
1837 maybe the HTML <code>id</code> or <code>_target</code> attributes or a symbolic link
1838 in a file-system, you may find this attribute behaves similar to any of those.
1839 </p>
1840 <p>To create a <code>_target</code> attribute use the following syntax:
1841 </p>
1842 <div class="example">
1843 <pre class="example">ATTR SET _target element[<code>TAB</code>child[..]] element[<code>TAB</code>child[..]]
1844 </pre></div>
1846 <p>Note the single space between the two element paths. The first element path is
1847 where the <code>_target</code> attribute will be created. If the element path does
1848 not exist then it will be created. This is the only time the <code>ATTR</code>
1849 (see <a href="#ATTR">ATTR</a>) command will create elements. The attribute is created in the
1850 final element of the element path.
1851 </p>
1852 <p>The second element path is the destination of where you want the first element
1853 path to resolve to. When an element path is passed as an argument to a
1854 protocol command <code>pwmd</code> looks for a <code>_target</code> attribute when
1855 resolving each element and, if found, &quot;jumps&quot; to the attribute value and
1856 continues resolving any remaining elements a commands element path.
1857 </p>
1858 <p>When an element of a element path is removed that a <code>_target</code> attribute
1859 resolves to then an error will occur when trying to access that element. You
1860 may need to either update the <code>_target</code> attribute value with a new element
1861 path or remove the attribute entirely.
1862 </p>
1863 <p>Clients should be careful of creating <code>_target</code> loops, or targets that
1864 resolve to themselves. See the <var>recursion_depth</var> (see <a href="#Configuration">Configuration</a>)
1865 configuration parameter for details.
1866 </p>
1867 <p>The <code>REALPATH</code> command (see <a href="#REALPATH">REALPATH</a>) can be used to show the element
1868 path after resolving all <code>_target</code> attributes.
1869 </p>
1870 <p><em>Note that when setting this attribute any children of the element will
1871 be removed.</em>
1872 </p>
1874 <hr>
1875 <span id="Other-Attributes"></span><div class="header">
1877 Next: <a href="#Key-Expiration" accesskey="n" rel="next">Key Expiration</a>, Previous: <a href="#Target-Attribute" accesskey="p" rel="prev">Target Attribute</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1878 </div>
1879 <span id="Other-special-attributes"></span><h2 class="chapter">46 Other special attributes</h2>
1880 <span id="index-special-attributes"></span>
1881 <p>In addition to the <code>_target</code> attribute (see <a href="#Target-Attribute">Target Attribute</a>), there
1882 are a few other attributes that are specially handled by <code>pwmd</code>. The
1883 first is the <code>_ctime</code> attribute which is set to the current time when an
1884 element is created. Next is the <code>_mtime</code> attribute which is created when
1885 an element is created and also updated when an element is modified. Neither of
1886 these attributes may be modified by the client. The <code>_acl</code> attribute
1887 controls access to the element, beit modifying or accessing element content,
1888 or descending into child elements. See <a href="#Access-Control">Access Control</a> for details. The
1889 <code>_name</code> attribute contains the name of an element.
1890 </p>
1891 <p>The above mentioned attributes are considered reserved attribute names.
1892 Reserved attributes are treated specially when a <code>_target</code> attribute is
1893 found for the current element. The <code>ATTR LIST</code> command will show these
1894 attribute values for the current element and not the attribute values for the
1895 resolved <code>_target</code> element. All other non-reserved attributes for the
1896 resolved <code>_target</code> are appended to the <code>ATTR LIST</code> command output.
1897 Other <code>ATTR</code> commands (see <a href="#ATTR">ATTR</a>) behave as usual. You can, for
1898 example, <code>ATTR DELETE</code> a non-reserved attribute for an element that
1899 contains a <code>_target</code> attribute. The resolved target elements&rsquo; attribute
1900 will be removed rather than the element containing the <code>_target</code>
1901 attribute.
1902 </p>
1903 <p>Another specially handled attribute is the <code>_expire</code> attribute. This
1904 attribute value, like the <code>_ctime</code> and <code>_mtime</code> attributes, is a
1905 timestamp. But this timestamp is usually in the future and for use with the
1906 <code>GET</code> (see <a href="#GET">GET</a>) and <code>STORE</code> (see <a href="#STORE">STORE</a>) commands. When the
1907 <code>GET</code> command is issued, it checks for an <code>_expire</code> attribute an
1908 compares its&rsquo; value with the current time. If the <code>_expire</code> timestamp is
1909 in the past then a status message is sent (see <a href="#Status-Messages">Status Messages</a>) to inform
1910 the client that the element content should be updated. When the content for
1911 an element containing an <code>_expire</code> attribute is set when using the
1912 <code>STORE</code> command, the value of the <code>_age</code> attribute is added to the
1913 current time and the <code>_expire</code> attribute value is updated. When no
1914 <code>_age</code> attribute is found, no modification is done of the <code>_expire</code>
1915 attribute.
1916 </p>
1918 <hr>
1919 <span id="Key-Expiration"></span><div class="header">
1921 Next: <a href="#Signals" accesskey="n" rel="next">Signals</a>, Previous: <a href="#Other-Attributes" accesskey="p" rel="prev">Other Attributes</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1922 </div>
1923 <span id="Key-Expiration-1"></span><h2 class="chapter">47 Key Expiration</h2>
1924 <span id="index-key-expiration"></span>
1925 <p>When a key used for signing a data file has expired there is no indication
1926 until the next <code>SAVE</code> command is sent. The command will fail since one
1927 cannot sign the data file with an expired key. The client will need to either
1928 use a different key for signing by either specifying an existing non-expired
1929 key, generate a new key, or change the expire time of the existing key with
1930 <code>gpg</code>.
1931 </p>
1932 <p>To change the expiration of the currently used signing key with <code>gpg</code>,
1933 use the <code>KEYINFO</code> command (see <a href="#KEYINFO">KEYINFO</a>) to obtain the fingerprint of
1934 the signing key of the current data file, then change the expire time with
1935 <code>gpg</code>:
1936 </p>
1937 <div class="example">
1938 <pre class="example">gpg --homedir ~/.pwmd/.gnupg --edit-key &lt;fingerprint&gt;
1939 </pre></div>
1941 <p>Then use the <code>expire</code> command to set the new key expire date. When
1942 finished, use the <code>save</code> command to save your changes.
1943 </p>
1945 <hr>
1946 <span id="Signals"></span><div class="header">
1948 Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previous: <a href="#Key-Expiration" accesskey="p" rel="prev">Key Expiration</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1949 </div>
1950 <span id="Recognized-signals"></span><h2 class="chapter">48 Recognized signals</h2>
1952 <p>Sending the <em>SIGHUP</em> signal to a <code>pwmd</code> process will reload the
1953 configuration file and sending <em>SIGUSR1</em> will clear the entire file
1954 cache.
1955 </p>
1958 <hr>
1959 <span id="Concept-Index"></span><div class="header">
1961 Previous: <a href="#Signals" accesskey="p" rel="prev">Signals</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
1962 </div>
1963 <span id="Concept-Index-1"></span><h2 class="unnumbered">Concept Index</h2>
1966 <span id="SEC_Overview"></span>
1967 <h2 class="shortcontents-heading">Short Table of Contents</h2>
1969 <div class="shortcontents">
1970 <ul class="no-bullet">
1971 <li><a id="stoc-Overview-of-pwmd" href="#toc-Overview-of-pwmd">1 Overview of <code>pwmd</code></a></li>
1972 <li><a id="stoc-Access-Control-1" href="#toc-Access-Control-1">2 Access Control</a></li>
1973 <li><a id="stoc-Cache-Control-1" href="#toc-Cache-Control-1">3 Cache Control</a></li>
1974 <li><a id="stoc-Invoking-pwmd" href="#toc-Invoking-pwmd">4 Invoking <code>pwmd</code></a></li>
1975 <li><a id="stoc-pwmd-configuration-file-options" href="#toc-pwmd-configuration-file-options">5 <code>pwmd</code> configuration file options</a></li>
1976 <li><a id="stoc-Configuring-remote-connections-over-TLS_002e" href="#toc-Configuring-remote-connections-over-TLS_002e">6 Configuring remote connections over TLS.</a></li>
1977 <li><a id="stoc-Pinentry-configuration" href="#toc-Pinentry-configuration">7 Pinentry configuration</a></li>
1978 <li><a id="stoc-Protocol-commands-and-their-syntax" href="#toc-Protocol-commands-and-their-syntax">8 Protocol commands and their syntax</a></li>
1979 <li><a id="stoc-Modifying-element-attributes_002e" href="#toc-Modifying-element-attributes_002e">9 Modifying element attributes.</a></li>
1980 <li><a id="stoc-Run-a-series-of-commands-in-sequence_002e" href="#toc-Run-a-series-of-commands-in-sequence_002e">10 Run a series of commands in sequence.</a></li>
1981 <li><a id="stoc-Setting-the-cache-timeout_002e" href="#toc-Setting-the-cache-timeout_002e">11 Setting the cache timeout.</a></li>
1982 <li><a id="stoc-Removing-a-cache-entry_002e" href="#toc-Removing-a-cache-entry_002e">12 Removing a cache entry.</a></li>
1983 <li><a id="stoc-Copying-an-element_002e" href="#toc-Copying-an-element_002e">13 Copying an element.</a></li>
1984 <li><a id="stoc-Deleting-an-element_002e" href="#toc-Deleting-an-element_002e">14 Deleting an element.</a></li>
1985 <li><a id="stoc-Deleting-a-key-from-the-key-ring_002e" href="#toc-Deleting-a-key-from-the-key-ring_002e">15 Deleting a key from the key ring.</a></li>
1986 <li><a id="stoc-Showing-the-XML-document_002e" href="#toc-Showing-the-XML-document_002e">16 Showing the XML document.</a></li>
1987 <li><a id="stoc-Generating-a-new-key_002e" href="#toc-Generating-a-new-key_002e">17 Generating a new key.</a></li>
1988 <li><a id="stoc-Getting-the-content-of-an-element_002e" href="#toc-Getting-the-content-of-an-element_002e">18 Getting the content of an element.</a></li>
1989 <li><a id="stoc-Obtaining-a-configuration-value_002e" href="#toc-Obtaining-a-configuration-value_002e">19 Obtaining a configuration value.</a></li>
1990 <li><a id="stoc-Obtaining-server-and-client-information_002e" href="#toc-Obtaining-server-and-client-information_002e">20 Obtaining server and client information.</a></li>
1991 <li><a id="stoc-Showing-available-commands_002e" href="#toc-Showing-available-commands_002e">21 Showing available commands.</a></li>
1992 <li><a id="stoc-Creating-elements-from-XML_002e" href="#toc-Creating-elements-from-XML_002e">22 Creating elements from XML.</a></li>
1993 <li><a id="stoc-Testing-cache-status_002e" href="#toc-Testing-cache-status_002e">23 Testing cache status.</a></li>
1994 <li><a id="stoc-Showing-keys-used-for-the-current-data-file_002e" href="#toc-Showing-keys-used-for-the-current-data-file_002e">24 Showing keys used for the current data file.</a></li>
1995 <li><a id="stoc-Terminating-another-client_002e" href="#toc-Terminating-another-client_002e">25 Terminating another client.</a></li>
1996 <li><a id="stoc-Showing-document-elements_002e" href="#toc-Showing-document-elements_002e">26 Showing document elements.</a></li>
1997 <li><a id="stoc-Listing-keys-in-the-key-ring_002e" href="#toc-Listing-keys-in-the-key-ring_002e">27 Listing keys in the key ring.</a></li>
1998 <li><a id="stoc-Locking-the-current-data-file_002e" href="#toc-Locking-the-current-data-file_002e">28 Locking the current data file.</a></li>
1999 <li><a id="stoc-Showing-available-data-files_002e" href="#toc-Showing-available-data-files_002e">29 Showing available data files.</a></li>
2000 <li><a id="stoc-Moving-an-element_002e" href="#toc-Moving-an-element_002e">30 Moving an element.</a></li>
2001 <li><a id="stoc-Testing-the-connection_002e" href="#toc-Testing-the-connection_002e">31 Testing the connection.</a></li>
2002 <li><a id="stoc-Opening-a-data-file_002e" href="#toc-Opening-a-data-file_002e">32 Opening a data file.</a></li>
2003 <li><a id="stoc-Setting-various-client-parameters_002e" href="#toc-Setting-various-client-parameters_002e">33 Setting various client parameters.</a></li>
2004 <li><a id="stoc-Changing-the-passphrase-for-a-key_002e" href="#toc-Changing-the-passphrase-for-a-key_002e">34 Changing the passphrase for a key.</a></li>
2005 <li><a id="stoc-Resolving-an-element_002e" href="#toc-Resolving-an-element_002e">35 Resolving an element.</a></li>
2006 <li><a id="stoc-Renaming-an-element_002e" href="#toc-Renaming-an-element_002e">36 Renaming an element.</a></li>
2007 <li><a id="stoc-Resetting-the-client-state_002e" href="#toc-Resetting-the-client-state_002e">37 Resetting the client state.</a></li>
2008 <li><a id="stoc-Saving-document-changes-to-disk_002e" href="#toc-Saving-document-changes-to-disk_002e">38 Saving document changes to disk.</a></li>
2009 <li><a id="stoc-Modifying-the-content-of-an-element_002e" href="#toc-Modifying-the-content-of-an-element_002e">39 Modifying the content of an element.</a></li>
2010 <li><a id="stoc-Removing-a-data-file-lock_002e" href="#toc-Removing-a-data-file-lock_002e">40 Removing a data file lock.</a></li>
2011 <li><a id="stoc-Modifying-more-than-one-element_002e" href="#toc-Modifying-more-than-one-element_002e">41 Modifying more than one element.</a></li>
2012 <li><a id="stoc-Modifying-more-than-one-element_0027s-attributes_002e" href="#toc-Modifying-more-than-one-element_0027s-attributes_002e">42 Modifying more than one element&rsquo;s attributes.</a></li>
2013 <li><a id="stoc-Running-multiple-commands-in-sequence" href="#toc-Running-multiple-commands-in-sequence">43 Running multiple commands in sequence</a></li>
2014 <li><a id="stoc-Status-messages-and-their-meanings" href="#toc-Status-messages-and-their-meanings">44 Status messages and their meanings</a></li>
2015 <li><a id="stoc-The-target-attribute" href="#toc-The-target-attribute">45 The <code>target</code> attribute</a></li>
2016 <li><a id="stoc-Other-special-attributes" href="#toc-Other-special-attributes">46 Other special attributes</a></li>
2017 <li><a id="stoc-Key-Expiration-1" href="#toc-Key-Expiration-1">47 Key Expiration</a></li>
2018 <li><a id="stoc-Recognized-signals" href="#toc-Recognized-signals">48 Recognized signals</a></li>
2019 <li><a id="stoc-Concept-Index-1" href="#toc-Concept-Index-1">Concept Index</a></li>
2021 </ul>
2022 </div>
2024 <span id="SEC_Contents"></span>
2025 <h2 class="contents-heading">Table of Contents</h2>
2027 <div class="contents">
2028 <ul class="no-bullet">
2029 <li><a id="toc-Overview-of-pwmd" href="#Introduction">1 Overview of <code>pwmd</code></a></li>
2030 <li><a id="toc-Access-Control-1" href="#Access-Control">2 Access Control</a></li>
2031 <li><a id="toc-Cache-Control-1" href="#Cache-Control">3 Cache Control</a></li>
2032 <li><a id="toc-Invoking-pwmd" href="#Invoking">4 Invoking <code>pwmd</code></a></li>
2033 <li><a id="toc-pwmd-configuration-file-options" href="#Configuration">5 <code>pwmd</code> configuration file options</a></li>
2034 <li><a id="toc-Configuring-remote-connections-over-TLS_002e" href="#TLS">6 Configuring remote connections over TLS.</a></li>
2035 <li><a id="toc-Pinentry-configuration" href="#Pinentry">7 Pinentry configuration</a></li>
2036 <li><a id="toc-Protocol-commands-and-their-syntax" href="#Commands">8 Protocol commands and their syntax</a></li>
2037 <li><a id="toc-Modifying-element-attributes_002e" href="#ATTR">9 Modifying element attributes.</a></li>
2038 <li><a id="toc-Run-a-series-of-commands-in-sequence_002e" href="#BULK">10 Run a series of commands in sequence.</a></li>
2039 <li><a id="toc-Setting-the-cache-timeout_002e" href="#CACHETIMEOUT">11 Setting the cache timeout.</a></li>
2040 <li><a id="toc-Removing-a-cache-entry_002e" href="#CLEARCACHE">12 Removing a cache entry.</a></li>
2041 <li><a id="toc-Copying-an-element_002e" href="#COPY">13 Copying an element.</a></li>
2042 <li><a id="toc-Deleting-an-element_002e" href="#DELETE">14 Deleting an element.</a></li>
2043 <li><a id="toc-Deleting-a-key-from-the-key-ring_002e" href="#DELETEKEY">15 Deleting a key from the key ring.</a></li>
2044 <li><a id="toc-Showing-the-XML-document_002e" href="#DUMP">16 Showing the XML document.</a></li>
2045 <li><a id="toc-Generating-a-new-key_002e" href="#GENKEY">17 Generating a new key.</a></li>
2046 <li><a id="toc-Getting-the-content-of-an-element_002e" href="#GET">18 Getting the content of an element.</a></li>
2047 <li><a id="toc-Obtaining-a-configuration-value_002e" href="#GETCONFIG">19 Obtaining a configuration value.</a></li>
2048 <li><a id="toc-Obtaining-server-and-client-information_002e" href="#GETINFO">20 Obtaining server and client information.</a></li>
2049 <li><a id="toc-Showing-available-commands_002e" href="#HELP">21 Showing available commands.</a></li>
2050 <li><a id="toc-Creating-elements-from-XML_002e" href="#IMPORT">22 Creating elements from XML.</a></li>
2051 <li><a id="toc-Testing-cache-status_002e" href="#ISCACHED">23 Testing cache status.</a></li>
2052 <li><a id="toc-Showing-keys-used-for-the-current-data-file_002e" href="#KEYINFO">24 Showing keys used for the current data file.</a></li>
2053 <li><a id="toc-Terminating-another-client_002e" href="#KILL">25 Terminating another client.</a></li>
2054 <li><a id="toc-Showing-document-elements_002e" href="#LIST">26 Showing document elements.</a></li>
2055 <li><a id="toc-Listing-keys-in-the-key-ring_002e" href="#LISTKEYS">27 Listing keys in the key ring.</a></li>
2056 <li><a id="toc-Locking-the-current-data-file_002e" href="#LOCK">28 Locking the current data file.</a></li>
2057 <li><a id="toc-Showing-available-data-files_002e" href="#LS">29 Showing available data files.</a></li>
2058 <li><a id="toc-Moving-an-element_002e" href="#MOVE">30 Moving an element.</a></li>
2059 <li><a id="toc-Testing-the-connection_002e" href="#NOP">31 Testing the connection.</a></li>
2060 <li><a id="toc-Opening-a-data-file_002e" href="#OPEN">32 Opening a data file.</a></li>
2061 <li><a id="toc-Setting-various-client-parameters_002e" href="#OPTION">33 Setting various client parameters.</a></li>
2062 <li><a id="toc-Changing-the-passphrase-for-a-key_002e" href="#PASSWD">34 Changing the passphrase for a key.</a></li>
2063 <li><a id="toc-Resolving-an-element_002e" href="#REALPATH">35 Resolving an element.</a></li>
2064 <li><a id="toc-Renaming-an-element_002e" href="#RENAME">36 Renaming an element.</a></li>
2065 <li><a id="toc-Resetting-the-client-state_002e" href="#RESET">37 Resetting the client state.</a></li>
2066 <li><a id="toc-Saving-document-changes-to-disk_002e" href="#SAVE">38 Saving document changes to disk.</a></li>
2067 <li><a id="toc-Modifying-the-content-of-an-element_002e" href="#STORE">39 Modifying the content of an element.</a></li>
2068 <li><a id="toc-Removing-a-data-file-lock_002e" href="#UNLOCK">40 Removing a data file lock.</a></li>
2069 <li><a id="toc-Modifying-more-than-one-element_002e" href="#XPATH">41 Modifying more than one element.</a></li>
2070 <li><a id="toc-Modifying-more-than-one-element_0027s-attributes_002e" href="#XPATHATTR">42 Modifying more than one element&rsquo;s attributes.</a></li>
2071 <li><a id="toc-Running-multiple-commands-in-sequence" href="#Bulk-Commands">43 Running multiple commands in sequence</a></li>
2072 <li><a id="toc-Status-messages-and-their-meanings" href="#Status-Messages">44 Status messages and their meanings</a></li>
2073 <li><a id="toc-The-target-attribute" href="#Target-Attribute">45 The <code>target</code> attribute</a></li>
2074 <li><a id="toc-Other-special-attributes" href="#Other-Attributes">46 Other special attributes</a></li>
2075 <li><a id="toc-Key-Expiration-1" href="#Key-Expiration">47 Key Expiration</a></li>
2076 <li><a id="toc-Recognized-signals" href="#Signals">48 Recognized signals</a></li>
2077 <li><a id="toc-Concept-Index-1" href="#Concept-Index">Concept Index</a></li>
2079 </ul>
2080 </div>
2082 <hr>
2086 </body>
2087 </html>