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

OPTIONS

238       GPGSM comes features a bunch of options to control the exact  behaviour
239       and to change the default configuration.
240
241
242
243
244
245   How to change the configuration
246
247
248       These  options  are  used  to  change the configuration and are usually
249       found in the option file.
250
251
252
253       --options file
254              Reads configuration from file instead of from the  default  per-
255              user  configuration  file.   The  default  configuration file is
256              named  ‘gpgsm.conf’  and  expected  in  the  ‘.gnupg’  directory
257              directly below the home directory of the user.
258
259
260       --homedir dir
261              Set the name of the home directory to dir. If this option is not
262              used, the home directory defaults to  ‘~/.gnupg’.   It  is  only
263              recognized  when  given  on the command line.  It also overrides
264              any home  directory  stated  through  the  environment  variable
265GNUPGHOME’  or  (on W32 systems) by means of the Registry entry
266              HKCU\Software\GNU\GnuPG:HomeDir.
267
268
269
270
271       -v
272
273       --verbose
274              Outputs additional information while running.  You can  increase
275              the  verbosity by giving several verbose commands to gpgsm, such
276              as '-vv'.
277
278
279       --policy-file filename
280              Change the default name of the policy file to filename.
281
282
283       --agent-program file
284              Specify an agent program to be used for secret  key  operations.
285              The  default  value  is the ‘/usr/local/bin/gpg-agent’.  This is
286              only  used  as  a  fallback  when   the   environment   variable
287              GPG_AGENT_INFO is not set or a running agent can't be connected.
288
289
290       --dirmngr-program file
291              Specify  a  dirmngr  program  to  be  used  for CRL checks.  The
292              default value is ‘/usr/sbin/dirmngr’.  This is only  used  as  a
293              fallback  when  the environment variable DIRMNGR_INFO is not set
294              or a running dirmngr can't be connected.
295
296
297       --prefer-system-dirmngr
298              If a system wide dirmngr is running in daemon mode, first try to
299              connect  to  this  one.  Fallback to a pipe based server if this
300              does not work.  Under Windows this option is ignored because the
301              system dirmngr is always used.
302
303
304       --disable-dirmngr
305              Entirely disable the use of the Dirmngr.
306
307
308       --no-secmem-warning
309              Don't  print  a warning when the so called "secure memory" can't
310              be used.
311
312
313       --log-file file
314              When running in server mode, append all logging output to file.
315
316
317
318
319
320   Certificate related options
321
322
323
324
325       --enable-policy-checks
326
327       --disable-policy-checks
328              By default policy checks are enabled.  These options may be used
329              to change it.
330
331
332       --enable-crl-checks
333
334       --disable-crl-checks
335              By default the CRL checks are enabled and the DirMngr is used to
336              check for revoked certificates.  The disable option is most use‐
337              ful with an off-line network connection to suppress this check.
338
339
340       --enable-trusted-cert-crl-check
341
342       --disable-trusted-cert-crl-check
343              By  default  the  CRL  for trusted root certificates are checked
344              like for any other certificates.  This allows a CA to revoke its
345              own  certificates voluntary without the need of putting all ever
346              issued certificates into a CRL.  The disable option may be  used
347              to  switch this extra check off.  Due to the caching done by the
348              Dirmngr, there won't be any noticeable performance gain.   Note,
349              that  this  also  disables possible OCSP checks for trusted root
350              certificates.  A more specific way of disabling this check is by
351              adding  the  ``relax''  keyword  to  the  root  CA  line  of the
352trustlist.txt
353
354
355
356       --force-crl-refresh
357              Tell the dirmngr to reload the CRL for each request.  For better
358              performance,  the  dirmngr  will  actually optimize this by sup‐
359              pressing the loading for short time intervals (e.g. 30 minutes).
360              This option is useful to make sure that a fresh CRL is available
361              for certificates hold in the keybox.  The suggested way of doing
362              this  is by using it along with the option --with-validation for
363              a key listing command.  This option should not be used in a con‐
364              figuration file.
365
366
367       --enable-ocsp
368
369       --disable-ocsp
370              Be  default  OCSP checks are disabled.  The enable option may be
371              used to enable OCSP checks via Dirmngr.  If CRL checks are  also
372              enabled,  CRLs  will be used as a fallback if for some reason an
373              OCSP request won't succeed.  Note, that you have to  allow  OCSP
374              requests in Dirmngr's configuration too (option --allow-ocsp and
375              configure dirmngr properly.  If you don't do so you will get the
376              error code 'Not supported'.
377
378
379       --auto-issuer-key-retrieve
380              If  a required certificate is missing while validating the chain
381              of certificates, try to load that certificate from  an  external
382              location.  This usually means that Dirmngr is employed to search
383              for the certificate.  Note that this option makes  a  "web  bug"
384              like  behavior  possible.   LDAP  server operators can see which
385              keys you request, so by sending you a message signed by a  brand
386              new  key  (which  you naturally will not have on your local key‐
387              box), the operator can tell both your IP address  and  the  time
388              when you verified the signature.
389
390
391
392       --validation-model name
393              This option changes the default validation model.  The only pos‐
394              sible values are "shell" (which  is  the  default)  and  "chain"
395              which  forces  the  use  of the chain model.  The chain model is
396              also used if an option in the ‘trustlist.txt’ or an attribute of
397              the certificate requests it.  However the standard model (shell)
398              is in that case always tried first.
399
400
401       --ignore-cert-extension oid
402              Add oid to the list of ignored certificate extensions.  The  oid
403              is  expected  to be in dotted decimal form, like 2.5.29.3.  This
404              option may used more than once.   Critical  flagged  certificate
405              extensions  matching  one of the OIDs in the list are treated as
406              if they are actually handled and thus the certificate  won't  be
407              rejected  due to an unknown critical extension.  Use this option
408              with care because extensions are usually flagged as critical for
409              a reason.
410
411
412
413
414   Input and Output
415
416
417
418       --armor
419
420       -a     Create PEM encoded output.  Default is binary output.
421
422
423       --base64
424              Create  Base-64  encoded  output;  i.e.  PEM  without the header
425              lines.
426
427
428       --assume-armor
429              Assume the input data is PEM encoded.  Default is to  autodetect
430              the encoding but this is may fail.
431
432
433       --assume-base64
434              Assume the input data is plain base-64 encoded.
435
436
437       --assume-binary
438              Assume the input data is binary encoded.
439
440
441
442       --p12-charset name
443              gpgsm  uses  the  UTF-8  encoding  when encoding passphrases for
444              PKCS#12 files.  This option may be used to force the  passphrase
445              to be encoded in the specified encoding name.  This is useful if
446              the application used to import the key uses a different encoding
447              and  thus  won't  be  able  to import a file generated by gpgsm.
448              Commonly used values for name are Latin1 and CP850.   Note  that
449              gpgsm  itself  automagically  imports any file with a passphrase
450              encoded to the most commonly used encodings.
451
452
453
454       --default-key user_id
455              Use user_id as the standard key for signing.  This key  is  used
456              if  no  other key has been defined as a signing key.  Note, that
457              the first --local-users option also sets this key if it has  not
458              yet been set; however --default-key always overrides this.
459
460
461
462       --local-user user_id
463
464       -u user_id
465              Set  the  user(s)  to  be  used for signing.  The default is the
466              first secret key found in the database.
467
468
469
470       --recipient name
471
472       -r     Encrypt to the user id name.  There are several ways a  user  id
473              may be given (see: [how-to-specify-a-user-id]).
474
475
476
477       --output file
478
479       -o file
480              Write output to file.  The default is to write it to stdout.
481
482
483
484       --with-key-data
485              Displays extra information with the --list-keys commands.  Espe‐
486              cially a line tagged grp is printed which tells you the  keygrip
487              of  a  key.  This string is for example used as the file name of
488              the secret key.
489
490
491       --with-validation
492              When doing a key listing, do a full validation  check  for  each
493              key  and  print  the  result.   This is usually a slow operation
494              because it requires a CRL lookup and other operations.
495
496              When used along with --import, a validation of  the  certificate
497              to  import  is  done  and only imported if it succeeds the test.
498              Note that this does not affect an already available  certificate
499              in  the  DB.  This option is therefore useful to simply verify a
500              certificate.
501
502
503
504       --with-md5-fingerprint
505              For standard key listings, also print the MD5 fingerprint of the
506              certificate.
507
508
509
510
511   How to change how the CMS is created.
512
513
514
515       --include-certs n
516              Using n of -2 includes all certificate except for the root cert,
517              -1 includes all certs, 0 does not include any certs, 1  includes
518              only  the signers cert (this is the default) and all other posi‐
519              tive values include up  to  n  certificates  starting  with  the
520              signer cert.  The default is -2.
521
522
523       --cipher-algo oid
524              Use  the  cipher  algorithm with the ASN.1 object identifier oid
525              for encryption.  For  convenience  the  strings  3DES,  AES  and
526              AES256  may  be used instead of their OIDs.  The default is 3DES
527              (1.2.840.113549.3.7).
528
529
530       --digest-algo name
531              Use name as the message digest algorithm.   Usually  this  algo‐
532              rithm  is deduced from the respective signing certificate.  This
533              option forces the use of the given algorithm  and  may  lead  to
534              severe interoperability problems.
535
536
537
538
539
540
541   Doing things one usually don't want to do.
542
543
544
545
546
547       --extra-digest-algo name
548              Sometimes  signatures are broken in that they announce a differ‐
549              ent digest algorithm than actually used.  gpgsm uses a  one-pass
550              data  processing  model  and thus needs to rely on the announced
551              digest algorithms to properly hash the data.   As  a  workaround
552              this  option may be used to tell gpg to also hash the data using
553              the algorithm name; this slows processing down a little bit  but
554              allows  to  verify  such  broken signatures.  If gpgsm prints an
555              error like ``digest algo 8 has not been enabled'' you  may  want
556              to try this option, with 'SHA256' for name.
557
558
559
560       --faked-system-time epoch
561              This  option is only useful for testing; it sets the system time
562              back or forth to epoch which is the number  of  seconds  elapsed
563              since the year 1970.  Alternatively epoch may be given as a full
564              ISO time string (e.g. "20070924T154812").
565
566
567       --with-ephemeral-keys
568              Include ephemeral flagged keys in the output  of  key  listings.
569              Note  that they are included anyway if the key specification for
570              a listing is given as fingerprint or keygrip.
571
572
573       --debug-level level
574              Select the debug level for investigating problems. level may  be
575              a numeric value or by a keyword:
576
577
578              none   No  debugging at all.  A value of less than 1 may be used
579                     instead of the keyword.
580
581              basic  Some basic debug messages.  A value between 1 and  2  may
582                     be used instead of the keyword.
583
584              advanced
585                     More verbose debug messages.  A value between 3 and 5 may
586                     be used instead of the keyword.
587
588              expert Even more detailed messages.  A value between 6 and 8 may
589                     be used instead of the keyword.
590
591              guru   All  of  the  debug messages you can get. A value greater
592                     than 8 may be used instead of the keyword.  The  creation
593                     of  hash  tracing files is only enabled if the keyword is
594                     used.
595
596       How these messages are mapped to the  actual  debugging  flags  is  not
597       specified  and may change with newer releases of this program. They are
598       however carefully selected to best aid in debugging.
599
600
601       --debug flags
602              This option is only useful for debugging and the  behaviour  may
603              change  at  any time without notice; using --debug-levels is the
604              preferred method to select the debug verbosity.  FLAGS  are  bit
605              encoded  and  may  be  given  in  usual  C-Syntax. The currently
606              defined bits are:
607
608
609              0 (1)  X.509 or OpenPGP protocol related data
610
611              1 (2)  values of big number integers
612
613              2 (4)  low level crypto operations
614
615              5 (32) memory allocation
616
617              6 (64) caching
618
619              7 (128)
620                     show memory statistics.
621
622              9 (512)
623                     write hashed data to files named dbgmd-000*
624
625              10 (1024)
626                     trace Assuan protocol
627
628       Note, that all flags set  using  this  option  may  get  overridden  by
629       --debug-level.
630
631
632       --debug-all
633              Same as --debug=0xffffffff
634
635
636       --debug-allow-core-dump
637              Usually  gpgsm  tries to avoid dumping core by well written code
638              and by disabling core dumps for security reasons.  However, bugs
639              are  pretty  durable  beasts  and to squash them it is sometimes
640              useful to have a core dump.   This  option  enables  core  dumps
641              unless the Bad Thing happened before the option parsing.
642
643
644       --debug-no-chain-validation
645              This is actually not a debugging option but only useful as such.
646              It lets gpgsm bypass all certificate chain validation checks.
647
648
649       --debug-ignore-expiration
650              This is actually not a debugging option but only useful as such.
651              It  lets  gpgsm  ignore  all notAfter dates, this is used by the
652              regression tests.
653
654
655       --fixed-passphrase string
656              Supply the passphrase  string  to  the  gpg-protect-tool.   This
657              option  is  only  useful  for the regression tests included with
658              this package and may be revised or removed at any  time  without
659              notice.
660
661
662       --no-common-certs-import
663              Suppress the import of common certificates on keybox creation.
664
665
666              All the long options may also be given in the configuration file
667              after stripping off the two leading dashes.
668
669
670

