1 @c Copyright (C) 2002 Free Software Foundation, Inc.
2 @c This is part of the GnuPG manual.
3 @c For copying conditions, see the file gnupg.texi.
5 @node Invoking GPG-AGENT
6 @chapter Invoking GPG-AGENT
7 @cindex GPG-AGENT command options
8 @cindex command options
9 @cindex options, GPG-AGENT command
14 \- Secret key management for GnuPG
45 @command{gpg-agent} is a daemon to manage secret (private) keys
46 independently from any protocol. It is used as a backend for
47 @command{gpg} and @command{gpgsm} as well as for a couple of other
51 The usual way to run the agent is from the @code{~/.xsession} file:
54 eval `gpg-agent --daemon`
58 If you don't use an X server, you can also put this into your regular
59 startup file @code{~/.profile} or @code{.bash_profile}. It is best not
60 to run multiple instance of the @command{gpg-agent}, so you should make
61 sure that only one is running: @command{gpg-agent} uses an environment
62 variable to inform clients about the communication parameters. You can
63 write the content of this environment variable to a file so that you can
64 test for a running agent. This short script may do the job:
67 if test -f $HOME/.gpg-agent-info && \
68 kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then
69 GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info`
72 eval `gpg-agent --daemon`
73 echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info
78 Note that the new option @option{--write-env-file} may be used instead.
82 You should always add the following lines to your @code{.bashrc} or
83 whatever initialization file is used for all shell invocations:
91 It is important that this environment variable always reflects the
92 output of the @code{tty} command. For W32 systems this option is not
95 Please make sure that a proper pinentry program has been installed
96 under the default filename (which is system dependant) or use the
97 option @code{pinentry-pgm} to specify the full name of that program.
98 It is often useful to install a symbolic link from the actual used
99 pinentry (e.g. @file{/usr/bin/pinentry-gtk}) to the expected
100 one (e.g. @file{/usr/bin/pinentry}).
104 @xref{Option Index},for an index to @command{GPG-AGENT}'s commands and options.
108 * Agent Commands:: List of all commands.
109 * Agent Options:: List of all options.
110 * Agent Configuration:: Configuration files.
111 * Agent Signals:: Use of some signals.
112 * Agent Examples:: Some usage examples.
113 * Agent Protocol:: The protocol the agent uses.
120 Commands are not distinguished from options execpt for the fact that
121 only one one command is allowed.
126 Print the program version and licensing information. Not that you can
127 abbreviate this command.
132 Print a usage message summarizing the most useful command-line options.
133 Not that you can abbreviate this command.
136 @opindex dump-options
137 Print a list of all available options and commands. Not that you can
138 abbreviate this command.
142 Run in server mode and wait for commands on the @code{stdin}. The
143 default mode is to create a socket and listen for commands there.
145 @item --daemon [@var{command line}]
147 Run the program in the background. This option is required to prevent
148 it from being accidently running in the background. A common way to do
152 $ eval `gpg-agent --daemon`
158 @section Option Summary
162 @anchor{option --options}
163 @item --options @var{file}
165 Reads configuration from @var{file} instead of from the default
166 per-user configuration file. The default configuration file is named
167 @file{gpg-agent.conf} and expected in the @file{.gnupg} directory directly
168 below the home directory of the user.
170 @anchor{option --homedir}
171 @include opt-homedir.texi
178 Outputs additional information while running.
179 You can increase the verbosity by giving several
180 verbose commands to @command{gpgsm}, such as @samp{-vv}.
186 Try to be as quiet as possible.
190 Don't invoke a pinentry or do any other thing requiring human interaction.
192 @item --faked-system-time @var{epoch}
193 @opindex faked-system-time
194 This option is only useful for testing; it sets the system time back or
195 forth to @var{epoch} which is the number of seconds elapsed since the year
198 @item --debug-level @var{level}
200 Select the debug level for investigating problems. @var{level} may be
207 some basic debug messages
209 more verbose debug messages
211 even more detailed messages
213 all of the debug messages you can get
216 How these messages are mapped to the actual debugging flags is not
217 specified and may change with newer releaes of this program. They are
218 however carefully selected to best aid in debugging.
220 @item --debug @var{flags}
222 This option is only useful for debugging and the behaviour may change at
223 any time without notice. FLAGS are bit encoded and may be given in
224 usual C-Syntax. The currently defined bits are:
228 X.509 or OpenPGP protocol related data
230 values of big number integers
232 low level crypto operations
238 show memory statistics.
240 write hashed data to files named @code{dbgmd-000*}
242 trace Assuan protocol
244 bypass all certificate validation
249 Same as @code{--debug=0xffffffff}
251 @item --debug-wait @var{n}
253 When running in server mode, wait @var{n} seconds before entering the
254 actual processing loop and print the pid. This gives time to attach a
259 Don't detach the process from the console. This is manly usefule for
270 Format the info output in daemon mode for use with the standard Bourne
271 shell respective the C-shell . The default is to guess it based on the
272 environment variable @code{SHELL} which is in almost all cases
275 @item --write-env-file @var{file}
276 @opindex write-env-file
277 Often it is required to connect to the agent from a process not being an
278 inferior of @command{gpg-agent} and thus the environment variable with
279 the socket name is not available. To help setting up those variables in
280 other sessions, this option may be used to write the information into
281 @var{file}. If @var{file} is not specified the default name
282 @file{$@{HOME@}/.gpg-agent-info} will be used. The format is suitable
283 to be evaluated by a Bourne shell like in this simple example:
286 eval `cat @var{file}`
287 eval `cut -d= -f 1 < @var{file} | xargs echo export`
294 Tell the pinentryo not to grab the keyboard and mouse. This option
295 should in general not be used to avaoid X-sniffing attacks.
297 @item --log-file @var{file}
299 Append all logging output to @var{file}. This is very helpful in
300 seeing what the agent actually does.
302 @anchor{option --allow-mark-trusted}
303 @item --allow-mark-trusted
304 @opindex allow-mark-trusted
305 Allow clients to mark keys as trusted, i.e. put them into the
306 @file{trustlist.txt} file. This is by default not allowed to make it
307 harder for users to inadvertly accept Root-CA keys.
309 @item --ignore-cache-for-signing
310 @opindex ignore-cache-for-signing
311 This option will let @command{gpg-agent} bypass the passphrase cache for all
312 signing operation. Note that there is also a per-session option to
313 control this behaviour but this command line option takes precedence.
315 @item --default-cache-ttl @var{n}
316 @opindex default-cache-ttl
317 Set the time a cache entry is valid to @var{n} seconds. The default are
320 @item --default-cache-ttl-ssh @var{n}
321 @opindex default-cache-ttl
322 Set the time a cache entry used for SSH keys is valid to @var{n}
323 seconds. The default are 1800 seconds.
325 @item --max-cache-ttl @var{n}
326 @opindex max-cache-ttl
327 Set the maximum time a cache entry is valid to @var{n} seconds. After
328 this time a cache entry will get expired even if it has been accessed
329 recently. The default are 2 hours (7200 seconds).
331 @item --max-cache-ttl-ssh @var{n}
332 @opindex max-cache-ttl-ssh
333 Set the maximum time a cache entry used for SSH keys is valid to @var{n}
334 seconds. After this time a cache entry will get expired even if it has
335 been accessed recently. The default are 2 hours (7200 seconds).
337 @item --min-passphrase-len @var{n}
338 @opindex min-passphrase-len
339 Set the minimal length of a passphrase. When entering a new passphrase
340 shorter than this value a warning will be displayed. Defaults to 8.
342 @item --pinentry-program @var{filename}
343 @opindex pinentry-program
344 Use program @var{filename} as the PIN entry. The default is installation
345 dependend and can be shown with the @code{--version} command.
347 @item --pinentry-touch-file @var{filename}
348 @opindex pinentry-touch-file
349 By default the file name of the socket gpg-agent is listening for
350 requests is passed to Pinentry, so that it can touch that file before
351 exiting (it does this only in curses mode). This option changes the
352 file passed to Pinentry to @var{filename}. The special name
353 @code{/dev/null} may be used to completely disable this feature. Note
354 that Pinentry will not create that file, it will only change the
355 modification and access time.
358 @item --scdaemon-program @var{filename}
359 @opindex scdaemon-program
360 Use program @var{filename} as the Smartcard daemon. The default is
361 installation dependend and can be shown with the @code{--version}
364 @item --disable-scdaemon
365 @opindex disable-scdaemon
366 Do not make use of the scdaemon tool. This option has the effect of
367 disabling the ability to do smartcard operations. Note, that enabling
368 this option at runtime does not kill an already forked scdaemon.
370 @item --use-standard-socket
371 @itemx --no-use-standard-socket
372 @opindex use-standard-socket
373 @opindex no-use-standard-socket
374 By enabling this option @command{gpg-agent} will listen on the socket
375 named @file{S.gpg-agent}, located in the home directory, and not create
376 a random socket below a temporary directory. Tools connecting to
377 @command{gpg-agent} should first try to connect to the socket given in
378 environment variable @var{GPG_AGENT_INFO} and the fall back to this
379 socket. This option may not be used if the home directory is mounted as
380 a remote file system.
383 Note, that as of now, W32 systems default to this option.
386 @item --display @var{string}
387 @itemx --ttyname @var{string}
388 @itemx --ttytype @var{string}
389 @itemx --lc-type @var{string}
390 @itemx --lc-messages @var{string}
396 These options are used with the server mode to pass localization
400 @itemx --keep-display
402 @opindex keep-display
403 Ignore requests to change change the current @code{tty} respective the X
404 window system's @code{DISPLAY} variable. This is useful to lock the
405 pinentry to pop up at the @code{tty} or display you started the agent.
407 @anchor{option --enable-ssh-support}
408 @item --enable-ssh-support
409 @opindex enable-ssh-support
411 Enable emulation of the OpenSSH Agent protocol.
413 In this mode of operation, the agent does not only implement the
414 gpg-agent protocol, but also the agent protocol used by OpenSSH
415 (through a seperate socket). Consequently, it should possible to use
416 the gpg-agent as a drop-in replacement for the well known ssh-agent.
418 SSH Keys, which are to be used through the agent, need to be added to
419 the gpg-agent initially through the ssh-add utility. When a key is
420 added, ssh-add will ask for the password of the provided key file and
421 send the unprotected key material to the agent; this causes the
422 gpg-agent to ask for a passphrase, which is to be used for encrypting
423 the newly received key and storing it in a gpg-agent specific
426 Once, a key has been added to the gpg-agent this way, the gpg-agent
427 will be ready to use the key.
429 Note: in case the gpg-agent receives a signature request, the user might
430 need to be prompted for a passphrase, which is necessary for decrypting
431 the stored key. Since the ssh-agent protocol does not contain a
432 mechanism for telling the agent on which display/terminal it is running,
433 gpg-agent's ssh-support will use the TTY or X display where gpg-agent
434 has been started. To switch this display to the current one, the
435 follwing command may be used:
438 echo UPDATESTARTUPTTY | gpg-connect-agent
445 All the long options may also be given in the configuration file after
446 stripping off the two leading dashes.
450 @node Agent Configuration
451 @section Configuration
453 There are a few configuration files needed for the operation of the
454 agent. By default they may all be found in the current home directory
455 (@pxref{option --homedir}).
460 @cindex gpg-agent.conf
461 This is the standard configuration file read by @command{gpg-agent} on
462 startup. It may contain any valid long option; the leading
463 two dashes may not be entered and the option may not be abbreviated.
464 This file is also read after a @code{SIGHUP} however only a few
465 options will actually have an effect. This default name may be
466 changed on the command line (@pxref{option --options}).
469 This is the list of trusted keys. Comment lines, indicated by a leading
470 hash mark, as well as empty lines are ignored. To mark a key as trusted
471 you need to enter its fingerprint followed by a space and a capital
472 letter @code{S}. Colons may optionally be used to separate the bytes of
473 a fingerprint; this allows to cut and paste the fingerprint from a key
476 Here is an example where two keys are marked as ultimately trusted:
479 # CN=Wurzel ZS 3,O=Intevation GmbH,C=DE
480 A6935DD34EF3087973C706FC311AA2CCF733765B S
482 # CN=PCA-1-Verwaltung-02/O=PKI-1-Verwaltung/C=DE
483 DC:BD:69:25:48:BD:BB:7E:31:6E:BB:80:D3:00:80:35:D4:F8:A6:CD S
486 Before entering a key into this file, you need to ensure its
487 authenticity. How to do this depends on your organisation; your
488 administrator might have already entered those keys which are deemed
489 trustworthy enough into this file. Places where to look for the
490 fingerprint of a root certificate are letters received from the CA or
491 the website of the CA (after making 100% sure that this is indeed the
492 website of that CA). You may want to consider allowing interactive
493 updates of this file by using the @xref{option --allow-mark-trusted}.
494 This is however not as secure as maintaining this file manually. It is
495 even advisable to change the permissions to read-only so that this file
496 can't be changed inadvertently.
498 It is possible to add further flags after the @code{S} for use by the
499 caller. The only flag currently defined is @code{relax} to relax
500 checking of some root certificate requirements.
502 As a special feature a line @code{include-default} will include a global
503 list of trusted certificates (e.g. @file{/etc/gnupg/trustlist.txt}).
504 This global list is also used if the local list is not available.
509 This file is used when support for the secure shell agent protocol has
510 been enabled (@pxref{option --enable-ssh-support}). Only keys present in
511 this file are used in the SSH protocol. The @command{ssh-add} tool y be
512 used to add new entries to this file; you may also add them manually.
513 Comment lines, indicated by a leading hash mark, as well as empty lines
514 are ignored. An entry starts with optional white spaces, followed by
515 the keygrip of the key given as 40 hex digits, optionally followed by
516 the caching TTL in seconds and another optional field for arbitrary
517 flags. A @code{!} may be prepended to the keygrip to disable this
520 The follwoing example lists exactly one key. Note that keys available
521 through a OpenPGP smartcard in the active smartcard reader are implictly
522 added to this list; i.e. there is no need to list them.
525 # Key added on 2005-02-25 15:08:29
526 5A6592BF45DC73BD876874A28FD4639282E29B52 0
529 @item private-keys-v1.d/
531 This is the directory where gpg-agent stores the private keys. Each
532 key is stored in a file with the name made up of the keygrip and the
538 Note that on larger installations, it is useful to put predefined
539 files into the directory @file{/etc/skel/.gnupg/} so that newly created
540 users start up with a working configuration. For existing users the
541 a small helper script is provied to create these files (@pxref{addgnupghome}).
550 @section Use of some signals.
551 A running @command{gpg-agent} may be controlled by signals, i.e. using
552 the @command{kill} command to send a signal to the process.
554 Here is a list of supported signals:
560 This signal flushes all chached passphrases and if the program has been
561 started with a configuration file, the configuration file is read again.
562 Only certain options are honored: @code{quiet}, @code{verbose},
563 @code{debug}, @code{debug-all}, @code{debug-level}, @code{no-grab},
564 @code{pinentry-program}, @code{default-cache-ttl}, @code{max-cache-ttl},
565 @code{ignore-cache-for-signing}, @code{allow-mark-trusted} and
566 @code{disable-scdaemon}. @code{scdaemon-program} is also supported but
567 due to the current implementation, which calls the scdaemon only once,
568 it is not of much use unless you manually kill the scdaemon.
573 Shuts down the process but waits until all current requests are
574 fulfilled. If the process has received 3 of these signals and requests
575 are still pending, a shutdown is forced.
579 Shuts down the process immediately.
583 Dump internal information to the log file.
587 This signal is used for internal purposes.
598 The usual way to invoke @command{gpg-agent} is
601 $ eval `gpg-agent --daemon`
604 An alternative way is by replacing @command{ssh-agent} with
605 @command{gpg-agent}. If for example @command{ssh-agent} is started as
606 part of the Xsession intialization you may simply replace
607 @command{ssh-agent} by a script like:
613 exec /usr/local/bin/gpg-agent --enable-ssh-support --daemon \
614 --write-env-file $@{HOME@}/.gpg-agent-info "$@@"
619 and add something like (for Bourne shells)
623 if [ -f "$@{HOME@}/.gpg-agent-info" ]; then
624 . "$@{HOME@}/.gpg-agent-info"
625 export GPG_AGENT_INFO
633 to your shell initialization file (e.g. @file{~/.bashrc}).
640 @section Agent's Assuan Protocol
642 Note: this section does only document the protocol, which is used by
643 GnuPG components; it does not deal with the ssh-agent protocol.
645 The @command{gpg-agent} should be started by the login shell and set an
646 environment variable to tell clients about the socket to be used.
647 Clients should deny to access an agent with a socket name which does
648 not match its own configuration. An application may choose to start
649 an instance of the gpgagent if it does not figure that any has been
650 started; it should not do this if a gpgagent is running but not
651 usable. Because @command{gpg-agent} can only be used in background mode, no
652 special command line option is required to activate the use of the
655 To identify a key we use a thing called keygrip which is the SHA-1 hash
656 of an canoncical encoded S-Expression of the the public key as used in
657 Libgcrypt. For the purpose of this interface the keygrip is given as a
658 hex string. The advantage of using this and not the hash of a
659 certificate is that it will be possible to use the same keypair for
660 different protocols, thereby saving space on the token used to keep the
664 * Agent PKDECRYPT:: Decrypting a session key
665 * Agent PKSIGN:: Signing a Hash
666 * Agent GENKEY:: Generating a Key
667 * Agent IMPORT:: Importing a Secret Key
668 * Agent EXPORT:: Exporting a Secret Key
669 * Agent ISTRUSTED:: Importing a Root Certificate
670 * Agent GET_PASSPHRASE:: Ask for a passphrase
671 * Agent GET_CONFIRMATION:: Ask for confirmation
672 * Agent HAVEKEY:: Check whether a key is available
673 * Agent LEARN:: Register a smartcard
674 * Agent PASSWD:: Change a Passphrase
675 * Agent UPDATESTARTUPTTY:: Change the Standard Display
676 * Agent GETEVENTCOUNTER:: Get the Event Counters
679 @node Agent PKDECRYPT
680 @subsection Decrypting a session key
682 The client asks the server to decrypt a session key. The encrypted
683 session key should have all information needed to select the
684 appropriate secret key or to delegate it to a smartcard.
690 Tell the server about the key to be used for decryption. If this is
691 not used, @command{gpg-agent} may try to figure out the key by trying to
692 decrypt the message with each key available.
698 The agent checks whether this command is allowed and then does an
699 INQUIRY to get the ciphertext the client should then send the cipher
703 S: INQUIRE CIPHERTEXT
709 Please note that the server may send status info lines while reading the
710 data lines from the client. The data send is a SPKI like S-Exp with
716 (<param_name1> <mpi>)
718 (<param_namen> <mpi>)))
721 Where algo is a string with the name of the algorithm; see the libgcrypt
722 documentation for a list of valid algorithms. The number and names of
723 the parameters depend on the algorithm. The agent does return an error
724 if there is an inconsistency.
726 If the decryption was successful the decrypted data is returned by
729 Here is an example session:
733 S: INQUIRE CIPHERTEXT
734 C: D (enc-val elg (a 349324324)
735 C: D (b 3F444677CA)))
737 S: # session key follows
738 S: D (value 1234567890ABCDEF0)
739 S: OK descryption successful
744 @subsection Signing a Hash
746 The client ask the agent to sign a given hash value. A default key
747 will be chosen if no key has been set. To set a key a client first
754 This can be used multiple times to create multiple signature, the list
755 of keys is reset with the next PKSIGN command or a RESET. The server
756 test whether the key is a valid key to sign something and responds with
760 SETHASH --hash=<name>|<algo> <hexstring>
763 The client can use this command to tell the server about the data <hexstring>
764 (which usually is a hash) to be signed. <algo> is the decimal encoded hash
765 algorithm number as used by Libgcrypt. Either <algo> or --hash=<name>
766 must be given. Valid names for <name> are:
777 The actual signing is done using
783 Options are not yet defined, but my later be used to choosen among
784 different algorithms. The agent does then some checks, asks for the
785 passphrase and as a result the server returns the signature as an SPKI
786 like S-expression in "D" lines:
791 (<param_name1> <mpi>)
793 (<param_namen> <mpi>)))
797 The operation is affected by the option
800 OPTION use-cache-for-signing=0|1
803 The default of @code{1} uses the cache. Setting this option to @code{0}
804 will lead @command{gpg-agent} to ignore the passphrase cache. Note, that there is
805 also a global command line option for @command{gpg-agent} to globally disable the
809 Here is an example session:
817 S: # I did ask the user whether he really wants to sign
818 S: # I did ask the user for the passphrase
820 C: D ABCDEF012345678901234
822 S: # signature follows
823 S: D (sig-val rsa (s 45435453654612121212))
829 @subsection Generating a Key
831 This is used to create a new keypair and store the secret key inside the
832 active PSE -w which is in most cases a Soft-PSE. An not yet defined
833 option allows to choose the storage location. To get the secret key out
834 of the PSE, a special export tool has to be used.
840 Invokes the key generation process and the server will then inquire
841 on the generation parameters, like:
845 C: D (genkey (rsa (nbits 1024)))
849 The format of the key parameters which depends on the algorithm is of
855 (parameter_name_1 ....)
857 (parameter_name_n ....)))
860 If everything succeeds, the server returns the *public key* in a SPKI
861 like S-Expression like this:
870 Here is an example session:
875 C: D (genkey (rsa (nbits 1024)))
878 S: D (rsa (n 326487324683264) (e 10001)))
883 @subsection Importing a Secret Key
885 This operation is not yet supportted by GpgAgent. Specialized tools
886 are to be used for this.
888 There is no actual need because we can expect that secret keys
889 created by a 3rd party are stored on a smartcard. If we have
890 generated the key ourself, we do not need to import it.
893 @subsection Export a Secret Key
897 Should be done by an extra tool.
899 @node Agent ISTRUSTED
900 @subsection Importing a Root Certificate
902 Actually we do not import a Root Cert but provide a way to validate
903 any piece of data by storing its Hash along with a description and
904 an identifier in the PSE. Here is the interface desription:
907 ISTRUSTED <fingerprint>
910 Check whether the OpenPGP primary key or the X.509 certificate with the
911 given fingerprint is an ultimately trusted key or a trusted Root CA
912 certificate. The fingerprint should be given as a hexstring (without
913 any blanks or colons or whatever in between) and may be left padded with
914 00 in case of an MD5 fingerprint. GPGAgent will answer with:
920 The key is in the table of trusted keys.
923 ERR 304 (Not Trusted)
926 The key is not in this table.
928 Gpg needs the entire list of trusted keys to maintain the web of
929 trust; the following command is therefore quite helpful:
935 GpgAgent returns a list of trusted keys line by line:
938 S: D 000000001234454556565656677878AF2F1ECCFF P
939 S: D 340387563485634856435645634856438576457A P
940 S: D FEDC6532453745367FD83474357495743757435D S
944 The first item on a line is the hexified fingerprint where MD5
945 ingerprints are @code{00} padded to the left and the second item is a
946 flag to indicate the type of key (so that gpg is able to only take care
947 of PGP keys). P = OpenPGP, S = S/MIME. A client should ignore the rest
948 of the line, so that we can extend the format in the future.
950 Finally a client should be able to mark a key as trusted:
953 MARKTRUSTED @var{fingerprint} "P"|"S"
956 The server will then pop up a window to ask the user whether she
957 really trusts this key. For this it will probably ask for a text to
958 be displayed like this:
962 C: D Do you trust the key with the fingerprint @@FPR@@
963 C: D bla fasel blurb.
968 Known sequences with the pattern @@foo@@ are replaced according to this
973 Format the fingerprint according to gpg rules for a v3 keys.
975 Format the fingerprint according to gpg rules for a v4 keys.
977 Choose an appropriate format to format the fingerprint.
979 Replaced by a single @code{@@}
982 @node Agent GET_PASSPHRASE
983 @subsection Ask for a passphrase
985 This function is usually used to ask for a passphrase to be used for
986 conventional encryption, but may also be used by programs which need
987 special handling of passphrases. This command uses a syntax which helps
988 clients to use the agent with minimum effort.
991 GET_PASSPHRASE [--data] [--check] @var{cache_id} [@var{error_message} @var{prompt} @var{description}]
994 @var{cache_id} is expected to be a string used to identify a cached
995 passphrase. Use a @code{X} to bypass the cache. With no other
996 arguments the agent returns a cached passphrase or an error. By
997 convention either the hexified fingerprint of the key shall be used for
998 @var{cache_id} or an arbitrary string prefixed with the name of the
999 calling application and a colon: Like @code{gpg:somestring}.
1001 @var{error_message} is either a single @code{X} for no error message or
1002 a string to be shown as an error message like (e.g. "invalid
1003 passphrase"). Blanks must be percent escaped or replaced by @code{+}'.
1005 @var{prompt} is either a single @code{X} for a default prompt or the
1006 text to be shown as the prompt. Blanks must be percent escaped or
1007 replaced by @code{+}.
1009 @var{description} is a text shown above the entry field. Blanks must be
1010 percent escaped or replaced by @code{+}.
1012 The agent either returns with an error or with a OK followed by the hex
1013 encoded passphrase. Note that the length of the strings is implicitly
1014 limited by the maximum length of a command. If the option
1015 @option{--data} is used, the passphrase is not returned on the OK line
1016 but by regular data lines; this is the preferred method.
1018 If the option @option{--check} is used, the standard passphrase
1019 constraints checks are applied. A check is not done if the passphrase
1020 has been found in the cache.
1023 CLEAR_PASSPHRASE @var{cache_id}
1026 may be used to invalidate the cache entry for a passphrase. The
1027 function returns with OK even when there is no cached passphrase.
1030 @node Agent GET_CONFIRMATION
1031 @subsection Ask for confirmation
1033 This command may be used to ask for a simple confirmation by
1034 presenting a text and 2 bottonts: Okay and Cancel.
1037 GET_CONFIRMATION @var{description}
1040 @var{description}is displayed along with a Okay and Cancel
1041 button. Blanks must be percent escaped or replaced by @code{+}. A
1042 @code{X} may be used to display confirmation dialog with a default
1045 The agent either returns with an error or with a OK. Note, that the
1046 length of @var{description} is implicitly limited by the maximum
1047 length of a command.
1052 @subsection Check whether a key is available
1054 This can be used to see whether a secret key is available. It does
1055 not return any information on whether the key is somehow protected.
1058 HAVEKEY @var{keygrip}
1061 The Agent answers either with OK or @code{No_Secret_Key} (208). The
1062 caller may want to check for other error codes as well.
1066 @subsection Register a smartcard
1072 This command is used to register a smartcard. With the --send
1073 option given the certificates are send back.
1077 @subsection Change a Passphrase
1080 PASSWD @var{keygrip}
1083 This command is used to interactively change the passphrase of the key
1084 indentified by the hex string @var{keygrip}.
1087 @node Agent UPDATESTARTUPTTY
1088 @subsection Change the standard display
1094 Set the startup TTY and X-DISPLAY variables to the values of this
1095 session. This command is useful to direct future pinentry invocations
1096 to another screen. It is only required because there is no way in the
1097 ssh-agent protocol to convey this information.
1100 @node Agent GETEVENTCOUNTER
1101 @subsection Get the Event Counters
1107 This function return one status line with the current values of the
1108 event counters. The event counters are useful to avoid polling by
1109 delaying a poll until something has changed. The values are decimal
1110 numbers in the range @code{0} to @code{UINT_MAX} and wrapping around to
1111 0. The actual values should not be relied upon; they shall only be used
1114 The currently defined counters are are:
1117 Incremented with any change of any of the other counters.
1119 Incremented for added or removed private keys.
1121 Incremented for changes of the card readers stati.
1129 @command{gpg-connect-agent}(1),
1130 @command{scdaemon}(1)
1132 @include see-also-note.texi