1GPGSM(1)                     GNU Privacy Guard 2.2                    GPGSM(1)
2
3
4

NAME

6       gpgsm - CMS encryption and signing tool
7

SYNOPSIS

9       gpgsm [--homedir dir] [--options file] [options] command [args]
10
11
12

DESCRIPTION

14       gpgsm  is a tool similar to gpg to provide digital encryption and sign‐
15       ing services on X.509 certificates and the CMS protocol.  It is  mainly
16       used  as  a  backend for S/MIME mail processing.  gpgsm includes a full
17       featured certificate management and complies with all rules defined for
18       the German Sphinx project.
19
20
21
22
23

COMMANDS

25       Commands  are  not  distinguished from options except for the fact that
26       only one command is allowed.
27
28
29
30
31
32   Commands not specific to the function
33
34
35
36       --version
37              Print the program version and licensing information.  Note  that
38              you cannot abbreviate this command.
39
40
41       --help, -h
42              Print  a  usage message summarizing the most useful command-line
43              options.  Note that you cannot abbreviate this command.
44
45
46       --warranty
47              Print warranty information.  Note  that  you  cannot  abbreviate
48              this command.
49
50
51       --dump-options
52              Print  a  list of all available options and commands.  Note that
53              you cannot abbreviate this command.
54
55   Commands to select the type of operation
56
57
58
59       --encrypt
60              Perform an encryption.  The keys the data is encrypted  to  must
61              be set using the option --recipient.
62
63
64       --decrypt
65              Perform  a decryption; the type of input is automatically deter‐
66              mined.  It may either be in binary form or  PEM  encoded;  auto‐
67              matic determination of base-64 encoding is not done.
68
69
70       --sign Create a digital signature.  The key used is either the fist one
71              found in the keybox or those set with the --local-user option.
72
73
74       --verify
75              Check a signature file for validity.  Depending on the arguments
76              a detached signature may also be checked.
77
78
79       --server
80              Run in server mode and wait for commands on the stdin.
81
82
83       --call-dirmngr command [args]
84              Behave  as a Dirmngr client issuing the request command with the
85              optional list of args.  The output of  the  Dirmngr  is  printed
86              stdout.   Please  note that file names given as arguments should
87              have an absolute file name (i.e. commencing with /) because they
88              are  passed verbatim to the Dirmngr and the working directory of
89              the Dirmngr might not be the same as the  one  of  this  client.
90              Currently it is not possible to pass data via stdin to the Dirm‐
91              ngr.  command should not contain spaces.
92
93              This is command is required for certain maintaining tasks of the
94              dirmngr where a dirmngr must be able to call back to gpgsm.  See
95              the Dirmngr manual for details.
96
97
98       --call-protect-tool arguments
99              Certain maintenance operations are done by an  external  program
100              call gpg-protect-tool; this is usually not installed in a direc‐
101              tory listed in the PATH variable.  This command provides a  sim‐
102              ple  wrapper to access this tool.  arguments are passed verbatim
103              to this command; use ‘--help’ to get a list of supported  opera‐
104              tions.
105
106
107
108   How to manage the certificates and keys
109
110
111
112       --generate-key
113       --gen-key
114              This  command  allows  the creation of a certificate signing re‐
115              quest or a self-signed certificate.  It is commonly  used  along
116              with  the --output option to save the created CSR or certificate
117              into a file.  If used with the --batch a parameter file is  used
118              to  create  the CSR or certificate and it is further possible to
119              create non-self-signed certificates.
120
121
122       --list-keys
123       -k     List all available certificates stored in the  local  key  data‐
124              base.   Note  that  the  displayed data might be reformatted for
125              better human readability and illegal characters are replaced  by
126              safe substitutes.
127
128
129       --list-secret-keys
130       -K     List  all available certificates for which a corresponding a se‐
131              cret key is available.
132
133
134       --list-external-keys pattern
135              List certificates matching pattern  using  an  external  server.
136              This utilizes the dirmngr service.
137
138
139       --list-chain
140              Same  as  --list-keys  but  also  prints  all keys making up the
141              chain.
142
143
144
145       --dump-cert
146       --dump-keys
147              List all available certificates stored in the local key database
148              using a format useful mainly for debugging.
149
150
151       --dump-chain
152              Same  as  --dump-keys  but  also  prints  all keys making up the
153              chain.
154
155
156       --dump-secret-keys
157              List all available certificates for which a corresponding a  se‐
158              cret  key  is  available using a format useful mainly for debug‐
159              ging.
160
161
162       --dump-external-keys pattern
163              List certificates matching pattern  using  an  external  server.
164              This  utilizes  the  dirmngr  service.   It uses a format useful
165              mainly for debugging.
166
167
168       --show-certs [files]
169              This command takes certificate files as input and prints  infor‐
170              mation  about them in the same format as --dump-cert does.  Each
171              file may either contain a single binary certificate  or  several
172              PEM  encoded  certificates.  If no files are given, the input is
173              taken from stdin.
174
175              Please note that the listing format may be changed in future re‐
176              leases  and  that  the option --with-colons has currently no ef‐
177              fect.
178
179
180
181       --keydb-clear-some-cert-flags
182              This is a debugging aid to reset certain flags in the key  data‐
183              base  which  are used to cache certain certificate statuses.  It
184              is especially useful if a bad CRL or a weird  running  OCSP  re‐
185              sponder  did accidentally revoke certificate.  There is no secu‐
186              rity issue with this command because gpgsm always make sure that
187              the  validity  of  a  certificate  is checked right before it is
188              used.
189
190
191       --delete-keys pattern
192              Delete the keys matching pattern.  Note that there is no command
193              to delete the secret part of the key directly.  In case you need
194              to do this, you should run the command gpgsm  --dump-secret-keys
195              KEYID  before  you delete the key, copy the string of hex-digits
196              in the ``keygrip'' line and delete the file consisting of  these
197              hex-digits  and the suffix .key from the ‘private-keys-v1.d’ di‐
198              rectory below our GnuPG home directory (usually ‘~/.gnupg’).
199
200
201       --export [pattern]
202              Export all certificates stored in the Keybox or those  specified
203              by the optional pattern. Those pattern consist of a list of user
204              ids (see: [how-to-specify-a-user-id]).  When used along with the
205              --armor  option  a  few informational lines are prepended before
206              each block.  There is one limitation: As there  is  no  commonly
207              agreed  upon way to pack more than one certificate into an ASN.1
208              structure, the binary export (i.e. without  using  armor)  works
209              only  for the export of one certificate.  Thus it is required to
210              specify  a  pattern  which  yields  exactly   one   certificate.
211              Ephemeral certificate are only exported if all pattern are given
212              as fingerprints or keygrips.
213
214
215       --export-secret-key-p12 key-id
216              Export the private key and the certificate identified by  key-id
217              using  the  PKCS#12 format.  When used with the --armor option a
218              few informational lines are prepended to the output.  Note, that
219              the PKCS#12 format is not very secure and proper transport secu‐
220              rity should be used to convey the exported key.   (See:  [option
221              --p12-charset].)
222
223
224       --export-secret-key-p8 key-id
225       --export-secret-key-raw key-id
226              Export  the  private key of the certificate identified by key-id
227              with any encryption stripped.  The ...-raw  command  exports  in
228              PKCS#1  format;  the  ...-p8  command  exports in PKCS#8 format.
229              When used with the --armor option a few informational lines  are
230              prepended to the output.  These commands are useful to prepare a
231              key for use on a TLS server.
232
233
234       --import [files]
235              Import the certificates from the PEM or binary encoded files  as
236              well  as  from  signed-only  messages.  This command may also be
237              used to import a secret key from a PKCS#12 file.
238
239
240       --learn-card
241              Read information about the private keys from the  smartcard  and
242              import  the  certificates from there.  This command utilizes the
243              gpg-agent and in turn the scdaemon.
244
245
246       --change-passphrase user_id
247       --passwd user_id
248              Change the passphrase of the private key belonging to  the  cer‐
249              tificate   specified   as  user_id.   Note,  that  changing  the
250              passphrase/PIN of a smartcard is not yet supported.
251
252