HOW TO SPECIFY A USER ID

672       There are different ways to specify a user ID to GnuPG.  Some  of  them
673       are  only  valid  for  gpg others are only good for gpgsm.  Here is the
674       entire list of ways to specify a key:
675
676
677
678       By key Id.
679              This format is deduced from the length of  the  string  and  its
680              content or 0x prefix. The key Id of an X.509 certificate are the
681              low 64 bits of its SHA-1 fingerprint.  The use  of  key  Ids  is
682              just  a  shortcut,  for all automated processing the fingerprint
683              should be used.
684
685              When using gpg an exclamation mark (!) may be appended to  force
686              using  the specified primary or secondary key and not to try and
687              calculate which primary or secondary key to use.
688
689              The last four lines of the example give the key ID in their long
690              form as internally used by the OpenPGP protocol. You can see the
691              long key ID using the option --with-colons.
692
693         234567C4
694         0F34E556E
695         01347A56A
696         0xAB123456
697
698         234AABBCC34567C4
699         0F323456784E56EAB
700         01AB3FED1347A5612
701         0x234AABBCC34567C4
702
703
704
705
706       By fingerprint.
707              This format is deduced from the length of  the  string  and  its
708              content  or  the 0x prefix.  Note, that only the 20 byte version
709              fingerprint is available with gpgsm (i.e. the SHA-1 hash of  the
710              certificate).
711
712              When  using gpg an exclamation mark (!) may be appended to force
713              using the specified primary or secondary key and not to try  and
714              calculate which primary or secondary key to use.
715
716              The  best  way  to specify a key Id is by using the fingerprint.
717              This avoids any ambiguities in case that  there  are  duplicated
718              key IDs.
719
720         1234343434343434C434343434343434
721         123434343434343C3434343434343734349A3434
722         0E12343434343434343434EAB3484343434343434
723         0xE12343434343434343434EAB3484343434343434
724
725
726       (gpgsm  also  accepts  colons  between  each pair of hexadecimal digits
727       because this is the de-facto standard on how to present  X.509  finger‐
728       prints.)
729
730
731       By exact match on OpenPGP user ID.
732              This  is denoted by a leading equal sign. It does not make sense
733              for X.509 certificates.
734
735         =Heinrich Heine <heinrichh@uni-duesseldorf.de>
736
737
738       By exact match on an email address.
739              This is indicated by enclosing the email address  in  the  usual
740              way with left and right angles.
741
742         <heinrichh@uni-duesseldorf.de>
743
744
745
746       By word match.
747              All words must match exactly (not case sensitive) but can appear
748              in any order in the user ID or a subjects name.  Words  are  any
749              sequences  of letters, digits, the underscore and all characters
750              with bit 7 set.
751
752         +Heinrich Heine duesseldorf
753
754
755       By exact match on the subject's DN.
756              This is indicated by a leading slash, directly followed  by  the
757              RFC-2253 encoded DN of the subject.  Note that you can't use the
758              string printed by "gpgsm --list-keys" because that one  as  been
759              reordered and modified for better readability; use --with-colons
760              to print the raw (but standard escaped) RFC-2253 string
761
762         /CN=Heinrich Heine,O=Poets,L=Paris,C=FR
763
764
765       By exact match on the issuer's DN.
766              This is indicated by a leading hash mark, directly followed by a
767              slash  and  then  directly followed by the rfc2253 encoded DN of
768              the issuer.  This should return the Root  cert  of  the  issuer.
769              See note above.
770
771         #/CN=Root Cert,O=Poets,L=Paris,C=FR
772
773
774
775       By exact match on serial number and issuer's DN.
776              This  is  indicated  by a hash mark, followed by the hexadecimal
777              representation of the serial number, then followed  by  a  slash
778              and the RFC-2253 encoded DN of the issuer. See note above.
779
780         #4F03/CN=Root Cert,O=Poets,L=Paris,C=FR
781
782
783       By keygrip
784              This  is indicated by an ampersand followed by the 40 hex digits
785              of a keygrip.  gpgsm prints the keygrip when using  the  command
786              --dump-cert.  It does not yet work for OpenPGP keys.
787
788         &D75F22C3F86E355877348498CDC92BD21010A480
789
790
791
792       By substring match.
793              This is the default mode but applications may want to explicitly
794              indicate this by putting the asterisk in front.   Match  is  not
795              case sensitive.
796
797         Heine
798         *Heine
799
800
801
802       Please note that we have reused the hash mark identifier which was used
803       in old GnuPG versions to indicate the so called local-id.   It  is  not
804       anymore  used  and  there  should  be  no conflict when used with X.509
805       stuff.
806
807       Using the RFC-2253 format of DNs has the drawback that it is not possi‐
808       ble to map them back to the original encoding, however we don't have to
809       do this because our key database stores this encoding as meta data.
810
811
812
813
814
815

