{
    "content": [
        {
            "type": "text",
            "text": "# gpgsm (man)\n\n## NAME\n\ngpgsm - CMS encryption and signing tool\n\n## SYNOPSIS\n\ngpgsm [--homedir dir] [--options file] [options] command [args]\n\n## DESCRIPTION\n\ngpgsm  is  a  tool similar to gpg to provide digital encryption and signing services on X.509\ncertificates and the CMS protocol.  It is mainly used as a backend for S/MIME  mail  process‐\ning.   gpgsm  includes a full featured certificate management and complies with all rules de‐\nfined for the German Sphinx project.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **COMMANDS** (24 subsections)\n- **OPTIONS** (45 subsections)\n- **HOW TO SPECIFY A USER ID** (11 subsections)\n- **EXAMPLES**\n- **FILES** (7 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "gpgsm",
        "section": "",
        "mode": "man",
        "summary": "gpgsm - CMS encryption and signing tool",
        "synopsis": "gpgsm [--homedir dir] [--options file] [options] command [args]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--verbose",
                "arg": null,
                "description": "Outputs additional information while running. You can increase the verbosity by giv‐ ing several verbose commands to gpgsm, such as ‘-vv’. --policy-file filename Change the default name of the policy file to filename. --agent-program file Specify an agent program to be used for secret key operations. The default value is determined by running the command gpgconf. Note that the pipe symbol (|) is used for a regression test suite hack and may thus not be used in the file name. --dirmngr-program file Specify a dirmngr program to be used for CRL checks. The default value is ‘/usr/bin/dirmngr’."
            },
            {
                "flag": "",
                "long": "--prefer-system-dirmngr",
                "arg": null,
                "description": "This option is obsolete and ignored."
            },
            {
                "flag": "",
                "long": "--disable-dirmngr",
                "arg": null,
                "description": "Entirely disable the use of the Dirmngr."
            },
            {
                "flag": "",
                "long": "--no-autostart",
                "arg": null,
                "description": "Do not start the gpg-agent or the dirmngr if it has not yet been started and its ser‐ vice is required. This option is mostly useful on machines where the connection to gpg-agent has been redirected to another machines. If dirmngr is required on the re‐ mote machine, it may be started manually using gpgconf --launch dirmngr."
            },
            {
                "flag": "",
                "long": "--no-secmem-warning",
                "arg": null,
                "description": "Do not print a warning when the so called \"secure memory\" cannot be used. --log-file file When running in server mode, append all logging output to file. Use ‘socket://’ to log to socket."
            },
            {
                "flag": "",
                "long": "--enable-policy-checks",
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--disable-policy-checks",
                "arg": null,
                "description": "By default policy checks are enabled. These options may be used to change it."
            },
            {
                "flag": "",
                "long": "--enable-crl-checks",
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--disable-crl-checks",
                "arg": null,
                "description": "By default the CRL checks are enabled and the DirMngr is used to check for revoked certificates. The disable option is most useful with an off-line network connection to suppress this check and also to avoid that new certificates introduce a web bug by including a certificate specific CRL DP. The disable option also disables an issuer certificate lookup via the authorityInfoAccess property of the certificate; the --en‐‐ able-issuer-key-retrieve can be used to make use of that property anyway."
            },
            {
                "flag": "",
                "long": "--enable-trusted-cert-crl-check",
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--disable-trusted-cert-crl-check",
                "arg": null,
                "description": "By default the CRL for trusted root certificates are checked like for any other cer‐ tificates. This allows a CA to revoke its own certificates voluntary without the need of putting all ever issued certificates into a CRL. The disable option may be used to switch this extra check off. Due to the caching done by the Dirmngr, there will not be any noticeable performance gain. Note, that this also disables possible OCSP checks for trusted root certificates. A more specific way of disabling this check is by adding the ``relax'' keyword to the root CA line of the ‘trustlist.txt’"
            },
            {
                "flag": "",
                "long": "--force-crl-refresh",
                "arg": null,
                "description": "Tell the dirmngr to reload the CRL for each request. For better performance, the dirmngr will actually optimize this by suppressing the loading for short time inter‐ vals (e.g. 30 minutes). This option is useful to make sure that a fresh CRL is avail‐ able for certificates hold in the keybox. The suggested way of doing this is by using it along with the option --with-validation for a key listing command. This option should not be used in a configuration file."
            },
            {
                "flag": "",
                "long": "--enable-issuer-based-crl-check",
                "arg": null,
                "description": "Run a CRL check even for certificates which do not have any CRL distribution point. This requires that a suitable LDAP server has been configured in Dirmngr and that the CRL can be found using the issuer. This option reverts to what GnuPG did up to ver‐ sion 2.2.20. This option is in general not useful."
            },
            {
                "flag": "",
                "long": "--enable-ocsp",
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--disable-ocsp",
                "arg": null,
                "description": "By default OCSP checks are disabled. The enable option may be used to enable OCSP checks via Dirmngr. If CRL checks are also enabled, CRLs will be used as a fallback if for some reason an OCSP request will not succeed. Note, that you have to allow OCSP requests in Dirmngr's configuration too (option --allow-ocsp) and configure Dirm‐ ngr properly. If you do not do so you will get the error code ‘Not supported’."
            },
            {
                "flag": "",
                "long": "--auto-issuer-key-retrieve",
                "arg": null,
                "description": "If a required certificate is missing while validating the chain of certificates, try to load that certificate from an external location. This usually means that Dirmngr is employed to search for the certificate. Note that this option makes a \"web bug\" like behavior possible. LDAP server operators can see which keys you request, so by sending you a message signed by a brand new key (which you naturally will not have on your local keybox), the operator can tell both your IP address and the time when you verified the signature. --validation-model name This option changes the default validation model. The only possible values are \"shell\" (which is the default), \"chain\" which forces the use of the chain model and \"steed\" for a new simplified model. The chain model is also used if an option in the ‘trustlist.txt’ or an attribute of the certificate requests it. However the standard model (shell) is in that case always tried first. --ignore-cert-extension oid Add oid to the list of ignored certificate extensions. The oid is expected to be in dotted decimal form, like 2.5.29.3. This option may be used more than once. Critical flagged certificate extensions matching one of the OIDs in the list are treated as if they are actually handled and thus the certificate will not be rejected due to an un‐ known critical extension. Use this option with care because extensions are usually flagged as critical for a reason."
            },
            {
                "flag": "",
                "long": "--armor",
                "arg": null,
                "description": ""
            },
            {
                "flag": "-a",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--base64",
                "arg": null,
                "description": "Create Base-64 encoded output; i.e. PEM without the header lines."
            },
            {
                "flag": "",
                "long": "--assume-armor",
                "arg": null,
                "description": "Assume the input data is PEM encoded. Default is to autodetect the encoding but this is may fail."
            },
            {
                "flag": "",
                "long": "--assume-base64",
                "arg": null,
                "description": "Assume the input data is plain base-64 encoded."
            },
            {
                "flag": "",
                "long": "--assume-binary",
                "arg": null,
                "description": "Assume the input data is binary encoded. --p12-charset name gpgsm uses the UTF-8 encoding when encoding passphrases for PKCS#12 files. This op‐ tion may be used to force the passphrase to be encoded in the specified encoding name. This is useful if the application used to import the key uses a different encoding and thus will not be able to import a file generated by gpgsm. Commonly used values for name are Latin1 and CP850. Note that gpgsm itself automagically imports any file with a passphrase encoded to the most commonly used encodings. --default-key userid Use userid as the standard key for signing. This key is used if no other key has been defined as a signing key. Note, that the first --local-users option also sets this key if it has not yet been set; however --default-key always overrides this. --local-user userid"
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "Set the user(s) to be used for signing. The default is the first secret key found in the database. --recipient name"
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "[how-to-specify-a-user-id]). --output file"
            },
            {
                "flag": "-o",
                "long": null,
                "arg": null,
                "description": "Write output to file. The default is to write it to stdout."
            },
            {
                "flag": "",
                "long": "--with-key-data",
                "arg": null,
                "description": "Displays extra information with the --list-keys commands. Especially a line tagged grp is printed which tells you the keygrip of a key. This string is for example used as the file name of the secret key. Implies --with-colons."
            },
            {
                "flag": "",
                "long": "--with-validation",
                "arg": null,
                "description": "When doing a key listing, do a full validation check for each key and print the re‐ sult. This is usually a slow operation because it requires a CRL lookup and other op‐ erations. When used along with --import, a validation of the certificate to import is done and only imported if it succeeds the test. Note that this does not affect an already available certificate in the DB. This option is therefore useful to simply verify a certificate."
            },
            {
                "flag": "",
                "long": "--with-md5-fingerprint",
                "arg": null,
                "description": "For standard key listings, also print the MD5 fingerprint of the certificate."
            },
            {
                "flag": "",
                "long": "--with-keygrip",
                "arg": null,
                "description": "Include the keygrip in standard key listings. Note that the keygrip is always listed in --with-colons mode."
            },
            {
                "flag": "",
                "long": "--with-secret",
                "arg": null,
                "description": "Include info about the presence of a secret key in public key listings done with --with-colons."
            },
            {
                "flag": "",
                "long": "--digest-algo",
                "arg": null,
                "description": "Use name as the message digest algorithm. Usually this algorithm is deduced from the respective signing certificate. This option forces the use of the given algorithm and may lead to severe interoperability problems."
            },
            {
                "flag": "",
                "long": "--with-ephemeral-keys",
                "arg": null,
                "description": "Include ephemeral flagged keys in the output of key listings. Note that they are in‐ cluded anyway if the key specification for a listing is given as fingerprint or key‐ grip. --debug-level level Select the debug level for investigating problems. level may be a numeric value or by a keyword: none No debugging at all. A value of less than 1 may be used instead of the key‐ word. basic Some basic debug messages. A value between 1 and 2 may be used instead of the keyword. advanced More verbose debug messages. A value between 3 and 5 may be used instead of the keyword. expert Even more detailed messages. A value between 6 and 8 may be used instead of the keyword. guru All of the debug messages you can get. A value greater than 8 may be used in‐ stead of the keyword. The creation of hash tracing files is only enabled if the keyword is used. How these messages are mapped to the actual debugging flags is not specified and may change with newer releases of this program. They are however carefully selected to best aid in de‐ bugging. --debug flags This option is only useful for debugging and the behaviour may change at any time without notice; using --debug-levels is the preferred method to select the debug ver‐ bosity. FLAGS are bit encoded and may be given in usual C-Syntax. The currently de‐ fined bits are: 0 (1) X.509 or OpenPGP protocol related data 1 (2) values of big number integers 2 (4) low level crypto operations 5 (32) memory allocation 6 (64) caching 7 (128) show memory statistics 9 (512) write hashed data to files named dbgmd-000* 10 (1024) trace Assuan protocol Note, that all flags set using this option may get overridden by --debug-level."
            },
            {
                "flag": "",
                "long": "--debug-all",
                "arg": null,
                "description": "Same as --debug=0xffffffff"
            },
            {
                "flag": "",
                "long": "--debug-allow-core-dump",
                "arg": null,
                "description": "Usually gpgsm tries to avoid dumping core by well written code and by disabling core dumps for security reasons. However, bugs are pretty durable beasts and to squash them it is sometimes useful to have a core dump. This option enables core dumps un‐ less the Bad Thing happened before the option parsing."
            },
            {
                "flag": "",
                "long": "--debug-no-chain-validation",
                "arg": null,
                "description": "This is actually not a debugging option but only useful as such. It lets gpgsm bypass all certificate chain validation checks."
            },
            {
                "flag": "",
                "long": "--debug-ignore-expiration",
                "arg": null,
                "description": "This is actually not a debugging option but only useful as such. It lets gpgsm ignore all notAfter dates, this is used by the regression tests."
            },
            {
                "flag": "",
                "long": "--passphrase-fd",
                "arg": null,
                "description": "Read the passphrase from file descriptor n. Only the first line will be read from file descriptor n. If you use 0 for n, the passphrase will be read from STDIN. This can only be used if only one passphrase is supplied. Note that this passphrase is only used if the option --batch has also been given."
            },
            {
                "flag": "",
                "long": "--pinentry-mode",
                "arg": null,
                "description": "Set the pinentry mode to mode. Allowed values for mode are: default Use the default of the agent, which is ask. ask Force the use of the Pinentry. cancel Emulate use of Pinentry's cancel button. error Return a Pinentry error (``No Pinentry''). loopback Redirect Pinentry queries to the caller. Note that in contrast to Pinentry the user is not prompted again if he enters a bad password. --request-origin origin Tell gpgsm to assume that the operation ultimately originated at origin. Depending on the origin certain restrictions are applied and the Pinentry may include an extra note on the origin. Supported values for origin are: local which is the default, remote to indicate a remote origin or browser for an operation requested by a web browser."
            },
            {
                "flag": "",
                "long": "--no-common-certs-import",
                "arg": null,
                "description": "Suppress the import of common certificates on keybox creation. All the long options may also be given in the configuration file after stripping off the two leading dashes."
            }
        ],
        "examples": [
            "$ gpgsm -er goo@bar.net <plaintext >ciphertext"
        ],
        "see_also": [
            {
                "name": "gpg2",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gpg2/1/json"
            },
            {
                "name": "gpg-agent",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gpg-agent/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "COMMANDS",
                "lines": 7,
                "subsections": [
                    {
                        "name": "Commands not specific to the function",
                        "lines": 1
                    },
                    {
                        "name": "--version",
                        "lines": 4,
                        "long": "--version"
                    },
                    {
                        "name": "--help, -h",
                        "lines": 4,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--warranty",
                        "lines": 3,
                        "long": "--warranty"
                    },
                    {
                        "name": "--dump-options",
                        "lines": 3,
                        "long": "--dump-options"
                    },
                    {
                        "name": "Commands to select the type of operation",
                        "lines": 1
                    },
                    {
                        "name": "--encrypt",
                        "lines": 4,
                        "long": "--encrypt"
                    },
                    {
                        "name": "--decrypt",
                        "lines": 9,
                        "long": "--decrypt"
                    },
                    {
                        "name": "--verify",
                        "lines": 4,
                        "long": "--verify"
                    },
                    {
                        "name": "--server",
                        "lines": 23,
                        "long": "--server"
                    },
                    {
                        "name": "How to manage the certificates and keys",
                        "lines": 1
                    },
                    {
                        "name": "--generate-key",
                        "lines": 1,
                        "long": "--generate-key"
                    },
                    {
                        "name": "--gen-key",
                        "lines": 7,
                        "long": "--gen-key"
                    },
                    {
                        "name": "--list-keys",
                        "lines": 1,
                        "long": "--list-keys"
                    },
                    {
                        "name": "-k",
                        "lines": 4,
                        "flag": "-k"
                    },
                    {
                        "name": "--list-secret-keys",
                        "lines": 1,
                        "long": "--list-secret-keys"
                    },
                    {
                        "name": "-K",
                        "lines": 5,
                        "flag": "-K"
                    },
                    {
                        "name": "--list-chain",
                        "lines": 4,
                        "long": "--list-chain"
                    },
                    {
                        "name": "--dump-cert",
                        "lines": 1,
                        "long": "--dump-cert"
                    },
                    {
                        "name": "--dump-keys",
                        "lines": 4,
                        "long": "--dump-keys"
                    },
                    {
                        "name": "--dump-chain",
                        "lines": 3,
                        "long": "--dump-chain"
                    },
                    {
                        "name": "--dump-secret-keys",
                        "lines": 9,
                        "long": "--dump-secret-keys"
                    },
                    {
                        "name": "--keydb-clear-some-cert-flags",
                        "lines": 49,
                        "long": "--keydb-clear-some-cert-flags"
                    },
                    {
                        "name": "--learn-card",
                        "lines": 10,
                        "long": "--learn-card"
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 7,
                "subsections": [
                    {
                        "name": "How to change the configuration",
                        "lines": 31
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    },
                    {
                        "name": "--verbose",
                        "lines": 19,
                        "long": "--verbose"
                    },
                    {
                        "name": "--prefer-system-dirmngr",
                        "lines": 3,
                        "long": "--prefer-system-dirmngr"
                    },
                    {
                        "name": "--disable-dirmngr",
                        "lines": 3,
                        "long": "--disable-dirmngr"
                    },
                    {
                        "name": "--no-autostart",
                        "lines": 6,
                        "long": "--no-autostart"
                    },
                    {
                        "name": "--no-secmem-warning",
                        "lines": 8,
                        "long": "--no-secmem-warning"
                    },
                    {
                        "name": "Certificate related options",
                        "lines": 1
                    },
                    {
                        "name": "--enable-policy-checks",
                        "lines": 1,
                        "long": "--enable-policy-checks"
                    },
                    {
                        "name": "--disable-policy-checks",
                        "lines": 3,
                        "long": "--disable-policy-checks"
                    },
                    {
                        "name": "--enable-crl-checks",
                        "lines": 1,
                        "long": "--enable-crl-checks"
                    },
                    {
                        "name": "--disable-crl-checks",
                        "lines": 8,
                        "long": "--disable-crl-checks"
                    },
                    {
                        "name": "--enable-trusted-cert-crl-check",
                        "lines": 1,
                        "long": "--enable-trusted-cert-crl-check"
                    },
                    {
                        "name": "--disable-trusted-cert-crl-check",
                        "lines": 10,
                        "long": "--disable-trusted-cert-crl-check"
                    },
                    {
                        "name": "--force-crl-refresh",
                        "lines": 8,
                        "long": "--force-crl-refresh"
                    },
                    {
                        "name": "--enable-issuer-based-crl-check",
                        "lines": 6,
                        "long": "--enable-issuer-based-crl-check"
                    },
                    {
                        "name": "--enable-ocsp",
                        "lines": 1,
                        "long": "--enable-ocsp"
                    },
                    {
                        "name": "--disable-ocsp",
                        "lines": 7,
                        "long": "--disable-ocsp"
                    },
                    {
                        "name": "--auto-issuer-key-retrieve",
                        "lines": 28,
                        "long": "--auto-issuer-key-retrieve"
                    },
                    {
                        "name": "Input and Output",
                        "lines": 1
                    },
                    {
                        "name": "--armor",
                        "lines": 1,
                        "long": "--armor"
                    },
                    {
                        "name": "-a",
                        "lines": 1,
                        "flag": "-a"
                    },
                    {
                        "name": "--base64",
                        "lines": 3,
                        "long": "--base64"
                    },
                    {
                        "name": "--assume-armor",
                        "lines": 4,
                        "long": "--assume-armor"
                    },
                    {
                        "name": "--assume-base64",
                        "lines": 3,
                        "long": "--assume-base64"
                    },
                    {
                        "name": "--assume-binary",
                        "lines": 23,
                        "long": "--assume-binary"
                    },
                    {
                        "name": "-u",
                        "lines": 6,
                        "flag": "-u"
                    },
                    {
                        "name": "-r",
                        "lines": 5,
                        "flag": "-r"
                    },
                    {
                        "name": "-o",
                        "lines": 5,
                        "flag": "-o"
                    },
                    {
                        "name": "--with-key-data",
                        "lines": 6,
                        "long": "--with-key-data"
                    },
                    {
                        "name": "--with-validation",
                        "lines": 11,
                        "long": "--with-validation"
                    },
                    {
                        "name": "--with-md5-fingerprint",
                        "lines": 3,
                        "long": "--with-md5-fingerprint"
                    },
                    {
                        "name": "--with-keygrip",
                        "lines": 4,
                        "long": "--with-keygrip"
                    },
                    {
                        "name": "--with-secret",
                        "lines": 4,
                        "long": "--with-secret"
                    },
                    {
                        "name": "How to change how the CMS is created",
                        "lines": 13
                    },
                    {
                        "name": "--digest-algo name",
                        "lines": 5,
                        "long": "--digest-algo"
                    },
                    {
                        "name": "Doing things one usually do not want to do",
                        "lines": 17
                    },
                    {
                        "name": "--with-ephemeral-keys",
                        "lines": 61,
                        "long": "--with-ephemeral-keys"
                    },
                    {
                        "name": "--debug-all",
                        "lines": 3,
                        "long": "--debug-all"
                    },
                    {
                        "name": "--debug-allow-core-dump",
                        "lines": 6,
                        "long": "--debug-allow-core-dump"
                    },
                    {
                        "name": "--debug-no-chain-validation",
                        "lines": 4,
                        "long": "--debug-no-chain-validation"
                    },
                    {
                        "name": "--debug-ignore-expiration",
                        "lines": 4,
                        "long": "--debug-ignore-expiration"
                    },
                    {
                        "name": "--passphrase-fd n",
                        "lines": 7,
                        "long": "--passphrase-fd"
                    },
                    {
                        "name": "--pinentry-mode mode",
                        "lines": 23,
                        "long": "--pinentry-mode"
                    },
                    {
                        "name": "--no-common-certs-import",
                        "lines": 8,
                        "long": "--no-common-certs-import"
                    }
                ]
            },
            {
                "name": "HOW TO SPECIFY A USER ID",
                "lines": 5,
                "subsections": [
                    {
                        "name": "By key Id.",
                        "lines": 26
                    },
                    {
                        "name": "By fingerprint.",
                        "lines": 22
                    },
                    {
                        "name": "By exact match on OpenPGP user ID.",
                        "lines": 6
                    },
                    {
                        "name": "By exact match on an email address.",
                        "lines": 7
                    },
                    {
                        "name": "By partial match on an email address.",
                        "lines": 6
                    },
                    {
                        "name": "By exact match on the subject's DN.",
                        "lines": 8
                    },
                    {
                        "name": "By exact match on the issuer's DN.",
                        "lines": 8
                    },
                    {
                        "name": "By exact match on serial number and issuer's DN.",
                        "lines": 7
                    },
                    {
                        "name": "By keygrip.",
                        "lines": 7
                    },
                    {
                        "name": "By substring match.",
                        "lines": 7
                    },
                    {
                        "name": ". and + prefixes",
                        "lines": 14
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 5,
                "subsections": [
                    {
                        "name": "gpgsm.conf",
                        "lines": 7
                    },
                    {
                        "name": "policies.txt",
                        "lines": 13
                    },
                    {
                        "name": "qualified.txt",
                        "lines": 30
                    },
                    {
                        "name": "help.txt",
                        "lines": 10
                    },
                    {
                        "name": "com-certs.pem",
                        "lines": 15
                    },
                    {
                        "name": "pubring.kbx",
                        "lines": 11
                    },
                    {
                        "name": "S.gpg-agent",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 12,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "gpgsm - CMS encryption and signing tool\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "gpgsm [--homedir dir] [--options file] [options] command [args]\n\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "gpgsm  is  a  tool similar to gpg to provide digital encryption and signing services on X.509\ncertificates and the CMS protocol.  It is mainly used as a backend for S/MIME  mail  process‐\ning.   gpgsm  includes a full featured certificate management and complies with all rules de‐\nfined for the German Sphinx project.\n\n\n\n\n",
                "subsections": []
            },
            "COMMANDS": {
                "content": "Commands are not distinguished from options except for the fact that only one command is  al‐\nlowed.\n\n\n\n\n",
                "subsections": [
                    {
                        "name": "Commands not specific to the function",
                        "content": ""
                    },
                    {
                        "name": "--version",
                        "content": "Print  the program version and licensing information.  Note that you cannot abbreviate\nthis command.\n\n",
                        "long": "--version"
                    },
                    {
                        "name": "--help, -h",
                        "content": "Print a usage message summarizing the most useful command-line options.  Note that you\ncannot abbreviate this command.\n\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "--warranty",
                        "content": "Print warranty information.  Note that you cannot abbreviate this command.\n\n",
                        "long": "--warranty"
                    },
                    {
                        "name": "--dump-options",
                        "content": "Print  a  list of all available options and commands.  Note that you cannot abbreviate\nthis command.\n",
                        "long": "--dump-options"
                    },
                    {
                        "name": "Commands to select the type of operation",
                        "content": ""
                    },
                    {
                        "name": "--encrypt",
                        "content": "Perform an encryption.  The keys the data is encrypted to must be set using the option\n--recipient.\n\n",
                        "long": "--encrypt"
                    },
                    {
                        "name": "--decrypt",
                        "content": "Perform a decryption; the type of input is automatically determined.  It may either be\nin binary form or PEM encoded; automatic determination  of  base-64  encoding  is  not\ndone.\n\n\n--sign Create  a  digital signature.  The key used is either the fist one found in the keybox\nor those set with the --local-user option.\n\n",
                        "long": "--decrypt"
                    },
                    {
                        "name": "--verify",
                        "content": "Check a signature file for validity.  Depending on the arguments a detached  signature\nmay also be checked.\n\n",
                        "long": "--verify"
                    },
                    {
                        "name": "--server",
                        "content": "Run in server mode and wait for commands on the stdin.\n\n\n--call-dirmngr command [args]\nBehave as a Dirmngr client issuing the request command with the optional list of args.\nThe output of the Dirmngr is printed stdout.  Please note that file names given as ar‐\nguments  should  have  an absolute file name (i.e. commencing with /) because they are\npassed verbatim to the Dirmngr and the working directory of the Dirmngr might  not  be\nthe  same  as  the  one of this client.  Currently it is not possible to pass data via\nstdin to the Dirmngr.  command should not contain spaces.\n\nThis is command is required for certain maintaining tasks of the dirmngr where a dirm‐\nngr must be able to call back to gpgsm.  See the Dirmngr manual for details.\n\n\n--call-protect-tool arguments\nCertain  maintenance operations are done by an external program call gpg-protect-tool;\nthis is usually not installed in a directory listed in the PATH variable.   This  com‐\nmand  provides a simple wrapper to access this tool.  arguments are passed verbatim to\nthis command; use ‘--help’ to get a list of supported operations.\n\n\n",
                        "long": "--server"
                    },
                    {
                        "name": "How to manage the certificates and keys",
                        "content": ""
                    },
                    {
                        "name": "--generate-key",
                        "content": "",
                        "long": "--generate-key"
                    },
                    {
                        "name": "--gen-key",
                        "content": "This command allows the creation of a certificate signing  request  or  a  self-signed\ncertificate.   It  is commonly used along with the --output option to save the created\nCSR or certificate into a file.  If used with the --batch a parameter file is used  to\ncreate  the  CSR  or  certificate and it is further possible to create non-self-signed\ncertificates.\n\n",
                        "long": "--gen-key"
                    },
                    {
                        "name": "--list-keys",
                        "content": "",
                        "long": "--list-keys"
                    },
                    {
                        "name": "-k",
                        "content": "played  data  might be reformatted for better human readability and illegal characters\nare replaced by safe substitutes.\n\n",
                        "flag": "-k"
                    },
                    {
                        "name": "--list-secret-keys",
                        "content": "",
                        "long": "--list-secret-keys"
                    },
                    {
                        "name": "-K",
                        "content": "--list-external-keys pattern\nList certificates matching pattern using an external server.  This utilizes the  dirm‐‐\nngr service.\n\n",
                        "flag": "-K"
                    },
                    {
                        "name": "--list-chain",
                        "content": "Same as --list-keys but also prints all keys making up the chain.\n\n\n",
                        "long": "--list-chain"
                    },
                    {
                        "name": "--dump-cert",
                        "content": "",
                        "long": "--dump-cert"
                    },
                    {
                        "name": "--dump-keys",
                        "content": "List all available certificates stored in the local key database using a format useful\nmainly for debugging.\n\n",
                        "long": "--dump-keys"
                    },
                    {
                        "name": "--dump-chain",
                        "content": "Same as --dump-keys but also prints all keys making up the chain.\n\n",
                        "long": "--dump-chain"
                    },
                    {
                        "name": "--dump-secret-keys",
                        "content": "List all available certificates for which a corresponding a secret  key  is  available\nusing a format useful mainly for debugging.\n\n\n--dump-external-keys pattern\nList  certificates matching pattern using an external server.  This utilizes the dirm‐‐\nngr service.  It uses a format useful mainly for debugging.\n\n",
                        "long": "--dump-secret-keys"
                    },
                    {
                        "name": "--keydb-clear-some-cert-flags",
                        "content": "This is a debugging aid to reset certain flags in the key database which are  used  to\ncache certain certificate stati.  It is especially useful if a bad CRL or a weird run‐\nning OCSP responder did accidentally revoke certificate.  There is no  security  issue\nwith this command because gpgsm always make sure that the validity of a certificate is\nchecked right before it is used.\n\n\n--delete-keys pattern\nDelete the keys matching pattern.  Note that there is no command to delete the  secret\npart  of  the  key  directly.  In case you need to do this, you should run the command\ngpgsm --dump-secret-keys KEYID before you delete the key, copy the string of  hex-dig‐\nits in the ``keygrip'' line and delete the file consisting of these hex-digits and the\nsuffix .key from the ‘private-keys-v1.d’ directory  below  our  GnuPG  home  directory\n(usually ‘~/.gnupg’).\n\n\n--export [pattern]\nExport  all  certificates stored in the Keybox or those specified by the optional pat‐\ntern. Those pattern consist of a list of user ids  (see:  [how-to-specify-a-user-id]).\nWhen used along with the --armor option a few informational lines are prepended before\neach block.  There is one limitation: As there is no commonly agreed upon way to  pack\nmore than one certificate into an ASN.1 structure, the binary export (i.e. without us‐\ning armor) works only for the export of one certificate.  Thus it is required to spec‐\nify  a  pattern  which yields exactly one certificate.  Ephemeral certificate are only\nexported if all pattern are given as fingerprints or keygrips.\n\n\n--export-secret-key-p12 key-id\nExport the private key and the certificate identified by key-id using the PKCS#12 for‐\nmat.  When used with the --armor option a few informational lines are prepended to the\noutput.  Note, that the PKCS#12 format is not very secure and proper  transport  secu‐\nrity should be used to convey the exported key.  (See: [option --p12-charset].)\n\n\n--export-secret-key-p8 key-id\n--export-secret-key-raw key-id\nExport  the  private  key  of the certificate identified by key-id with any encryption\nstripped.  The ...-raw command exports in PKCS#1 format; the ...-p8 command exports in\nPKCS#8  format.   When  used  with  the  --armor  option a few informational lines are\nprepended to the output.  These commands are useful to prepare a key for use on a  TLS\nserver.\n\n\n--import [files]\nImport  the  certificates from the PEM or binary encoded files as well as from signed-\nonly messages.  This command may also be used to import a secret key  from  a  PKCS#12\nfile.\n\n",
                        "long": "--keydb-clear-some-cert-flags"
                    },
                    {
                        "name": "--learn-card",
                        "content": "Read information about the private keys from the smartcard and import the certificates\nfrom there.  This command utilizes the gpg-agent and in turn the scdaemon.\n\n\n--change-passphrase userid\n--passwd userid\nChange the passphrase of the private key belonging to  the  certificate  specified  as\nuserid.  Note, that changing the passphrase/PIN of a smartcard is not yet supported.\n\n",
                        "long": "--learn-card"
                    }
                ]
            },
            "OPTIONS": {
                "content": "GPGSM  features  a  bunch of options to control the exact behaviour and to change the default\nconfiguration.\n\n\n\n\n",
                "subsections": [
                    {
                        "name": "How to change the configuration",
                        "content": "These options are used to change the configuration and are usually found in the option file.\n\n\n\n\n--options file\nReads configuration from file instead of from the default per-user configuration file.\nThe  default configuration file is named ‘gpgsm.conf’ and expected in the ‘.gnupg’ di‐\nrectory directly below the home directory of the user.\n\n\n--homedir dir\nSet the name of the home directory to dir. If this option is not used, the home direc‐\ntory  defaults  to  ‘~/.gnupg’.  It is only recognized when given on the command line.\nIt  also  overrides  any  home  directory  stated  through  the  environment  variable\n‘GNUPGHOME’  or  (on  Windows  systems)  by  means  of  the  Registry entry HKCU\\Soft‐\nware\\GNU\\GnuPG:HomeDir.\n\nOn Windows systems it is possible to install GnuPG as a portable application.  In this\ncase  only this command line option is considered, all other ways to set a home direc‐\ntory are ignored.\n\nTo install GnuPG as a portable application under Windows, create an empty  file  named\n‘gpgconf.ctl’  in  the  same directory as the tool ‘gpgconf.exe’.  The root of the in‐\nstallation is then that directory; or, if ‘gpgconf.exe’ has  been  installed  directly\nbelow  a directory named ‘bin’, its parent directory.  You also need to make sure that\nthe following directories exist and are writable: ‘ROOT/home’ for the GnuPG  home  and\n‘ROOT/var/cache/gnupg’ for internal cache files.\n\n\n"
                    },
                    {
                        "name": "-v",
                        "content": "",
                        "flag": "-v"
                    },
                    {
                        "name": "--verbose",
                        "content": "Outputs  additional information while running.  You can increase the verbosity by giv‐\ning several verbose commands to gpgsm, such as ‘-vv’.\n\n\n--policy-file filename\nChange the default name of the policy file to filename.\n\n\n--agent-program file\nSpecify an agent program to be used for secret key operations.  The default  value  is\ndetermined  by running the command gpgconf.  Note that the pipe symbol (|) is used for\na regression test suite hack and may thus not be used in the file name.\n\n\n--dirmngr-program file\nSpecify a  dirmngr  program  to  be  used  for  CRL  checks.   The  default  value  is\n‘/usr/bin/dirmngr’.\n\n",
                        "long": "--verbose"
                    },
                    {
                        "name": "--prefer-system-dirmngr",
                        "content": "This option is obsolete and ignored.\n\n",
                        "long": "--prefer-system-dirmngr"
                    },
                    {
                        "name": "--disable-dirmngr",
                        "content": "Entirely disable the use of the Dirmngr.\n\n",
                        "long": "--disable-dirmngr"
                    },
                    {
                        "name": "--no-autostart",
                        "content": "Do  not start the gpg-agent or the dirmngr if it has not yet been started and its ser‐\nvice is required.  This option is mostly useful on machines where  the  connection  to\ngpg-agent  has been redirected to another machines.  If dirmngr is required on the re‐\nmote machine, it may be started manually using gpgconf --launch dirmngr.\n\n",
                        "long": "--no-autostart"
                    },
                    {
                        "name": "--no-secmem-warning",
                        "content": "Do not print a warning when the so called \"secure memory\" cannot be used.\n\n\n--log-file file\nWhen running in server mode, append all logging output to file.   Use  ‘socket://’  to\nlog to socket.\n\n",
                        "long": "--no-secmem-warning"
                    },
                    {
                        "name": "Certificate related options",
                        "content": ""
                    },
                    {
                        "name": "--enable-policy-checks",
                        "content": "",
                        "long": "--enable-policy-checks"
                    },
                    {
                        "name": "--disable-policy-checks",
                        "content": "By default policy checks are enabled.  These options may be used to change it.\n\n",
                        "long": "--disable-policy-checks"
                    },
                    {
                        "name": "--enable-crl-checks",
                        "content": "",
                        "long": "--enable-crl-checks"
                    },
                    {
                        "name": "--disable-crl-checks",
                        "content": "By  default  the  CRL  checks are enabled and the DirMngr is used to check for revoked\ncertificates.  The disable option is most useful with an off-line  network  connection\nto  suppress this check and also to avoid that new certificates introduce a web bug by\nincluding a certificate specific CRL DP.  The disable option also disables  an  issuer\ncertificate  lookup via the authorityInfoAccess property of the certificate; the --en‐‐\nable-issuer-key-retrieve can be used to make use of that property anyway.\n\n",
                        "long": "--disable-crl-checks"
                    },
                    {
                        "name": "--enable-trusted-cert-crl-check",
                        "content": "",
                        "long": "--enable-trusted-cert-crl-check"
                    },
                    {
                        "name": "--disable-trusted-cert-crl-check",
                        "content": "By default the CRL for trusted root certificates are checked like for any  other  cer‐\ntificates.  This allows a CA to revoke its own certificates voluntary without the need\nof putting all ever issued certificates into a CRL.  The disable option may be used to\nswitch  this  extra check off.  Due to the caching done by the Dirmngr, there will not\nbe any noticeable performance gain.  Note,  that  this  also  disables  possible  OCSP\nchecks  for trusted root certificates.  A more specific way of disabling this check is\nby adding the ``relax'' keyword to the root CA line of the ‘trustlist.txt’\n\n\n",
                        "long": "--disable-trusted-cert-crl-check"
                    },
                    {
                        "name": "--force-crl-refresh",
                        "content": "Tell the dirmngr to reload the CRL for each  request.   For  better  performance,  the\ndirmngr  will  actually optimize this by suppressing the loading for short time inter‐\nvals (e.g. 30 minutes). This option is useful to make sure that a fresh CRL is  avail‐\nable for certificates hold in the keybox.  The suggested way of doing this is by using\nit along with the option --with-validation for a key  listing  command.   This  option\nshould not be used in a configuration file.\n\n",
                        "long": "--force-crl-refresh"
                    },
                    {
                        "name": "--enable-issuer-based-crl-check",
                        "content": "Run  a  CRL  check even for certificates which do not have any CRL distribution point.\nThis requires that a suitable LDAP server has been configured in Dirmngr and that  the\nCRL  can  be found using the issuer.  This option reverts to what GnuPG did up to ver‐\nsion 2.2.20.  This option is in general not useful.\n\n",
                        "long": "--enable-issuer-based-crl-check"
                    },
                    {
                        "name": "--enable-ocsp",
                        "content": "",
                        "long": "--enable-ocsp"
                    },
                    {
                        "name": "--disable-ocsp",
                        "content": "By default OCSP checks are disabled.  The enable option may be  used  to  enable  OCSP\nchecks  via  Dirmngr.  If CRL checks are also enabled, CRLs will be used as a fallback\nif for some reason an OCSP request will not succeed.  Note, that  you  have  to  allow\nOCSP requests in Dirmngr's configuration too (option --allow-ocsp) and configure Dirm‐\nngr properly.  If you do not do so you will get the error code ‘Not supported’.\n\n",
                        "long": "--disable-ocsp"
                    },
                    {
                        "name": "--auto-issuer-key-retrieve",
                        "content": "If a required certificate is missing while validating the chain of  certificates,  try\nto  load  that certificate from an external location.  This usually means that Dirmngr\nis employed to search for the certificate.  Note that this option makes  a  \"web  bug\"\nlike  behavior  possible.  LDAP server operators can see which keys you request, so by\nsending you a message signed by a brand new key (which you naturally will not have  on\nyour  local  keybox), the operator can tell both your IP address and the time when you\nverified the signature.\n\n\n\n\n--validation-model name\nThis option changes the default  validation  model.   The  only  possible  values  are\n\"shell\"  (which  is  the default), \"chain\" which forces the use of the chain model and\n\"steed\" for a new simplified model.  The chain model is also used if an option in  the\n‘trustlist.txt’  or an attribute of the certificate requests it.  However the standard\nmodel (shell) is in that case always tried first.\n\n\n--ignore-cert-extension oid\nAdd oid to the list of ignored certificate extensions.  The oid is expected to  be  in\ndotted decimal form, like 2.5.29.3.  This option may be used more than once.  Critical\nflagged certificate extensions matching one of the OIDs in the list are treated as  if\nthey  are actually handled and thus the certificate will not be rejected due to an un‐\nknown critical extension.  Use this option with care because  extensions  are  usually\nflagged as critical for a reason.\n\n",
                        "long": "--auto-issuer-key-retrieve"
                    },
                    {
                        "name": "Input and Output",
                        "content": ""
                    },
                    {
                        "name": "--armor",
                        "content": "",
                        "long": "--armor"
                    },
                    {
                        "name": "-a",
                        "content": "",
                        "flag": "-a"
                    },
                    {
                        "name": "--base64",
                        "content": "Create Base-64 encoded output; i.e. PEM without the header lines.\n\n",
                        "long": "--base64"
                    },
                    {
                        "name": "--assume-armor",
                        "content": "Assume  the input data is PEM encoded.  Default is to autodetect the encoding but this\nis may fail.\n\n",
                        "long": "--assume-armor"
                    },
                    {
                        "name": "--assume-base64",
                        "content": "Assume the input data is plain base-64 encoded.\n\n",
                        "long": "--assume-base64"
                    },
                    {
                        "name": "--assume-binary",
                        "content": "Assume the input data is binary encoded.\n\n\n\n--p12-charset name\ngpgsm uses the UTF-8 encoding when encoding passphrases for PKCS#12 files.   This  op‐\ntion may be used to force the passphrase to be encoded in the specified encoding name.\nThis is useful if the application used to import the key uses a different encoding and\nthus  will  not be able to import a file generated by gpgsm.  Commonly used values for\nname are Latin1 and CP850.  Note that gpgsm itself automagically imports any file with\na passphrase encoded to the most commonly used encodings.\n\n\n\n--default-key userid\nUse  userid  as  the  standard key for signing.  This key is used if no other key has\nbeen defined as a signing key.  Note, that the first --local-users  option  also  sets\nthis key if it has not yet been set; however --default-key always overrides this.\n\n\n\n--local-user userid\n",
                        "long": "--assume-binary"
                    },
                    {
                        "name": "-u",
                        "content": "Set  the user(s) to be used for signing.  The default is the first secret key found in\nthe database.\n\n\n\n--recipient name",
                        "flag": "-u"
                    },
                    {
                        "name": "-r",
                        "content": "[how-to-specify-a-user-id]).\n\n\n\n--output file",
                        "flag": "-r"
                    },
                    {
                        "name": "-o",
                        "content": "Write output to file.  The default is to write it to stdout.\n\n\n\n",
                        "flag": "-o"
                    },
                    {
                        "name": "--with-key-data",
                        "content": "Displays  extra  information  with the --list-keys commands.  Especially a line tagged\ngrp is printed which tells you the keygrip of a key.  This string is for example  used\nas the file name of the secret key.  Implies --with-colons.\n\n\n",
                        "long": "--with-key-data"
                    },
                    {
                        "name": "--with-validation",
                        "content": "When  doing  a  key listing, do a full validation check for each key and print the re‐\nsult.  This is usually a slow operation because it requires a CRL lookup and other op‐\nerations.\n\nWhen  used  along with --import, a validation of the certificate to import is done and\nonly imported if it succeeds the test.  Note that this  does  not  affect  an  already\navailable  certificate  in the DB.  This option is therefore useful to simply verify a\ncertificate.\n\n\n",
                        "long": "--with-validation"
                    },
                    {
                        "name": "--with-md5-fingerprint",
                        "content": "For standard key listings, also print the MD5 fingerprint of the certificate.\n\n",
                        "long": "--with-md5-fingerprint"
                    },
                    {
                        "name": "--with-keygrip",
                        "content": "Include the keygrip in standard key listings.  Note that the keygrip is always  listed\nin --with-colons mode.\n\n",
                        "long": "--with-keygrip"
                    },
                    {
                        "name": "--with-secret",
                        "content": "Include  info  about  the  presence  of  a secret key in public key listings done with\n--with-colons.\n\n",
                        "long": "--with-secret"
                    },
                    {
                        "name": "How to change how the CMS is created",
                        "content": "--include-certs n\nUsing n of -2 includes all certificate except for  the  root  cert,  -1  includes  all\ncerts,  0  does  not include any certs, 1 includes only the signers cert and all other\npositive values include up to n certificates starting with the signer cert.   The  de‐\nfault is -2.\n\n\n--cipher-algo oid\nUse  the  cipher  algorithm  with the ASN.1 object identifier oid for encryption.  For\nconvenience the strings 3DES, AES and AES256 may be used instead of their  OIDs.   The\ndefault is AES (2.16.840.1.101.3.4.1.2).\n\n"
                    },
                    {
                        "name": "--digest-algo name",
                        "content": "Use  name as the message digest algorithm.  Usually this algorithm is deduced from the\nrespective signing certificate.  This option forces the use of the given algorithm and\nmay lead to severe interoperability problems.\n\n",
                        "long": "--digest-algo"
                    },
                    {
                        "name": "Doing things one usually do not want to do",
                        "content": "--extra-digest-algo name\nSometimes  signatures  are  broken  in that they announce a different digest algorithm\nthan actually used.  gpgsm uses a one-pass data processing model  and  thus  needs  to\nrely  on  the  announced digest algorithms to properly hash the data.  As a workaround\nthis option may be used to tell gpgsm to also hash the data using the algorithm  name;\nthis  slows processing down a little bit but allows verification of such broken signa‐\ntures.  If gpgsm prints an error like ``digest algo 8 has not been enabled''  you  may\nwant to try this option, with ‘SHA256’ for name.\n\n\n\n--faked-system-time epoch\nThis option is only useful for testing; it sets the system time back or forth to epoch\nwhich is the number of seconds elapsed since the year 1970.  Alternatively  epoch  may\nbe given as a full ISO time string (e.g. \"20070924T154812\").\n\n"
                    },
                    {
                        "name": "--with-ephemeral-keys",
                        "content": "Include  ephemeral flagged keys in the output of key listings.  Note that they are in‐\ncluded anyway if the key specification for a listing is given as fingerprint  or  key‐\ngrip.\n\n\n--debug-level level\nSelect  the debug level for investigating problems. level may be a numeric value or by\na keyword:\n\n\nnone   No debugging at all.  A value of less than 1 may be used instead  of  the  key‐\nword.\n\nbasic  Some  basic debug messages.  A value between 1 and 2 may be used instead of the\nkeyword.\n\nadvanced\nMore verbose debug messages.  A value between 3 and 5 may be  used  instead  of\nthe keyword.\n\nexpert Even  more  detailed  messages.  A value between 6 and 8 may be used instead of\nthe keyword.\n\nguru   All of the debug messages you can get. A value greater than 8 may be  used  in‐\nstead  of  the  keyword.  The creation of hash tracing files is only enabled if\nthe keyword is used.\n\nHow these messages are mapped to the actual debugging flags is not specified and  may  change\nwith  newer  releases of this program. They are however carefully selected to best aid in de‐\nbugging.\n\n\n--debug flags\nThis option is only useful for debugging and the behaviour  may  change  at  any  time\nwithout  notice; using --debug-levels is the preferred method to select the debug ver‐\nbosity.  FLAGS are bit encoded and may be given in usual C-Syntax. The  currently  de‐\nfined bits are:\n\n\n0 (1)  X.509 or OpenPGP protocol related data\n\n1 (2)  values of big number integers\n\n2 (4)  low level crypto operations\n\n5 (32) memory allocation\n\n6 (64) caching\n\n7 (128)\nshow memory statistics\n\n9 (512)\nwrite hashed data to files named dbgmd-000*\n\n10 (1024)\ntrace Assuan protocol\n\nNote, that all flags set using this option may get overridden by --debug-level.\n\n",
                        "long": "--with-ephemeral-keys"
                    },
                    {
                        "name": "--debug-all",
                        "content": "Same as --debug=0xffffffff\n\n",
                        "long": "--debug-all"
                    },
                    {
                        "name": "--debug-allow-core-dump",
                        "content": "Usually  gpgsm  tries to avoid dumping core by well written code and by disabling core\ndumps for security reasons.  However, bugs are pretty durable  beasts  and  to  squash\nthem  it  is sometimes useful to have a core dump.  This option enables core dumps un‐\nless the Bad Thing happened before the option parsing.\n\n",
                        "long": "--debug-allow-core-dump"
                    },
                    {
                        "name": "--debug-no-chain-validation",
                        "content": "This is actually not a debugging option but only useful as such.  It lets gpgsm bypass\nall certificate chain validation checks.\n\n",
                        "long": "--debug-no-chain-validation"
                    },
                    {
                        "name": "--debug-ignore-expiration",
                        "content": "This is actually not a debugging option but only useful as such.  It lets gpgsm ignore\nall notAfter dates, this is used by the regression tests.\n\n",
                        "long": "--debug-ignore-expiration"
                    },
                    {
                        "name": "--passphrase-fd n",
                        "content": "Read the passphrase from file descriptor n. Only the first line will be read from file\ndescriptor  n.  If  you  use 0 for n, the passphrase will be read from STDIN. This can\nonly be used if only one passphrase is supplied.\n\nNote that this passphrase is only used if the option --batch has also been given.\n\n",
                        "long": "--passphrase-fd"
                    },
                    {
                        "name": "--pinentry-mode mode",
                        "content": "Set the pinentry mode to mode.  Allowed values for mode are:\n\ndefault\nUse the default of the agent, which is ask.\n\nask    Force the use of the Pinentry.\n\ncancel Emulate use of Pinentry's cancel button.\n\nerror  Return a Pinentry error (``No Pinentry'').\n\nloopback\nRedirect Pinentry queries to the caller.  Note that in contrast to Pinentry the\nuser is not prompted again if he enters a bad password.\n\n\n--request-origin origin\nTell gpgsm to assume that the operation ultimately originated at origin.  Depending on\nthe origin certain restrictions are applied and the Pinentry may include an extra note\non the origin.  Supported values for origin are: local which is the default, remote to\nindicate a remote origin or browser for an operation requested by a web browser.\n\n",
                        "long": "--pinentry-mode"
                    },
                    {
                        "name": "--no-common-certs-import",
                        "content": "Suppress the import of common certificates on keybox creation.\n\n\nAll the long options may also be given in the configuration file after stripping off the  two\nleading dashes.\n\n\n",
                        "long": "--no-common-certs-import"
                    }
                ]
            },
            "HOW TO SPECIFY A USER ID": {
                "content": "There  are different ways to specify a user ID to GnuPG.  Some of them are only valid for gpg\nothers are only good for gpgsm.  Here is the entire list of ways to specify a key:\n\n\n",
                "subsections": [
                    {
                        "name": "By key Id.",
                        "content": "This format is deduced from the length of the string and its content or 0x prefix. The\nkey  Id of an X.509 certificate are the low 64 bits of its SHA-1 fingerprint.  The use\nof key Ids is just a shortcut, for all automated processing the fingerprint should  be\nused.\n\nWhen  using  gpg  an exclamation mark (!) may be appended to force using the specified\nprimary or secondary key and not to try and calculate which primary or  secondary  key\nto use.\n\nThe  last  four  lines of the example give the key ID in their long form as internally\nused by the OpenPGP protocol. You can see the long key ID  using  the  option  --with-\ncolons.\n\n234567C4\n0F34E556E\n01347A56A\n0xAB123456\n\n234AABBCC34567C4\n0F323456784E56EAB\n01AB3FED1347A5612\n0x234AABBCC34567C4\n\n\n\n"
                    },
                    {
                        "name": "By fingerprint.",
                        "content": "This format is deduced from the length of the string and its content or the 0x prefix.\nNote, that only the 20 byte version fingerprint is  available  with  gpgsm  (i.e.  the\nSHA-1 hash of the certificate).\n\nWhen  using  gpg  an exclamation mark (!) may be appended to force using the specified\nprimary or secondary key and not to try and calculate which primary or  secondary  key\nto use.\n\nThe best way to specify a key Id is by using the fingerprint.  This avoids any ambigu‐\nities in case that there are duplicated key IDs.\n\n1234343434343434C434343434343434\n123434343434343C3434343434343734349A3434\n0E12343434343434343434EAB3484343434343434\n0xE12343434343434343434EAB3484343434343434\n\n\ngpgsm also accepts colons between each pair of hexadecimal digits because  this  is  the  de-\nfacto  standard  on  how to present X.509 fingerprints.  gpg also allows the use of the space\nseparated SHA-1 fingerprint as printed by the key listing commands.\n\n"
                    },
                    {
                        "name": "By exact match on OpenPGP user ID.",
                        "content": "This is denoted by a leading equal sign. It does not make  sense  for  X.509  certifi‐\ncates.\n\n=Heinrich Heine <heinrichh@uni-duesseldorf.de>\n\n"
                    },
                    {
                        "name": "By exact match on an email address.",
                        "content": "This  is indicated by enclosing the email address in the usual way with left and right\nangles.\n\n<heinrichh@uni-duesseldorf.de>\n\n\n"
                    },
                    {
                        "name": "By partial match on an email address.",
                        "content": "This is indicated by prefixing the search string with an @.   This  uses  a  substring\nsearch but considers only the mail address (i.e. inside the angle brackets).\n\n@heinrichh\n\n"
                    },
                    {
                        "name": "By exact match on the subject's DN.",
                        "content": "This  is indicated by a leading slash, directly followed by the RFC-2253 encoded DN of\nthe subject.  Note that you can't use the string printed by gpgsm --list-keys  because\nthat  one has been reordered and modified for better readability; use --with-colons to\nprint the raw (but standard escaped) RFC-2253 string.\n\n/CN=Heinrich Heine,O=Poets,L=Paris,C=FR\n\n"
                    },
                    {
                        "name": "By exact match on the issuer's DN.",
                        "content": "This is indicated by a leading hash mark, directly followed by a slash  and  then  di‐\nrectly followed by the RFC-2253 encoded DN of the issuer.  This should return the Root\ncert of the issuer.  See note above.\n\n#/CN=Root Cert,O=Poets,L=Paris,C=FR\n\n\n"
                    },
                    {
                        "name": "By exact match on serial number and issuer's DN.",
                        "content": "This is indicated by a hash mark, followed by the hexadecimal  representation  of  the\nserial number, then followed by a slash and the RFC-2253 encoded DN of the issuer. See\nnote above.\n\n#4F03/CN=Root Cert,O=Poets,L=Paris,C=FR\n\n"
                    },
                    {
                        "name": "By keygrip.",
                        "content": "This is indicated by an ampersand followed by the 40 hex digits of a  keygrip.   gpgsm\nprints the keygrip when using the command --dump-cert.\n\n&D75F22C3F86E355877348498CDC92BD21010A480\n\n\n"
                    },
                    {
                        "name": "By substring match.",
                        "content": "This  is  the  default  mode  but applications may want to explicitly indicate this by\nputting the asterisk in front.  Match is not case sensitive.\n\nHeine\n*Heine\n\n"
                    },
                    {
                        "name": ". and + prefixes",
                        "content": "These prefixes are reserved for looking up mails anchored at the end and  for  a  word\nsearch mode.  They are not yet implemented and using them is undefined.\n\n\nPlease  note  that we have reused the hash mark identifier which was used in old GnuPG\nversions to indicate the so called local-id.  It is not anymore used and there  should\nbe no conflict when used with X.509 stuff.\n\nUsing  the RFC-2253 format of DNs has the drawback that it is not possible to map them\nback to the original encoding, however we don't have to do this because our key  data‐\nbase stores this encoding as meta data.\n\n\n"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "$ gpgsm -er goo@bar.net <plaintext >ciphertext\n\n\n\n",
                "subsections": []
            },
            "FILES": {
                "content": "There  are  a few configuration files to control certain aspects of gpgsm's operation. Unless\nnoted, they are expected in the current home directory (see: [option --homedir]).\n\n\n",
                "subsections": [
                    {
                        "name": "gpgsm.conf",
                        "content": "This is the standard configuration file read by gpgsm on startup.  It may contain  any\nvalid long option; the leading two dashes may not be entered and the option may not be\nabbreviated.  This default name may be changed on the command line (see: [gpgsm-option\n--options]).  You should backup this file.\n\n\n"
                    },
                    {
                        "name": "policies.txt",
                        "content": "This  is  a list of allowed CA policies.  This file should list the object identifiers\nof the policies line by line.  Empty lines and lines starting with a hash mark are ig‐\nnored.   Policies  missing  in this file and not marked as critical in the certificate\nwill print only a warning; certificates with  policies  marked  as  critical  and  not\nlisted  in  this  file  will  fail the signature verification.  You should backup this\nfile.\n\nFor example, to allow only the policy 2.289.9.9, the file should look like this:\n\n# Allowed policies\n2.289.9.9\n\n"
                    },
                    {
                        "name": "qualified.txt",
                        "content": "This is the list of root certificates used for qualified certificates.  They  are  de‐\nfined  as  certificates capable of creating legally binding signatures in the same way\nas handwritten signatures are.  Comments start with a hash mark and  empty  lines  are\nignored.   Lines  do  have  a length limit but this is not a serious limitation as the\nformat of the entries is fixed and checked by gpgsm: A non-comment  line  starts  with\noptional  whitespace,  followed by exactly 40 hex characters, white space and a lower‐\ncased 2 letter country code.  Additional data delimited with by a white space is  cur‐\nrent ignored but might late be used for other purposes.\n\nNote  that  even  if a certificate is listed in this file, this does not mean that the\ncertificate is trusted; in general the certificates listed in this  file  need  to  be\nlisted also in ‘trustlist.txt’.\n\nThis is a global file an installed in the data directory (e.g. ‘/usr/share/gnupg/qual‐\nified.txt’).  GnuPG installs a suitable file with root certificates as  used  in  Ger‐\nmany.   As new Root-CA certificates may be issued over time, these entries may need to\nbe updated; new distributions of this software should come with an updated list but it\nis still the responsibility of the Administrator to check that this list is correct.\n\nEvery time gpgsm uses a certificate for signing or verification this file will be con‐\nsulted to check whether the certificate under question has ultimately been  issued  by\none  of  these  CAs.   If this is the case the user will be informed that the verified\nsignature represents a legally binding (``qualified'')  signature.   When  creating  a\nsignature using such a certificate an extra prompt will be issued to let the user con‐\nfirm that such a legally binding signature shall really be created.\n\nBecause this software has not yet been approved for use with such certificates, appro‐\npriate notices will be shown to indicate this fact.\n\n"
                    },
                    {
                        "name": "help.txt",
                        "content": "This  is plain text file with a few help entries used with pinentry as well as a large\nlist of help items for gpg and gpgsm.  The standard file has English  help  texts;  to\ninstall  localized  versions use filenames like ‘help.LL.txt’ with LL denoting the lo‐\ncale.  GnuPG comes with a set of predefined help files in  the  data  directory  (e.g.\n‘/usr/share/gnupg/gnupg/help.de.txt’)  and  allows overriding of any help item by help\nfiles stored in the system configuration  directory  (e.g.  ‘/etc/gnupg/help.de.txt’).\nFor a reference of the help file's syntax, please see the installed ‘help.txt’ file.\n\n\n"
                    },
                    {
                        "name": "com-certs.pem",
                        "content": "This  file  is  a  collection of common certificates used to populated a newly created\n‘pubring.kbx’.  An administrator may replace this file with a custom one.  The  format\nis  a  concatenation of PEM encoded X.509 certificates.  This global file is installed\nin the data directory (e.g. ‘/usr/share/gnupg/com-certs.pem’).\n\n\nNote that on larger installations, it is useful to put predefined files  into  the  directory\n‘/etc/skel/.gnupg/’  so  that newly created users start up with a working configuration.  For\nexisting users a small helper script is provided to create these files (see: [addgnupghome]).\n\nFor internal purposes gpgsm creates and maintains a few other files; they  all  live  in  the\ncurrent home directory (see: [option --homedir]).  Only gpgsm may modify these files.\n\n\n"
                    },
                    {
                        "name": "pubring.kbx",
                        "content": "This a database file storing the certificates as well as meta information.  For debug‐\nging purposes the tool kbxutil may be used to show  the  internal  structure  of  this\nfile.  You should backup this file.\n\n\nrandomseed\nThis  content of this file is used to maintain the internal state of the random number\ngenerator across invocations.  The same file is used by other programs of  this  soft‐\nware too.\n\n"
                    },
                    {
                        "name": "S.gpg-agent",
                        "content": "If  this file exists gpgsm will first try to connect to this socket for accessing gpg-\nagent before starting a new gpg-agent instance.  Under Windows this socket  (which  in\nreality  be  a plain file describing a regular TCP listening port) is the standard way\nof connecting the gpg-agent.\n\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "gpg2(1), gpg-agent(1)\n\nThe full documentation for this tool is maintained as a Texinfo manual.   If  GnuPG  and  the\ninfo program are properly installed at your site, the command\n\ninfo gnupg\n\nshould give you access to the complete manual including a menu structure and an index.\n\n\n\nGnuPG 2.2.27                                 2020-12-21                                     GPGSM(1)",
                "subsections": []
            }
        }
    }
}