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.
8 @chapter Invoking GPGSM
9 @cindex GPGSM command options
10 @cindex command options
11 @cindex options, GPGSM command
16 \- CMS encryption and signing tool
33 @command{gpgsm} is a tool similar to @command{gpg} to provide digital
34 encryption and signing services on X.509 certificates and the CMS
35 protocol. It is mainly used as a backend for S/MIME mail processing.
36 @command{gpgsm} includes a full featured certificate management and
37 complies with all rules defined for the German Sphinx project.
40 @xref{Option Index}, for an index to @command{GPGSM}'s commands and options.
44 * GPGSM Commands:: List of all commands.
45 * GPGSM Options:: List of all options.
46 * GPGSM Configuration:: Configuration files.
47 * GPGSM Examples:: Some usage examples.
49 Developer information:
50 * Unattended Usage:: Using @command{gpgsm} from other programs.
51 * GPGSM Protocol:: The protocol the server mode uses.
54 @c *******************************************
55 @c *************** ****************
56 @c *************** COMMANDS ****************
57 @c *************** ****************
58 @c *******************************************
63 Commands are not distinguished from options except for the fact that
64 only one command is allowed.
67 * General GPGSM Commands:: Commands not specific to the functionality.
68 * Operational GPGSM Commands:: Commands to select the type of operation.
69 * Certificate Management:: How to manage certificates.
73 @c *******************************************
74 @c ********** GENERAL COMMANDS *************
75 @c *******************************************
76 @node General GPGSM Commands
77 @subsection Commands not specific to the function
82 Print the program version and licensing information. Note that you
83 cannot abbreviate this command.
87 Print a usage message summarizing the most useful command-line options.
88 Note that you cannot abbreviate this command.
92 Print warranty information. Note that you cannot abbreviate this
97 Print a list of all available options and commands. Note that you cannot
98 abbreviate this command.
102 @c *******************************************
103 @c ******** OPERATIONAL COMMANDS ***********
104 @c *******************************************
105 @node Operational GPGSM Commands
106 @subsection Commands to select the type of operation
111 Perform an encryption. The keys the data is encrypted to must be set
112 using the option @option{--recipient}.
116 Perform a decryption; the type of input is automatically determined. It
117 may either be in binary form or PEM encoded; automatic determination of
118 base-64 encoding is not done.
122 Create a digital signature. The key used is either the fist one found
123 in the keybox or those set with the @option{--local-user} option.
127 Check a signature file for validity. Depending on the arguments a
128 detached signature may also be checked.
132 Run in server mode and wait for commands on the @code{stdin}.
134 @item --call-dirmngr @var{command} [@var{args}]
135 @opindex call-dirmngr
136 Behave as a Dirmngr client issuing the request @var{command} with the
137 optional list of @var{args}. The output of the Dirmngr is printed
138 stdout. Please note that file names given as arguments should have an
139 absolute file name (i.e. commencing with @code{/}) because they are
140 passed verbatim to the Dirmngr and the working directory of the
141 Dirmngr might not be the same as the one of this client. Currently it
142 is not possible to pass data via stdin to the Dirmngr. @var{command}
143 should not contain spaces.
145 This is command is required for certain maintaining tasks of the dirmngr
146 where a dirmngr must be able to call back to @command{gpgsm}. See the Dirmngr
149 @item --call-protect-tool @var{arguments}
150 @opindex call-protect-tool
151 Certain maintenance operations are done by an external program call
152 @command{gpg-protect-tool}; this is usually not installed in a directory
153 listed in the PATH variable. This command provides a simple wrapper to
154 access this tool. @var{arguments} are passed verbatim to this command;
155 use @samp{--help} to get a list of supported operations.
161 @c *******************************************
162 @c ******* CERTIFICATE MANAGEMENT **********
163 @c *******************************************
164 @node Certificate Management
165 @subsection How to manage the certificates and keys
169 @opindex generate-key
172 This command allows the creation of a certificate signing request or a
173 self-signed certificate. It is commonly used along with the
174 @option{--output} option to save the created CSR or certificate into a
175 file. If used with the @option{--batch} a parameter file is used to
176 create the CSR or certificate and it is further possible to create
177 non-self-signed certificates.
182 List all available certificates stored in the local key database.
183 Note that the displayed data might be reformatted for better human
184 readability and illegal characters are replaced by safe substitutes.
186 @item --list-secret-keys
188 @opindex list-secret-keys
189 List all available certificates for which a corresponding a secret key
192 @item --list-external-keys @var{pattern}
194 List certificates matching @var{pattern} using an external server. This
195 utilizes the @code{dirmngr} service.
199 Same as @option{--list-keys} but also prints all keys making up the chain.
206 List all available certificates stored in the local key database using a
207 format useful mainly for debugging.
211 Same as @option{--dump-keys} but also prints all keys making up the chain.
213 @item --dump-secret-keys
214 @opindex dump-secret-keys
215 List all available certificates for which a corresponding a secret key
216 is available using a format useful mainly for debugging.
218 @item --dump-external-keys @var{pattern}
219 @opindex dump-external-keys
220 List certificates matching @var{pattern} using an external server.
221 This utilizes the @code{dirmngr} service. It uses a format useful
222 mainly for debugging.
224 @item --show-certs [@var{files}]
226 This command takes certificate files as input and prints information
227 about them in the same format as @option{--dump-cert} does. Each file
228 may either contain a single binary certificate or several PEM encoded
229 certificates. If no files are given, the input is taken from stdin.
231 Please note that the listing format may be changed in future releases
232 and that the option @option{--with-colons} has currently no effect.
235 @item --keydb-clear-some-cert-flags
236 @opindex keydb-clear-some-cert-flags
237 This is a debugging aid to reset certain flags in the key database
238 which are used to cache certain certificate statuses. It is especially
239 useful if a bad CRL or a weird running OCSP responder did accidentally
240 revoke certificate. There is no security issue with this command
241 because @command{gpgsm} always make sure that the validity of a certificate is
242 checked right before it is used.
244 @item --delete-keys @var{pattern}
246 Delete the keys matching @var{pattern}. Note that there is no command
247 to delete the secret part of the key directly. In case you need to do
248 this, you should run the command @code{gpgsm --dump-secret-keys KEYID}
249 before you delete the key, copy the string of hex-digits in the
250 ``keygrip'' line and delete the file consisting of these hex-digits
251 and the suffix @code{.key} from the @file{private-keys-v1.d} directory
252 below our GnuPG home directory (usually @file{~/.gnupg}).
254 @item --export [@var{pattern}]
256 Export all certificates stored in the Keybox or those specified by the
257 optional @var{pattern}. Those pattern consist of a list of user ids
258 (@pxref{how-to-specify-a-user-id}). When used along with the
259 @option{--armor} option a few informational lines are prepended before
260 each block. There is one limitation: As there is no commonly agreed
261 upon way to pack more than one certificate into an ASN.1 structure,
262 the binary export (i.e. without using @option{armor}) works only for
263 the export of one certificate. Thus it is required to specify a
264 @var{pattern} which yields exactly one certificate. Ephemeral
265 certificate are only exported if all @var{pattern} are given as
266 fingerprints or keygrips.
268 @item --export-secret-key-p12 @var{key-id}
269 @opindex export-secret-key-p12
270 Export the private key and the certificate identified by @var{key-id}
271 using the PKCS#12 format. When used with the @code{--armor} option a few
272 informational lines are prepended to the output. Note, that the PKCS#12
273 format is not very secure and proper transport security should be used
274 to convey the exported key. (@xref{option --p12-charset}.)
276 @item --export-secret-key-p8 @var{key-id}
277 @itemx --export-secret-key-raw @var{key-id}
278 @opindex export-secret-key-p8
279 @opindex export-secret-key-raw
280 Export the private key of the certificate identified by @var{key-id}
281 with any encryption stripped. The @code{...-raw} command exports in
282 PKCS#1 format; the @code{...-p8} command exports in PKCS#8 format.
283 When used with the @code{--armor} option a few informational lines are
284 prepended to the output. These commands are useful to prepare a key
285 for use on a TLS server.
287 @item --import [@var{files}]
289 Import the certificates from the PEM or binary encoded files as well as
290 from signed-only messages. This command may also be used to import a
291 secret key from a PKCS#12 file.
295 Read information about the private keys from the smartcard and import
296 the certificates from there. This command utilizes the @command{gpg-agent}
297 and in turn the @command{scdaemon}.
299 @item --change-passphrase @var{user_id}
300 @opindex change-passphrase
301 @itemx --passwd @var{user_id}
303 Change the passphrase of the private key belonging to the certificate
304 specified as @var{user_id}. Note, that changing the passphrase/PIN of a
305 smartcard is not yet supported.
310 @c *******************************************
311 @c *************** ****************
312 @c *************** OPTIONS ****************
313 @c *************** ****************
314 @c *******************************************
317 @section Option Summary
319 @command{GPGSM} features a bunch of options to control the exact behaviour
320 and to change the default configuration.
323 * Configuration Options:: How to change the configuration.
324 * Certificate Options:: Certificate related options.
325 * Input and Output:: Input and Output.
326 * CMS Options:: How to change how the CMS is created.
327 * Esoteric Options:: Doing things one usually do not want to do.
331 @c *******************************************
332 @c ******** CONFIGURATION OPTIONS **********
333 @c *******************************************
334 @node Configuration Options
335 @subsection How to change the configuration
337 These options are used to change the configuration and are usually found
342 @anchor{gpgsm-option --options}
343 @item --options @var{file}
345 Reads configuration from @var{file} instead of from the default
346 per-user configuration file. The default configuration file is named
347 @file{gpgsm.conf} and expected in the @file{.gnupg} directory directly
348 below the home directory of the user.
350 @include opt-homedir.texi
357 Outputs additional information while running.
358 You can increase the verbosity by giving several
359 verbose commands to @command{gpgsm}, such as @samp{-vv}.
361 @item --ldapserver @var{string}
362 @itemx --keyserver @var{string}
365 Add an LDAP server to use for X.509 certificate and CRL lookup. This
366 option can be given multiple times to configure more than one LDAP
367 server. Note that in general @command{dirmngr} should be configured
368 with the list of LDAP servers; if this option is also configured here,
369 it is used in addition to those configured in dirmngr. For the syntax
370 see the description of dirmngr's ldapserver option.
372 @item --policy-file @var{filename}
374 Change the default name of the policy file to @var{filename}. The
375 default name is @file{policies.txt}.
377 @item --agent-program @var{file}
378 @opindex agent-program
379 Specify an agent program to be used for secret key operations. The
380 default value is determined by running the command @command{gpgconf}.
381 Note that the pipe symbol (@code{|}) is used for a regression test
382 suite hack and may thus not be used in the file name.
384 @item --dirmngr-program @var{file}
385 @opindex dirmngr-program
386 Specify a dirmngr program to be used for @acronym{CRL} checks. The
387 default value is @file{@value{BINDIR}/dirmngr}.
389 @item --prefer-system-dirmngr
390 @opindex prefer-system-dirmngr
391 This option is obsolete and ignored.
393 @item --disable-dirmngr
394 Entirely disable the use of the Dirmngr.
397 @opindex no-autostart
398 Do not start the gpg-agent or the dirmngr if it has not yet been
399 started and its service is required. This option is mostly useful on
400 machines where the connection to gpg-agent has been redirected to
401 another machines. If dirmngr is required on the remote machine, it
402 may be started manually using @command{gpgconf --launch dirmngr}.
404 @item --no-secmem-warning
405 @opindex no-secmem-warning
406 Do not print a warning when the so called "secure memory" cannot be used.
408 @item --log-file @var{file}
410 When running in server mode, append all logging output to @var{file}.
411 Use @file{socket://} to log to socket.
416 @c *******************************************
417 @c ******** CERTIFICATE OPTIONS ************
418 @c *******************************************
419 @node Certificate Options
420 @subsection Certificate related options
424 @item --enable-policy-checks
425 @itemx --disable-policy-checks
426 @opindex enable-policy-checks
427 @opindex disable-policy-checks
428 By default policy checks are enabled. These options may be used to
431 @item --enable-crl-checks
432 @itemx --disable-crl-checks
433 @opindex enable-crl-checks
434 @opindex disable-crl-checks
435 By default the @acronym{CRL} checks are enabled and the DirMngr is
436 used to check for revoked certificates. The disable option is most
437 useful with an off-line network connection to suppress this check and
438 also to avoid that new certificates introduce a web bug by including a
439 certificate specific CRL DP. The disable option also disables an
440 issuer certificate lookup via the authorityInfoAccess property of the
441 certificate; the @option{--enable-issuer-key-retrieve} can be used
442 to make use of that property anyway.
444 @item --enable-trusted-cert-crl-check
445 @itemx --disable-trusted-cert-crl-check
446 @opindex enable-trusted-cert-crl-check
447 @opindex disable-trusted-cert-crl-check
448 By default the @acronym{CRL} for trusted root certificates are checked
449 like for any other certificates. This allows a CA to revoke its own
450 certificates voluntary without the need of putting all ever issued
451 certificates into a CRL. The disable option may be used to switch this
452 extra check off. Due to the caching done by the Dirmngr, there will not be
453 any noticeable performance gain. Note, that this also disables possible
454 OCSP checks for trusted root certificates. A more specific way of
455 disabling this check is by adding the ``relax'' keyword to the root CA
456 line of the @file{trustlist.txt}
459 @item --force-crl-refresh
460 @opindex force-crl-refresh
461 Tell the dirmngr to reload the CRL for each request. For better
462 performance, the dirmngr will actually optimize this by suppressing
463 the loading for short time intervals (e.g. 30 minutes). This option
464 is useful to make sure that a fresh CRL is available for certificates
465 hold in the keybox. The suggested way of doing this is by using it
466 along with the option @option{--with-validation} for a key listing
467 command. This option should not be used in a configuration file.
469 @item --enable-issuer-based-crl-check
470 @opindex enable-issuer-based-crl-check
471 Run a CRL check even for certificates which do not have any CRL
472 distribution point. This requires that a suitable LDAP server has
473 been configured in Dirmngr and that the CRL can be found using the
474 issuer. This option reverts to what GnuPG did up to version 2.2.20.
475 This option is in general not useful.
478 @itemx --disable-ocsp
480 @opindex disable-ocsp
481 By default @acronym{OCSP} checks are disabled. The enable option may
482 be used to enable OCSP checks via Dirmngr. If @acronym{CRL} checks
483 are also enabled, CRLs will be used as a fallback if for some reason an
484 OCSP request will not succeed. Note, that you have to allow OCSP
485 requests in Dirmngr's configuration too (option
486 @option{--allow-ocsp}) and configure Dirmngr properly. If you do not do
487 so you will get the error code @samp{Not supported}.
489 @item --auto-issuer-key-retrieve
490 @opindex auto-issuer-key-retrieve
491 If a required certificate is missing while validating the chain of
492 certificates, try to load that certificate from an external location.
493 This usually means that Dirmngr is employed to search for the
494 certificate. Note that this option makes a "web bug" like behavior
495 possible. LDAP server operators can see which keys you request, so by
496 sending you a message signed by a brand new key (which you naturally
497 will not have on your local keybox), the operator can tell both your IP
498 address and the time when you verified the signature.
501 @anchor{gpgsm-option --validation-model}
502 @item --validation-model @var{name}
503 @opindex validation-model
504 This option changes the default validation model. The only possible
505 values are "shell" (which is the default), "chain" which forces the
506 use of the chain model and "steed" for a new simplified model. The
507 chain model is also used if an option in the @file{trustlist.txt} or
508 an attribute of the certificate requests it. However the standard
509 model (shell) is in that case always tried first.
511 @item --ignore-cert-extension @var{oid}
512 @opindex ignore-cert-extension
513 Add @var{oid} to the list of ignored certificate extensions. The
514 @var{oid} is expected to be in dotted decimal form, like
515 @code{2.5.29.3}. This option may be used more than once. Critical
516 flagged certificate extensions matching one of the OIDs in the list
517 are treated as if they are actually handled and thus the certificate
518 will not be rejected due to an unknown critical extension. Use this
519 option with care because extensions are usually flagged as critical
524 @c *******************************************
525 @c *********** INPUT AND OUTPUT ************
526 @c *******************************************
527 @node Input and Output
528 @subsection Input and Output
534 Create PEM encoded output. Default is binary output.
538 Create Base-64 encoded output; i.e. PEM without the header lines.
541 @opindex assume-armor
542 Assume the input data is PEM encoded. Default is to autodetect the
543 encoding but this is may fail.
545 @item --assume-base64
546 @opindex assume-base64
547 Assume the input data is plain base-64 encoded.
549 @item --assume-binary
550 @opindex assume-binary
551 Assume the input data is binary encoded.
553 @anchor{option --p12-charset}
554 @item --p12-charset @var{name}
556 @command{gpgsm} uses the UTF-8 encoding when encoding passphrases for
557 PKCS#12 files. This option may be used to force the passphrase to be
558 encoded in the specified encoding @var{name}. This is useful if the
559 application used to import the key uses a different encoding and thus
560 will not be able to import a file generated by @command{gpgsm}. Commonly
561 used values for @var{name} are @code{Latin1} and @code{CP850}. Note
562 that @command{gpgsm} itself automagically imports any file with a
563 passphrase encoded to the most commonly used encodings.
566 @item --default-key @var{user_id}
568 Use @var{user_id} as the standard key for signing. This key is used if
569 no other key has been defined as a signing key. Note, that the first
570 @option{--local-users} option also sets this key if it has not yet been
571 set; however @option{--default-key} always overrides this.
574 @item --local-user @var{user_id}
575 @item -u @var{user_id}
577 Set the user(s) to be used for signing. The default is the first
578 secret key found in the database.
581 @item --recipient @var{name}
584 Encrypt to the user id @var{name}. There are several ways a user id
585 may be given (@pxref{how-to-specify-a-user-id}).
588 @item --output @var{file}
591 Write output to @var{file}. The default is to write it to stdout.
594 @anchor{gpgsm-option --with-key-data}
595 @item --with-key-data
596 @opindex with-key-data
597 Displays extra information with the @code{--list-keys} commands. Especially
598 a line tagged @code{grp} is printed which tells you the keygrip of a
599 key. This string is for example used as the file name of the
600 secret key. Implies @code{--with-colons}.
602 @anchor{gpgsm-option --with-validation}
603 @item --with-validation
604 @opindex with-validation
605 When doing a key listing, do a full validation check for each key and
606 print the result. This is usually a slow operation because it
607 requires a CRL lookup and other operations.
609 When used along with @option{--import}, a validation of the certificate to
610 import is done and only imported if it succeeds the test. Note that
611 this does not affect an already available certificate in the DB.
612 This option is therefore useful to simply verify a certificate.
615 @item --with-md5-fingerprint
616 For standard key listings, also print the MD5 fingerprint of the
620 Include the keygrip in standard key listings. Note that the keygrip is
621 always listed in @option{--with-colons} mode.
625 Include info about the presence of a secret key in public key listings
626 done with @code{--with-colons}.
630 @c *******************************************
631 @c ************* CMS OPTIONS ***************
632 @c *******************************************
634 @subsection How to change how the CMS is created
637 @item --include-certs @var{n}
638 @opindex include-certs
639 Using @var{n} of -2 includes all certificate except for the root cert,
640 -1 includes all certs, 0 does not include any certs, 1 includes only the
641 signers cert and all other positive values include up to @var{n}
642 certificates starting with the signer cert. The default is -2.
644 @item --cipher-algo @var{oid}
646 Use the cipher algorithm with the ASN.1 object identifier @var{oid} for
647 encryption. For convenience the strings @code{3DES}, @code{AES} and
648 @code{AES256} may be used instead of their OIDs. The default is
649 @code{AES} (2.16.840.1.101.3.4.1.2).
651 @item --digest-algo @code{name}
652 Use @code{name} as the message digest algorithm. Usually this
653 algorithm is deduced from the respective signing certificate. This
654 option forces the use of the given algorithm and may lead to severe
655 interoperability problems.
661 @c *******************************************
662 @c ******** ESOTERIC OPTIONS ***************
663 @c *******************************************
664 @node Esoteric Options
665 @subsection Doing things one usually do not want to do
670 @item --chuid @var{uid}
672 Change the current user to @var{uid} which may either be a number or a
673 name. This can be used from the root account to run gpgsm for
674 another user. If @var{uid} is not the current UID a standard PATH is
675 set and the envvar GNUPGHOME is unset. To override the latter the
676 option @option{--homedir} can be used. This option has only an effect
677 when used on the command line. This option has currently no effect at
681 @item --extra-digest-algo @var{name}
682 @opindex extra-digest-algo
683 Sometimes signatures are broken in that they announce a different digest
684 algorithm than actually used. @command{gpgsm} uses a one-pass data
685 processing model and thus needs to rely on the announced digest
686 algorithms to properly hash the data. As a workaround this option may
687 be used to tell @command{gpgsm} to also hash the data using the algorithm
688 @var{name}; this slows processing down a little bit but allows verification of
689 such broken signatures. If @command{gpgsm} prints an error like
690 ``digest algo 8 has not been enabled'' you may want to try this option,
691 with @samp{SHA256} for @var{name}.
693 @item --compliance @var{string}
695 Set the compliance mode. Valid values are shown when using "help" for
698 @item --min-rsa-length @var{n}
699 @opindex min-rsa-length
700 This option adjusts the compliance mode "de-vs" for stricter key size
701 requirements. For example, a value of 3000 turns rsa2048 and dsa2048
702 keys into non-VS-NfD compliant keys.
704 @item --faked-system-time @var{epoch}
705 @opindex faked-system-time
706 This option is only useful for testing; it sets the system time back or
707 forth to @var{epoch} which is the number of seconds elapsed since the year
708 1970. Alternatively @var{epoch} may be given as a full ISO time string
709 (e.g. "20070924T154812").
711 @item --with-ephemeral-keys
712 @opindex with-ephemeral-keys
713 Include ephemeral flagged keys in the output of key listings. Note
714 that they are included anyway if the key specification for a listing
715 is given as fingerprint or keygrip.
717 @item --debug-level @var{level}
719 Select the debug level for investigating problems. @var{level} may be
720 a numeric value or by a keyword:
724 No debugging at all. A value of less than 1 may be used instead of
727 Some basic debug messages. A value between 1 and 2 may be used
728 instead of the keyword.
730 More verbose debug messages. A value between 3 and 5 may be used
731 instead of the keyword.
733 Even more detailed messages. A value between 6 and 8 may be used
734 instead of the keyword.
736 All of the debug messages you can get. A value greater than 8 may be
737 used instead of the keyword. The creation of hash tracing files is
738 only enabled if the keyword is used.
741 How these messages are mapped to the actual debugging flags is not
742 specified and may change with newer releases of this program. They are
743 however carefully selected to best aid in debugging.
745 @item --debug @var{flags}
747 Set debug flags. All flags are or-ed and @var{flags} may be given
748 in C syntax (e.g. 0x0042) or as a comma separated list of flag names.
749 To get a list of all supported flags the single word "help" can be
750 used. This option is only useful for debugging and the behavior may
751 change at any time without notice.
753 Note, that all flags set using this option may get overridden by
754 @code{--debug-level}.
758 Same as @code{--debug=0xffffffff}
760 @item --debug-allow-core-dump
761 @opindex debug-allow-core-dump
762 Usually @command{gpgsm} tries to avoid dumping core by well written code and by
763 disabling core dumps for security reasons. However, bugs are pretty
764 durable beasts and to squash them it is sometimes useful to have a core
765 dump. This option enables core dumps unless the Bad Thing happened
766 before the option parsing.
768 @item --debug-no-chain-validation
769 @opindex debug-no-chain-validation
770 This is actually not a debugging option but only useful as such. It
771 lets @command{gpgsm} bypass all certificate chain validation checks.
773 @item --debug-ignore-expiration
774 @opindex debug-ignore-expiration
775 This is actually not a debugging option but only useful as such. It
776 lets @command{gpgsm} ignore all notAfter dates, this is used by the regression
779 @item --passphrase-fd @code{n}
780 @opindex passphrase-fd
781 Read the passphrase from file descriptor @code{n}. Only the first line
782 will be read from file descriptor @code{n}. If you use 0 for @code{n},
783 the passphrase will be read from STDIN. This can only be used if only
784 one passphrase is supplied.
786 Note that this passphrase is only used if the option @option{--batch}
789 @item --pinentry-mode @code{mode}
790 @opindex pinentry-mode
791 Set the pinentry mode to @code{mode}. Allowed values for @code{mode}
795 Use the default of the agent, which is @code{ask}.
797 Force the use of the Pinentry.
799 Emulate use of Pinentry's cancel button.
801 Return a Pinentry error (``No Pinentry'').
803 Redirect Pinentry queries to the caller. Note that in contrast to
804 Pinentry the user is not prompted again if he enters a bad password.
807 @item --request-origin @var{origin}
808 @opindex request-origin
809 Tell gpgsm to assume that the operation ultimately originated at
810 @var{origin}. Depending on the origin certain restrictions are applied
811 and the Pinentry may include an extra note on the origin. Supported
812 values for @var{origin} are: @code{local} which is the default,
813 @code{remote} to indicate a remote origin or @code{browser} for an
814 operation requested by a web browser.
816 @item --no-common-certs-import
817 @opindex no-common-certs-import
818 Suppress the import of common certificates on keybox creation.
822 All the long options may also be given in the configuration file after
823 stripping off the two leading dashes.
825 @c *******************************************
826 @c *************** ****************
827 @c *************** USER ID ****************
828 @c *************** ****************
829 @c *******************************************
830 @mansect how to specify a user id
832 @include specify-user-id.texi
835 @c *******************************************
836 @c *************** ****************
837 @c *************** FILES ****************
838 @c *************** ****************
839 @c *******************************************
841 @node GPGSM Configuration
842 @section Configuration files
844 There are a few configuration files to control certain aspects of
845 @command{gpgsm}'s operation. Unless noted, they are expected in the
846 current home directory (@pxref{option --homedir}).
852 This is the standard configuration file read by @command{gpgsm} on
853 startup. It may contain any valid long option; the leading two dashes
854 may not be entered and the option may not be abbreviated. This default
855 name may be changed on the command line (@pxref{gpgsm-option --options}).
856 You should backup this file.
860 This is an optional configuration file read by @command{gpgsm} on
861 startup. It may contain options pertaining to all components of
862 GnuPG. Its current main use is for the "use-keyboxd" option.
865 @efindex policies.txt
866 This is a list of allowed CA policies. This file should list the
867 object identifiers of the policies line by line. Empty lines and
868 lines starting with a hash mark are ignored. Policies missing in this
869 file and not marked as critical in the certificate will print only a
870 warning; certificates with policies marked as critical and not listed
871 in this file will fail the signature verification. You should backup
874 For example, to allow only the policy 2.289.9.9, the file should look
885 @efindex qualified.txt
886 This is the list of root certificates used for qualified certificates.
887 They are defined as certificates capable of creating legally binding
888 signatures in the same way as handwritten signatures are. Comments
889 start with a hash mark and empty lines are ignored. Lines do have a
890 length limit but this is not a serious limitation as the format of the
891 entries is fixed and checked by @command{gpgsm}: A non-comment line starts with
892 optional whitespace, followed by exactly 40 hex characters, white space
893 and a lowercased 2 letter country code. Additional data delimited with
894 by a white space is current ignored but might late be used for other
897 Note that even if a certificate is listed in this file, this does not
898 mean that the certificate is trusted; in general the certificates listed
899 in this file need to be listed also in @file{trustlist.txt}. This is a global
900 file an installed in the sysconf directory (e.g.
901 @file{@value{SYSCONFDIR}/qualified.txt}).
903 Every time @command{gpgsm} uses a certificate for signing or verification
904 this file will be consulted to check whether the certificate under
905 question has ultimately been issued by one of these CAs. If this is the
906 case the user will be informed that the verified signature represents a
907 legally binding (``qualified'') signature. When creating a signature
908 using such a certificate an extra prompt will be issued to let the user
909 confirm that such a legally binding signature shall really be created.
911 Because this software has not yet been approved for use with such
912 certificates, appropriate notices will be shown to indicate this fact.
916 This is plain text file with a few help entries used with
917 @command{pinentry} as well as a large list of help items for
918 @command{gpg} and @command{gpgsm}. The standard file has English help
919 texts; to install localized versions use filenames like @file{help.LL.txt}
920 with LL denoting the locale. GnuPG comes with a set of predefined help
921 files in the data directory (e.g. @file{@value{DATADIR}/gnupg/help.de.txt})
922 and allows overriding of any help item by help files stored in the
923 system configuration directory (e.g. @file{@value{SYSCONFDIR}/help.de.txt}).
924 For a reference of the help file's syntax, please see the installed
925 @file{help.txt} file.
929 @efindex com-certs.pem
930 This file is a collection of common certificates used to populated a
931 newly created @file{pubring.kbx}. An administrator may replace this
932 file with a custom one. The format is a concatenation of PEM encoded
933 X.509 certificates. This global file is installed in the data directory
934 (e.g. @file{@value{DATADIR}/com-certs.pem}).
939 Note that on larger installations, it is useful to put predefined files
940 into the directory @file{/etc/skel/.gnupg/} so that newly created users
941 start up with a working configuration. For existing users a small
942 helper script is provided to create these files (@pxref{addgnupghome}).
944 For internal purposes @command{gpgsm} creates and maintains a few other files;
945 they all live in the current home directory (@pxref{option
946 --homedir}). Only @command{gpgsm} may modify these files.
952 This a database file storing the certificates as well as meta
953 information. For debugging purposes the tool @command{kbxutil} may be
954 used to show the internal structure of this file. You should backup
959 This content of this file is used to maintain the internal state of the
960 random number generator across invocations. The same file is used by
961 other programs of this software too.
966 @command{gpgsm} will first try to connect to this socket for
967 accessing @command{gpg-agent} before starting a new @command{gpg-agent}
968 instance. Under Windows this socket (which in reality be a plain file
969 describing a regular TCP listening port) is the standard way of
970 connecting the @command{gpg-agent}.
975 @c *******************************************
976 @c *************** ****************
977 @c *************** EXAMPLES ****************
978 @c *************** ****************
979 @c *******************************************
985 $ gpgsm -er goo@@bar.net <plaintext >ciphertext
989 @c *******************************************
990 @c *************** **************
991 @c *************** UNATTENDED **************
992 @c *************** **************
993 @c *******************************************
995 @node Unattended Usage
996 @section Unattended Usage
998 @command{gpgsm} is often used as a backend engine by other software. To help
999 with this a machine interface has been defined to have an unambiguous
1000 way to do this. This is most likely used with the @code{--server} command
1001 but may also be used in the standard operation mode by using the
1002 @code{--status-fd} option.
1005 * Automated signature checking:: Automated signature checking.
1006 * CSR and certificate creation:: CSR and certificate creation.
1009 @node Automated signature checking
1010 @subsection Automated signature checking
1012 It is very important to understand the semantics used with signature
1013 verification. Checking a signature is not as simple as it may sound and
1014 so the operation is a bit complicated. In most cases it is required
1015 to look at several status lines. Here is a table of all cases a signed
1019 @item The signature is valid
1020 This does mean that the signature has been successfully verified, the
1021 certificates are all sane. However there are two subcases with
1022 important information: One of the certificates may have expired or a
1023 signature of a message itself as expired. It is a sound practise to
1024 consider such a signature still as valid but additional information
1025 should be displayed. Depending on the subcase @command{gpgsm} will issue
1028 @item signature valid and nothing did expire
1029 @code{GOODSIG}, @code{VALIDSIG}, @code{TRUST_FULLY}
1030 @item signature valid but at least one certificate has expired
1031 @code{EXPKEYSIG}, @code{VALIDSIG}, @code{TRUST_FULLY}
1032 @item signature valid but expired
1033 @code{EXPSIG}, @code{VALIDSIG}, @code{TRUST_FULLY}
1034 Note, that this case is currently not implemented.
1037 @item The signature is invalid
1038 This means that the signature verification failed (this is an indication
1039 of a transfer error, a program error or tampering with the message).
1040 @command{gpgsm} issues one of these status codes sequences:
1043 @item @code{GOODSIG}, @code{VALIDSIG} @code{TRUST_NEVER}
1046 @item Error verifying a signature
1047 For some reason the signature could not be verified, i.e. it cannot be
1048 decided whether the signature is valid or invalid. A common reason for
1049 this is a missing certificate.
1053 @node CSR and certificate creation
1054 @subsection CSR and certificate creation
1056 The command @option{--generate-key} may be used along with the option
1057 @option{--batch} to either create a certificate signing request (CSR)
1058 or an X.509 certificate. This is controlled by a parameter file; the
1059 format of this file is as follows:
1062 @item Text only, line length is limited to about 1000 characters.
1063 @item UTF-8 encoding must be used to specify non-ASCII characters.
1064 @item Empty lines are ignored.
1065 @item Leading and trailing while space is ignored.
1066 @item A hash sign as the first non white space character indicates
1068 @item Control statements are indicated by a leading percent sign, the
1069 arguments are separated by white space from the keyword.
1070 @item Parameters are specified by a keyword, followed by a colon. Arguments
1071 are separated by white space.
1072 @item The first parameter must be @samp{Key-Type}, control statements
1073 may be placed anywhere.
1075 The order of the parameters does not matter except for @samp{Key-Type}
1076 which must be the first parameter. The parameters are only used for
1077 the generated CSR/certificate; parameters from previous sets are not
1078 used. Some syntactically checks may be performed.
1080 Key generation takes place when either the end of the parameter file
1081 is reached, the next @samp{Key-Type} parameter is encountered or at the
1082 control statement @samp{%commit} is encountered.
1090 @item %echo @var{text}
1091 Print @var{text} as diagnostic.
1094 Suppress actual key generation (useful for syntax checking).
1097 Perform the key generation. Note that an implicit commit is done at
1098 the next @asis{Key-Type} parameter.
1100 @c %certfile <filename>
1101 @c [Not yet implemented!]
1102 @c Do not write the certificate to the keyDB but to <filename>.
1103 @c This must be given before the first
1104 @c commit to take place, duplicate specification of the same filename
1105 @c is ignored, the last filename before a commit is used.
1106 @c The filename is used until a new filename is used (at commit points)
1107 @c and all keys are written to that file. If a new filename is given,
1108 @c this file is created (and overwrites an existing one).
1109 @c Both control statements must be given.
1117 @item Key-Type: @var{algo}
1118 Starts a new parameter block by giving the type of the primary
1119 key. The algorithm must be capable of signing. This is a required
1120 parameter. The supported values for @var{algo} are @samp{rsa},
1121 @samp{ecdsa}, and @samp{eddsa}.
1123 @item Key-Length: @var{nbits}
1124 The requested length of a generated key in bits. Defaults to
1125 3072. The value is ignored for ECC algorithms.
1127 @item Key-Grip: @var{hexstring}
1128 This is optional and used to generate a CSR or certificate for an
1129 already existing key. Key-Length will be ignored when given.
1131 @item Key-Usage: @var{usage-list}
1132 Space or comma delimited list of key usage, allowed values are
1133 @samp{encrypt}, @samp{sign} and @samp{cert}. This is used to generate
1134 the keyUsage extension. Please make sure that the algorithm is
1135 capable of this usage. Default is to allow encrypt and sign.
1137 @item Name-DN: @var{subject-name}
1138 This is the Distinguished Name (DN) of the subject in RFC-2253 format.
1140 @item Name-Email: @var{string}
1141 This is an email address for the altSubjectName. This parameter is
1142 optional but may occur several times to add several email addresses to
1145 @item Name-DNS: @var{string}
1146 The is an DNS name for the altSubjectName. This parameter is optional
1147 but may occur several times to add several DNS names to a certificate.
1149 @item Name-URI: @var{string}
1150 This is an URI for the altSubjectName. This parameter is optional but
1151 may occur several times to add several URIs to a certificate.
1155 Additional parameters used to create a certificate (in contrast to a
1156 certificate signing request):
1160 @item Serial: @var{sn}
1161 If this parameter is given an X.509 certificate will be generated.
1162 @var{sn} is expected to be a hex string representing an unsigned
1163 integer of arbitrary length. The special value @samp{random} can be
1164 used to create a 64 bit random serial number.
1166 @item Issuer-DN: @var{issuer-name}
1167 This is the DN name of the issuer in RFC-2253 format. If it is not set
1168 it will default to the subject DN and a special GnuPG extension will
1169 be included in the certificate to mark it as a standalone certificate.
1171 @item Creation-Date: @var{iso-date}
1172 @itemx Not-Before: @var{iso-date}
1173 Set the notBefore date of the certificate. Either a date like
1174 @samp{1986-04-26} or @samp{1986-04-26 12:00} or a standard ISO
1175 timestamp like @samp{19860426T042640} may be used. The time is
1176 considered to be UTC. If it is not given the current date is used.
1178 @item Expire-Date: @var{iso-date}
1179 @itemx Not-After: @var{iso-date}
1180 Set the notAfter date of the certificate. Either a date like
1181 @samp{2063-04-05} or @samp{2063-04-05 17:00} or a standard ISO
1182 timestamp like @samp{20630405T170000} may be used. The time is
1183 considered to be UTC. If it is not given a default value in the not
1184 too far future is used.
1186 @item Signing-Key: @var{keygrip}
1187 This gives the keygrip of the key used to sign the certificate. If it
1188 is not given a self-signed certificate will be created. For
1189 compatibility with future versions, it is suggested to prefix the
1190 keygrip with a @samp{&}.
1192 @item Hash-Algo: @var{hash-algo}
1193 Use @var{hash-algo} for this CSR or certificate. The supported hash
1194 algorithms are: @samp{sha1}, @samp{sha256}, @samp{sha384} and
1195 @samp{sha512}; they may also be specified with uppercase letters. The
1196 default is @samp{sha256}.
1198 @item Authority-Key-Id: @var{hexstring}
1199 Insert the decoded value of @var{hexstring} as authorityKeyIdentifier.
1200 If this is not given and an ECC algorithm is used the public part of
1201 the certified public key is used as authorityKeyIdentifier. To
1202 inhibit any authorityKeyIdentifier use the special value @code{none}
1203 for @var{hexstring}.
1205 @item Subject-Key-Id: @var{hexstring}
1206 Insert the decoded value of @var{hexstring} as subjectKeyIdentifier.
1207 If this is not given and an ECC algorithm is used the public part of
1208 the signing key is used as authorityKeyIdentifier. To inhibit any
1209 subjectKeyIdentifier use the special value @code{none} for
1214 @c *******************************************
1215 @c *************** *****************
1216 @c *************** ASSSUAN *****************
1217 @c *************** *****************
1218 @c *******************************************
1219 @node GPGSM Protocol
1220 @section The Protocol the Server Mode Uses
1222 Description of the protocol used to access @command{GPGSM}.
1223 @command{GPGSM} does implement the Assuan protocol and in addition
1224 provides a regular command line interface which exhibits a full client
1225 to this protocol (but uses internal linking). To start
1226 @command{gpgsm} as a server the command line the option
1227 @code{--server} must be used. Additional options are provided to
1228 select the communication method (i.e. the name of the socket).
1230 We assume that the connection has already been established; see the
1231 Assuan manual for details.
1234 * GPGSM ENCRYPT:: Encrypting a message.
1235 * GPGSM DECRYPT:: Decrypting a message.
1236 * GPGSM SIGN:: Signing a message.
1237 * GPGSM VERIFY:: Verifying a message.
1238 * GPGSM GENKEY:: Generating a key.
1239 * GPGSM LISTKEYS:: List available keys.
1240 * GPGSM EXPORT:: Export certificates.
1241 * GPGSM IMPORT:: Import certificates.
1242 * GPGSM DELETE:: Delete certificates.
1243 * GPGSM GETAUDITLOG:: Retrieve an audit log.
1244 * GPGSM GETINFO:: Information about the process
1245 * GPGSM OPTION:: Session options.
1250 @subsection Encrypting a Message
1252 Before encryption can be done the recipient must be set using the
1256 RECIPIENT @var{userID}
1259 Set the recipient for the encryption. @var{userID} should be the
1260 internal representation of the key; the server may accept any other way
1261 of specification. If this is a valid and trusted recipient the server
1262 does respond with OK, otherwise the return is an ERR with the reason why
1263 the recipient cannot be used, the encryption will then not be done for
1264 this recipient. If the policy is not to encrypt at all if not all
1265 recipients are valid, the client has to take care of this. All
1266 @code{RECIPIENT} commands are cumulative until a @code{RESET} or an
1267 successful @code{ENCRYPT} command.
1270 INPUT FD[=@var{n}] [--armor|--base64|--binary]
1273 Set the file descriptor for the message to be encrypted to @var{n}.
1274 Obviously the pipe must be open at that point, the server establishes
1275 its own end. If the server returns an error the client should consider
1276 this session failed. If @var{n} is not given, this commands uses the
1277 last file descriptor passed to the application.
1278 @xref{fun-assuan_sendfd, ,the assuan_sendfd function,assuan,the Libassuan
1279 manual}, on how to do descriptor passing.
1281 The @code{--armor} option may be used to advise the server that the
1282 input data is in @acronym{PEM} format, @code{--base64} advises that a
1283 raw base-64 encoding is used, @code{--binary} advises of raw binary
1284 input (@acronym{BER}). If none of these options is used, the server
1285 tries to figure out the used encoding, but this may not always be
1289 OUTPUT FD[=@var{n}] [--armor|--base64]
1292 Set the file descriptor to be used for the output (i.e. the encrypted
1293 message). Obviously the pipe must be open at that point, the server
1294 establishes its own end. If the server returns an error the client
1295 should consider this session failed.
1297 The option @option{--armor} encodes the output in @acronym{PEM} format, the
1298 @option{--base64} option applies just a base-64 encoding. No option
1299 creates binary output (@acronym{BER}).
1301 The actual encryption is done using the command
1307 It takes the plaintext from the @code{INPUT} command, writes to the
1308 ciphertext to the file descriptor set with the @code{OUTPUT} command,
1309 take the recipients from all the recipients set so far. If this command
1310 fails the clients should try to delete all output currently done or
1311 otherwise mark it as invalid. @command{GPGSM} does ensure that there
1313 security problem with leftover data on the output in this case.
1315 This command should in general not fail, as all necessary checks have
1316 been done while setting the recipients. The input and output pipes are
1321 @subsection Decrypting a message
1323 Input and output FDs are set the same way as in encryption, but
1324 @code{INPUT} refers to the ciphertext and @code{OUTPUT} to the plaintext. There
1325 is no need to set recipients. @command{GPGSM} automatically strips any
1326 @acronym{S/MIME} headers from the input, so it is valid to pass an
1327 entire MIME part to the INPUT pipe.
1329 The decryption is done by using the command
1335 It performs the decrypt operation after doing some check on the internal
1336 state (e.g. that all needed data has been set). Because it utilizes
1337 the GPG-Agent for the session key decryption, there is no need to ask
1338 the client for a protecting passphrase - GpgAgent takes care of this by
1339 requesting this from the user.
1343 @subsection Signing a Message
1345 Signing is usually done with these commands:
1348 INPUT FD[=@var{n}] [--armor|--base64|--binary]
1351 This tells @command{GPGSM} to read the data to sign from file descriptor @var{n}.
1354 OUTPUT FD[=@var{m}] [--armor|--base64]
1357 Write the output to file descriptor @var{m}. If a detached signature is
1358 requested, only the signature is written.
1364 Sign the data set with the @code{INPUT} command and write it to the sink set by
1365 @code{OUTPUT}. With @code{--detached}, a detached signature is created
1368 The key used for signing is the default one or the one specified in
1369 the configuration file. To get finer control over the keys, it is
1370 possible to use the command
1376 to set the signer's key. @var{userID} should be the
1377 internal representation of the key; the server may accept any other way
1378 of specification. If this is a valid and trusted recipient the server
1379 does respond with OK, otherwise the return is an ERR with the reason why
1380 the key cannot be used, the signature will then not be created using
1381 this key. If the policy is not to sign at all if not all
1382 keys are valid, the client has to take care of this. All
1383 @code{SIGNER} commands are cumulative until a @code{RESET} is done.
1384 Note that a @code{SIGN} does not reset this list of signers which is in
1385 contrast to the @code{RECIPIENT} command.
1389 @subsection Verifying a Message
1391 To verify a message the command:
1397 is used. It does a verify operation on the message send to the input FD.
1398 The result is written out using status lines. If an output FD was
1399 given, the signed text will be written to that. If the signature is a
1400 detached one, the server will inquire about the signed material and the
1401 client must provide it.
1404 @subsection Generating a Key
1406 This is used to generate a new keypair, store the secret part in the
1407 @acronym{PSE} and the public key in the key database. We will probably
1408 add optional commands to allow the client to select whether a hardware
1409 token is used to store the key. Configuration options to
1410 @command{GPGSM} can be used to restrict the use of this command.
1416 @command{GPGSM} checks whether this command is allowed and then does an
1417 INQUIRY to get the key parameters, the client should then send the
1418 key parameters in the native format:
1421 S: INQUIRE KEY_PARAM native
1427 Please note that the server may send Status info lines while reading the
1428 data lines from the client. After this the key generation takes place
1429 and the server eventually does send an ERR or OK response. Status lines
1430 may be issued as a progress indicator.
1433 @node GPGSM LISTKEYS
1434 @subsection List available keys
1435 @anchor{gpgsm-cmd listkeys}
1437 To list the keys in the internal database or using an external key
1438 provider, the command:
1441 LISTKEYS @var{pattern}
1444 is used. To allow multiple patterns (which are ORed during the search)
1445 quoting is required: Spaces are to be translated into "+" or into "%20";
1446 in turn this requires that the usual escape quoting rules are done.
1449 LISTSECRETKEYS @var{pattern}
1452 Lists only the keys where a secret key is available.
1454 The list commands are affected by the option
1457 OPTION list-mode=@var{mode}
1463 Use default (which is usually the same as 1).
1465 List only the internal keys.
1467 List only the external keys.
1469 List internal and external keys.
1472 Note that options are valid for the entire session.
1476 @subsection Export certificates
1478 To export certificate from the internal key database the command:
1481 EXPORT [--data [--armor] [--base64]] [--] @var{pattern}
1484 is used. To allow multiple patterns (which are ORed) quoting is
1485 required: Spaces are to be translated into "+" or into "%20"; in turn
1486 this requires that the usual escape quoting rules are done.
1488 If the @option{--data} option has not been given, the format of the
1489 output depends on what was set with the @code{OUTPUT} command. When using
1490 @acronym{PEM} encoding a few informational lines are prepended.
1492 If the @option{--data} has been given, a target set via @code{OUTPUT} is
1493 ignored and the data is returned inline using standard
1494 @code{D}-lines. This avoids the need for an extra file descriptor. In
1495 this case the options @option{--armor} and @option{--base64} may be used
1496 in the same way as with the @code{OUTPUT} command.
1500 @subsection Import certificates
1502 To import certificates into the internal key database, the command
1505 IMPORT [--re-import]
1508 is used. The data is expected on the file descriptor set with the
1509 @code{INPUT} command. Certain checks are performed on the
1510 certificate. Note that the code will also handle PKCS#12 files and
1511 import private keys; a helper program is used for that.
1513 With the option @option{--re-import} the input data is expected to a be
1514 a linefeed separated list of fingerprints. The command will re-import
1515 the corresponding certificates; that is they are made permanent by
1516 removing their ephemeral flag.
1520 @subsection Delete certificates
1522 To delete a certificate the command
1525 DELKEYS @var{pattern}
1528 is used. To allow multiple patterns (which are ORed) quoting is
1529 required: Spaces are to be translated into "+" or into "%20"; in turn
1530 this requires that the usual escape quoting rules are done.
1532 The certificates must be specified unambiguously otherwise an error is
1535 @node GPGSM GETAUDITLOG
1536 @subsection Retrieve an audit log
1537 @anchor{gpgsm-cmd getauditlog}
1539 This command is used to retrieve an audit log.
1542 GETAUDITLOG [--data] [--html]
1545 If @option{--data} is used, the audit log is send using D-lines
1546 instead of being sent to the file descriptor given by an @code{OUTPUT}
1547 command. If @option{--html} is used, the output is formatted as an
1548 XHTML block. This is designed to be incorporated into a HTML
1553 @subsection Return information about the process
1555 This is a multipurpose function to return a variety of information.
1561 The value of @var{what} specifies the kind of information returned:
1564 Return the version of the program.
1566 Return the process id of the process.
1568 Return OK if the agent is running.
1569 @item cmd_has_option @var{cmd} @var{opt}
1570 Return OK if the command @var{cmd} implements the option @var{opt}.
1571 The leading two dashes usually used with @var{opt} shall not be given.
1573 Return OK if the connection is in offline mode. This may be either
1574 due to a @code{OPTION offline=1} or due to @command{gpgsm} being
1575 started with option @option{--disable-dirmngr}.
1579 @subsection Session options
1581 The standard Assuan option handler supports these options.
1584 OPTION @var{name}[=@var{value}]
1587 These @var{name}s are recognized:
1592 Change the session's environment to be passed via gpg-agent to
1593 Pinentry. @var{value} is a string of the form
1594 @code{<KEY>[=[<STRING>]]}. If only @code{<KEY>} is given the
1595 environment variable @code{<KEY>} is removed from the session
1596 environment, if @code{<KEY>=} is given that environment variable is
1597 set to the empty string, and if @code{<STRING>} is given it is set to
1602 Set the session environment variable @code{DISPLAY} is set to @var{value}.
1605 Set the session environment variable @code{GPG_TTY} is set to @var{value}.
1608 Set the session environment variable @code{TERM} is set to @var{value}.
1611 Set the session environment variable @code{LC_CTYPE} is set to @var{value}.
1613 @efindex LC_MESSAGES
1614 Set the session environment variable @code{LC_MESSAGES} is set to @var{value}.
1617 Set the session environment variable @code{XAUTHORITY} is set to @var{value}.
1618 @item pinentry-user-data
1619 @efindex PINENTRY_USER_DATA
1620 Set the session environment variable @code{PINENTRY_USER_DATA} is set
1624 This option overrides the command line option
1625 @option{--include-certs}. A @var{value} of -2 includes all
1626 certificates except for the root certificate, -1 includes all
1627 certificates, 0 does not include any certificates, 1 includes only the
1628 signers certificate and all other positive values include up to
1629 @var{value} certificates starting with the signer cert.
1632 @xref{gpgsm-cmd listkeys}.
1634 @item list-to-output
1635 If @var{value} is true the output of the list commands
1636 (@pxref{gpgsm-cmd listkeys}) is written to the file descriptor set
1637 with the last @code{OUTPUT} command. If @var{value} is false the output is
1638 written via data lines; this is the default.
1640 @item with-validation
1641 If @var{value} is true for each listed certificate the validation
1642 status is printed. This may result in the download of a CRL or the
1643 user being asked about the trustworthiness of a root certificate. The
1644 default is given by a command line option (@pxref{gpgsm-option
1645 --with-validation}).
1649 If @var{value} is true certificates with a corresponding private key
1650 are marked by the list commands.
1652 @item validation-model
1653 This option overrides the command line option
1654 @option{validation-model} for the session.
1655 (@xref{gpgsm-option --validation-model}.)
1658 This option globally enables the command line option
1659 @option{--with-key-data}. (@xref{gpgsm-option --with-key-data}.)
1661 @item enable-audit-log
1662 If @var{value} is true data to write an audit log is gathered.
1663 (@xref{gpgsm-cmd getauditlog}.)
1665 @item allow-pinentry-notify
1666 If this option is used notifications about the launch of a Pinentry
1667 are passed back to the client.
1669 @item with-ephemeral-keys
1670 If @var{value} is true ephemeral certificates are included in the
1671 output of the list commands.
1674 If this option is used all keys set by the command line option
1675 @option{--encrypt-to} are ignored.
1678 If @var{value} is true or @var{value} is not given all network access
1679 is disabled for this session. This is the same as the command line
1680 option @option{--disable-dirmngr}.
1687 @command{gpg-agent}(1)
1689 @include see-also-note.texi