OPTIONS

254       GPGSM features a bunch of options to control the exact behaviour and to
255       change the default configuration.
256
257
258
259
260
261   How to change the configuration
262
263
264       These  options  are  used  to  change the configuration and are usually
265       found in the option file.
266
267
268
269
270       --options file
271              Reads configuration from file instead of from the  default  per-
272              user  configuration  file.   The  default  configuration file is
273              named ‘gpgsm.conf’ and expected in the  ‘.gnupg’  directory  di‐
274              rectly below the home directory of the user.
275
276
277       --homedir dir
278              Set the name of the home directory to dir. If this option is not
279              used, the home directory defaults to  ‘~/.gnupg’.   It  is  only
280              recognized  when  given  on the command line.  It also overrides
281              any home  directory  stated  through  the  environment  variable
282GNUPGHOME’ or (on Windows systems) by means of the Registry en‐
283              try HKCU\Software\GNU\GnuPG:HomeDir.
284
285              On Windows systems it is possible to install GnuPG as a portable
286              application.  In this case only this command line option is con‐
287              sidered, all other ways to set a home directory are ignored.
288
289              To install GnuPG as a portable application under Windows, create
290              an  empty  file named ‘gpgconf.ctl’ in the same directory as the
291              tool ‘gpgconf.exe’.  The root of the installation is  then  that
292              directory;  or, if ‘gpgconf.exe’ has been installed directly be‐
293              low a directory named ‘bin’, its  parent  directory.   You  also
294              need  to  make sure that the following directories exist and are
295              writable:    ‘ROOT/home’    for    the    GnuPG     home     and
296ROOT/var/cache/gnupg’ for internal cache files.
297
298
299
300       -v
301
302       --verbose
303              Outputs  additional information while running.  You can increase
304              the verbosity by giving several verbose commands to gpgsm,  such
305              as ‘-vv’.
306
307
308       --ldapserver string
309       --keyserver string
310              Add  an LDAP server to use for X.509 certificate and CRL lookup.
311              This option can be given multiple times to configure  more  than
312              one LDAP server.  Note that in general dirmngr should be config‐
313              ured with the list of LDAP servers; if this option is also  con‐
314              figured  here,  it  is  used  in addition to those configured in
315              dirmngr.  For  the  syntax  see  the  description  of  dirmngr's
316              ldapserver option.
317
318
319       --policy-file filename
320              Change the default name of the policy file to filename.  The de‐
321              fault name is ‘policies.txt’.
322
323
324       --agent-program file
325              Specify an agent program to be used for secret  key  operations.
326              The  default value is determined by running the command gpgconf.
327              Note that the pipe symbol (|) is  used  for  a  regression  test
328              suite hack and may thus not be used in the file name.
329
330
331       --dirmngr-program file
332              Specify  a  dirmngr  program to be used for CRL checks.  The de‐
333              fault value is ‘/usr/bin/dirmngr’.
334
335
336       --prefer-system-dirmngr
337              This option is obsolete and ignored.
338
339
340       --disable-dirmngr
341              Entirely disable the use of the Dirmngr.
342
343
344       --no-autostart
345              Do not start the gpg-agent or the dirmngr if it has not yet been
346              started and its service is required.  This option is mostly use‐
347              ful on machines where the connection to gpg-agent has been redi‐
348              rected  to  another machines.  If dirmngr is required on the re‐
349              mote machine, it may be started manually using gpgconf  --launch
350              dirmngr.
351
352
353       --no-secmem-warning
354              Do not print a warning when the so called "secure memory" cannot
355              be used.
356
357
358       --log-file file
359              When running in server mode, append all logging output to  file.
360              Use ‘socket://’ to log to socket.
361
362
363   Certificate related options
364
365
366
367
368       --enable-policy-checks
369       --disable-policy-checks
370              By default policy checks are enabled.  These options may be used
371              to change it.
372
373
374       --enable-crl-checks
375       --disable-crl-checks
376              By default the CRL checks are enabled and the DirMngr is used to
377              check for revoked certificates.  The disable option is most use‐
378              ful with an off-line network connection to suppress  this  check
379              and  also  to avoid that new certificates introduce a web bug by
380              including a certificate specific CRL  DP.   The  disable  option
381              also  disables an issuer certificate lookup via the authorityIn‐
382              foAccess property of the certificate;  the  --enable-issuer-key-
383              retrieve can be used to make use of that property anyway.
384
385
386       --enable-trusted-cert-crl-check
387       --disable-trusted-cert-crl-check
388              By  default  the  CRL  for trusted root certificates are checked
389              like for any other certificates.  This allows a CA to revoke its
390              own  certificates voluntary without the need of putting all ever
391              issued certificates into a CRL.  The disable option may be  used
392              to  switch this extra check off.  Due to the caching done by the
393              Dirmngr, there will not  be  any  noticeable  performance  gain.
394              Note,  that  this also disables possible OCSP checks for trusted
395              root certificates.  A more specific way of disabling this  check
396              is  by  adding  the ``relax'' keyword to the root CA line of the
397trustlist.txt
398
399
400
401       --force-crl-refresh
402              Tell the dirmngr to reload the CRL for each request.  For better
403              performance,  the  dirmngr  will  actually optimize this by sup‐
404              pressing the loading for short time intervals (e.g. 30 minutes).
405              This option is useful to make sure that a fresh CRL is available
406              for certificates hold in the keybox.  The suggested way of doing
407              this  is by using it along with the option --with-validation for
408              a key listing command.  This option should not be used in a con‐
409              figuration file.
410
411
412       --enable-issuer-based-crl-check
413              Run  a CRL check even for certificates which do not have any CRL
414              distribution point.  This requires that a suitable  LDAP  server
415              has been configured in Dirmngr and that the CRL can be found us‐
416              ing the issuer.  This option reverts to what  GnuPG  did  up  to
417              version 2.2.20.  This option is in general not useful.
418
419
420       --enable-ocsp
421       --disable-ocsp
422              By  default  OCSP checks are disabled.  The enable option may be
423              used to enable OCSP checks via Dirmngr.  If CRL checks are  also
424              enabled,  CRLs  will be used as a fallback if for some reason an
425              OCSP request will not succeed.  Note, that  you  have  to  allow
426              OCSP  requests  in  Dirmngr's configuration too (option --allow-
427              ocsp) and configure Dirmngr properly.  If you do not do  so  you
428              will get the error code ‘Not supported’.
429
430
431       --auto-issuer-key-retrieve
432              If  a required certificate is missing while validating the chain
433              of certificates, try to load that certificate from  an  external
434              location.  This usually means that Dirmngr is employed to search
435              for the certificate.  Note that this option makes  a  "web  bug"
436              like  behavior  possible.   LDAP  server operators can see which
437              keys you request, so by sending you a message signed by a  brand
438              new  key  (which  you naturally will not have on your local key‐
439              box), the operator can tell both your IP address  and  the  time
440              when you verified the signature.
441
442
443
444
445       --validation-model name
446              This option changes the default validation model.  The only pos‐
447              sible values are "shell" (which is the default),  "chain"  which
448              forces  the use of the chain model and "steed" for a new simpli‐
449              fied model.  The chain model is also used if an  option  in  the
450trustlist.txt’  or an attribute of the certificate requests it.
451              However the standard model (shell) is in that case always  tried
452              first.
453
454
455       --ignore-cert-extension oid
456              Add  oid to the list of ignored certificate extensions.  The oid
457              is expected to be in dotted decimal form, like  2.5.29.3.   This
458              option may be used more than once.  Critical flagged certificate
459              extensions matching one of the OIDs in the list are  treated  as
460              if  they  are actually handled and thus the certificate will not
461              be rejected due to an unknown critical extension.  Use this  op‐
462              tion  with care because extensions are usually flagged as criti‐
463              cal for a reason.
464
465
466   Input and Output
467
468
469
470       --armor
471       -a     Create PEM encoded output.  Default is binary output.
472
473
474       --base64
475              Create Base-64 encoded  output;  i.e.  PEM  without  the  header
476              lines.
477
478
479       --assume-armor
480              Assume  the input data is PEM encoded.  Default is to autodetect
481              the encoding but this is may fail.
482
483
484       --assume-base64
485              Assume the input data is plain base-64 encoded.
486
487
488       --assume-binary
489              Assume the input data is binary encoded.
490
491
492
493       --p12-charset name
494              gpgsm uses the UTF-8  encoding  when  encoding  passphrases  for
495              PKCS#12  files.  This option may be used to force the passphrase
496              to be encoded in the specified encoding name.  This is useful if
497              the application used to import the key uses a different encoding
498              and thus will not be able to import a file generated  by  gpgsm.
499              Commonly  used  values for name are Latin1 and CP850.  Note that
500              gpgsm itself automagically imports any file  with  a  passphrase
501              encoded to the most commonly used encodings.
502
503
504
505       --default-key user_id
506              Use  user_id  as the standard key for signing.  This key is used
507              if no other key has been defined as a signing key.   Note,  that
508              the  first --local-users option also sets this key if it has not
509              yet been set; however --default-key always overrides this.
510
511
512
513       --local-user user_id
514
515       -u user_id
516              Set the user(s) to be used for  signing.   The  default  is  the
517              first secret key found in the database.
518
519
520
521       --recipient name
522       -r     Encrypt  to  the user id name.  There are several ways a user id
523              may be given (see: [how-to-specify-a-user-id]).
524
525
526
527       --output file
528       -o file
529              Write output to file.  The default is to write it to stdout.
530
531
532
533
534       --with-key-data
535              Displays extra information with the --list-keys commands.  Espe‐
536              cially  a line tagged grp is printed which tells you the keygrip
537              of a key.  This string is for example used as the file  name  of
538              the secret key.  Implies --with-colons.
539
540
541
542       --with-validation
543              When  doing  a  key listing, do a full validation check for each
544              key and print the result.  This is usually a slow operation  be‐
545              cause it requires a CRL lookup and other operations.
546
547              When  used  along with --import, a validation of the certificate
548              to import is done and only imported if  it  succeeds  the  test.
549              Note  that this does not affect an already available certificate
550              in the DB.  This option is therefore useful to simply  verify  a
551              certificate.
552
553
554
555       --with-md5-fingerprint
556              For standard key listings, also print the MD5 fingerprint of the
557              certificate.
558
559
560       --with-keygrip
561              Include the keygrip in standard key  listings.   Note  that  the
562              keygrip is always listed in --with-colons mode.
563
564
565       --with-secret
566              Include  info  about  the presence of a secret key in public key
567              listings done with --with-colons.
568
569
570   How to change how the CMS is created
571
572
573
574       --include-certs n
575              Using n of -2 includes all certificate except for the root cert,
576              -1  includes all certs, 0 does not include any certs, 1 includes
577              only the signers cert and all other positive values  include  up
578              to n certificates starting with the signer cert.  The default is
579              -2.
580
581
582       --cipher-algo oid
583              Use the cipher algorithm with the ASN.1  object  identifier  oid
584              for  encryption.   For  convenience  the  strings  3DES, AES and
585              AES256 may be used instead of their OIDs.  The  default  is  AES
586              (2.16.840.1.101.3.4.1.2).
587
588
589       --digest-algo name
590              Use  name  as  the message digest algorithm.  Usually this algo‐
591              rithm is deduced from the respective signing certificate.   This
592              option forces the use of the given algorithm and may lead to se‐
593              vere interoperability problems.
594
595
596   Doing things one usually do not want to do
597
598
599
600
601
602       --chuid uid
603              Change the current user to uid which may either be a number or a
604              name.   This  can be used from the root account to run gpgsm for
605              another user.  If uid is not the current UID a standard PATH  is
606              set  and  the envvar GNUPGHOME is unset.  To override the latter
607              the option --homedir can be used.  This option has only  an  ef‐
608              fect  when  used on the command line.  This option has currently
609              no effect at all on Windows.
610
611
612
613       --extra-digest-algo name
614              Sometimes signatures are broken in that they announce a  differ‐
615              ent  digest algorithm than actually used.  gpgsm uses a one-pass
616              data processing model and thus needs to rely  on  the  announced
617              digest  algorithms  to  properly hash the data.  As a workaround
618              this option may be used to tell gpgsm to also hash the data  us‐
619              ing  the algorithm name; this slows processing down a little bit
620              but allows verification of such  broken  signatures.   If  gpgsm
621              prints  an error like ``digest algo 8 has not been enabled'' you
622              may want to try this option, with ‘SHA256’ for name.
623
624
625
626       --faked-system-time epoch
627              This option is only useful for testing; it sets the system  time
628              back  or  forth  to epoch which is the number of seconds elapsed
629              since the year 1970.  Alternatively epoch may be given as a full
630              ISO time string (e.g. "20070924T154812").
631
632
633       --with-ephemeral-keys
634              Include  ephemeral  flagged  keys in the output of key listings.
635              Note that they are included anyway if the key specification  for
636              a listing is given as fingerprint or keygrip.
637
638
639       --debug-level level
640              Select  the debug level for investigating problems. level may be
641              a numeric value or by a keyword:
642
643
644              none   No debugging at all.  A value of less than 1 may be  used
645                     instead of the keyword.
646
647              basic  Some  basic  debug messages.  A value between 1 and 2 may
648                     be used instead of the keyword.
649
650              advanced
651                     More verbose debug messages.  A value between 3 and 5 may
652                     be used instead of the keyword.
653
654              expert Even more detailed messages.  A value between 6 and 8 may
655                     be used instead of the keyword.
656
657              guru   All of the debug messages you can get.  A  value  greater
658                     than  8 may be used instead of the keyword.  The creation
659                     of hash tracing files is only enabled if the  keyword  is
660                     used.
661
662       How  these  messages  are  mapped  to the actual debugging flags is not
663       specified and may change with newer releases of this program. They  are
664       however carefully selected to best aid in debugging.
665
666
667       --debug flags
668              Set  debug flags.  All flags are or-ed and flags may be given in
669              C syntax (e.g. 0x0042) or as a  comma  separated  list  of  flag
670              names.   To  get  a  list of all supported flags the single word
671              "help" can be used. This option is only useful for debugging and
672              the behavior may change at any time without notice.
673
674              Note, that all flags set using this option may get overridden by
675              --debug-level.
676
677
678       --debug-all
679              Same as --debug=0xffffffff
680
681
682       --debug-allow-core-dump
683              Usually gpgsm tries to avoid dumping core by well  written  code
684              and by disabling core dumps for security reasons.  However, bugs
685              are pretty durable beasts and to squash  them  it  is  sometimes
686              useful  to have a core dump.  This option enables core dumps un‐
687              less the Bad Thing happened before the option parsing.
688
689
690       --debug-no-chain-validation
691              This is actually not a debugging option but only useful as such.
692              It lets gpgsm bypass all certificate chain validation checks.
693
694
695       --debug-ignore-expiration
696              This is actually not a debugging option but only useful as such.
697              It lets gpgsm ignore all notAfter dates, this is used by the re‐
698              gression tests.
699
700
701       --passphrase-fd n
702              Read  the passphrase from file descriptor n. Only the first line
703              will be read from file descriptor n. If you use  0  for  n,  the
704              passphrase  will  be  read  from STDIN. This can only be used if
705              only one passphrase is supplied.
706
707              Note that this passphrase is only used if the option --batch has
708              also been given.
709
710
711       --pinentry-mode mode
712              Set the pinentry mode to mode.  Allowed values for mode are:
713
714              default
715                     Use the default of the agent, which is ask.
716
717              ask    Force the use of the Pinentry.
718
719              cancel Emulate use of Pinentry's cancel button.
720
721              error  Return a Pinentry error (``No Pinentry'').
722
723              loopback
724                     Redirect  Pinentry  queries  to the caller.  Note that in
725                     contrast to Pinentry the user is not prompted again if he
726                     enters a bad password.
727
728
729       --request-origin origin
730              Tell gpgsm to assume that the operation ultimately originated at
731              origin.  Depending on the origin certain  restrictions  are  ap‐
732              plied  and the Pinentry may include an extra note on the origin.
733              Supported values for origin are: local which is the default, re‐
734              mote to indicate a remote origin or browser for an operation re‐
735              quested by a web browser.
736
737
738       --no-common-certs-import
739              Suppress the import of common certificates on keybox creation.
740
741
742       All the long options may also be given in the configuration file  after
743       stripping off the two leading dashes.
744
745
746