EXAMPLES

817         $ gpgsm -er goo@bar.net <plaintext >ciphertext
818
819
820
821
822
823       gpgsm is often used as a backend engine by  other  software.   To  help
824       with  this  a machine interface has been defined to have an unambiguous
825       way to do this.  This is most likely used with the --server command but
826       may  also be used in the standard operation mode by using the --status-
827       fd option.
828
829
830
831       It is very important to understand the semantics  used  with  signature
832       verification.   Checking  a  signature is not as simple as it may sound
833       and so the operation is  a  bit  complicated.   In  most  cases  it  is
834       required to look at several status lines.  Here is a table of all cases
835       a signed message may have:
836
837
838       The signature is valid
839              This does mean that the signature has  been  successfully  veri‐
840              fied, the certificates are all sane.  However there are two sub‐
841              cases with important information:  One of the  certificates  may
842              have  expired or a signature of a message itself as expired.  It
843              is a sound practise to consider such a signature still as  valid
844              but  additional  information  should be displayed.  Depending on
845              the subcase gpgsm will issue these status codes:
846                .RS
847                .TP signature valid and nothing did expire
848                GOODSIG, VALIDSIG, TRUST_FULLY
849                .TP signature valid but at least one certificate has expired
850                EXPKEYSIG, VALIDSIG, TRUST_FULLY
851                .TP signature valid but expired
852                EXPSIG, VALIDSIG, TRUST_FULLY
853                Note, that this case is currently not implemented.
854                .RE
855
856
857       The signature is invalid
858              This means that the signature verification failed  (this  is  an
859              indication  of af a transfer error, a program error or tampering
860              with the message).  gpgsm  issues  one  of  these  status  codes
861              sequences:
862                .RS
863                .TP BADSIG
864                .TP GOODSIG, VALIDSIG TRUST_NEVER
865                .RE
866
867
868       Error verifying a signature
869              For  some  reason  the  signature could not be verified, i.e. it
870              can't be decided whether the signature is valid or  invalid.   A
871              common reason for this is a missing certificate.
872
873
874
875
876

FILES

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

SEE ALSO

1010       gpg2(1), gpg-agent(1)
1011
1012       The full documentation for this tool is maintained as a Texinfo manual.
1013       If GnuPG and the info program are properly installed at your site,  the
1014       command
1015
1016         info gnupg
1017
1018       should  give  you access to the complete manual including a menu struc‐
1019       ture and an index.
1020
1021
1022
1023GnuPG 2.0.14                      2018-07-13                          GPGSM(1)
Impressum