Blame doc/uiserver.texi

Packit d7e8d0
@c uiserver.texi                    -*- mode: texinfo; coding: latin-1; -*-
Packit d7e8d0
@c Specification of the UI server protocol.
Packit d7e8d0
@c To be included by gpgme.texi
Packit d7e8d0
Packit d7e8d0
@node UI Server Protocol
Packit d7e8d0
@appendix The GnuPG UI Server Protocol
Packit d7e8d0
@cindex UI server
Packit d7e8d0
@cindex user interface server
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
This section specifies the protocol used between clients and a User
Packit d7e8d0
Interface Server (UI server).  This protocol helps to build a system
Packit d7e8d0
where all cryptographic operations are done by a server and the server
Packit d7e8d0
is responsible for all dialogs.  Although @acronym{GPGME} has no direct
Packit d7e8d0
support for this protocol it is believed that servers will utilize the
Packit d7e8d0
@acronym{GPGME} library; thus having the specification included in this
Packit d7e8d0
manual is an appropriate choice.  This protocol should be referenced as
Packit d7e8d0
`The GnuPG UI Server Protocol'.
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
A server needs to implement these commands:@footnote{In all examples we
Packit d7e8d0
assume that the connection has already been established; see the Assuan
Packit d7e8d0
manual for details.}
Packit d7e8d0
Packit d7e8d0
@menu
Packit d7e8d0
* UI Server Encrypt::                Encrypt a message.
Packit d7e8d0
* UI Server Sign::                   Sign a message.
Packit d7e8d0
* UI Server Decrypt::                Decrypt a message.
Packit d7e8d0
* UI Server Verify::                 Verify a message.
Packit d7e8d0
* UI Server Set Input Files::        Specifying the input files to operate on.
Packit d7e8d0
* UI Server Sign/Encrypt Files::     Encrypting and signing files.
Packit d7e8d0
* UI Server Verify/Decrypt Files::   Decrypting and verifying files.
Packit d7e8d0
* UI Server Import/Export Keys::     Managing certificates.
Packit d7e8d0
* UI Server Checksum Files::         Create and verify checksums for files.
Packit d7e8d0
* Miscellaneous UI Server Commands::   Commands not related to a specific operation.
Packit d7e8d0
@end menu
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Encrypt
Packit d7e8d0
@section UI Server: Encrypt a Message
Packit d7e8d0
Packit d7e8d0
Before encryption can be done the recipients must be set using the
Packit d7e8d0
command:
Packit d7e8d0
Packit d7e8d0
@deffn Command RECIPIENT @var{string}
Packit d7e8d0
Packit d7e8d0
Set the recipient for the encryption.  @var{string} is an RFC-2822
Packit d7e8d0
recipient name ("mailbox" as per section 3.4).  This command may or may
Packit d7e8d0
not check the recipient for validity right away; if it does not all
Packit d7e8d0
recipients are expected to be checked at the time of the @code{ENCRYPT}
Packit d7e8d0
command.  All @code{RECIPIENT} commands are cumulative until a
Packit d7e8d0
successful @code{ENCRYPT} command or until a @code{RESET} command.
Packit d7e8d0
Linefeeds are obviously not allowed in @var{string} and should be folded
Packit d7e8d0
into spaces (which are equivalent).
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
To tell the server the source and destination of the data, the next two
Packit d7e8d0
commands are to be used:
Packit d7e8d0
Packit d7e8d0
@deffn Command INPUT FD=@var{n}
Packit d7e8d0
Set the file descriptor for the message to be encrypted to @var{n}.  The
Packit d7e8d0
message send to the server is binary encoded.
Packit d7e8d0
Packit d7e8d0
GpgOL is a Windows only program, thus @var{n} is not a libc file
Packit d7e8d0
descriptor but a regular system handle.  Given that the Assuan
Packit d7e8d0
connection works over a socket, it is not possible to use regular
Packit d7e8d0
inheritance to make the file descriptor available to the server.
Packit d7e8d0
Thus @code{DuplicateHandle} needs to be used to duplicate a handle
Packit d7e8d0
to the server process.  This is the reason that the server needs to
Packit d7e8d0
implement the @code{GETINFO pid} command.  Sending this command a second
Packit d7e8d0
time replaces the file descriptor set by the last one.
Packit d7e8d0
@c If @var{n} is not given, this commands uses the
Packit d7e8d0
@c %last file descriptor passed to the application.
Packit d7e8d0
@c %@xref{fun-assuan_sendfd, ,the assuan_sendfd function,assuan,the
Packit d7e8d0
@c %Libassuan manual}, on how to do descriptor passing.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@deffn Command OUTPUT FD=@var{n} [--binary]
Packit d7e8d0
Set the file descriptor to be used for the output (i.e. the encrypted
Packit d7e8d0
message) to @var{n}.  If the option @code{--binary} is given the
Packit d7e8d0
output shall be in binary format; if not given, the output for OpenPGP
Packit d7e8d0
needs to be ASCII armored and for CMS Base-64 encoded.  For details on
Packit d7e8d0
the file descriptor, see the @code{INPUT} command.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
The setting of the recipients, the data source and destination may
Packit d7e8d0
happen in any order, even intermixed.  If this has been done the actual
Packit d7e8d0
encryption operation is called using:
Packit d7e8d0
Packit d7e8d0
@deffn Command ENCRYPT -@w{}-protocol=@var{name}
Packit d7e8d0
Packit d7e8d0
This command reads the plaintext from the file descriptor set by the
Packit d7e8d0
@code{INPUT} command, encrypts it and writes the ciphertext to the file
Packit d7e8d0
descriptor set by the @code{OUTPUT} command.  The server may (and
Packit d7e8d0
should) overlap reading and writing.  The recipients used for the
Packit d7e8d0
encryption are all the recipients set so far.  If any recipient is not
Packit d7e8d0
usable the server should take appropriate measures to notify the user
Packit d7e8d0
about the problem and may cancel the operation by returning an error
Packit d7e8d0
code.  The used file descriptors are void after this command; the
Packit d7e8d0
recipient list is only cleared if the server returns success.
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
Because GpgOL uses a streaming mode of operation the server is not
Packit d7e8d0
allowed to auto select the protocol and must obey to the mandatory
Packit d7e8d0
@var{protocol} parameter:
Packit d7e8d0
Packit d7e8d0
@table @code
Packit d7e8d0
@item OpenPGP
Packit d7e8d0
Use the OpenPGP protocol (RFC-2440).
Packit d7e8d0
@item CMS
Packit d7e8d0
Use the CMS (PKCS#7) protocol (RFC-3852).
Packit d7e8d0
@end table
Packit d7e8d0
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
To support automagically selection of the protocol depending on the
Packit d7e8d0
selected keys, the server MAY implement the command:
Packit d7e8d0
Packit d7e8d0
@deffn Command PREP_ENCRYPT [-@w{}-protocol=@var{name}] [-@w{}-expect-sign]
Packit d7e8d0
Packit d7e8d0
This commands considers all recipients set so far and decides whether it
Packit d7e8d0
is able to take input and start the actual encryption.  This is kind of
Packit d7e8d0
a dry-run @command{ENCRYPT} without requiring or using the input and
Packit d7e8d0
output file descriptors.  The server shall cache the result of any user
Packit d7e8d0
selection to avoid asking this again when the actual @command{ENCRYPT}
Packit d7e8d0
command is send.  The @option{--protocol} option is optional; if it is
Packit d7e8d0
not given, the server should allow the user to select the protocol to be
Packit d7e8d0
used based on the recipients given or by any other means.
Packit d7e8d0
Packit d7e8d0
If @option{--expect-sign} is given the server should expect that the
Packit d7e8d0
message will also be signed and use this hint to present a unified
Packit d7e8d0
recipient and signer selection dialog if possible and desired.  A
Packit d7e8d0
selected signer should then be cached for the expected SIGN command
Packit d7e8d0
(which is expected in the same session but possible on another
Packit d7e8d0
connection).
Packit d7e8d0
Packit d7e8d0
If this command is given again before a successful @command{ENCRYPT}
Packit d7e8d0
command, the second one takes effect.
Packit d7e8d0
Packit d7e8d0
Before sending the OK response the server shall tell the client the
Packit d7e8d0
protocol to be used (either the one given by the argument or the one
Packit d7e8d0
selected by the user) by means of a status line:
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@deffn {Status line} PROTOCOL @var{name}
Packit d7e8d0
Advise the client to use the protocol @var{name} for the
Packit d7e8d0
@command{ENCRYPT} command.  The valid protocol names are listed under
Packit d7e8d0
the description of the @command{ENCRYPT} command.  The server shall emit
Packit d7e8d0
exactly one PROTOCOL status line.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
Here is an example of a complete encryption sequence; client lines are
Packit d7e8d0
indicated by a @sc{c:}, server responses by @sc{c:}:
Packit d7e8d0
Packit d7e8d0
@smallexample
Packit d7e8d0
@group
Packit d7e8d0
  @clnt{RESET}
Packit d7e8d0
  @srvr{OK}
Packit d7e8d0
  @clnt{RECIPIENT foo@@example.net}
Packit d7e8d0
  @srvr{OK}
Packit d7e8d0
  @clnt{RECIPIENT bar@@example.com}
Packit d7e8d0
  @srvr{OK}
Packit d7e8d0
  @clnt{PREP_ENCRYPT}
Packit d7e8d0
  @srvr{S PROTOCOL OpenPGP}
Packit d7e8d0
  @srvr{OK}
Packit d7e8d0
  @clnt{INPUT FD=17}
Packit d7e8d0
  @srvr{OK}
Packit d7e8d0
  @clnt{OUTPUT FD=18}
Packit d7e8d0
  @srvr{OK}
Packit d7e8d0
  @clnt{ENCRYPT}
Packit d7e8d0
  @srvr{OK}
Packit d7e8d0
@end group
Packit d7e8d0
@end smallexample
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Sign
Packit d7e8d0
@section UI Server: Sign a Message
Packit d7e8d0
Packit d7e8d0
The server needs to implement opaque signing as well as detached
Packit d7e8d0
signing.  Due to the nature of OpenPGP messages it is always required to
Packit d7e8d0
send the entire message to the server; sending just the hash is not
Packit d7e8d0
possible.  The following two commands are required to set the input and
Packit d7e8d0
output file descriptors:
Packit d7e8d0
Packit d7e8d0
@deffn Command INPUT FD=@var{n}
Packit d7e8d0
Set the file descriptor for the message to be signed to @var{n}.  The
Packit d7e8d0
message send to the server is binary encoded.  For details on the file
Packit d7e8d0
descriptor, see the description of @code{INPUT} in the @code{ENCRYPT}
Packit d7e8d0
section.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@deffn Command OUTPUT FD=@var{n} [--binary]
Packit d7e8d0
Set the file descriptor to be used for the output.  The output is
Packit d7e8d0
either the complete signed message or in case of a detached signature
Packit d7e8d0
just that detached signature.  If the option @code{--binary} is given
Packit d7e8d0
the output shall be in binary format; if not given, the output for
Packit d7e8d0
OpenPGP needs to be ASCII armored and for CMS Base-64 encoded.  For
Packit d7e8d0
details on the file descriptor, see the @code{INPUT} command.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
To allow the server the selection of a non-default signing key the
Packit d7e8d0
client may optionally use the @code{SENDER} command, see @ref{command
Packit d7e8d0
SENDER}.
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
The signing operation is then initiated by:
Packit d7e8d0
Packit d7e8d0
@deffn Command SIGN -@w{}-protocol=@var{name} [-@w{}-detached]
Packit d7e8d0
Sign the data set with the @code{INPUT} command and write it to the sink
Packit d7e8d0
set by OUTPUT.  @var{name} is the signing protocol used for the
Packit d7e8d0
message. For a description of the allowed protocols see the
Packit d7e8d0
@code{ENCRYPT} command.  With option @code{--detached} given, a detached
Packit d7e8d0
signature is created; this is actually the usual way the command is
Packit d7e8d0
used.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
The client expects the server to send at least this status information
Packit d7e8d0
before the final OK response:
Packit d7e8d0
Packit d7e8d0
@deffn {Status line} MICALG @var{string}
Packit d7e8d0
The @var{string} represents the hash algorithm used to create the
Packit d7e8d0
signature. It is used with RFC-1847 style signature messages and defined by
Packit d7e8d0
PGP/MIME (RFC-3156) and S/MIME (RFC-3851).  The GPGME library has a
Packit d7e8d0
supporting function @code{gpgme_hash_algo_name} to return the algorithm
Packit d7e8d0
name as a string.  This string needs to be lowercased and for OpenPGP
Packit d7e8d0
prefixed with "@code{pgp-}".
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Decrypt
Packit d7e8d0
@section UI Server: Decrypt a Message
Packit d7e8d0
Packit d7e8d0
Decryption may include the verification of OpenPGP messages.  This is
Packit d7e8d0
due to the often used combined signing/encryption modus of OpenPGP.  The
Packit d7e8d0
client may pass an option to the server to inhibit the signature
Packit d7e8d0
verification.  The following two commands are required to set the input
Packit d7e8d0
and output file descriptors:
Packit d7e8d0
Packit d7e8d0
@deffn Command INPUT FD=@var{n}
Packit d7e8d0
Set the file descriptor for the message to be decrypted to @var{n}.  The
Packit d7e8d0
message send to the server is either binary encoded or --- in the case
Packit d7e8d0
of OpenPGP --- ASCII armored.  For details on the file descriptor, see
Packit d7e8d0
the description of @code{INPUT} in the @code{ENCRYPT} section.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@deffn Command OUTPUT FD=@var{n}
Packit d7e8d0
Set the file descriptor to be used for the output. The output is binary
Packit d7e8d0
encoded. For details on the file descriptor, see the description of
Packit d7e8d0
@code{INPUT} in the @code{ENCRYPT} section.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
The decryption is started with the command:
Packit d7e8d0
Packit d7e8d0
@deffn Command DECRYPT -@w{}-protocol=@var{name} [-@w{}-no-verify] [-@w{}-export-session-key]
Packit d7e8d0
@var{name} is the encryption protocol used for the message. For a
Packit d7e8d0
description of the allowed protocols see the @code{ENCRYPT} command.
Packit d7e8d0
This argument is mandatory.  If the option @option{--no-verify} is
Packit d7e8d0
given, the server should not try to verify a signature, in case the
Packit d7e8d0
input data is an OpenPGP combined message. If the option
Packit d7e8d0
@option{--export-session-key} is given and the underlying engine knows
Packit d7e8d0
how to export the session key, it will appear on a status line
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Verify
Packit d7e8d0
@section UI Server: Verify a Message
Packit d7e8d0
Packit d7e8d0
The server needs to support the verification of opaque signatures as
Packit d7e8d0
well as detached signatures.  The kind of input sources controls what
Packit d7e8d0
kind message is to be verified.
Packit d7e8d0
Packit d7e8d0
@deffn Command MESSAGE FD=@var{n}
Packit d7e8d0
This command is used with detached signatures to set the file descriptor
Packit d7e8d0
for the signed data to @var{n}. The data is binary encoded (used
Packit d7e8d0
verbatim).  For details on the file descriptor, see the description of
Packit d7e8d0
@code{INPUT} in the @code{ENCRYPT} section.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@deffn Command INPUT FD=@var{n}
Packit d7e8d0
Set the file descriptor for the opaque message or the signature part of
Packit d7e8d0
a detached signature to @var{n}.  The message send to the server is
Packit d7e8d0
either binary encoded or -- in the case of OpenPGP -- ASCII armored.
Packit d7e8d0
For details on the file descriptor, see the description of @code{INPUT}
Packit d7e8d0
in the @code{ENCRYPT} section.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@deffn Command OUTPUT FD=@var{n}
Packit d7e8d0
Set the file descriptor to be used for the output. The output is binary
Packit d7e8d0
encoded and only used for opaque signatures.  For details on the file
Packit d7e8d0
descriptor, see the description of @code{INPUT} in the @code{ENCRYPT}
Packit d7e8d0
section.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
The verification is then started using:
Packit d7e8d0
Packit d7e8d0
@deffn Command VERIFY -@w{}-protocol=@var{name} [-@w{}-silent]
Packit d7e8d0
@var{name} is the signing protocol used for the message. For a
Packit d7e8d0
description of the allowed protocols see the @code{ENCRYPT} command.
Packit d7e8d0
This argument is mandatory.  Depending on the combination of
Packit d7e8d0
@code{MESSAGE} @code{INPUT} and @code{OUTPUT} commands, the server needs
Packit d7e8d0
to select the appropriate verification mode:
Packit d7e8d0
Packit d7e8d0
@table @asis
Packit d7e8d0
@item MESSAGE and INPUT
Packit d7e8d0
This indicates a detached signature.  Output data is not applicable.
Packit d7e8d0
@item INPUT
Packit d7e8d0
This indicates an opaque signature.  As no output command has been given,
Packit d7e8d0
the server is only required to check the signature.
Packit d7e8d0
@item INPUT and OUTPUT
Packit d7e8d0
This indicates an opaque signature.  The server shall write the signed
Packit d7e8d0
data to the file descriptor set by the output command.  This data shall
Packit d7e8d0
even be written if the signatures can't be verified.
Packit d7e8d0
@end table
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
With @option{--silent} the server shall not display any dialog; this is
Packit d7e8d0
for example used by the client to get the content of opaque signed
Packit d7e8d0
messages. The client expects the server to send at least this status
Packit d7e8d0
information before the final OK response:
Packit d7e8d0
Packit d7e8d0
@deffn {Status line} SIGSTATUS @var{flag} @var{displaystring}
Packit d7e8d0
Returns the status for the signature and a short string explaining the
Packit d7e8d0
status.  Valid values for @var{flag} are:
Packit d7e8d0
Packit d7e8d0
@table @code
Packit d7e8d0
@item none
Packit d7e8d0
The message has a signature but it could not not be verified due to a
Packit d7e8d0
missing key.
Packit d7e8d0
@item green
Packit d7e8d0
The signature is fully valid.
Packit d7e8d0
@item yellow
Packit d7e8d0
The signature is valid but additional information was shown regarding the
Packit d7e8d0
validity of the key.
Packit d7e8d0
@item red
Packit d7e8d0
The signature is not valid.
Packit d7e8d0
@end table
Packit d7e8d0
Packit d7e8d0
@var{displaystring} is a percent-and-plus-encoded string with a short
Packit d7e8d0
human readable description of the status.  For example
Packit d7e8d0
Packit d7e8d0
@smallexample
Packit d7e8d0
S SIGSTATUS green Good+signature+from+Keith+Moon+<keith@@example.net>
Packit d7e8d0
@end smallexample
Packit d7e8d0
Packit d7e8d0
Note that this string needs to fit into an Assuan line and should be
Packit d7e8d0
short enough to be displayed as short one-liner on the clients window.
Packit d7e8d0
As usual the encoding of this string is UTF-8 and it should be send in
Packit d7e8d0
its translated form.
Packit d7e8d0
Packit d7e8d0
The server shall send one status line for every signature found on the
Packit d7e8d0
message.
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Set Input Files
Packit d7e8d0
@section UI Server: Specifying the input files to operate on.
Packit d7e8d0
Packit d7e8d0
All file related UI server commands operate on a number of input files
Packit d7e8d0
or directories, specified by one or more @code{FILE} commands:
Packit d7e8d0
Packit d7e8d0
@deffn Command FILE [--clear] @var{name}
Packit d7e8d0
Add the file or directory @var{name} to the list of pathnames to be
Packit d7e8d0
processed by the server.  The parameter @var{name} must be an absolute
Packit d7e8d0
path name (including the drive letter) and is percent espaced (in
Packit d7e8d0
particular, the characters %, = and white space characters are always
Packit d7e8d0
escaped).  If the option @code{--clear} is given, the list of files is
Packit d7e8d0
cleared before adding @var{name}.
Packit d7e8d0
Packit d7e8d0
Historical note: The original spec did not define @code{--clear} but
Packit d7e8d0
the keyword @code{--continued} after the file name to indicate that
Packit d7e8d0
more files are to be expected.  However, this has never been used and
Packit d7e8d0
thus removed from the specs.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Sign/Encrypt Files
Packit d7e8d0
@section UI Server: Encrypting and signing files.
Packit d7e8d0
Packit d7e8d0
First, the input files need to be specified by one or more
Packit d7e8d0
@code{FILE} commands.  Afterwards, the actual operation is requested:
Packit d7e8d0
Packit d7e8d0
@deffn Command ENCRYPT_FILES --nohup
Packit d7e8d0
@deffnx Command SIGN_FILES --nohup
Packit d7e8d0
@deffnx Command ENCRYPT_SIGN_FILES --nohup
Packit d7e8d0
Request that the files specified by @code{FILE} are encrypted and/or
Packit d7e8d0
signed.  The command selects the default action.  The UI server may
Packit d7e8d0
allow the user to change this default afterwards interactively, and
Packit d7e8d0
even abort the operation or complete it only on some of the selected
Packit d7e8d0
files and directories.
Packit d7e8d0
Packit d7e8d0
What it means to encrypt or sign a file or directory is specific to
Packit d7e8d0
the preferences of the user, the functionality the UI server provides,
Packit d7e8d0
and the selected protocol.  Typically, for each input file a new file
Packit d7e8d0
is created under the original filename plus a protocol specific
Packit d7e8d0
extension (like @code{.gpg} or @code{.sig}), which contain the
Packit d7e8d0
encrypted/signed file or a detached signature.  For directories, the
Packit d7e8d0
server may offer multiple options to the user (for example ignore or
Packit d7e8d0
process recursively).
Packit d7e8d0
Packit d7e8d0
The @code{ENCRYPT_SIGN_FILES} command requests a combined sign and
Packit d7e8d0
encrypt operation.  It may not be available for all protocols (for
Packit d7e8d0
example, it is available for OpenPGP but not for CMS).
Packit d7e8d0
Packit d7e8d0
The option @code{--nohup} is mandatory.  It is currently unspecified
Packit d7e8d0
what should happen if @code{--nohup} is not present.  Because
Packit d7e8d0
@code{--nohup} is present, the server always returns @code{OK}
Packit d7e8d0
promptly, and completes the operation asynchronously.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Verify/Decrypt Files
Packit d7e8d0
@section UI Server: Decrypting and verifying files.
Packit d7e8d0
Packit d7e8d0
First, the input files need to be specified by one or more
Packit d7e8d0
@code{FILE} commands.  Afterwards, the actual operation is requested:
Packit d7e8d0
Packit d7e8d0
@deffn Command DECRYPT_FILES --nohup
Packit d7e8d0
@deffnx Command VERIFY_FILES --nohup
Packit d7e8d0
@deffnx Command DECRYPT_VERIFY_FILES --nohup
Packit d7e8d0
Request that the files specified by @code{FILE} are decrypted and/or
Packit d7e8d0
verified.  The command selects the default action.  The UI server may
Packit d7e8d0
allow the user to change this default afterwards interactively, and
Packit d7e8d0
even abort the operation or complete it only on some of the selected
Packit d7e8d0
files and directories.
Packit d7e8d0
Packit d7e8d0
What it means to decrypt or verify a file or directory is specific to
Packit d7e8d0
the preferences of the user, the functionality the UI server provides,
Packit d7e8d0
and the selected protocol.  Typically, for decryption, a new file is
Packit d7e8d0
created for each input file under the original filename minus a
Packit d7e8d0
protocol specific extension (like @code{.gpg}) which contains the
Packit d7e8d0
original plaintext.  For verification a status is displayed for each
Packit d7e8d0
signed input file, indicating if it is signed, and if yes, if the
Packit d7e8d0
signature is valid.  For files that are signed and encrypted, the
Packit d7e8d0
@code{VERIFY} command transiently decrypts the file to verify the
Packit d7e8d0
enclosed signature.  For directories, the server may offer multiple
Packit d7e8d0
options to the user (for example ignore or process recursively).
Packit d7e8d0
Packit d7e8d0
The option @code{--nohup} is mandatory.  It is currently unspecified
Packit d7e8d0
what should happen if @code{--nohup} is not present.  Because
Packit d7e8d0
@code{--nohup} is present, the server always returns @code{OK}
Packit d7e8d0
promptly, and completes the operation asynchronously.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Import/Export Keys
Packit d7e8d0
@section UI Server: Managing certificates.
Packit d7e8d0
Packit d7e8d0
First, the input files need to be specified by one or more
Packit d7e8d0
@code{FILE} commands.  Afterwards, the actual operation is requested:
Packit d7e8d0
Packit d7e8d0
@deffn Command IMPORT_FILES --nohup
Packit d7e8d0
Request that the certificates contained in the files specified by
Packit d7e8d0
@code{FILE} are imported into the local certificate databases.
Packit d7e8d0
Packit d7e8d0
For directories, the server may offer multiple options to the user
Packit d7e8d0
(for example ignore or process recursively).
Packit d7e8d0
Packit d7e8d0
The option @code{--nohup} is mandatory.  It is currently unspecified
Packit d7e8d0
what should happen if @code{--nohup} is not present.  Because
Packit d7e8d0
@code{--nohup} is present, the server always returns @code{OK}
Packit d7e8d0
promptly, and completes the operation asynchronously.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
FIXME: It may be nice to support an @code{EXPORT} command as well,
Packit d7e8d0
which is enabled by the context menu of the background of a directory.
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@node UI Server Checksum Files
Packit d7e8d0
@section UI Server: Create and verify checksums for files.
Packit d7e8d0
Packit d7e8d0
First, the input files need to be specified by one or more
Packit d7e8d0
@code{FILE} commands.  Afterwards, the actual operation is requested:
Packit d7e8d0
Packit d7e8d0
@deffn Command CHECKSUM_CREATE_FILES --nohup
Packit d7e8d0
Request that checksums are created for the files specified by
Packit d7e8d0
@code{FILE}.  The choice of checksum algorithm and the destination
Packit d7e8d0
storage and format for the created checksums depend on the preferences
Packit d7e8d0
of the user and the functionality provided by the UI server.  For
Packit d7e8d0
directories, the server may offer multiple options to the user (for
Packit d7e8d0
example ignore or process recursively).
Packit d7e8d0
Packit d7e8d0
The option @code{--nohup} is mandatory.  It is currently unspecified
Packit d7e8d0
what should happen if @code{--nohup} is not present.  Because
Packit d7e8d0
@code{--nohup} is present, the server always returns @code{OK}
Packit d7e8d0
promptly, and completes the operation asynchronously.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@deffn Command CHECKSUM_VERIFY_FILES --nohup
Packit d7e8d0
Request that checksums are created for the files specified by
Packit d7e8d0
@code{FILE} and verified against previously created and stored
Packit d7e8d0
checksums.  The choice of checksum algorithm and the source storage
Packit d7e8d0
and format for previously created checksums depend on the preferences
Packit d7e8d0
of the user and the functionality provided by the UI server.  For
Packit d7e8d0
directories, the server may offer multiple options to the user (for
Packit d7e8d0
example ignore or process recursively).
Packit d7e8d0
Packit d7e8d0
If the source storage of previously created checksums is available to
Packit d7e8d0
the user through the Windows shell, this command may also accept such
Packit d7e8d0
checksum files as @code{FILE} arguments.  In this case, the UI server
Packit d7e8d0
should instead verify the checksum of the referenced files as if they
Packit d7e8d0
were given as INPUT files.
Packit d7e8d0
Packit d7e8d0
The option @code{--nohup} is mandatory.  It is currently unspecified
Packit d7e8d0
what should happen if @code{--nohup} is not present.  Because
Packit d7e8d0
@code{--nohup} is present, the server always returns @code{OK}
Packit d7e8d0
promptly, and completes the operation asynchronously.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@c
Packit d7e8d0
@c M I S C E L L A N E O U S  C O M M A N D S
Packit d7e8d0
@c
Packit d7e8d0
@node Miscellaneous UI Server Commands
Packit d7e8d0
@section Miscellaneous UI Server Commands
Packit d7e8d0
Packit d7e8d0
The server needs to implement the following commands which are not
Packit d7e8d0
related to a specific command:
Packit d7e8d0
Packit d7e8d0
@deffn Command GETINFO @var{what}
Packit d7e8d0
This is a multi purpose command, commonly used to return a variety of
Packit d7e8d0
information.  The required subcommands as described by the @var{what}
Packit d7e8d0
parameter are:
Packit d7e8d0
Packit d7e8d0
@table @code
Packit d7e8d0
@item pid
Packit d7e8d0
Return the process id of the server in decimal notation using an Assuan
Packit d7e8d0
data line.
Packit d7e8d0
@end table
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
To allow the server to pop up the windows in the correct relation to the
Packit d7e8d0
client, the client is advised to tell the server by sending the option:
Packit d7e8d0
Packit d7e8d0
@deffn {Command option} window-id @var{number}
Packit d7e8d0
The @var{number} represents the native window ID of the clients current
Packit d7e8d0
window.  On Windows systems this is a windows handle (@code{HWND}) and
Packit d7e8d0
on X11 systems it is the @code{X Window ID}.  The number needs to be
Packit d7e8d0
given as a hexadecimal value so that it is easier to convey pointer
Packit d7e8d0
values (e.g. @code{HWND}).
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
A client may want to fire up the certificate manager of the server.  To
Packit d7e8d0
do this it uses the Assuan command:
Packit d7e8d0
Packit d7e8d0
@deffn Command START_KEYMANAGER
Packit d7e8d0
The server shall pop up the main window of the key manager (aka
Packit d7e8d0
certificate manager).  The client expects that the key manager is brought
Packit Service 30b792
into the foregound and that this command immediately returns (does not
Packit d7e8d0
wait until the key manager has been fully brought up).
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
A client may want to fire up the configuration dialog of the server.  To
Packit d7e8d0
do this it uses the Assuan command:
Packit d7e8d0
Packit d7e8d0
@deffn Command START_CONFDIALOG
Packit d7e8d0
The server shall pop up its configuration dialog.  The client expects
Packit d7e8d0
that this dialog is brought into the foregound and that this command
Packit Service 30b792
immediately returns (i.e. it does not wait until the dialog has been
Packit d7e8d0
fully brought up).
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@anchor{command SENDER}
Packit d7e8d0
@noindent
Packit d7e8d0
When doing an operation on a mail, it is useful to let the server know
Packit d7e8d0
the address of the sender:
Packit d7e8d0
Packit d7e8d0
@deffn Command SENDER [-@w{}-info] [-@w{}-protocol=@var{name}] @var{email}
Packit d7e8d0
@var{email} is the plain ASCII encoded address ("addr-spec" as per
Packit d7e8d0
RFC-2822) enclosed in angle brackets.  The address set with this command
Packit d7e8d0
is valid until a successful completion of the operation or until a
Packit d7e8d0
@code{RESET} command.  A second command overrides the effect of the
Packit d7e8d0
first one; if @var{email} is not given and @option{--info} is not used,
Packit d7e8d0
the server shall use the default signing key.
Packit d7e8d0
Packit d7e8d0
If option @option{--info} is not given, the server shall also suggest a
Packit d7e8d0
protocol to use for signing.  The client may use this suggested protocol
Packit d7e8d0
on its own discretion.  The same status line as with PREP_ENCRYPT is
Packit d7e8d0
used for this.
Packit d7e8d0
Packit d7e8d0
The option @option{--protocol} may be used to give the server a hint on
Packit d7e8d0
which signing protocol should be preferred.
Packit d7e8d0
@end deffn
Packit d7e8d0
Packit d7e8d0
@noindent
Packit d7e8d0
To allow the UI-server to visually identify a running operation or to
Packit d7e8d0
associate operations the server MAY support the command:
Packit d7e8d0
Packit d7e8d0
@deffn Command SESSION @var{number} [@var{string}]
Packit d7e8d0
The @var{number} is an arbitrary value, a server may use to associate
Packit d7e8d0
simultaneous running sessions.  It is a 32 bit unsigned integer with
Packit d7e8d0
@code{0} as a special value indicating that no session association shall
Packit d7e8d0
be done.
Packit d7e8d0
Packit d7e8d0
If @var{string} is given, the server may use this as the title of a
Packit d7e8d0
window or, in the case of an email operation, to extract the sender's
Packit d7e8d0
address. The string may contain spaces; thus no plus-escaping is used.
Packit d7e8d0
Packit d7e8d0
This command may be used at any time and overrides the effect of the
Packit d7e8d0
last command.  A @code{RESET} undoes the effect of this command.
Packit d7e8d0
Packit d7e8d0
@end deffn