{
    "content": [
        {
            "type": "text",
            "text": "# EVP_KEYMGMT-DSA (man)\n\n## NAME\n\nEVPPKEY-DSA, EVPKEYMGMT-DSA - EVPPKEY DSA keytype and algorithm support\n\n## DESCRIPTION\n\nFor DSA the FIPS186-4 standard specifies that the values used for FFC parameter generation\nare also required for parameter validation.  This means that optional FFC domain parameter\nvalues for seed, pcounter and gindex may need to be stored for validation purposes. For DSA\nthese fields are not stored in the ASN1 data so they need to be stored externally if\nvalidation is required.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION** (2 subsections)\n- **EXAMPLES**\n- **CONFORMING TO**\n- **SEE ALSO**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "EVP_KEYMGMT-DSA",
        "section": "",
        "mode": "man",
        "summary": "EVPPKEY-DSA, EVPKEYMGMT-DSA - EVPPKEY DSA keytype and algorithm support",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "An EVPPKEY context can be obtained by calling:",
            "EVPPKEYCTX *pctx = EVPPKEYCTXnewfromname(NULL, \"DSA\", NULL);",
            "The DSA domain parameters can be generated by calling:",
            "unsigned int pbits = 2048;",
            "unsigned int qbits = 256;",
            "int gindex = 1;",
            "OSSLPARAM params[5];",
            "EVPPKEY *paramkey = NULL;",
            "EVPPKEYCTX *pctx = NULL;",
            "pctx = EVPPKEYCTXnewfromname(NULL, \"DSA\", NULL);",
            "EVPPKEYparamgeninit(pctx);",
            "params[0] = OSSLPARAMconstructuint(\"pbits\", &pbits);",
            "params[1] = OSSLPARAMconstructuint(\"qbits\", &qbits);",
            "params[2] = OSSLPARAMconstructint(\"gindex\", &gindex);",
            "params[3] = OSSLPARAMconstructutf8string(\"digest\", \"SHA384\", 0);",
            "params[4] = OSSLPARAMconstructend();",
            "EVPPKEYCTXsetparams(pctx, params);",
            "EVPPKEYgenerate(pctx, &paramkey);",
            "EVPPKEYCTXfree(pctx);",
            "EVPPKEYprintparams(bioout, paramkey, 0, NULL);",
            "A DSA key can be generated using domain parameters by calling:",
            "EVPPKEY *key = NULL;",
            "EVPPKEYCTX *gctx = NULL;",
            "gctx = EVPPKEYCTXnewfrompkey(NULL, paramkey, NULL);",
            "EVPPKEYkeygeninit(gctx);",
            "EVPPKEYgenerate(gctx, &key);",
            "EVPPKEYCTXfree(gctx);",
            "EVPPKEYprintprivate(bioout, key, 0, NULL);"
        ],
        "see_also": [
            {
                "name": "EVPPKEY-FFC",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPPKEY-FFC/7/json"
            },
            {
                "name": "EVPSIGNATURE-DSA",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPSIGNATURE-DSA/7/json"
            },
            {
                "name": "EVPPKEY",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPPKEY/3/json"
            },
            {
                "name": "provider-keymgmt",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/provider-keymgmt/7/json"
            },
            {
                "name": "EVPKEYMGMT",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPKEYMGMT/3/json"
            },
            {
                "name": "OSSLPROVIDER-default",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/OSSLPROVIDER-default/7/json"
            },
            {
                "name": "OSSLPROVIDER-FIPS",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/OSSLPROVIDER-FIPS/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": [
                    {
                        "name": "DSA parameters",
                        "lines": 2
                    },
                    {
                        "name": "DSA key generation parameters",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 39,
                "subsections": []
            },
            {
                "name": "CONFORMING TO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "EVPPKEY-DSA, EVPKEYMGMT-DSA - EVPPKEY DSA keytype and algorithm support\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "For DSA the FIPS186-4 standard specifies that the values used for FFC parameter generation\nare also required for parameter validation.  This means that optional FFC domain parameter\nvalues for seed, pcounter and gindex may need to be stored for validation purposes. For DSA\nthese fields are not stored in the ASN1 data so they need to be stored externally if\nvalidation is required.\n",
                "subsections": [
                    {
                        "name": "DSA parameters",
                        "content": "The DSA key type supports the FFC parameters (see \"FFC parameters\" in EVPPKEY-FFC(7)).\n"
                    },
                    {
                        "name": "DSA key generation parameters",
                        "content": "The DSA key type supports the FFC key generation parameters (see \"FFC key generation\nparameters\" in EVPPKEY-FFC(7)\n\nThe following restrictions apply to the \"pbits\" field:\n\nFor \"fips1864\" this must be either 2048 or 3072.  For \"fips1862\" this must be 1024.  For\n\"group\" this can be any one of 2048, 3072, 4096, 6144 or 8192.\n"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "An EVPPKEY context can be obtained by calling:\n\nEVPPKEYCTX *pctx = EVPPKEYCTXnewfromname(NULL, \"DSA\", NULL);\n\nThe DSA domain parameters can be generated by calling:\n\nunsigned int pbits = 2048;\nunsigned int qbits = 256;\nint gindex = 1;\nOSSLPARAM params[5];\nEVPPKEY *paramkey = NULL;\nEVPPKEYCTX *pctx = NULL;\n\npctx = EVPPKEYCTXnewfromname(NULL, \"DSA\", NULL);\nEVPPKEYparamgeninit(pctx);\n\nparams[0] = OSSLPARAMconstructuint(\"pbits\", &pbits);\nparams[1] = OSSLPARAMconstructuint(\"qbits\", &qbits);\nparams[2] = OSSLPARAMconstructint(\"gindex\", &gindex);\nparams[3] = OSSLPARAMconstructutf8string(\"digest\", \"SHA384\", 0);\nparams[4] = OSSLPARAMconstructend();\nEVPPKEYCTXsetparams(pctx, params);\n\nEVPPKEYgenerate(pctx, &paramkey);\nEVPPKEYCTXfree(pctx);\n\nEVPPKEYprintparams(bioout, paramkey, 0, NULL);\n\nA DSA key can be generated using domain parameters by calling:\n\nEVPPKEY *key = NULL;\nEVPPKEYCTX *gctx = NULL;\n\ngctx = EVPPKEYCTXnewfrompkey(NULL, paramkey, NULL);\nEVPPKEYkeygeninit(gctx);\nEVPPKEYgenerate(gctx, &key);\nEVPPKEYCTXfree(gctx);\nEVPPKEYprintprivate(bioout, key, 0, NULL);\n",
                "subsections": []
            },
            "CONFORMING TO": {
                "content": "The following sections of FIPS 186-4:\n\nA.1.1.2 Generation of Probable Primes p and q Using an Approved Hash Function.\nA.2.3 Generation of canonical generator g.\nA.2.1 Unverifiable Generation of the Generator g.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "EVPPKEY-FFC(7), EVPSIGNATURE-DSA(7) EVPPKEY(3), provider-keymgmt(7), EVPKEYMGMT(3),\nOSSLPROVIDER-default(7), OSSLPROVIDER-FIPS(7)\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.\n\nLicensed under the Apache License 2.0 (the \"License\").  You may not use this file except in\ncompliance with the License.  You can obtain a copy in the file LICENSE in the source\ndistribution or at <https://www.openssl.org/source/license.html>.\n\n\n\n3.0.2                                        2026-06-02                           EVPPKEY-DSA(7SSL)",
                "subsections": []
            }
        }
    }
}