{
    "mode": "man",
    "parameter": "EVP_KEYMGMT-DSA",
    "section": "7ssl",
    "url": "https://www.chedong.com/phpMan.php/man/EVP_KEYMGMT-DSA/7ssl/json",
    "generated": "2026-10-07T21:07:16Z",
    "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"
                },
                {
                    "name": "DSA key validation",
                    "content": "For DSA keys, EVPPKEYparamcheck(3) behaves in the following way: The OpenSSL FIPS provider\nconforms to the rules within the FIPS186-4 standard for FFC parameter validation. For\nbackwards compatibility the OpenSSL default provider uses a much simpler check (see below)\nfor parameter validation, unless the seed parameter is set.\n\nFor DSA keys, EVPPKEYparamcheckquick(3) behaves in the following way: A simple check of L\nand N and partial g is performed. The default provider also supports validation of legacy\n\"fips1862\" keys.\n\nFor DSA keys, EVPPKEYpubliccheck(3), EVPPKEYprivatecheck(3) and\nEVPPKEYpairwisecheck(3) the OpenSSL default and FIPS providers conform to the rules within\nSP800-56Ar3 for public, private and pairwise tests respectively.\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 FIPS186-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-2022 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\n3.0.13                                       2026-07-29                           EVPPKEY-DSA(7SSL)",
            "subsections": []
        }
    },
    "summary": "EVPPKEY-DSA, EVPKEYMGMT-DSA - EVPPKEY DSA keytype and algorithm support",
    "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"
        }
    ]
}