gpg-connect-agent (1) Linux Manual Page
NAME
gpg-connect-agent – Communicate with a running agent
SYNOPSIS
gpg-connect-agent [options][commands]
DESCRIPTION
The gpg-connect-agent is a utility to communicate with a running gpg-agent. It is useful to check out the commands gpg-agent provides using the Assuan interface. It might also be useful for scripting simple applications. Input is expected at stdin and output gets printed to stdout.
It is very similar to running gpg-agent in server mode; but here we connect to a running instance.
The following options may be used:
-v-
–verboseOutput additional information while running. -q–quiet- Try to be as quiet as possible.
–homedirdir- Set the name of the home directory to dir. If this option is not used, the home directory defaults to ‘~/.gnupg‘. It is only recognized when given on the command line. It also overrides any home directory stated through the environment variable ‘GNUPGHOME‘ or (on Windows systems) by means of the Registry entry HKCU\Software\GNU\GnuPG:HomeDir.
On Windows systems it is possible to install GnuPG as a portable application. In this case only this command line option is considered, all other ways to set a home directory are ignored.
To install GnuPG as a portable application under Windows, create an empty file named ‘gpgconf.ctl‘ in the same directory as the tool ‘gpgconf.exe‘. The root of the installation is then that directory; or, if ‘gpgconf.exe‘ has been installed directly below a directory named ‘bin‘, its parent directory. You also need to make sure that the following directories exist and are writable: ‘ROOT/home‘ for the GnuPG home and ‘ROOT/var/cache/gnupg‘ for internal cache files.
–agent-programfile- Specify the agent program to be started if none is running. The default value is determined by running
gpgconfwith the option–list-dirs. Note that the pipe symbol (|) is used for a regression test suite hack and may thus not be used in the file name. –dirmngr-programfile- Specify the directory manager (keyserver client) program to be started if none is running. This has only an effect if used together with the option
–dirmngr. –dirmngr- Connect to a running directory manager (keyserver client) instead of to the gpg-agent. If a dirmngr is not running, start it.
-S-
–raw-socketname Connect to socket name assuming this is an Assuan style server. Do not run any special initializations or environment checks. This may be used to directly connect to any Assuan style socket server. -E-
–execTake the rest of the command line as a program and it’s arguments and execute it as an Assuan server. Here is how you would rungpgsm:-
gpg-connect-agent --exec gpgsm --server
Note that you may not use options on the command line in this case.
–no-ext-connect- When using
-Sor–exec,gpg-connect-agentconnects to the Assuan server in extended mode to allow descriptor passing. This option makes it use the old mode. –no-autostart- Do not start the gpg-agent or the dirmngr if it has not yet been started.
-rfile-
–runfile Run the commands from file at startup and then continue with the regular input method. Note, that commands given on the command line are executed after this file. -s-
–substRun the command/substat startup. –hex- Print data lines in a hex format and the ASCII representation of non-control characters.
–decode- Decode data lines. That is to remove percent escapes but make sure that a new line always starts with a D and a space.
CONTROL COMMANDS
While reading Assuan commands, gpg-agent also allows a few special commands to control its operation. These control commands all start with a slash (/).
/echoargs- Just print args.
/letname value- Set the variable name to value. Variables are only substituted on the input if the
/substhas been used. Variables are referenced by prefixing the name with a dollar sign and optionally include the name in curly braces. The rules for a valid name are identically to those of the standard bourne shell. This is not yet enforced but may be in the future. When used with curly braces no leading or trailing white space is allowed.If a variable is not found, it is searched in the environment and if found copied to the table of variables.
Variable functions are available: The name of the function must be followed by at least one space and the at least one argument. The following functions are available:
-
get- Return a value described by the argument. Available arguments are:
-
cwd- The current working directory.
homedir- The gnupg homedir.
sysconfdir- GnuPG’s system configuration directory.
bindir- GnuPG’s binary directory.
libdir- GnuPG’s library directory.
libexecdir- GnuPG’s library directory for executable files.
datadir- GnuPG’s data directory.
serverpid- The PID of the current server. Command
/serverpidmust have been given to return a useful value.
unescapeargs- Remove C-style escapes from args. Note that
