tls: Disable TLS1.1 and CBC cipher suites by default.
[pwmd.git] / doc / pwmd.html
blobdf39533d2b75be2886a68c7f149dd6221baf9216
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 reguardless 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,[+,][-!]#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>This parameter may also be specified in a filename section to allow or deny a
461 client to <code>OPEN</code> (see <a href="#OPEN">OPEN</a>) a data file. It also affects the cache
462 commands <code>CLEARCACHE</code> (see <a href="#CLEARCACHE">CLEARCACHE</a>) and <code>CACHETIMEOUT</code>
463 (see <a href="#CACHETIMEOUT">CACHETIMEOUT</a>). When not specified in a file section, any user that
464 can connect may also open any filename (provided they can decrypt it).
465 </p>
466 <p>The following example would deny all users in group <code>primary</code> but
467 allow <code>username</code> who may be a member of <code>primary</code>. It will also
468 allow any TLS client except for the client with TLS fingerprint hash
469 <code>#ABCDEF</code>:
470 </p>
471 <div class="example">
472 <pre class="example">allowed=-@primary,username,+,!#ABCDEF
473 </pre></div>
475 </dd>
476 <dt>&lsquo;<samp>allowed_file = filename</samp>&rsquo;</dt>
477 <dd><p>A file containing one entry per line. An entry has the same syntax as the
478 <code>allowed</code> parameter. When both this parameter and the <code>allowed</code>
479 parameter are specified then the <code>allowed_file</code> entries will be appended
480 to the <code>allowed</code> parameter value.
481 </p>
482 </dd>
483 <dt>&lsquo;<samp>encrypt_to = boolean</samp>&rsquo;</dt>
484 <dd><p>When <code>true</code> and <code>SAVE</code>&rsquo;ing a data file, allow <code>gpg</code> to
485 append it&rsquo;s configured key to the list of recipients. The default is
486 <code>false</code> meaning that only keys specified with <code>SAVE</code>
487 <samp>--keyid</samp> are recipients.
488 </p>
489 </dd>
490 <dt>&lsquo;<samp>always_trust = boolean</samp>&rsquo;</dt>
491 <dd><p>When <code>true</code>, allow encrypting to untrusted recipients or public
492 encryption keys. The default is <code>false</code>.
493 </p>
494 </dd>
495 <dt>&lsquo;<samp>gpg_homedir = path</samp>&rsquo;</dt>
496 <dd><p>The location where <code>gpg</code> will store its public and private keys and
497 configuration. The default is <samp>HOMEDIR/.gnupg</samp> where <var>HOMEDIR</var> is the
498 default (<samp>~/.pwmd</samp>) or the value specified on the command line with the
499 <samp>--homedir</samp> command line option (see <a href="#Invoking">Invoking</a>). If you want to use
500 your standard <code>gpg</code> keyring then set this to <samp>~/.gnupg</samp>. Note
501 that a new instance of <code>gpg-agent</code> will be started when <em>not</em>
502 using the standard keyring and that any configuration options for
503 <code>gpg-agent</code> will need to placed in
504 <samp>HOMEDIR/.gnupg/gpg-agent.conf</samp>.
505 </p>
506 </dd>
507 <dt>&lsquo;<samp>disable_mlockall = boolean</samp>&rsquo;</dt>
508 <dd><p>When set to <code>false</code>, <cite>mlockall(2)</cite> will be called on startup. This
509 will use more physical memory but may also be more secure since no swapping to
510 disk will occur. The default is <var>true</var>. If possible, use an encrypted swap
511 file or partition and leave this set to <var>true</var>.
512 </p>
513 </dd>
514 <dt>&lsquo;<samp>log_path = /path/to/logfile</samp>&rsquo;</dt>
515 <dd><p>Logs informational messages to the specified file. The default is
516 <samp>~/.pwmd/log</samp>.
517 </p>
518 </dd>
519 <dt>&lsquo;<samp>enable_logging = boolean</samp>&rsquo;</dt>
520 <dd><p>Enable or disable logging to <var>log_path</var>. The default is <code>false</code>.
521 </p>
522 </dd>
523 <dt>&lsquo;<samp>log_keepopen = boolean</samp>&rsquo;</dt>
524 <dd><p>When set to <code>false</code>, the log file specified with <var>log_path</var> will be
525 closed after writing each line. The default is <code>true</code>.
526 </p>
527 </dd>
528 <dt>&lsquo;<samp>syslog = boolean</samp>&rsquo;</dt>
529 <dd><p>Enable logging to <cite>syslog(8)</cite> with facility <em>LOG_DAEMON</em> and priority
530 <em>LOG_INFO</em>. The default is <code>false</code>.
531 </p>
532 </dd>
533 <dt>&lsquo;<samp>log_level = level</samp>&rsquo;</dt>
534 <dd><p>When <code>0</code>, only connections and errors are logged. When <code>1</code>, data
535 file recipients and signers are logged during <code>OPEN</code> (see <a href="#OPEN">OPEN</a>) and
536 <code>SAVE</code> (see <a href="#SAVE">SAVE</a>). When <code>2</code>, client commands are also logged.
537 The default is <code>0</code>.
538 </p>
539 </dd>
540 <dt>&lsquo;<samp>kill_scd = boolean</samp>&rsquo;</dt>
541 <dd><p>Attempt to kill <code>scdaemon</code> after a client disconnects. The default is
542 <code>false</code>.
543 </p>
544 </dd>
545 <dt>&lsquo;<samp>disable_list_and_dump = boolean</samp>&rsquo;</dt>
546 <dd><p>When <code>true</code>, the <code>XPATH</code>, <code>XPATHATTR</code>, <code>LIST</code> and
547 <code>DUMP</code> protocol commands (see <a href="#Commands">Commands</a>) will be disabled.
548 </p>
549 </dd>
550 <dt>&lsquo;<samp>cache_push = file1,file2</samp>&rsquo;</dt>
551 <dd><p>A comma separated list of filenames that will be pushed into the file cache
552 upon startup. <code>pwmd</code> will prompt for the passphrase for each file
553 unless specified with <var>passphrase_file</var> parameter in a matching file
554 section.
555 </p>
556 </dd>
557 <dt>&lsquo;<samp>priority = integer</samp>&rsquo;</dt>
558 <dd><p>The priority, or niceness, of the server. The default is inherited from the
559 parent process.
560 </p>
561 </dd>
562 <dt>&lsquo;<samp>lock_timeout = integer</samp>&rsquo;</dt>
563 <dd><p>The default timeout in tenths of a second before giving up waiting for a file
564 lock and returning an error. The default is <code>50</code>.
565 </p>
566 </dd>
567 </dl>
569 <span id="index-Data-file-configuration-options"></span>
570 <p>The following options are defaults for new files when specified in the
571 &lsquo;<samp>global</samp>&rsquo; section. When placed in a data file section they are options
572 specific to that data file only.
573 </p>
574 <dl compact="compact">
575 <dt>&lsquo;<samp>require_save_key = boolean</samp>&rsquo;</dt>
576 <dd><p>Require the passphrase needed for signing before writing changes of the
577 document to disk reguardless of the key cache status. The default is
578 <code>true</code>. This option compliments <code>gpg-agent</code> option
579 <samp>--ignore-cache-for-signing</samp> and is used as a fail-safe.
580 </p>
581 </dd>
582 <dt>&lsquo;<samp>backup = boolean</samp>&rsquo;</dt>
583 <dd><p>Whether to create a backup of the data file when saving. The backup filename
584 has the <samp>.backup</samp> extension appended to the opened file. The default is
585 <code>true</code>.
586 </p>
587 </dd>
588 <dt>&lsquo;<samp>cache_timeout = seconds</samp>&rsquo;</dt>
589 <dd><p>The number of seconds to keep the cache entry for this file. If <code>-1</code>, the
590 cache entry is kept forever. If <code>0</code>, each time an encrypted file is
591 <code>OPEN</code>ed (see <a href="#OPEN">OPEN</a>) a passphrase will be required. The default
592 is <code>600</code> or 10 minutes.
593 </p>
594 </dd>
595 <dt>&lsquo;<samp>passphrase_file = /path/to/filename</samp>&rsquo;</dt>
596 <dd><p>Obtain the passphrase to open the data file from <var>filename</var>. If specified
597 in the &lsquo;<samp>global</samp>&rsquo; section then the <var>passphrase_file</var> is a default for
598 all data files. Note that if a client changes the passphrase for this data
599 file then the <var>passphrase_file</var> will need to be updated with the new
600 passphrase.
601 </p>
602 </dd>
603 <dt>&lsquo;<samp>recursion_depth = integer</samp>&rsquo;</dt>
604 <dd><p>The maximum number of times to resolve a <code>_target</code> attribute for an
605 element in an element path (see <a href="#Target-Attribute">Target Attribute</a>). An error is returned
606 when this value is exceeded. The default is <code>100</code> but can be disabled by
607 setting to <code>0</code> (<em>not recommended</em>).
608 </p>
609 </dd>
610 <dt>&lsquo;<samp>allowed = [-]user,[-]@group,[!]#TLSFINGERPRINT,...</samp>&rsquo;</dt>
611 <dd><p>Same parameter value as the <code>allowed</code> parameter mentioned above in
612 the &lsquo;<samp>[global]</samp>&rsquo; section but grants or denies a client from opening a
613 specific data file. The default is to allow any client that is allowed to
614 connect.
615 </p>
616 </dd>
617 </dl>
618 <table class="menu" border="0" cellspacing="0">
619 <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.
620 </td></tr>
621 <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.
622 </td></tr>
623 </table>
625 <hr>
626 <span id="TLS"></span><div class="header">
628 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>
629 </div>
630 <span id="Configuring-remote-connections-over-TLS_002e"></span><h2 class="chapter">6 Configuring remote connections over TLS.</h2>
631 <p>Remote connections can also be made to <code>pwmd</code> over TLS.
632 Authentication is done by using X.509 client certificates that are signed with
633 the same Certificate Authority (CA) as the server certificate.
634 </p>
635 <p>The CA certificate is expected to be found in
636 <samp>~/.pwmd/ca-cert.pem</samp> while the <code>pwmd</code> server certificate and key
637 file should be put in <samp>~/.pwmd/server-cert.pem</samp> and
638 <samp>~/.pwmd/server-key.pem</samp>, respectively.
639 </p>
640 <p>See the documentation of <code>certtool</code> or <code>openssl</code> for details
641 about creating self-signed certificates.
642 </p>
643 <p>The following TLS configuration options are available:
644 </p>
645 <dl compact="compact">
646 <dt>&lsquo;<samp>enable_tcp = boolean</samp>&rsquo;</dt>
647 <dd><p>Whether to enable TCP/TLS server support. If enabled, both TCP and the local
648 unix domain socket will listen for connections. The default is
649 <code>false</code>.
650 </p>
651 </dd>
652 <dt>&lsquo;<samp>tcp_port = integer</samp>&rsquo;</dt>
653 <dd><p>The TCP port to listen on when <var>enable_tcp</var> is <code>true</code>. The default is
654 <code>6466</code>.
655 </p>
656 </dd>
657 <dt>&lsquo;<samp>tcp_bind = string</samp>&rsquo;</dt>
658 <dd><p>The internet protocol to listen with. Must be one of <code>ipv4</code>, <code>ipv6</code>
659 or <code>any</code> to listen for both IPv4 and IPv6 connections. The default is
660 <code>any</code>.
661 </p>
662 </dd>
663 <dt>&lsquo;<samp>tcp_interface = string</samp>&rsquo;</dt>
664 <dd><p>Only useful if running as root.
665 </p>
666 </dd>
667 <dt>&lsquo;<samp>tls_timeout = seconds</samp>&rsquo;</dt>
668 <dd><p>The number of seconds to wait for a read() or write() call on a
669 TLS client file descriptor to complete before returning an
670 error. The default is <var>300</var>.
671 </p>
672 </dd>
673 <dt>&lsquo;<samp>keepalive_interval = seconds</samp>&rsquo;</dt>
674 <dd><p>Send a keepalive status message to an idle remote client. An idle
675 client is one that is not in a command. The purpose of this status
676 message is to disconnect a hung remote client and release any file mutex
677 locks so another client may open the same data file. The default is <code>60</code>.
678 </p>
679 </dd>
680 <dt>&lsquo;<samp>tcp_require_key = boolean</samp>&rsquo;</dt>
681 <dd><p>When <code>true</code>, require the remote client to provide the passphrase to open
682 a data file even if the file is cached. This option is a default for all
683 files when specified in the &lsquo;<samp>[global]</samp>&rsquo; section. The default is
684 <code>false</code>.
685 </p>
686 </dd>
687 <dt>&lsquo;<samp>tls_cipher_suite = string</samp>&rsquo;</dt>
688 <dd><p>The GnuTLS cipher suite and protocol to use. See the GnuTLS documentation for
689 information about the format of this string. The default is
690 <code>SECURE256:SECURE192:SECURE128:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-AES-128-CBC:-AES-256-CBC</code>.
691 </p>
692 </dd>
693 <dt>&lsquo;<samp>tls_dh_params_file = filename</samp>&rsquo;</dt>
694 <dd><p>The PEM encoded filename containing DH parameters. If not specified
695 then DH algorithms will not be available to the client. See the
696 <code>openssl dhparam</code> or <code>certtool</code> manual pages for details about
697 generating this file.
698 </p>
699 <p>Note that SIGHUP will not reload this file once TLS support has been enabled.
700 You will need to restart <code>pwmd</code> for changes to take effect.
701 </p>
702 </dd>
703 <dt>&lsquo;<samp>tls_use_crl = boolean</samp>&rsquo;</dt>
704 <dd><p>When <code>true</code>, enabling reading of <samp>~/.pwmd/crl.pem</samp>. This
705 file is an X.509 Certificate Revocation List and can be used to deny clients
706 by adding client certificates to it. The default is <code>false</code>.
707 <code>pwmd</code> will need to be restarted to recognize any changes to this
708 file.
709 </p></dd>
710 </dl>
712 <hr>
713 <span id="Pinentry"></span><div class="header">
715 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>
716 </div>
717 <span id="Pinentry-configuration"></span><h2 class="chapter">7 Pinentry configuration</h2>
719 <p>The <code>pinentry</code> program is used to prompt the user for passphrase
720 input or as a confirmation dialog; it needs to know where to prompt for
721 the input, beit from a terminal or an X11 display.
722 </p>
723 <p>It is the responsibility of the client to tell <code>pinentry</code> about the
724 terminal or X11 display before requiring the input. This is done with the
725 <code>OPTION</code> command (see <a href="#OPTION">OPTION</a>) to either set or unset needed
726 <code>pwmd</code> environment variables and by using the
727 <code>gpg-connect-agent</code> program. Please read it&rsquo;s documentation about the
728 <em>UPDATESTARTUPTTY</em> command.
729 </p>
730 <hr>
731 <span id="Commands"></span><div class="header">
733 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>
734 </div>
735 <span id="Protocol-commands-and-their-syntax"></span><h2 class="chapter">8 Protocol commands and their syntax</h2>
736 <table class="menu" border="0" cellspacing="0">
737 <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.
738 </td></tr>
739 <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.
740 </td></tr>
741 <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.
742 </td></tr>
743 <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.
744 </td></tr>
745 <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.
746 </td></tr>
747 <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.
748 </td></tr>
749 <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.
750 </td></tr>
751 <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.
752 </td></tr>
753 <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.
754 </td></tr>
755 <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.
756 </td></tr>
757 <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.
758 </td></tr>
759 <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.
760 </td></tr>
761 <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.
762 </td></tr>
763 <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.
764 </td></tr>
765 <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.
766 </td></tr>
767 <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.
768 </td></tr>
769 <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.
770 </td></tr>
771 <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.
772 </td></tr>
773 <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.
774 </td></tr>
775 <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.
776 </td></tr>
777 <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.
778 </td></tr>
779 <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.
780 </td></tr>
781 <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.
782 </td></tr>
783 <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.
784 </td></tr>
785 <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.
786 </td></tr>
787 <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.
788 </td></tr>
789 <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.
790 </td></tr>
791 <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.
792 </td></tr>
793 <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.
794 </td></tr>
795 <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.
796 </td></tr>
797 <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.
798 </td></tr>
799 <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.
800 </td></tr>
801 <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.
802 </td></tr>
803 <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.
804 </td></tr>
805 </table>
806 <hr>
807 <span id="ATTR"></span><div class="header">
809 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>
810 </div>
811 <span id="Modifying-element-attributes_002e"></span><h2 class="chapter">9 Modifying element attributes.</h2>
812 <span id="index-ATTR-command"></span>
813 <p>Syntax:
814 </p><div class="example">
815 <pre class="example">ATTR [--inquire] SET|GET|DELETE|LIST [&lt;attribute&gt;] element[&lt;TAB&gt;child[..]] ..
816 </pre></div>
818 <dl compact="compact">
819 <dt>ATTR SET attribute element[&lt;TAB&gt;child[..]] [value]</dt>
820 <dd><p>Stores or updates an <var>attribute</var> name and optional <var>value</var> of an
821 element. When no <var>value</var> is specified any existing value will be removed.
822 <br><br>
823 </p></dd>
824 <dt>ATTR DELETE attribute element[&lt;TAB&gt;child[..]]</dt>
825 <dd><p>Removes an attribute from an element. If <var>attribute</var> is <code>_name</code>
826 or <code>target</code> an error is returned. Use the <code>DELETE</code> command
827 (see <a href="#DELETE">DELETE</a>) instead.
828 <br><br>
829 </p></dd>
830 <dt>ATTR LIST element[&lt;TAB&gt;child[..]]</dt>
831 <dd><p>Retrieves a newline separated list of attributes names and values
832 from the specified element. Each attribute name and value is space delimited.
833 <br><br>
834 </p></dd>
835 <dt>ATTR GET attribute element[&lt;TAB&gt;child[..]]</dt>
836 <dd><p>Retrieves the value of an <var>attribute</var> from an element.
837 </p></dd>
838 </dl>
839 <br><br>
840 <p>When the <samp>--inquire</samp> option is passed then all remaining non-option
841 arguments are retrieved via a server <em>INQUIRE</em>.
842 <br><br>
843 See <a href="#Target-Attribute">Target Attribute</a>, for details about this special attribute and also
844 see <a href="#Other-Attributes">Other Attributes</a> for other attributes that are handled specially
845 by <code>pwmd</code>.
846 </p>
848 <hr>
849 <span id="BULK"></span><div class="header">
851 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>
852 </div>
853 <span id="Run-a-series-of-commands-in-sequence_002e"></span><h2 class="chapter">10 Run a series of commands in sequence.</h2>
854 <span id="index-BULK-command"></span>
855 <p>Syntax:
856 </p><div class="example">
857 <pre class="example">BULK [--inquire]
858 </pre></div>
860 <p>Parses a semi-canonical s-expression representing a series of protocol
861 commands to be run in seqeunce (see <a href="#Bulk-Commands">Bulk Commands</a>). Returns a canonical
862 s-expression containing each commands id, return value and result data
863 (if any).
864 <br><br>
865 When the <samp>--inquire</samp> option is passed then all remaining non-option
866 arguments are retrieved via a server <em>INQUIRE</em>.
867 </p>
869 <hr>
870 <span id="CACHETIMEOUT"></span><div class="header">
872 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>
873 </div>
874 <span id="Setting-the-cache-timeout_002e"></span><h2 class="chapter">11 Setting the cache timeout.</h2>
875 <span id="index-CACHETIMEOUT-command"></span>
876 <p>Syntax:
877 </p><div class="example">
878 <pre class="example">CACHETIMEOUT &lt;seconds&gt;
879 </pre></div>
881 <p>The time in <var>seconds</var> until the currently opened data file will be
882 removed from the cache. <code>-1</code> will keep the cache entry forever,
883 <code>0</code> will require the passphrase for each <code>OPEN</code> command
884 (see <a href="#OPEN">OPEN</a>) or <code>SAVE</code> (see <a href="#SAVE">SAVE</a>) command. See <a href="#Configuration">Configuration</a>,
885 and the <code>cache_timeout</code> parameter.
886 </p>
888 <hr>
889 <span id="CLEARCACHE"></span><div class="header">
891 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>
892 </div>
893 <span id="Removing-a-cache-entry_002e"></span><h2 class="chapter">12 Removing a cache entry.</h2>
894 <span id="index-CLEARCACHE-command"></span>
895 <p>Syntax:
896 </p><div class="example">
897 <pre class="example">CLEARCACHE [&lt;filename&gt;]
898 </pre></div>
900 <p>Clears a file cache entry for all or the specified <var>filename</var>. Note that
901 this will also clear any <code>gpg-agent</code> cached keys which may cause
902 problems if another data file shares the same keys as <var>filename</var>.
903 <br><br>
904 When clearing all cache entries a permissions test is done against the
905 current client based on the <var>allowed</var> configuration parameter in a
906 <var>filename</var> section. Both a cache entry may be cleared and an error
907 returned depending on cached data files and client permissions.
908 </p>
910 <hr>
911 <span id="COPY"></span><div class="header">
913 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>
914 </div>
915 <span id="Copying-an-element_002e"></span><h2 class="chapter">13 Copying an element.</h2>
916 <span id="index-COPY-command"></span>
917 <p>Syntax:
918 </p><div class="example">
919 <pre class="example">COPY [--inquire] source[&lt;TAB&gt;child[..]] dest[&lt;TAB&gt;child[..]]
920 </pre></div>
922 <p>Copies the entire element tree starting from the child node of the source
923 element, to the destination element path. If the destination element path
924 does not exist then it will be created; otherwise it is overwritten.
925 <br><br>
926 Note that attributes from the source element are merged into the
927 destination element when the destination element path exists. When an
928 attribute of the same name exists in both the source and destination
929 elements then the destination attribute will be updated to the source
930 attribute value.
931 <br><br>
932 When the <samp>--inquire</samp> option is passed then all remaining non-option
933 arguments are retrieved via a server <em>INQUIRE</em>.
934 </p>
936 <hr>
937 <span id="DELETE"></span><div class="header">
939 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>
940 </div>
941 <span id="Deleting-an-element_002e"></span><h2 class="chapter">14 Deleting an element.</h2>
942 <span id="index-DELETE-command"></span>
943 <p>Syntax:
944 </p><div class="example">
945 <pre class="example">DELETE [--inquire] element[&lt;TAB&gt;child[..]]
946 </pre></div>
948 <p>Removes the specified element path and all of its children. This may break
949 an element with a <code>target</code> attribute (see <a href="#Target-Attribute">Target Attribute</a>) that
950 refers to this element or any of its children.
951 <br><br>
952 When the <samp>--inquire</samp> option is passed then all remaining non-option
953 arguments are retrieved via a server <em>INQUIRE</em>.
954 </p>
956 <hr>
957 <span id="DELETEKEY"></span><div class="header">
959 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>
960 </div>
961 <span id="Deleting-a-key-from-the-key-ring_002e"></span><h2 class="chapter">15 Deleting a key from the key ring.</h2>
962 <span id="index-DELETEKEY-command"></span>
963 <p>Syntax:
964 </p><div class="example">
965 <pre class="example">DELETEKEY &lt;keyid&gt;
966 </pre></div>
968 <p>Deletes the public and secret key associated with key <var>keyid</var> from the
969 keyring. The <var>keyid</var> must be one associated with the currently opened
970 data file.
971 Note that no confirmation occurs. Also note that when the key is deleted,
972 the current or other data files using this key will no longer be able to be
973 opened.
974 </p>
976 <hr>
977 <span id="DUMP"></span><div class="header">
979 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>
980 </div>
981 <span id="Showing-the-XML-document_002e"></span><h2 class="chapter">16 Showing the XML document.</h2>
982 <span id="index-DUMP-command"></span>
983 <p>Syntax:
984 </p><div class="example">
985 <pre class="example">DUMP
986 </pre></div>
988 <p>Shows the in memory <abbr>XML</abbr> document with indenting. See <a href="#XPATH">XPATH</a>, for
989 dumping a specific node.
990 </p>
992 <hr>
993 <span id="GENKEY"></span><div class="header">
995 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>
996 </div>
997 <span id="Generating-a-new-key_002e"></span><h2 class="chapter">17 Generating a new key.</h2>
998 <span id="index-GENKEY-command"></span>
999 <p>Syntax:
1000 </p><div class="example">
1001 <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;]
1002 </pre></div>
1004 <p>Generates a new key based on option arguments. One of
1005 <samp>--subkey-of</samp> or <samp>--userid</samp> is
1006 required. The <samp>--subkey-of</samp> option will generate a subkey for the key
1007 of the specified fingerprint.
1008 </p>
1010 <hr>
1011 <span id="GET"></span><div class="header">
1013 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>
1014 </div>
1015 <span id="Getting-the-content-of-an-element_002e"></span><h2 class="chapter">18 Getting the content of an element.</h2>
1016 <span id="index-GET-command"></span>
1017 <p>Syntax:
1018 </p><div class="example">
1019 <pre class="example">GET [--inquire] element[&lt;TAB&gt;child[..]]
1020 </pre></div>
1022 <p>Retrieves the content of the specified element. The content is returned
1023 with a data response.
1024 <br><br>
1025 When the <samp>--inquire</samp> option is passed then all remaining non-option
1026 arguments are retrieved via a server <em>INQUIRE</em>.
1027 </p>
1029 <hr>
1030 <span id="GETCONFIG"></span><div class="header">
1032 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>
1033 </div>
1034 <span id="Obtaining-a-configuration-value_002e"></span><h2 class="chapter">19 Obtaining a configuration value.</h2>
1035 <span id="index-GETCONFIG-command"></span>
1036 <p>Syntax:
1037 </p><div class="example">
1038 <pre class="example">GETCONFIG [filename] &lt;parameter&gt;
1039 </pre></div>
1041 <p>Returns the value of a <code>pwmd</code> configuration <var>parameter</var> with a
1042 data response. If no file has been opened then the value for <var>filename</var>
1043 or the default from the <var>global</var> section will be returned. If a file
1044 has been opened and no <var>filename</var> is specified, the value previously
1045 set with the <code>OPTION</code> command (see <a href="#OPTION">OPTION</a>) will be returned.
1046 </p>
1048 <hr>
1049 <span id="GETINFO"></span><div class="header">
1051 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>
1052 </div>
1053 <span id="Obtaining-server-and-client-information_002e"></span><h2 class="chapter">20 Obtaining server and client information.</h2>
1054 <span id="index-GETINFO-command"></span>
1055 <p>Syntax:
1056 </p><div class="example">
1057 <pre class="example">GETINFO [--data] [--verbose] CACHE | CLIENTS | PID | USER | LAST_ERROR | VERSION
1058 </pre></div>
1060 <p>Get server and other information. The information is returned via a status
1061 message (see <a href="#Status-Messages">Status Messages</a>) unless otherwise noted or <samp>--data</samp>
1062 is specified.
1063 <br><br>
1064 <var>CACHE</var> returns the number of cached documents.
1065 <br><br>
1066 <var>CLIENTS</var> returns the number of
1067 connected clients via a status message or a list of connected clients when
1068 the <samp>--verbose</samp> parameter is used (implies <samp>--data</samp>). A
1069 verbose line of a client list contains
1070 space delimited
1071 fields: the thread ID, client name, opened file (<code>/</code> if none opened),
1072 IP address if remote, file lock status, whether the current client is self
1073 or not, client state (see below),
1074 user ID or TLS fingerprint of the connected client, username if the
1075 client is a local one else <code>-</code>, and finally the time stamp of when the
1076 client connected.
1077 <br><br>
1078 Client state <code>0</code> is an unknown client state, state <code>1</code> indicates
1079 the client has connected but hasn&rsquo;t completed initializing, state <code>2</code>
1080 indicates that the client is idle, state <code>3</code> means the
1081 client is in a command and state <code>4</code> means the client is disconnecting.
1082 <br><br>
1083 <var>PID</var> returns the process ID number of the server via a data response.
1084 <br><br>
1085 <var>VERSION</var> returns the server version number and compile-time features
1086 via a data response with each being space delimited.
1087 <br><br>
1088 <var>LAST_ERROR</var> returns a detailed description of the last failed command
1089 via a data response, when available.
1090 <br><br>
1091 <var>USER</var> returns the username or <abbr>TLS</abbr> hash of the connected client
1092 via a data response.
1093 </p>
1095 <hr>
1096 <span id="HELP"></span><div class="header">
1098 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>
1099 </div>
1100 <span id="Showing-available-commands_002e"></span><h2 class="chapter">21 Showing available commands.</h2>
1101 <span id="index-HELP-command"></span>
1102 <p>Syntax:
1103 </p><div class="example">
1104 <pre class="example">HELP [--html] [&lt;COMMAND&gt;]
1105 </pre></div>
1107 <p>Show available commands or command specific help text.
1108 <br><br>
1109 The <samp>--html</samp> option will output the help text in HTML format.
1110 </p>
1112 <hr>
1113 <span id="IMPORT"></span><div class="header">
1115 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>
1116 </div>
1117 <span id="Creating-elements-from-XML_002e"></span><h2 class="chapter">22 Creating elements from XML.</h2>
1118 <span id="index-IMPORT-command"></span>
1119 <p>Syntax:
1120 </p><div class="example">
1121 <pre class="example">IMPORT [--root=element[&lt;TAB&gt;child[..]]]
1122 </pre></div>
1124 <p>This command uses a server <em>INQUIRE</em> to retrieve data from the client.
1125 <br><br>
1126 Like the <code>STORE</code> command (see <a href="#STORE">STORE</a>), but the <var>content</var>
1127 argument is raw <abbr>XML</abbr> data. The content is created as a child of
1128 the element path specified with the <samp>--root</samp> option or at the
1129 document root when not specified. Existing elements of the same name will
1130 be overwritten.
1131 <br><br>
1132 The content must begin with an <abbr>XML</abbr> element node. See <a href="#Introduction">Introduction</a>,
1133 for details.
1134 </p>
1136 <hr>
1137 <span id="ISCACHED"></span><div class="header">
1139 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>
1140 </div>
1141 <span id="Testing-cache-status_002e"></span><h2 class="chapter">23 Testing cache status.</h2>
1142 <span id="index-ISCACHED-command"></span>
1143 <p>Syntax:
1144 </p><div class="example">
1145 <pre class="example">ISCACHED [--lock] [--agent [--sign]] &lt;filename&gt;
1146 </pre></div>
1148 <p>Determines the file cache status of the specified <var>filename</var>.
1149 The default is to test whether the filename is cached in memory. Passing
1150 option <samp>--agent</samp> will test the <code>gpg-agent</code> cache for at most
1151 one cached key used for opening the data file (see <a href="#OPEN">OPEN</a>). To test if
1152 a signing key is cached, pass <samp>--sign</samp> along with <samp>--agent</samp>.
1153 Both the <samp>--agent</samp> and <samp>--sign</samp> options require an opened data
1154 file.
1155 <br><br>
1156 An <em>OK</em> response is returned if the specified <var>filename</var> is found
1157 in the cache. If not found in the cache but exists on the filesystem
1158 then <code>GPG_ERR_NO_DATA</code> is returned. Otherwise a filesystem error is
1159 returned.
1160 <br><br>
1161 The <samp>--lock</samp> option will lock the file mutex of <var>filename</var> when
1162 the file exists; it does not need to be opened nor cached. The lock will be
1163 released when the client exits or sends the <code>UNLOCK</code> command
1164 (see <a href="#UNLOCK">UNLOCK</a>). When this option is passed the current data file is closed.
1165 </p>
1167 <hr>
1168 <span id="KEYINFO"></span><div class="header">
1170 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>
1171 </div>
1172 <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>
1173 <span id="index-KEYINFO-command"></span>
1174 <p>Syntax:
1175 </p><div class="example">
1176 <pre class="example">KEYINFO [--learn]
1177 </pre></div>
1179 <p>Returns a new line separated list of key ID&rsquo;s that the currently opened
1180 data file has recipients and signers for. If the key is a signing key it
1181 will be prefixed with an <code>S</code>. If the file is a new one, or has no
1182 signers in the case of being symmetrically encrypted, the error code
1183 <code>GPG_ERR_NO_DATA</code> is returned.
1184 <br><br>
1185 When the <samp>--learn</samp> option is passed, keys on a smartcard will be
1186 imported.
1187 </p>
1189 <hr>
1190 <span id="KILL"></span><div class="header">
1192 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>
1193 </div>
1194 <span id="Terminating-another-client_002e"></span><h2 class="chapter">25 Terminating another client.</h2>
1195 <span id="index-KILL-command"></span>
1196 <p>Syntax:
1197 </p><div class="example">
1198 <pre class="example">KILL &lt;thread_id&gt;
1199 </pre></div>
1201 <p>Terminates the client identified by <var>thread_id</var> and releases any file
1202 lock or other resources it has held. See <code>GETINFO</code> (see <a href="#GETINFO">GETINFO</a>)
1203 for details about listing connected clients. An <code>invoking_user</code>
1204 (see <a href="#Configuration">Configuration</a>) may kill any client while others may only kill
1205 clients of the same <code>UID</code> or <abbr>TLS</abbr> fingerprint.
1206 </p>
1208 <hr>
1209 <span id="LIST"></span><div class="header">
1211 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>
1212 </div>
1213 <span id="Showing-document-elements_002e"></span><h2 class="chapter">26 Showing document elements.</h2>
1214 <span id="index-LIST-command"></span>
1215 <p>Syntax:
1216 </p><div class="example">
1217 <pre class="example">LIST [--inquire] [--recurse] [element[&lt;TAB&gt;child[..]]]
1218 </pre></div>
1220 <p>If no element path is given then a newline separated list of root elements
1221 is returned with a data response. If given, then children of the specified
1222 element path are returned.
1223 <br><br>
1224 Each element path
1225 returned will have zero or more flags appened to it. These flags are
1226 delimited from the element path by a single space character. A flag itself
1227 is a single character. Flag <code>P</code> indicates that access to the element
1228 is denied. Flag <code>+</code> indicates that there are child nodes of
1229 the current element path. Flag <code>E</code> indicates that an element of the
1230 element path contained in a <var>target</var> attribute could not be found. Flag
1231 <code>O</code> indicates that a <var>target</var> attribute recursion limit was reached
1232 (see <a href="#Configuration">Configuration</a>). Flag <code>T</code>, followed by a single space character,
1233 then an element path, is the element path of the <var>target</var> attribute
1234 contained in the current element.
1235 <br><br>
1236 When a specified element path contains an error, beit from the final
1237 element in the path or any previous element, the path is still shown but
1238 will contain the error flag for the element with the error. Determining
1239 the actual element which contains the error is up to the client. This can be
1240 done by traversing the final element up to parent elements that contain the
1241 same error flag.
1242 <br><br>
1243 The option <samp>--recurse</samp> may be used to list the entire element tree
1244 for a specified element path or the entire tree for all root elements.
1245 <br><br>
1246 When the <samp>--inquire</samp> option is passed then all remaining non-option
1247 arguments are retrieved via a server <em>INQUIRE</em>.
1248 </p>
1250 <hr>
1251 <span id="LISTKEYS"></span><div class="header">
1253 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>
1254 </div>
1255 <span id="Listing-keys-in-the-key-ring_002e"></span><h2 class="chapter">27 Listing keys in the key ring.</h2>
1256 <span id="index-LISTKEYS-command"></span>
1257 <p>Syntax:
1258 </p><div class="example">
1259 <pre class="example">LISTKEYS [--secret-only] [pattern[,&lt;pattern&gt;]]
1260 </pre></div>
1262 <p>Returns a new line separated list of key information matching a comma
1263 separated list of <var>pattern</var>&rsquo;s. When option <samp>--secret-only</samp> is
1264 specified, only keys matching <var>pattern</var> that also have a secret key
1265 available will be returned.
1266 </p>
1268 <hr>
1269 <span id="LOCK"></span><div class="header">
1271 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>
1272 </div>
1273 <span id="Locking-the-current-data-file_002e"></span><h2 class="chapter">28 Locking the current data file.</h2>
1274 <span id="index-LOCK-command"></span>
1275 <p>Syntax:
1276 </p><div class="example">
1277 <pre class="example">LOCK
1278 </pre></div>
1280 <p>Locks the mutex associated with the opened file. This prevents other clients
1281 from sending commands to the same opened file until the client
1282 that sent this command either disconnects or sends the <code>UNLOCK</code>
1283 command. See <a href="#UNLOCK">UNLOCK</a>.
1284 </p>
1286 <hr>
1287 <span id="LS"></span><div class="header">
1289 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>
1290 </div>
1291 <span id="Showing-available-data-files_002e"></span><h2 class="chapter">29 Showing available data files.</h2>
1292 <span id="index-LS-command"></span>
1293 <p>Syntax:
1294 </p><div class="example">
1295 <pre class="example">LS [--verbose]
1296 </pre></div>
1298 <p>Returns a newline separated list of data files stored in the data directory
1299 <samp>HOMEDIR/data</samp> (see <a href="#Invoking">Invoking</a>) with a data response. When the
1300 <var>&ndash;verbose</var> option is passed, the space-separated filesystem inode
1301 access, modification and change times are appended to the line.
1302 </p>
1304 <hr>
1305 <span id="MOVE"></span><div class="header">
1307 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>
1308 </div>
1309 <span id="Moving-an-element_002e"></span><h2 class="chapter">30 Moving an element.</h2>
1310 <span id="index-MOVE-command"></span>
1311 <p>Syntax:
1312 </p><div class="example">
1313 <pre class="example">MOVE [--inquire] source[&lt;TAB&gt;child[..]] [dest[&lt;TAB&gt;child[..]]]
1314 </pre></div>
1316 <p>Moves the source element path to the destination element path. If the
1317 destination is not specified then it will be moved to the root node of the
1318 document. If the destination is specified and exists then it will be
1319 overwritten; otherwise non-existing elements of the destination element
1320 path will be created.
1321 <br><br>
1322 When the <samp>--inquire</samp> option is passed then all remaining non-option
1323 arguments are retrieved via a server <em>INQUIRE</em>.
1324 </p>
1326 <hr>
1327 <span id="NOP"></span><div class="header">
1329 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>
1330 </div>
1331 <span id="Testing-the-connection_002e"></span><h2 class="chapter">31 Testing the connection.</h2>
1332 <span id="index-NOP-command"></span>
1333 <p>Syntax:
1334 </p><div class="example">
1335 <pre class="example">NOP
1336 </pre></div>
1338 <p>This command does nothing. It is useful for testing the connection for a
1339 timeout condition.
1340 </p>
1342 <hr>
1343 <span id="OPEN"></span><div class="header">
1345 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>
1346 </div>
1347 <span id="Opening-a-data-file_002e"></span><h2 class="chapter">32 Opening a data file.</h2>
1348 <span id="index-OPEN-command"></span>
1349 <p>Syntax:
1350 </p><div class="example">
1351 <pre class="example">OPEN [--lock] &lt;filename&gt;
1352 </pre></div>
1354 <p>Opens <var>filename</var>. When the <var>filename</var> is not found on the
1355 file-system then a new in-memory document will be created. If the file is
1356 found, it is looked for in the file cache and when found no passphrase will
1357 be required to open it. When not cached, <cite>pinentry(1)</cite> will be used to
1358 retrieve the passphrase for decryption unless <samp>disable-pinentry</samp>
1359 (see <a href="#OPTION">OPTION</a>) was specified in which case <code>pwmd</code> will
1360 <em>INQUIRE</em> the client for the passphrase. Note than when configuration
1361 option <samp>strict_open</samp> is enabled and the client is not an
1362 <samp>invoking_user</samp>, an error will be returned when the data file does
1363 not exist.
1364 <br><br>
1365 When the <samp>--lock</samp> option is passed then the file mutex will be
1366 locked as if the <code>LOCK</code> command (see <a href="#LOCK">LOCK</a>) had been sent after the
1367 file had been opened.
1368 </p>
1370 <hr>
1371 <span id="OPTION"></span><div class="header">
1373 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>
1374 </div>
1375 <span id="Setting-various-client-parameters_002e"></span><h2 class="chapter">33 Setting various client parameters.</h2>
1376 <span id="index-OPTION-command"></span>
1377 <p>Syntax:
1378 </p><div class="example">
1379 <pre class="example">OPTION &lt;NAME&gt;=[&lt;VALUE&gt;]
1380 </pre></div>
1382 <p>Sets a client option <var>name</var> to <var>value</var>. The value for an option is
1383 kept for the duration of the connection with the exception of the
1384 <code>pinentry</code> options which are defaults for all future connections
1385 (see <a href="#Pinentry">Pinentry</a>). When <var>value</var> is empty the option is unset.
1386 <br><br>
1387 </p><dl compact="compact">
1388 <dt>DISABLE-PINENTRY</dt>
1389 <dd><p>Disable use of <code>pinentry</code> for passphrase retrieval. When <code>1</code>, a
1390 server inquire is sent to the client to obtain the passphrase. This option
1391 may be set as needed before the <code>OPEN</code> (see <a href="#OPEN">OPEN</a>), <code>PASSWD</code>
1392 (see <a href="#PASSWD">PASSWD</a>) and <code>SAVE</code> (see <a href="#SAVE">SAVE</a>) commands. Set to <code>0</code>
1393 to use a <code>pinentry</code>.
1394 <br><br>
1395 </p></dd>
1396 <dt>DISPLAY</dt>
1397 <dd><p>Set or unset the X11 display to use when prompting for a passphrase.
1398 <br><br>
1399 </p></dd>
1400 <dt>TTYNAME</dt>
1401 <dd><p>Set the terminal device path to use when prompting for a passphrase.
1402 <br><br>
1403 </p></dd>
1404 <dt>TTYTYPE</dt>
1405 <dd><p>Set the terminal type for use with <samp>TTYNAME</samp>.
1406 <br><br>
1407 </p></dd>
1408 <dt>NAME</dt>
1409 <dd><p>Associates the thread ID of the connection with the specified textual
1410 representation. Useful for debugging log messages. May not contain whitespace.
1411 <br><br>
1412 </p></dd>
1413 <dt>LOCK-TIMEOUT</dt>
1414 <dd><p>When not <code>0</code>, the duration in tenths of a second to wait for the file
1415 mutex which has been locked by another thread to be released before returning
1416 an error. When <code>-1</code> the error will be returned immediately.
1417 <br><br>
1418 </p></dd>
1419 <dt>CLIENT-STATE</dt>
1420 <dd><p>When set to <code>1</code> then client state status messages for other clients are
1421 sent to the current client. The default is <code>0</code>.
1422 </p></dd>
1423 </dl>
1426 <hr>
1427 <span id="PASSWD"></span><div class="header">
1429 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>
1430 </div>
1431 <span id="Changing-the-passphrase-for-a-key_002e"></span><h2 class="chapter">34 Changing the passphrase for a key.</h2>
1432 <span id="index-PASSWD-command"></span>
1433 <p>Syntax:
1434 </p><div class="example">
1435 <pre class="example">PASSWD
1436 </pre></div>
1438 <p>Changes the passphrase of the secret key required to open the current
1439 data file. If the data file is symmetrically encrypted, the error
1440 <code>GPG_ERR_NOT_SUPPORTED</code> is returned. When symmetrically encrypted,
1441 the <code>SAVE</code> command (see <a href="#SAVE">SAVE</a>) should be used instead to prevent
1442 this command saving any unwanted changes to the <abbr>XML</abbr> document.
1443 <br><br>
1444 Note that when the current data file has been either encrypted or signed
1445 with a key stored on a smartcard this command will return an error. In this
1446 case you should instead use <code>gpg --card-edit</code> to change the
1447 pin of the smartcard or <code>gpg --edit-key</code> to change the passphrase
1448 of the key used to sign or encrypt the data file.
1449 <br><br>
1450 This command is not available to non-invoking clients
1451 (see <a href="#Access-Control">Access Control</a>).
1452 </p>
1454 <hr>
1455 <span id="REALPATH"></span><div class="header">
1457 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>
1458 </div>
1459 <span id="Resolving-an-element_002e"></span><h2 class="chapter">35 Resolving an element.</h2>
1460 <span id="index-REALPATH-command"></span>
1461 <p>Syntax:
1462 </p><div class="example">
1463 <pre class="example">REALPATH [--inquire] element[&lt;TAB&gt;child[..]]
1464 </pre></div>
1466 <p>Resolves all <code>target</code> attributes of the specified element path and
1467 returns the result with a data response. See <a href="#Target-Attribute">Target Attribute</a>, for details.
1468 <br><br>
1469 When the <samp>--inquire</samp> option is passed then all remaining non-option
1470 arguments are retrieved via a server <em>INQUIRE</em>.
1471 </p>
1473 <hr>
1474 <span id="RENAME"></span><div class="header">
1476 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>
1477 </div>
1478 <span id="Renaming-an-element_002e"></span><h2 class="chapter">36 Renaming an element.</h2>
1479 <span id="index-RENAME-command"></span>
1480 <p>Syntax:
1481 </p><div class="example">
1482 <pre class="example">RENAME [--inquire] element[&lt;TAB&gt;child[..]] &lt;value&gt;
1483 </pre></div>
1485 <p>Renames the specified <var>element</var> to the new <var>value</var>. If an element of
1486 the same name as the <var>value</var> already exists it will be overwritten.
1487 <br><br>
1488 When the <samp>--inquire</samp> option is passed then all remaining non-option
1489 arguments are retrieved via a server <em>INQUIRE</em>.
1490 </p>
1492 <hr>
1493 <span id="RESET"></span><div class="header">
1495 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>
1496 </div>
1497 <span id="Resetting-the-client-state_002e"></span><h2 class="chapter">37 Resetting the client state.</h2>
1498 <span id="index-RESET-command"></span>
1499 <p>Syntax:
1500 </p><div class="example">
1501 <pre class="example">RESET
1502 </pre></div>
1504 <p>Closes the currently opened file but keeps any previously set client options
1505 (see <a href="#OPTION">OPTION</a>).
1506 </p>
1508 <hr>
1509 <span id="SAVE"></span><div class="header">
1511 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>
1512 </div>
1513 <span id="Saving-document-changes-to-disk_002e"></span><h2 class="chapter">38 Saving document changes to disk.</h2>
1514 <span id="index-SAVE-command"></span>
1515 <p>Syntax:
1516 </p><div class="example">
1517 <pre class="example">SAVE [--sign-keyid=[&lt;fpr&gt;]] [--symmetric | --keyid=&lt;fpr&gt;[,..] | --inquire-keyid]
1518 </pre></div>
1520 <p>Writes the in-memory <abbr>XML</abbr> document to disk. The file written to is the
1521 file that was opened when using the <code>OPEN</code> command (see <a href="#OPEN">OPEN</a>).
1522 <br><br>
1523 If the file is a new one, one of <samp>--symmetric</samp>, <samp>--keyid</samp> or
1524 <samp>--inquire-keyid</samp> is required. When not <samp>--symmetric</samp>, option
1525 <samp>--sign-keyid</samp> is also required, but optional otherwise.
1526 <br><br>
1527 You can encrypt the data file to a recipient other than the one that it
1528 was originally encrypted with by passing the <samp>--keyid</samp> or
1529 <samp>--inquire-keyid</samp> option with a comma separated list of
1530 public encryption key fingerprints as its argument. Use the
1531 <code>LISTKEYS</code> command (see <a href="#LISTKEYS">LISTKEYS</a>) to show key information by
1532 pattern. The <samp>--sign-keyid</samp> option may also be used to sign the data
1533 file with an alternate key by specifying the fingerprint of a signing key.
1534 Only one signing key is supported unlike the <samp>--keyid</samp> option.
1535 A passphrase to decrypt the data file
1536 will be required when one or more of the original encryption keys or signing
1537 key are not found in either of these two options&rsquo; arguments or when the data
1538 file is symmetrically encrypted reguardless of the <code>require_save_key</code>
1539 configuration parameter. The original encryption keys and signing key will be
1540 used when neither of these options are specified.
1541 <br><br>
1542 The <samp>--keyid</samp> and <samp>--sign-keyid</samp> options are not available
1543 to non-invoking clients
1544 (see <a href="#Access-Control">Access Control</a>) when the recipients or signer do not match those
1545 that were used when the file was <code>OPEN</code>&rsquo;ed.
1546 <br><br>
1547 The <samp>--symmetric</samp> option specifies that a new data file be
1548 conventionally encrypted. These types of data files do not use a recipient
1549 public key but may optionally be signed by using the <samp>--sign-keyid</samp>
1550 option. To remove the signing key from a symmtrically encrypted data file,
1551 leave the option value empty.
1552 <br><br>
1553 Note that you cannot change encryption schemes once a data file has been
1554 saved.
1555 </p>
1557 <hr>
1558 <span id="STORE"></span><div class="header">
1560 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>
1561 </div>
1562 <span id="Modifying-the-content-of-an-element_002e"></span><h2 class="chapter">39 Modifying the content of an element.</h2>
1563 <span id="index-STORE-command"></span>
1564 <p>Syntax:
1565 </p><div class="example">
1566 <pre class="example">STORE element[&lt;TAB&gt;child[..]]&lt;TAB&gt;[content]
1567 </pre></div>
1569 <p>This command uses a server <em>INQUIRE</em> to retrieve data from the client.
1570 <br><br>
1571 Creates a new element path or modifies the <var>content</var> of an existing
1572 element. If only a single element is specified then a new root element is
1573 created. Otherwise, elements are <tt class="key">TAB</tt> delimited and the content will be
1574 set to the final <tt class="key">TAB</tt> delimited element. If no <var>content</var> is
1575 specified after the final <tt class="key">TAB</tt>, then the content of the existing
1576 element will be removed; or will be empty if creating a new element.
1577 <br><br>
1578 The only restriction of an element name is that it not contain whitespace
1579 characters. There is no other whitespace between the <tt class="key">TAB</tt> delimited
1580 elements. It is recommended that the content of an element be base64 encoded
1581 when it contains control or <tt class="key">TAB</tt> characters to prevent <abbr>XML</abbr>
1582 parsing and <code>pwmd</code> syntax errors.
1583 </p>
1585 <hr>
1586 <span id="UNLOCK"></span><div class="header">
1588 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>
1589 </div>
1590 <span id="Removing-a-data-file-lock_002e"></span><h2 class="chapter">40 Removing a data file lock.</h2>
1591 <span id="index-UNLOCK-command"></span>
1592 <p>Syntax:
1593 </p><div class="example">
1594 <pre class="example">UNLOCK
1595 </pre></div>
1597 <p>Unlocks the file mutex which was locked with the <code>LOCK</code> command or
1598 a commands&rsquo; <samp>--lock</samp> option (see <a href="#LOCK">LOCK</a>, see <a href="#OPEN">OPEN</a>,
1599 see <a href="#ISCACHED">ISCACHED</a>).
1600 </p>
1602 <hr>
1603 <span id="XPATH"></span><div class="header">
1605 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>
1606 </div>
1607 <span id="Modifying-more-than-one-element_002e"></span><h2 class="chapter">41 Modifying more than one element.</h2>
1608 <span id="index-XPATH-command"></span>
1609 <p>Syntax:
1610 </p><div class="example">
1611 <pre class="example">XPATH [--inquire] &lt;expression&gt;[&lt;TAB&gt;[value]]
1612 </pre></div>
1614 <p>Evaluates an XPath <var>expression</var>. If no <var>value</var> argument is
1615 specified it is assumed the expression is a request to return a result.
1616 Otherwise, the result is set to the <var>value</var> argument and the document is
1617 updated. If there is no <var>value</var> after the <tt class="key">TAB</tt> character, the value
1618 is assumed to be empty and the document is updated. For example:
1619 </p><br>
1620 <div class="example">
1621 <pre class="example">XPATH //element[@_name='password']<span class="key">TAB</span>
1622 </pre></div>
1623 <br>
1624 <p>would clear the content of all <var>password</var> elements in the data file
1625 while leaving off the trailing <tt class="key">TAB</tt> would return all <var>password</var>
1626 elements in <abbr>XML</abbr> format.
1627 <br><br>
1628 When the <samp>--inquire</samp> option is passed then all remaining non-option
1629 arguments are retrieved via a server <em>INQUIRE</em>.
1630 <br><br>
1631 See <a href="http://www.w3schools.com/xpath/xpath_syntax.asp">http://www.w3schools.com/xpath/xpath_syntax.asp</a> for <abbr>XPATH</abbr>
1632 expression syntax.
1633 </p>
1635 <hr>
1636 <span id="XPATHATTR"></span><div class="header">
1638 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>
1639 </div>
1640 <span id="Modifying-more-than-one-element_0027s-attributes_002e"></span><h2 class="chapter">42 Modifying more than one element&rsquo;s attributes.</h2>
1641 <span id="index-XPATHATTR-command"></span>
1642 <p>Syntax:
1643 </p><div class="example">
1644 <pre class="example">XPATHATTR [--inquire] SET|DELETE &lt;name&gt; &lt;expression&gt;[&lt;TAB&gt;[&lt;value&gt;]]
1645 </pre></div>
1647 <p>Like the <code>XPATH</code> command (see <a href="#XPATH">XPATH</a>) but operates on element
1648 attributes and does not return a result. For the <var>SET</var> operation the
1649 <var>value</var> is optional but the field is required. If not specified then
1650 the attribute value will be empty. For example:
1651 </p><br>
1652 <div class="example">
1653 <pre class="example">XPATHATTR SET password //element[@_name='password']<span class="key">TAB</span>
1654 </pre></div>
1655 <br>
1656 <p>would create a <var>password</var> attribute for each <var>password</var> element
1657 found in the document. The attribute value will be empty but still exist.
1658 <br><br>
1659 When the <samp>--inquire</samp> option is passed then all remaining non-option
1660 arguments are retrieved via a server <em>INQUIRE</em>.
1661 <br><br>
1662 See <a href="http://www.w3schools.com/xpath/xpath_syntax.asp">http://www.w3schools.com/xpath/xpath_syntax.asp</a> for <abbr>XPATH</abbr>
1663 expression syntax.
1664 </p>
1667 <hr>
1668 <span id="Bulk-Commands"></span><div class="header">
1670 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>
1671 </div>
1672 <span id="Running-multiple-commands-in-sequence"></span><h2 class="chapter">43 Running multiple commands in sequence</h2>
1673 <p>Multiple commands may be run in sequence by using the <code>BULK</code> command
1674 (see <a href="#BULK">BULK</a>). Using this feature may speed up remote connections since less
1675 socket IO is needed. The <code>BULK</code> command uses an <em>INQUIRE</em> to obtain
1676 an canonical s-expression of commands to be run. The s-expression syntax is as
1677 follows:
1678 </p>
1679 <div class="example">
1680 <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...])
1681 </pre></div>
1683 <p>Each token is prefixed with an unsigned integer that specifies the length of
1684 the token, followed by a colon &rsquo;<code>:</code>&rsquo;, followed by the token itself. Pwmd
1685 uses token pairs to create a <em>name=value</em> relationship. Whitespace is
1686 allowed between token pairs. For example, the following is valid:
1687 </p>
1688 <div class="example">
1689 <pre class="example">( 2:id 7:FirstID 4:LIST0: 2:rc 1:0 (2:id6:Second 7:GETINFO7:version))
1690 </pre></div>
1692 <p>The <code>id</code> token begins a new command and requires an <var>&lt;id&gt;</var> token
1693 of length <var>&lt;I&gt;</var> to uniquely identify this command. The next token pair is
1694 the protocol command name, without any command arguments, of length <var>&lt;P&gt;</var>
1695 to run followed by a colon &rsquo;<code>:</code>&rsquo;, followed by the command <var>&lt;prot&gt;</var>
1696 itself, followed by the length <var>&lt;D&gt;</var> of both command arguments and data,
1697 followed by a colon &rsquo;<code>:</code>&rsquo; and finally the <var>&lt;data&gt;</var> itself. If no
1698 arguments or data are needed for the command, set the length of the data
1699 <var>&lt;D&gt;</var> to <code>0</code> and append the required colon &rsquo;<code>:</code>&rsquo;.
1700 </p>
1701 <p>A new command enclosed in parentheses may be run when the previous command
1702 returns an error code that matches the <var>&lt;code&gt;</var> token of length <var>&lt;R&gt;</var>
1703 by appending <var>rc</var> tokens to the end of the previous commands <var>&lt;data&gt;</var>
1704 token. You may also test another return code for the previous command by
1705 placing the next <var>rc</var> token at the end of the closing parentheses of the
1706 previous return code command.
1707 </p>
1708 <p>Multiple <code>rc</code> <var>code</var>&rsquo;s may be specified for a single command by
1709 separating them with a pipe <code>|</code> character. This lets you specify an
1710 <em>if-this-and-that</em> expression for a commands return code.
1711 </p>
1712 <p>If another command is to be run after the previous and does not specify an
1713 <var>rc</var> token, the return value is ignored for the previous command and the
1714 next command is run. There is no limit on the number of commands or
1715 sub-commands except for system memory.
1716 </p>
1717 <p>After inquiring the commands to be run, <code>BULK</code> will run each command with
1718 <var>&lt;data&gt;</var> as its argument and store the result code and data of the command
1719 in a <code>bulk-result</code> canonical s-expression of the syntax:
1720 </p>
1721 <div class="example">
1722 <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...])
1723 </pre></div>
1725 <p>The <code>11:bulk-result</code> token begins the result of all commands. The
1726 <var>&lt;id&gt;</var> token of length <var>&lt;I&gt;</var> is the same that was associated with the
1727 command from the <em>INQUIRE</em>&rsquo;d syntax and is prefixed with <code>2:id</code>. The
1728 return code of the command is prefixed with <code>2:rc</code> followed by the length
1729 <var>&lt;R&gt;</var> of the unsigned integer <var>&lt;code&gt;</var> then the return <var>&lt;code&gt;</var>
1730 itself. If the command returned any <var>&lt;data&gt;</var>, it is prefixed with a
1731 length <var>&lt;D&gt;</var> and immediately following the return <var>&lt;code&gt;</var>. Otherwise,
1732 <var>&lt;D&gt;</var> will be <code>0</code> and followed by a colon &rsquo;<code>:</code>&rsquo;.
1733 </p>
1735 <hr>
1736 <span id="Status-Messages"></span><div class="header">
1738 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>
1739 </div>
1740 <span id="Status-messages-and-their-meanings"></span><h2 class="chapter">44 Status messages and their meanings</h2>
1741 <p>Some commands send status messages to inform the client about certain
1742 operations or as a progress indicator. Status messages begin with a
1743 <code>KEYWORD</code> followed by a status description for status messages that
1744 require it. What status messages are sent, when, and how often may depend on
1745 configuration settings (see <a href="#Configuration">Configuration</a>).
1746 </p>
1747 <table>
1748 <thead><tr><th width="20%">Message</th><th width="25%">Parameters</th><th width="55%">Description</th></tr></thead>
1749 <tr><td width="20%">CACHE
1750 <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
1751 (see <a href="#GETINFO">GETINFO</a>) and after every cache modification.</td></tr>
1752 <tr><td width="20%">CLIENTS
1753 <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
1754 when another client either connects or disconnects.</td></tr>
1755 <tr><td width="20%">DECRYPT
1756 <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
1757 status message is sent is determined by the <code>keepalive_interval</code>
1758 (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1759 <tr><td width="20%">ENCRYPT
1760 <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
1761 status message is sent is determined by the <code>keepalive_interval</code>
1762 (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1763 <tr><td width="20%">GENKEY
1764 <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
1765 status message is sent is determined by the <code>keepalive_interval</code>
1766 (see <a href="#Configuration">Configuration</a>) setting. The <var>sigkey_fpr</var> and <var>pubkey_fpr</var>
1767 parameters are added when key generation has completed.</td></tr>
1768 <tr><td width="20%">INQUIRE_MAXLEN
1769 <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
1770 specifies the maximum number of bytes allowed for the client to send and
1771 should not be exceeded.</td></tr>
1772 <tr><td width="20%">KEEPALIVE
1773 <span id="index-KEEPALIVE"></span></td><td width="25%"></td><td width="55%">Sent to each idle client every <var>keepalive_interval</var>
1774 (see <a href="#Configuration">Configuration</a>) seconds.</td></tr>
1775 <tr><td width="20%">LOCKED
1776 <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
1777 the mutex associated with a file. How often this status message is sent is
1778 determined by the <code>keepalive_interval</code> (see <a href="#Configuration">Configuration</a>) setting.</td></tr>
1779 <tr><td width="20%">NEWFILE
1780 <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
1781 exist on the file-system.</td></tr>
1782 <tr><td width="20%">XFER
1783 <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
1784 delimited arguments. The first being the current amount of bytes transferred
1785 and the other being the total bytes to be transferred. Note that since version
1786 <code>3.1.1</code> of <code>pwmd</code> this status message is sent only once and
1787 before the transfer begins with the <var>total</var> argument set to the size of the
1788 data and the <var>sent</var> argument set to <code>0</code> leaving it to the client to
1789 determine the progress of the transfer as the data is received.</td></tr>
1790 <tr><td width="20%">STATE
1791 <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
1792 <var>state</var> (see <a href="#GETINFO">GETINFO</a> for client states). For a client to receive
1793 another clients state the option <var>CLIENT-STATE</var> must be set.
1794 See <a href="#OPTION">OPTION</a> command.</td></tr>
1795 <tr><td width="20%">EXPIRE
1796 <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
1797 <code>_expire</code> (see <a href="#Other-Attributes">Other Attributes</a>) attribute that is in the past or when
1798 <code>STORE</code> (see <a href="#STORE">STORE</a>) updates the <code>_expire</code> attribute from the
1799 <code>_age</code> attribute value. The second field will be <code>0</code> when <code>GET</code>
1800 sends this status message. Otherwise the second field is the time the next
1801 expiry will be.</td></tr>
1802 <tr><td width="20%">PASSPHRASE_HINT
1803 <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
1804 <code>pinentry</code>. Only sent when pinentry is disabled (see <a href="#OPTION">OPTION</a>).</td></tr>
1805 <tr><td width="20%">PASSPHRASE_INFO
1806 <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
1807 <code>pinentry</code>. Only sent when pinentry is disabled (see <a href="#OPTION">OPTION</a>).</td></tr>
1808 <tr><td width="20%">REHANDSHAKE
1809 <span id="index-REHANDSHAKE"></span></td><td width="25%"></td><td width="55%">Sent to each TLS client just before performing a cipher renegotiation
1810 after a SIGHUP signal was received.</td></tr>
1811 <tr><td width="20%">BULK
1812 <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
1813 (see <a href="#BULK">BULK</a>) runs each command. The <var>&lt;command id&gt;</var> is the same that was
1814 associated with the command in the s-expression syntax.</td></tr>
1815 </table>
1817 <hr>
1818 <span id="Target-Attribute"></span><div class="header">
1820 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>
1821 </div>
1822 <span id="The-target-attribute"></span><h2 class="chapter">45 The <code>target</code> attribute</h2>
1823 <span id="index-target-attribute"></span>
1824 <p>A <em>case sensitive</em> attribute named <code>_target</code> is treated specially
1825 when found in each element of an element path. This attribute, like other
1826 element attributes, is created or modified with the <code>ATTR</code> command
1827 (see <a href="#ATTR">ATTR</a>). The value of this attribute is an existing element path
1828 somewhere in the document. If you are familiar with XML entities or
1829 maybe the HTML <code>id</code> or <code>_target</code> attributes or a symbolic link
1830 in a file-system, you may find this attribute behaves similar to any of those.
1831 </p>
1832 <p>To create a <code>_target</code> attribute use the following syntax:
1833 </p>
1834 <div class="example">
1835 <pre class="example">ATTR SET _target element[<code>TAB</code>child[..]] element[<code>TAB</code>child[..]]
1836 </pre></div>
1838 <p>Note the single space between the two element paths. The first element path is
1839 where the <code>_target</code> attribute will be created. If the element path does
1840 not exist then it will be created. This is the only time the <code>ATTR</code>
1841 (see <a href="#ATTR">ATTR</a>) command will create elements. The attribute is created in the
1842 final element of the element path.
1843 </p>
1844 <p>The second element path is the destination of where you want the first element
1845 path to resolve to. When an element path is passed as an argument to a
1846 protocol command <code>pwmd</code> looks for a <code>_target</code> attribute when
1847 resolving each element and, if found, &quot;jumps&quot; to the attribute value and
1848 continues resolving any remaining elements a commands element path.
1849 </p>
1850 <p>When an element of a element path is removed that a <code>_target</code> attribute
1851 resolves to then an error will occur when trying to access that element. You
1852 may need to either update the <code>_target</code> attribute value with a new element
1853 path or remove the attribute entirely.
1854 </p>
1855 <p>Clients should be careful of creating <code>_target</code> loops, or targets that
1856 resolve to themselves. See the <var>recursion_depth</var> (see <a href="#Configuration">Configuration</a>)
1857 configuration parameter for details.
1858 </p>
1859 <p>The <code>REALPATH</code> command (see <a href="#REALPATH">REALPATH</a>) can be used to show the element
1860 path after resolving all <code>_target</code> attributes.
1861 </p>
1862 <p><em>Note that when setting this attribute any children of the element will
1863 be removed.</em>
1864 </p>
1866 <hr>
1867 <span id="Other-Attributes"></span><div class="header">
1869 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>
1870 </div>
1871 <span id="Other-special-attributes"></span><h2 class="chapter">46 Other special attributes</h2>
1872 <span id="index-special-attributes"></span>
1873 <p>In addition to the <code>_target</code> attribute (see <a href="#Target-Attribute">Target Attribute</a>), there
1874 are a few other attributes that are specially handled by <code>pwmd</code>. The
1875 first is the <code>_ctime</code> attribute which is set to the current time when an
1876 element is created. Next is the <code>_mtime</code> attribute which is created when
1877 an element is created and also updated when an element is modified. Neither of
1878 these attributes may be modified by the client. The <code>_acl</code> attribute
1879 controls access to the element, beit modifying or accessing element content,
1880 or descending into child elements. See <a href="#Access-Control">Access Control</a> for details. The
1881 <code>_name</code> attribute contains the name of an element.
1882 </p>
1883 <p>The above mentioned attributes are considered reserved attribute names.
1884 Reserved attributes are treated specially when a <code>_target</code> attribute is
1885 found for the current element. The <code>ATTR LIST</code> command will show these
1886 attribute values for the current element and not the attribute values for the
1887 resolved <code>_target</code> element. All other non-reserved attributes for the
1888 resolved <code>_target</code> are appended to the <code>ATTR LIST</code> command output.
1889 Other <code>ATTR</code> commands (see <a href="#ATTR">ATTR</a>) behave as usual. You can, for
1890 example, <code>ATTR DELETE</code> a non-reserved attribute for an element that
1891 contains a <code>_target</code> attribute. The resolved target elements&rsquo; attribute
1892 will be removed rather than the element containing the <code>_target</code>
1893 attribute.
1894 </p>
1895 <p>Another specially handled attribute is the <code>_expire</code> attribute. This
1896 attribute value, like the <code>_ctime</code> and <code>_mtime</code> attributes, is a
1897 timestamp. But this timestamp is usually in the future and for use with the
1898 <code>GET</code> (see <a href="#GET">GET</a>) and <code>STORE</code> (see <a href="#STORE">STORE</a>) commands. When the
1899 <code>GET</code> command is issued, it checks for an <code>_expire</code> attribute an
1900 compares its&rsquo; value with the current time. If the <code>_expire</code> timestamp is
1901 in the past then a status message is sent (see <a href="#Status-Messages">Status Messages</a>) to inform
1902 the client that the element content should be updated. When the content for
1903 an element containing an <code>_expire</code> attribute is set when using the
1904 <code>STORE</code> command, the value of the <code>_age</code> attribute is added to the
1905 current time and the <code>_expire</code> attribute value is updated. When no
1906 <code>_age</code> attribute is found, no modification is done of the <code>_expire</code>
1907 attribute.
1908 </p>
1910 <hr>
1911 <span id="Key-Expiration"></span><div class="header">
1913 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>
1914 </div>
1915 <span id="Key-Expiration-1"></span><h2 class="chapter">47 Key Expiration</h2>
1916 <span id="index-key-expiration"></span>
1917 <p>When a key used for signing a data file has expired there is no indication
1918 until the next <code>SAVE</code> command is sent. The command will fail since one
1919 cannot sign the data file with an expired key. The client will need to either
1920 use a different key for signing by either specifying an existing non-expired
1921 key, generate a new key, or change the expire time of the existing key with
1922 <code>gpg</code>.
1923 </p>
1924 <p>To change the expiration of the currently used signing key with <code>gpg</code>,
1925 use the <code>KEYINFO</code> command (see <a href="#KEYINFO">KEYINFO</a>) to obtain the fingerprint of
1926 the signing key of the current data file, then change the expire time with
1927 <code>gpg</code>:
1928 </p>
1929 <div class="example">
1930 <pre class="example">gpg --homedir ~/.pwmd/.gnupg --edit-key &lt;fingerprint&gt;
1931 </pre></div>
1933 <p>Then use the <code>expire</code> command to set the new key expire date. When
1934 finished, use the <code>save</code> command to save your changes.
1935 </p>
1937 <hr>
1938 <span id="Signals"></span><div class="header">
1940 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>
1941 </div>
1942 <span id="Recognized-signals"></span><h2 class="chapter">48 Recognized signals</h2>
1944 <p>Sending the <em>SIGHUP</em> signal to a <code>pwmd</code> process will reload the
1945 configuration file and sending <em>SIGUSR1</em> will clear the entire file
1946 cache.
1947 </p>
1950 <hr>
1951 <span id="Concept-Index"></span><div class="header">
1953 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>
1954 </div>
1955 <span id="Concept-Index-1"></span><h2 class="unnumbered">Concept Index</h2>
1958 <span id="SEC_Overview"></span>
1959 <h2 class="shortcontents-heading">Short Table of Contents</h2>
1961 <div class="shortcontents">
1962 <ul class="no-bullet">
1963 <li><a id="stoc-Overview-of-pwmd" href="#toc-Overview-of-pwmd">1 Overview of <code>pwmd</code></a></li>
1964 <li><a id="stoc-Access-Control-1" href="#toc-Access-Control-1">2 Access Control</a></li>
1965 <li><a id="stoc-Cache-Control-1" href="#toc-Cache-Control-1">3 Cache Control</a></li>
1966 <li><a id="stoc-Invoking-pwmd" href="#toc-Invoking-pwmd">4 Invoking <code>pwmd</code></a></li>
1967 <li><a id="stoc-pwmd-configuration-file-options" href="#toc-pwmd-configuration-file-options">5 <code>pwmd</code> configuration file options</a></li>
1968 <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>
1969 <li><a id="stoc-Pinentry-configuration" href="#toc-Pinentry-configuration">7 Pinentry configuration</a></li>
1970 <li><a id="stoc-Protocol-commands-and-their-syntax" href="#toc-Protocol-commands-and-their-syntax">8 Protocol commands and their syntax</a></li>
1971 <li><a id="stoc-Modifying-element-attributes_002e" href="#toc-Modifying-element-attributes_002e">9 Modifying element attributes.</a></li>
1972 <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>
1973 <li><a id="stoc-Setting-the-cache-timeout_002e" href="#toc-Setting-the-cache-timeout_002e">11 Setting the cache timeout.</a></li>
1974 <li><a id="stoc-Removing-a-cache-entry_002e" href="#toc-Removing-a-cache-entry_002e">12 Removing a cache entry.</a></li>
1975 <li><a id="stoc-Copying-an-element_002e" href="#toc-Copying-an-element_002e">13 Copying an element.</a></li>
1976 <li><a id="stoc-Deleting-an-element_002e" href="#toc-Deleting-an-element_002e">14 Deleting an element.</a></li>
1977 <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>
1978 <li><a id="stoc-Showing-the-XML-document_002e" href="#toc-Showing-the-XML-document_002e">16 Showing the XML document.</a></li>
1979 <li><a id="stoc-Generating-a-new-key_002e" href="#toc-Generating-a-new-key_002e">17 Generating a new key.</a></li>
1980 <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>
1981 <li><a id="stoc-Obtaining-a-configuration-value_002e" href="#toc-Obtaining-a-configuration-value_002e">19 Obtaining a configuration value.</a></li>
1982 <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>
1983 <li><a id="stoc-Showing-available-commands_002e" href="#toc-Showing-available-commands_002e">21 Showing available commands.</a></li>
1984 <li><a id="stoc-Creating-elements-from-XML_002e" href="#toc-Creating-elements-from-XML_002e">22 Creating elements from XML.</a></li>
1985 <li><a id="stoc-Testing-cache-status_002e" href="#toc-Testing-cache-status_002e">23 Testing cache status.</a></li>
1986 <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>
1987 <li><a id="stoc-Terminating-another-client_002e" href="#toc-Terminating-another-client_002e">25 Terminating another client.</a></li>
1988 <li><a id="stoc-Showing-document-elements_002e" href="#toc-Showing-document-elements_002e">26 Showing document elements.</a></li>
1989 <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>
1990 <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>
1991 <li><a id="stoc-Showing-available-data-files_002e" href="#toc-Showing-available-data-files_002e">29 Showing available data files.</a></li>
1992 <li><a id="stoc-Moving-an-element_002e" href="#toc-Moving-an-element_002e">30 Moving an element.</a></li>
1993 <li><a id="stoc-Testing-the-connection_002e" href="#toc-Testing-the-connection_002e">31 Testing the connection.</a></li>
1994 <li><a id="stoc-Opening-a-data-file_002e" href="#toc-Opening-a-data-file_002e">32 Opening a data file.</a></li>
1995 <li><a id="stoc-Setting-various-client-parameters_002e" href="#toc-Setting-various-client-parameters_002e">33 Setting various client parameters.</a></li>
1996 <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>
1997 <li><a id="stoc-Resolving-an-element_002e" href="#toc-Resolving-an-element_002e">35 Resolving an element.</a></li>
1998 <li><a id="stoc-Renaming-an-element_002e" href="#toc-Renaming-an-element_002e">36 Renaming an element.</a></li>
1999 <li><a id="stoc-Resetting-the-client-state_002e" href="#toc-Resetting-the-client-state_002e">37 Resetting the client state.</a></li>
2000 <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>
2001 <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>
2002 <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>
2003 <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>
2004 <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>
2005 <li><a id="stoc-Running-multiple-commands-in-sequence" href="#toc-Running-multiple-commands-in-sequence">43 Running multiple commands in sequence</a></li>
2006 <li><a id="stoc-Status-messages-and-their-meanings" href="#toc-Status-messages-and-their-meanings">44 Status messages and their meanings</a></li>
2007 <li><a id="stoc-The-target-attribute" href="#toc-The-target-attribute">45 The <code>target</code> attribute</a></li>
2008 <li><a id="stoc-Other-special-attributes" href="#toc-Other-special-attributes">46 Other special attributes</a></li>
2009 <li><a id="stoc-Key-Expiration-1" href="#toc-Key-Expiration-1">47 Key Expiration</a></li>
2010 <li><a id="stoc-Recognized-signals" href="#toc-Recognized-signals">48 Recognized signals</a></li>
2011 <li><a id="stoc-Concept-Index-1" href="#toc-Concept-Index-1">Concept Index</a></li>
2013 </ul>
2014 </div>
2016 <span id="SEC_Contents"></span>
2017 <h2 class="contents-heading">Table of Contents</h2>
2019 <div class="contents">
2020 <ul class="no-bullet">
2021 <li><a id="toc-Overview-of-pwmd" href="#Introduction">1 Overview of <code>pwmd</code></a></li>
2022 <li><a id="toc-Access-Control-1" href="#Access-Control">2 Access Control</a></li>
2023 <li><a id="toc-Cache-Control-1" href="#Cache-Control">3 Cache Control</a></li>
2024 <li><a id="toc-Invoking-pwmd" href="#Invoking">4 Invoking <code>pwmd</code></a></li>
2025 <li><a id="toc-pwmd-configuration-file-options" href="#Configuration">5 <code>pwmd</code> configuration file options</a></li>
2026 <li><a id="toc-Configuring-remote-connections-over-TLS_002e" href="#TLS">6 Configuring remote connections over TLS.</a></li>
2027 <li><a id="toc-Pinentry-configuration" href="#Pinentry">7 Pinentry configuration</a></li>
2028 <li><a id="toc-Protocol-commands-and-their-syntax" href="#Commands">8 Protocol commands and their syntax</a></li>
2029 <li><a id="toc-Modifying-element-attributes_002e" href="#ATTR">9 Modifying element attributes.</a></li>
2030 <li><a id="toc-Run-a-series-of-commands-in-sequence_002e" href="#BULK">10 Run a series of commands in sequence.</a></li>
2031 <li><a id="toc-Setting-the-cache-timeout_002e" href="#CACHETIMEOUT">11 Setting the cache timeout.</a></li>
2032 <li><a id="toc-Removing-a-cache-entry_002e" href="#CLEARCACHE">12 Removing a cache entry.</a></li>
2033 <li><a id="toc-Copying-an-element_002e" href="#COPY">13 Copying an element.</a></li>
2034 <li><a id="toc-Deleting-an-element_002e" href="#DELETE">14 Deleting an element.</a></li>
2035 <li><a id="toc-Deleting-a-key-from-the-key-ring_002e" href="#DELETEKEY">15 Deleting a key from the key ring.</a></li>
2036 <li><a id="toc-Showing-the-XML-document_002e" href="#DUMP">16 Showing the XML document.</a></li>
2037 <li><a id="toc-Generating-a-new-key_002e" href="#GENKEY">17 Generating a new key.</a></li>
2038 <li><a id="toc-Getting-the-content-of-an-element_002e" href="#GET">18 Getting the content of an element.</a></li>
2039 <li><a id="toc-Obtaining-a-configuration-value_002e" href="#GETCONFIG">19 Obtaining a configuration value.</a></li>
2040 <li><a id="toc-Obtaining-server-and-client-information_002e" href="#GETINFO">20 Obtaining server and client information.</a></li>
2041 <li><a id="toc-Showing-available-commands_002e" href="#HELP">21 Showing available commands.</a></li>
2042 <li><a id="toc-Creating-elements-from-XML_002e" href="#IMPORT">22 Creating elements from XML.</a></li>
2043 <li><a id="toc-Testing-cache-status_002e" href="#ISCACHED">23 Testing cache status.</a></li>
2044 <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>
2045 <li><a id="toc-Terminating-another-client_002e" href="#KILL">25 Terminating another client.</a></li>
2046 <li><a id="toc-Showing-document-elements_002e" href="#LIST">26 Showing document elements.</a></li>
2047 <li><a id="toc-Listing-keys-in-the-key-ring_002e" href="#LISTKEYS">27 Listing keys in the key ring.</a></li>
2048 <li><a id="toc-Locking-the-current-data-file_002e" href="#LOCK">28 Locking the current data file.</a></li>
2049 <li><a id="toc-Showing-available-data-files_002e" href="#LS">29 Showing available data files.</a></li>
2050 <li><a id="toc-Moving-an-element_002e" href="#MOVE">30 Moving an element.</a></li>
2051 <li><a id="toc-Testing-the-connection_002e" href="#NOP">31 Testing the connection.</a></li>
2052 <li><a id="toc-Opening-a-data-file_002e" href="#OPEN">32 Opening a data file.</a></li>
2053 <li><a id="toc-Setting-various-client-parameters_002e" href="#OPTION">33 Setting various client parameters.</a></li>
2054 <li><a id="toc-Changing-the-passphrase-for-a-key_002e" href="#PASSWD">34 Changing the passphrase for a key.</a></li>
2055 <li><a id="toc-Resolving-an-element_002e" href="#REALPATH">35 Resolving an element.</a></li>
2056 <li><a id="toc-Renaming-an-element_002e" href="#RENAME">36 Renaming an element.</a></li>
2057 <li><a id="toc-Resetting-the-client-state_002e" href="#RESET">37 Resetting the client state.</a></li>
2058 <li><a id="toc-Saving-document-changes-to-disk_002e" href="#SAVE">38 Saving document changes to disk.</a></li>
2059 <li><a id="toc-Modifying-the-content-of-an-element_002e" href="#STORE">39 Modifying the content of an element.</a></li>
2060 <li><a id="toc-Removing-a-data-file-lock_002e" href="#UNLOCK">40 Removing a data file lock.</a></li>
2061 <li><a id="toc-Modifying-more-than-one-element_002e" href="#XPATH">41 Modifying more than one element.</a></li>
2062 <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>
2063 <li><a id="toc-Running-multiple-commands-in-sequence" href="#Bulk-Commands">43 Running multiple commands in sequence</a></li>
2064 <li><a id="toc-Status-messages-and-their-meanings" href="#Status-Messages">44 Status messages and their meanings</a></li>
2065 <li><a id="toc-The-target-attribute" href="#Target-Attribute">45 The <code>target</code> attribute</a></li>
2066 <li><a id="toc-Other-special-attributes" href="#Other-Attributes">46 Other special attributes</a></li>
2067 <li><a id="toc-Key-Expiration-1" href="#Key-Expiration">47 Key Expiration</a></li>
2068 <li><a id="toc-Recognized-signals" href="#Signals">48 Recognized signals</a></li>
2069 <li><a id="toc-Concept-Index-1" href="#Concept-Index">Concept Index</a></li>
2071 </ul>
2072 </div>
2074 <hr>
2078 </body>
2079 </html>