{
    "mode": "info",
    "parameter": "EVP_PKEY-DSA",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/EVP_PKEY-DSA/json",
    "generated": "2026-07-05T11:55:55Z",
    "sections": {
        "NAME": {
            "content": "EVPPKEY-DSA, EVPKEYMGMT-DSA - EVPPKEY DSA keytype and algorithm\nsupport\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "For DSA the FIPS186-4 standard specifies that the values used for FFC\nparameter generation are also required for parameter validation.  This\nmeans that optional FFC domain parameter values for seed, pcounter and\ngindex may need to be stored for validation purposes. For DSA these\nfields are not stored in the ASN1 data so they need to be stored\nexternally if validation is required.\n\nDSA parameters\nThe DSA key type supports the FFC parameters (see \"FFC parameters\" in\nEVPPKEY-FFC(7)).\n\nDSA key generation parameters\nThe DSA key type supports the FFC key generation parameters (see \"FFC\nkey generation parameters\" 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\nmust be 1024.  For \"group\" this can be any one of 2048, 3072, 4096,\n6144 or 8192.\n",
            "subsections": []
        },
        "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\nFunction.\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),\nEVPKEYMGMT(3), OSSLPROVIDER-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\nthis file except in compliance with the License.  You can obtain a copy\nin the file LICENSE in the source distribution or at\n<https://www.openssl.org/source/license.html>.\n\n3.0.2                             2026-06-02                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"
        }
    ]
}