HOW TO SPECIFY A USER ID

748       There  are  different ways to specify a user ID to GnuPG.  Some of them
749       are only valid for gpg others are only good for gpgsm.  Here is the en‐
750       tire list of ways to specify a key:
751
752
753
754       By key Id.
755              This  format  is  deduced  from the length of the string and its
756              content or 0x prefix. The key Id of an X.509 certificate are the
757              low  64  bits  of  its SHA-1 fingerprint.  The use of key Ids is
758              just a shortcut, for all automated  processing  the  fingerprint
759              should be used.
760
761              When  using gpg an exclamation mark (!) may be appended to force
762              using the specified primary or secondary key and not to try  and
763              calculate which primary or secondary key to use.
764
765              The last four lines of the example give the key ID in their long
766              form as internally used by the OpenPGP protocol. You can see the
767              long key ID using the option --with-colons.
768
769         234567C4
770         0F34E556E
771         01347A56A
772         0xAB123456
773
774         234AABBCC34567C4
775         0F323456784E56EAB
776         01AB3FED1347A5612
777         0x234AABBCC34567C4
778
779
780
781
782       By fingerprint.
783              This  format  is  deduced  from the length of the string and its
784              content or the 0x prefix.  Note, that only the 20  byte  version
785              fingerprint  is available with gpgsm (i.e. the SHA-1 hash of the
786              certificate).
787
788              When using gpg an exclamation mark (!) may be appended to  force
789              using  the specified primary or secondary key and not to try and
790              calculate which primary or secondary key to use.
791
792              The best way to specify a key Id is by  using  the  fingerprint.
793              This  avoids  any  ambiguities in case that there are duplicated
794              key IDs.
795
796         1234343434343434C434343434343434
797         123434343434343C3434343434343734349A3434
798         0E12343434343434343434EAB3484343434343434
799         0xE12343434343434343434EAB3484343434343434
800
801
802       gpgsm also accepts colons between each pair of hexadecimal  digits  be‐
803       cause  this  is  the  de-facto standard on how to present X.509 finger‐
804       prints.  gpg also allows the use of the space separated  SHA-1  finger‐
805       print as printed by the key listing commands.
806
807
808       By exact match on OpenPGP user ID.
809              This  is denoted by a leading equal sign. It does not make sense
810              for X.509 certificates.
811
812         =Heinrich Heine <heinrichh@uni-duesseldorf.de>
813
814
815       By exact match on an email address.
816              This is indicated by enclosing the email address  in  the  usual
817              way with left and right angles.
818
819         <heinrichh@uni-duesseldorf.de>
820
821
822
823       By partial match on an email address.
824              This  is  indicated  by  prefixing  the search string with an @.
825              This uses a substring search but considers only the mail address
826              (i.e. inside the angle brackets).
827
828         @heinrichh
829
830
831       By exact match on the subject's DN.
832              This  is  indicated by a leading slash, directly followed by the
833              RFC-2253 encoded DN of the subject.  Note that you can't use the
834              string  printed  by  gpgsm --list-keys because that one has been
835              reordered and modified for better readability; use --with-colons
836              to print the raw (but standard escaped) RFC-2253 string.
837
838         /CN=Heinrich Heine,O=Poets,L=Paris,C=FR
839
840
841       By exact match on the issuer's DN.
842              This is indicated by a leading hash mark, directly followed by a
843              slash and then directly followed by the RFC-2253 encoded  DN  of
844              the  issuer.   This  should  return the Root cert of the issuer.
845              See note above.
846
847         #/CN=Root Cert,O=Poets,L=Paris,C=FR
848
849
850
851       By exact match on serial number and issuer's DN.
852              This is indicated by a hash mark, followed  by  the  hexadecimal
853              representation  of  the  serial number, then followed by a slash
854              and the RFC-2253 encoded DN of the issuer. See note above.
855
856         #4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
857
858
859       By keygrip.
860              This is indicated by an ampersand followed by the 40 hex  digits
861              of  a  keygrip.  gpgsm prints the keygrip when using the command
862              --dump-cert.
863
864         &D75F22C3F86E355877348498CDC92BD21010A480
865
866
867
868       By substring match.
869              This is the default mode but applications may want to explicitly
870              indicate  this  by  putting the asterisk in front.  Match is not
871              case sensitive.
872
873         Heine
874         *Heine
875
876
877       . and + prefixes
878              These prefixes are reserved for looking up mails anchored at the
879              end  and  for  a word search mode.  They are not yet implemented
880              and using them is undefined.
881
882
883              Please note that we have reused the hash mark  identifier  which
884              was  used in old GnuPG versions to indicate the so called local-
885              id.  It is not anymore used and there should be no conflict when
886              used with X.509 stuff.
887
888              Using the RFC-2253 format of DNs has the drawback that it is not
889              possible to map them back to the original encoding,  however  we
890              don't  have  to do this because our key database stores this en‐
891              coding as meta data.
892
893
894

EXAMPLES

896         $ gpgsm -er goo@bar.net <plaintext >ciphertext
897
898
899
900

FILES

902       There are a few configuration  files  to  control  certain  aspects  of
903       gpgsm's  operation. Unless noted, they are expected in the current home
904       directory (see: [option --homedir]).
905
906
907
908       gpgsm.conf
909              This is  the  standard  configuration  file  read  by  gpgsm  on
910              startup.   It may contain any valid long option; the leading two
911              dashes may not be entered and the option may not be abbreviated.
912              This  default  name  may  be  changed  on the command line (see:
913              [gpgsm-option --options]).  You should backup this file.
914
915
916       common.conf
917              This is an optional configuration file read by gpgsm on startup.
918              It  may  contain  options pertaining to all components of GnuPG.
919              Its current main use is for the "use-keyboxd" option.
920
921
922       policies.txt
923              This is a list of allowed CA policies.  This  file  should  list
924              the  object  identifiers  of  the  policies line by line.  Empty
925              lines and lines starting with a hash mark are ignored.  Policies
926              missing  in this file and not marked as critical in the certifi‐
927              cate will print  only  a  warning;  certificates  with  policies
928              marked  as  critical  and  not listed in this file will fail the
929              signature verification.  You should backup this file.
930
931              For example, to allow only the policy 2.289.9.9, the file should
932              look like this:
933
934                # Allowed policies
935                2.289.9.9
936
937
938       qualified.txt
939              This  is  the  list of root certificates used for qualified cer‐
940              tificates.  They are defined as certificates capable of creating
941              legally binding signatures in the same way as handwritten signa‐
942              tures are.  Comments start with a hash mark and empty lines  are
943              ignored.  Lines do have a length limit but this is not a serious
944              limitation as the format of the entries is fixed and checked  by
945              gpgsm:  A non-comment line starts with optional whitespace, fol‐
946              lowed by exactly 40 hex characters, white space and a lowercased
947              2  letter  country  code.   Additional  data delimited with by a
948              white space is current ignored but might late be used for  other
949              purposes.
950
951              Note  that  even  if  a certificate is listed in this file, this
952              does not mean that the certificate is trusted;  in  general  the
953              certificates  listed  in  this  file  need  to be listed also in
954trustlist.txt’. This is a  global  file  an  installed  in  the
955              sysconf directory (e.g.  ‘/etc/gnupg/qualified.txt’).
956
957              Every  time gpgsm uses a certificate for signing or verification
958              this file will be consulted to check whether the certificate un‐
959              der question has ultimately been issued by one of these CAs.  If
960              this is the case the user will be  informed  that  the  verified
961              signature  represents  a  legally binding (``qualified'') signa‐
962              ture.  When creating a signature using such a certificate an ex‐
963              tra  prompt  will  be issued to let the user confirm that such a
964              legally binding signature shall really be created.
965
966              Because this software has not yet been  approved  for  use  with
967              such certificates, appropriate notices will be shown to indicate
968              this fact.
969
970
971       help.txt
972              This is plain text file with a few help entries used with pinen‐
973              try  as  well  as  a large list of help items for gpg and gpgsm.
974              The standard file has English help texts; to  install  localized
975              versions  use  filenames like ‘help.LL.txt’ with LL denoting the
976              locale.  GnuPG comes with a set of predefined help files in  the
977              data  directory  (e.g. ‘/usr/share/gnupg/gnupg/help.de.txt’) and
978              allows overriding of any help item by help files stored  in  the
979              system  configuration directory (e.g. ‘/etc/gnupg/help.de.txt’).
980              For a reference of the help file's syntax, please  see  the  in‐
981              stalled ‘help.txt’ file.
982
983
984
985       com-certs.pem
986              This  file  is a collection of common certificates used to popu‐
987              lated a newly created ‘pubring.kbx’.  An administrator  may  re‐
988              place  this  file with a custom one.  The format is a concatena‐
989              tion of PEM encoded X.509 certificates.  This global file is in‐
990              stalled  in  the  data  directory  (e.g.  ‘/usr/share/gnupg/com-
991              certs.pem’).
992
993
994       Note that on larger installations, it is useful to put predefined files
995       into  the  directory  ‘/etc/skel/.gnupg/’  so  that newly created users
996       start up with a working configuration.   For  existing  users  a  small
997       helper script is provided to create these files (see: [addgnupghome]).
998
999       For  internal  purposes  gpgsm creates and maintains a few other files;
1000       they all live in the current home directory (see: [option  --homedir]).
1001       Only gpgsm may modify these files.
1002
1003
1004
1005       pubring.kbx
1006              This  a  database  file storing the certificates as well as meta
1007              information.  For debugging purposes the  tool  kbxutil  may  be
1008              used  to  show  the internal structure of this file.  You should
1009              backup this file.
1010
1011
1012       random_seed
1013              This content of this file is used to maintain the internal state
1014              of  the  random  number  generator across invocations.  The same
1015              file is used by other programs of this software too.
1016
1017
1018       S.gpg-agent
1019              If this file exists gpgsm will first  try  to  connect  to  this
1020              socket  for  accessing gpg-agent before starting a new gpg-agent
1021              instance.  Under Windows this socket  (which  in  reality  be  a
1022              plain file describing a regular TCP listening port) is the stan‐
1023              dard way of connecting the gpg-agent.
1024
1025

SEE ALSO

1027       gpg2(1), gpg-agent(1)
1028
1029       The full documentation for this tool is maintained as a Texinfo manual.
1030       If  GnuPG and the info program are properly installed at your site, the
1031       command
1032
1033         info gnupg
1034
1035       should give you access to the complete manual including a  menu  struc‐
1036       ture and an index.
1037
1038
1039
1040GnuPG 2.3.3                       2021-10-06                          GPGSM(1)
Impressum