{
    "content": [
        {
            "type": "text",
            "text": "# openssl-genpkey(1) (man)\n\n**Summary:** openssl-genpkey - generate a private key\n\n**Synopsis:** openssl genpkey [-help] [-out filename] [-outform DER|PEM] [-quiet] [-pass arg] [-cciipphheerr]\n[-paramfile file] [-algorithm alg] [-pkeyopt opt:value] [-genparam] [-text] [-engine id]\n[-provider name] [-provider-path path] [-propquery propq] [-config configfile]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | — | — | Print out a usage message. |\n| — | — | — | Output the key to the specified file. If this argument is not specified then standard output is used. |\n| — | — | — | The output format, except when -genparam is given; the default is PEM. See openssl-format-options(1) for details. When - |\n| — | — | — | Do not output \"status dots\" while generating keys. |\n| — | — | — | The output file password source. For more information about the format of arg see openssl-passphrase-options(1). -cciipp |\n| — | — | — | Public key algorithm to use such as RSA, DSA, DH or DHX. If used this option must precede any -pkeyopt options. The opti |\n| — | — | — | Set the public key algorithm option opt to value. The precise set of options supported depends on the public key algorit |\n| — | — | — | Generate a set of parameters instead of a private key. If used this option must precede any -algorithm, -paramfile or -p |\n| — | — | — | Some public key algorithms generate a private key based on a set of parameters. They can be supplied using this option.  |\n| — | — | — | Print an (unencrypted) text representation of private and public keys and parameters along with the PEM or DER structure |\n| — | — | — | See \"Engine Options\" in openssl(1). This option is deprecated. |\n| — | — | — |  |\n| — | — | — |  |\n| — | — | — | See \"Provider Options\" in openssl(1), provider(7), and property(7). |\n| — | — | — | See \"Configuration Option\" in openssl(1). |\n\n## Examples\n\n- `Generate an RSA private key using default parameters:`\n- `openssl genpkey -algorithm RSA -out key.pem`\n- `Encrypt output private key using 128 bit AES and the passphrase \"hello\":`\n- `openssl genpkey -algorithm RSA -out key.pem -aes-128-cbc -pass pass:hello`\n- `Generate a 2048 bit RSA key using 3 as the public exponent:`\n- `openssl genpkey -algorithm RSA -out key.pem \\`\n- `-pkeyopt rsakeygenbits:2048 -pkeyopt rsakeygenpubexp:3`\n- `Generate 2048 bit DSA parameters that can be validated: The output values for gindex and seed`\n- `are required for key validation purposes and are not saved to the output pem file).`\n- `openssl genpkey -genparam -algorithm DSA -out dsap.pem -pkeyopt pbits:2048 \\`\n- `-pkeyopt qbits:224 -pkeyopt digest:SHA256 -pkeyopt gindex:1 -text`\n- `Generate DSA key from parameters:`\n- `openssl genpkey -paramfile dsap.pem -out dsakey.pem`\n- `Generate 4096 bit DH Key using safe prime group ffdhe4096:`\n- `openssl genpkey -algorithm DH -out dhkey.pem -pkeyopt group:ffdhe4096`\n- `Generate 2048 bit X9.42 DH key with 256 bit subgroup using RFC5114 group3:`\n- `openssl genpkey -algorithm DHX -out dhkey.pem -pkeyopt dhrfc5114:3`\n- `Generate a DH key using a DH parameters file:`\n- `openssl genpkey -paramfile dhp.pem -out dhkey.pem`\n- `Output DH parameters for safe prime group ffdhe2048:`\n- `openssl genpkey -genparam -algorithm DH -out dhp.pem -pkeyopt group:ffdhe2048`\n- `Output 2048 bit X9.42 DH parameters with 224 bit subgroup using RFC5114 group2:`\n- `openssl genpkey -genparam -algorithm DHX -out dhp.pem -pkeyopt dhrfc5114:2`\n- `Output 2048 bit X9.42 DH parameters with 224 bit subgroup using FIP186-4 keygen:`\n- `openssl genpkey -genparam -algorithm DHX -out dhp.pem -text \\`\n- `-pkeyopt pbits:2048 -pkeyopt qbits:224 -pkeyopt digest:SHA256 \\`\n- `-pkeyopt gindex:1 -pkeyopt dhparamgentype:2`\n- `Output 1024 bit X9.42 DH parameters with 160 bit subgroup using FIP186-2 keygen:`\n- `openssl genpkey -genparam -algorithm DHX -out dhp.pem -text \\`\n- `-pkeyopt pbits:1024 -pkeyopt qbits:160 -pkeyopt digest:SHA1 \\`\n- `-pkeyopt gindex:1 -pkeyopt dhparamgentype:1`\n- `Output 2048 bit DH parameters:`\n- `openssl genpkey -genparam -algorithm DH -out dhp.pem \\`\n- `-pkeyopt dhparamgenprimelen:2048`\n- `Output 2048 bit DH parameters using a generator:`\n- `openssl genpkey -genparam -algorithm DH -out dhpx.pem \\`\n- `-pkeyopt dhparamgenprimelen:2048 \\`\n- `-pkeyopt dhparamgentype:1`\n- `Generate EC parameters:`\n- `openssl genpkey -genparam -algorithm EC -out ecp.pem \\`\n- `-pkeyopt ecparamgencurve:secp384r1 \\`\n- `-pkeyopt ecparamenc:namedcurve`\n- `Generate EC key from parameters:`\n- `openssl genpkey -paramfile ecp.pem -out eckey.pem`\n- `Generate EC key directly:`\n- `openssl genpkey -algorithm EC -out eckey.pem \\`\n- `-pkeyopt ecparamgencurve:P-384 \\`\n- `-pkeyopt ecparamenc:namedcurve`\n- `Generate an X25519 private key:`\n- `openssl genpkey -algorithm X25519 -out xkey.pem`\n- `Generate an ED448 private key:`\n- `openssl genpkey -algorithm ED448 -out xkey.pem`\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (2 lines)\n- **OPTIONS** (1 lines) — 15 subsections\n  - -help (2 lines)\n  - -out (3 lines)\n  - -outform (5 lines)\n  - -quiet (2 lines)\n  - -pass (7 lines)\n  - -algorithm (13 lines)\n  - -pkeyopt (4 lines)\n  - -genparam (3 lines)\n  - -paramfile (5 lines)\n  - -text (3 lines)\n  - -engine (2 lines)\n  - -provider (1 lines)\n  - -provider-path (1 lines)\n  - -propquery (2 lines)\n  - -config (2 lines)\n- **KEY GENERATION OPTIONS** (4 lines) — 4 subsections\n  - RSA Key Generation Options (10 lines)\n  - RSA-PSS Key Generation Options (14 lines)\n  - EC Key Generation Options (9 lines)\n  - DH Key Generation Options (4 lines)\n- **PARAMETER GENERATION OPTIONS** (3 lines) — 3 subsections\n  - DSA Parameter Generation Options (34 lines)\n  - DH Parameter Generation Options (87 lines)\n  - EC Parameter Generation Options (3 lines)\n- **NOTES** (3 lines)\n- **EXAMPLES** (90 lines)\n- **HISTORY** (6 lines)\n- **COPYRIGHT** (9 lines)\n\n## Full Content\n\n### NAME\n\nopenssl-genpkey - generate a private key\n\n### SYNOPSIS\n\nopenssl genpkey [-help] [-out filename] [-outform DER|PEM] [-quiet] [-pass arg] [-cciipphheerr]\n[-paramfile file] [-algorithm alg] [-pkeyopt opt:value] [-genparam] [-text] [-engine id]\n[-provider name] [-provider-path path] [-propquery propq] [-config configfile]\n\n### DESCRIPTION\n\nThis command generates a private key.\n\n### OPTIONS\n\n#### -help\n\nPrint out a usage message.\n\n#### -out\n\nOutput the key to the specified file. If this argument is not specified then standard\noutput is used.\n\n#### -outform\n\nThe output format, except when -genparam is given; the default is PEM.  See\nopenssl-format-options(1) for details.\n\nWhen -genparam is given, -outform is ignored.\n\n#### -quiet\n\nDo not output \"status dots\" while generating keys.\n\n#### -pass\n\nThe output file password source. For more information about the format of arg see\nopenssl-passphrase-options(1).\n\n-cciipphheerr\nThis option encrypts the private key with the supplied cipher. Any algorithm name\naccepted by EVPgetcipherbyname() is acceptable such as des3.\n\n#### -algorithm\n\nPublic key algorithm to use such as RSA, DSA, DH or DHX. If used this option must precede\nany -pkeyopt options. The options -paramfile and -algorithm are mutually exclusive.\nEngines may add algorithms in addition to the standard built-in ones.\n\nValid built-in algorithm names for private key generation are RSA, RSA-PSS, EC, X25519,\nX448, ED25519 and ED448.\n\nValid built-in algorithm names for parameter generation (see the -genparam option) are\nDH, DSA and EC.\n\nNote that the algorithm name X9.42 DH may be used as a synonym for DHX keys and PKCS#3\nrefers to DH Keys. Some options are not shared between DH and DHX keys.\n\n#### -pkeyopt\n\nSet the public key algorithm option opt to value. The precise set of options supported\ndepends on the public key algorithm used and its implementation. See \"KEY GENERATION\nOPTIONS\" and \"PARAMETER GENERATION OPTIONS\" below for more details.\n\n#### -genparam\n\nGenerate a set of parameters instead of a private key. If used this option must precede\nany -algorithm, -paramfile or -pkeyopt options.\n\n#### -paramfile\n\nSome public key algorithms generate a private key based on a set of parameters.  They can\nbe supplied using this option. If this option is used the public key algorithm used is\ndetermined by the parameters. If used this option must precede any -pkeyopt options. The\noptions -paramfile and -algorithm are mutually exclusive.\n\n#### -text\n\nPrint an (unencrypted) text representation of private and public keys and parameters\nalong with the PEM or DER structure.\n\n#### -engine\n\nSee \"Engine Options\" in openssl(1).  This option is deprecated.\n\n#### -provider\n\n#### -provider-path\n\n#### -propquery\n\nSee \"Provider Options\" in openssl(1), provider(7), and property(7).\n\n#### -config\n\nSee \"Configuration Option\" in openssl(1).\n\n### KEY GENERATION OPTIONS\n\nThe options supported by each algorithm and indeed each implementation of an algorithm can\nvary. The options for the OpenSSL implementations are detailed below. There are no key\ngeneration options defined for the X25519, X448, ED25519 or ED448 algorithms.\n\n#### RSA Key Generation Options\n\nrsakeygenbits:numbits\nThe number of bits in the generated key. If not specified 2048 is used.\n\nrsakeygenprimes:numprimes\nThe number of primes in the generated key. If not specified 2 is used.\n\nrsakeygenpubexp:value\nThe RSA public exponent value. This can be a large decimal or hexadecimal value if\npreceded by \"0x\". Default value is 65537.\n\n#### RSA-PSS Key Generation Options\n\nNote: by default an RSA-PSS key has no parameter restrictions.\n\nrsakeygenbits:numbits, rsakeygenprimes:numprimes, rsakeygenpubexp:value\nThese options have the same meaning as the RSA algorithm.\n\nrsapsskeygenmd:digest\nIf set the key is restricted and can only use digest for signing.\n\nrsapsskeygenmgf1md:digest\nIf set the key is restricted and can only use digest as it's MGF1 parameter.\n\nrsapsskeygensaltlen:len\nIf set the key is restricted and len specifies the minimum salt length.\n\n#### EC Key Generation Options\n\nThe EC key generation options can also be used for parameter generation.\n\necparamgencurve:curve\nThe EC curve to use. OpenSSL supports NIST curve names such as \"P-256\".\n\necparamenc:encoding\nThe encoding to use for parameters. The encoding parameter must be either namedcurve or\nexplicit. The default value is namedcurve.\n\n#### DH Key Generation Options\n\ngroup:name\nThe paramfile option is not required if a named group is used here.  See the \"DH\nParameter Generation Options\" section below.\n\n### PARAMETER GENERATION OPTIONS\n\nThe options supported by each algorithm and indeed each implementation of an algorithm can\nvary. The options for the OpenSSL implementations are detailed below.\n\n#### DSA Parameter Generation Options\n\ndsaparamgenbits:numbits\nThe number of bits in the generated prime. If not specified 2048 is used.\n\ndsaparamgenqbits:numbits\nqbits:numbits\nThe number of bits in the q parameter. Must be one of 160, 224 or 256. If not specified\n224 is used.\n\ndsaparamgenmd:digest\ndigest:digest\nThe digest to use during parameter generation. Must be one of sha1, sha224 or sha256. If\nset, then the number of bits in q will match the output size of the specified digest and\nthe dsaparamgenqbits parameter will be ignored. If not set, then a digest will be used\nthat gives an output matching the number of bits in q, i.e. sha1 if q length is 160,\nsha224 if it 224 or sha256 if it is 256.\n\nproperties:query\nThe digest property query string to use when fetching a digest from a provider.\n\ntype:type\nThe type of generation to use. Set this to 1 to use legacy FIPS186-2 parameter\ngeneration. The default of 0 uses FIPS186-4 parameter generation.\n\ngindex:index\nThe index to use for canonical generation and verification of the generator g.  Set this\nto a positive value ranging from 0..255 to use this mode. Larger values will only use the\nbottom byte.  This index must then be reused during key validation to verify the value of\ng.  If this value is not set then g is not verifiable. The default value is -1.\n\nhexseed:seed\nThe seed seed data to use instead of generating a random seed internally.  This should be\nused for testing purposes only. This will either produced fixed values for the generated\nparameters OR it will fail if the seed did not generate valid primes.\n\n#### DH Parameter Generation Options\n\nFor most use cases it is recommended to use the group option rather than the type options.\nNote that the group option is not used by default if no parameter generation options are\nspecified.\n\ngroup:name\ndhparam:name\nUse a named DH group to select constant values for the DH parameters.  All other options\nwill be ignored if this value is set.\n\nValid values that are associated with the algorithm of \"DH\" are: \"ffdhe2048\",\n\"ffdhe3072\", \"ffdhe4096\", \"ffdhe6144\", \"ffdhe8192\", \"modp1536\", \"modp2048\",\n\"modp3072\", \"modp4096\", \"modp6144\", \"modp8192\".\n\nValid values that are associated with the algorithm of \"DHX\" are the RFC5114 names\n\"dh1024160\", \"dh2048224\", \"dh2048256\".\n\ndhrfc5114:num\nIf this option is set, then the appropriate RFC5114 parameters are used instead of\ngenerating new parameters. The value num can be one of 1, 2 or 3 that are equivalant to\nusing the option group with one of \"dh1024160\", \"dh2048224\" or \"dh2048256\".  All\nother options will be ignored if this value is set.\n\npbits:numbits\ndhparamgenprimelen:numbits\nThe number of bits in the prime parameter p. The default is 2048.\n\nqbits:numbits\ndhparamgensubprimelen:numbits\nThe number of bits in the sub prime parameter q. The default is 224.  Only relevant if\nused in conjunction with the dhparamgentype option to generate DHX parameters.\n\nsafeprime-generator:value\ndhparamgengenerator:value\nThe value to use for the generator g. The default is 2.  The algorithm option must be\n\"DH\" for this parameter to be used.\n\ntype:string\nThe type name of DH parameters to generate. Valid values are:\n\n\"generator\"\nUse a safe prime generator with the option safeprimegenerator The algorithm option\nmust be \"DH\".\n\n\"fips1864\"\nFIPS186-4 parameter generation.  The algorithm option must be \"DHX\".\n\n\"fips1862\"\nFIPS186-4 parameter generation.  The algorithm option must be \"DHX\".\n\n\"group\"\nCan be used with the option pbits to select one of \"ffdhe2048\", \"ffdhe3072\",\n\"ffdhe4096\", \"ffdhe6144\" or \"ffdhe8192\".  The algorithm option must be \"DH\".\n\n\"default\"\nSelects a default type based on the algorithm. This is used by the OpenSSL default\nprovider to set the type for backwards compatability.  If algorithm is \"DH\" then\n\"generator\" is used.  If algorithm is \"DHX\" then \"fips1862\" is used.\n\ndhparamgentype:value\nThe type of DH parameters to generate. Valid values are 0, 1, 2 or 3 which correspond to\nsetting the option type to \"generator\", \"fips1862\", \"fips1864\" or \"group\".\n\ndigest:digest\nThe digest to use during parameter generation. Must be one of sha1, sha224 or sha256. If\nset, then the number of bits in qbits will match the output size of the specified digest\nand the qbits parameter will be ignored. If not set, then a digest will be used that\ngives an output matching the number of bits in q, i.e. sha1 if q length is 160, sha224 if\nit is 224 or sha256 if it is 256.  This is only used by \"fips1864\" and \"fips1862\" key\ngeneration.\n\nproperties:query\nThe digest property query string to use when fetching a digest from a provider.  This is\nonly used by \"fips1864\" and \"fips1862\" key generation.\n\ngindex:index\nThe index to use for canonical generation and verification of the generator g.  Set this\nto a positive value ranging from 0..255 to use this mode. Larger values will only use the\nbottom byte.  This index must then be reused during key validation to verify the value of\ng.  If this value is not set then g is not verifiable. The default value is -1.  This is\nonly used by \"fips1864\" and \"fips1862\" key generation.\n\nhexseed:seed\nThe seed seed data to use instead of generating a random seed internally.  This should be\nused for testing purposes only. This will either produced fixed values for the generated\nparameters OR it will fail if the seed did not generate valid primes.  This is only used\nby \"fips1864\" and \"fips1862\" key generation.\n\n#### EC Parameter Generation Options\n\nThe EC parameter generation options are the same as for key generation. See \"EC Key\nGeneration Options\" above.\n\n### NOTES\n\nThe use of the genpkey program is encouraged over the algorithm specific utilities because\nadditional algorithm options and ENGINE provided algorithms can be used.\n\n### EXAMPLES\n\nGenerate an RSA private key using default parameters:\n\nopenssl genpkey -algorithm RSA -out key.pem\n\nEncrypt output private key using 128 bit AES and the passphrase \"hello\":\n\nopenssl genpkey -algorithm RSA -out key.pem -aes-128-cbc -pass pass:hello\n\nGenerate a 2048 bit RSA key using 3 as the public exponent:\n\nopenssl genpkey -algorithm RSA -out key.pem \\\n-pkeyopt rsakeygenbits:2048 -pkeyopt rsakeygenpubexp:3\n\nGenerate 2048 bit DSA parameters that can be validated: The output values for gindex and seed\nare required for key validation purposes and are not saved to the output pem file).\n\nopenssl genpkey -genparam -algorithm DSA -out dsap.pem -pkeyopt pbits:2048 \\\n-pkeyopt qbits:224 -pkeyopt digest:SHA256 -pkeyopt gindex:1 -text\n\nGenerate DSA key from parameters:\n\nopenssl genpkey -paramfile dsap.pem -out dsakey.pem\n\nGenerate 4096 bit DH Key using safe prime group ffdhe4096:\n\nopenssl genpkey -algorithm DH -out dhkey.pem -pkeyopt group:ffdhe4096\n\nGenerate 2048 bit X9.42 DH key with 256 bit subgroup using RFC5114 group3:\n\nopenssl genpkey -algorithm DHX -out dhkey.pem -pkeyopt dhrfc5114:3\n\nGenerate a DH key using a DH parameters file:\n\nopenssl genpkey -paramfile dhp.pem -out dhkey.pem\n\nOutput DH parameters for safe prime group ffdhe2048:\n\nopenssl genpkey -genparam -algorithm DH -out dhp.pem -pkeyopt group:ffdhe2048\n\nOutput 2048 bit X9.42 DH parameters with 224 bit subgroup using RFC5114 group2:\n\nopenssl genpkey -genparam -algorithm DHX -out dhp.pem -pkeyopt dhrfc5114:2\n\nOutput 2048 bit X9.42 DH parameters with 224 bit subgroup using FIP186-4 keygen:\n\nopenssl genpkey -genparam -algorithm DHX -out dhp.pem -text \\\n-pkeyopt pbits:2048 -pkeyopt qbits:224 -pkeyopt digest:SHA256 \\\n-pkeyopt gindex:1 -pkeyopt dhparamgentype:2\n\nOutput 1024 bit X9.42 DH parameters with 160 bit subgroup using FIP186-2 keygen:\n\nopenssl genpkey -genparam -algorithm DHX -out dhp.pem -text \\\n-pkeyopt pbits:1024 -pkeyopt qbits:160 -pkeyopt digest:SHA1 \\\n-pkeyopt gindex:1 -pkeyopt dhparamgentype:1\n\nOutput 2048 bit DH parameters:\n\nopenssl genpkey -genparam -algorithm DH -out dhp.pem \\\n-pkeyopt dhparamgenprimelen:2048\n\nOutput 2048 bit DH parameters using a generator:\n\nopenssl genpkey -genparam -algorithm DH -out dhpx.pem \\\n-pkeyopt dhparamgenprimelen:2048 \\\n-pkeyopt dhparamgentype:1\n\nGenerate EC parameters:\n\nopenssl genpkey -genparam -algorithm EC -out ecp.pem \\\n-pkeyopt ecparamgencurve:secp384r1 \\\n-pkeyopt ecparamenc:namedcurve\n\nGenerate EC key from parameters:\n\nopenssl genpkey -paramfile ecp.pem -out eckey.pem\n\nGenerate EC key directly:\n\nopenssl genpkey -algorithm EC -out eckey.pem \\\n-pkeyopt ecparamgencurve:P-384 \\\n-pkeyopt ecparamenc:namedcurve\n\nGenerate an X25519 private key:\n\nopenssl genpkey -algorithm X25519 -out xkey.pem\n\nGenerate an ED448 private key:\n\nopenssl genpkey -algorithm ED448 -out xkey.pem\n\n### HISTORY\n\nThe ability to use NIST curve names, and to generate an EC key directly, were added in\nOpenSSL 1.0.2.  The ability to generate X25519 keys was added in OpenSSL 1.1.0.  The ability\nto generate X448, ED25519 and ED448 keys was added in OpenSSL 1.1.1.\n\nThe -engine option was deprecated in OpenSSL 3.0.\n\n### COPYRIGHT\n\nCopyright 2006-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-04-07                        OPENSSL-GENPKEY(1SSL)\n\n"
        }
    ],
    "structuredContent": {
        "command": "openssl-genpkey",
        "section": "1",
        "mode": "man",
        "summary": "openssl-genpkey - generate a private key",
        "synopsis": "openssl genpkey [-help] [-out filename] [-outform DER|PEM] [-quiet] [-pass arg] [-cciipphheerr]\n[-paramfile file] [-algorithm alg] [-pkeyopt opt:value] [-genparam] [-text] [-engine id]\n[-provider name] [-provider-path path] [-propquery propq] [-config configfile]",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Print out a usage message."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Output the key to the specified file. If this argument is not specified then standard output is used."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The output format, except when -genparam is given; the default is PEM. See openssl-format-options(1) for details. When -genparam is given, -outform is ignored."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Do not output \"status dots\" while generating keys."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The output file password source. For more information about the format of arg see openssl-passphrase-options(1). -cciipphheerr This option encrypts the private key with the supplied cipher. Any algorithm name accepted by EVPgetcipherbyname() is acceptable such as des3."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Public key algorithm to use such as RSA, DSA, DH or DHX. If used this option must precede any -pkeyopt options. The options -paramfile and -algorithm are mutually exclusive. Engines may add algorithms in addition to the standard built-in ones. Valid built-in algorithm names for private key generation are RSA, RSA-PSS, EC, X25519, X448, ED25519 and ED448. Valid built-in algorithm names for parameter generation (see the -genparam option) are DH, DSA and EC. Note that the algorithm name X9.42 DH may be used as a synonym for DHX keys and PKCS#3 refers to DH Keys. Some options are not shared between DH and DHX keys."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Set the public key algorithm option opt to value. The precise set of options supported depends on the public key algorithm used and its implementation. See \"KEY GENERATION OPTIONS\" and \"PARAMETER GENERATION OPTIONS\" below for more details."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Generate a set of parameters instead of a private key. If used this option must precede any -algorithm, -paramfile or -pkeyopt options."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Some public key algorithms generate a private key based on a set of parameters. They can be supplied using this option. If this option is used the public key algorithm used is determined by the parameters. If used this option must precede any -pkeyopt options. The options -paramfile and -algorithm are mutually exclusive."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Print an (unencrypted) text representation of private and public keys and parameters along with the PEM or DER structure."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "See \"Engine Options\" in openssl(1). This option is deprecated."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "See \"Provider Options\" in openssl(1), provider(7), and property(7)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "See \"Configuration Option\" in openssl(1)."
            }
        ],
        "examples": [
            "Generate an RSA private key using default parameters:",
            "openssl genpkey -algorithm RSA -out key.pem",
            "Encrypt output private key using 128 bit AES and the passphrase \"hello\":",
            "openssl genpkey -algorithm RSA -out key.pem -aes-128-cbc -pass pass:hello",
            "Generate a 2048 bit RSA key using 3 as the public exponent:",
            "openssl genpkey -algorithm RSA -out key.pem \\",
            "-pkeyopt rsakeygenbits:2048 -pkeyopt rsakeygenpubexp:3",
            "Generate 2048 bit DSA parameters that can be validated: The output values for gindex and seed",
            "are required for key validation purposes and are not saved to the output pem file).",
            "openssl genpkey -genparam -algorithm DSA -out dsap.pem -pkeyopt pbits:2048 \\",
            "-pkeyopt qbits:224 -pkeyopt digest:SHA256 -pkeyopt gindex:1 -text",
            "Generate DSA key from parameters:",
            "openssl genpkey -paramfile dsap.pem -out dsakey.pem",
            "Generate 4096 bit DH Key using safe prime group ffdhe4096:",
            "openssl genpkey -algorithm DH -out dhkey.pem -pkeyopt group:ffdhe4096",
            "Generate 2048 bit X9.42 DH key with 256 bit subgroup using RFC5114 group3:",
            "openssl genpkey -algorithm DHX -out dhkey.pem -pkeyopt dhrfc5114:3",
            "Generate a DH key using a DH parameters file:",
            "openssl genpkey -paramfile dhp.pem -out dhkey.pem",
            "Output DH parameters for safe prime group ffdhe2048:",
            "openssl genpkey -genparam -algorithm DH -out dhp.pem -pkeyopt group:ffdhe2048",
            "Output 2048 bit X9.42 DH parameters with 224 bit subgroup using RFC5114 group2:",
            "openssl genpkey -genparam -algorithm DHX -out dhp.pem -pkeyopt dhrfc5114:2",
            "Output 2048 bit X9.42 DH parameters with 224 bit subgroup using FIP186-4 keygen:",
            "openssl genpkey -genparam -algorithm DHX -out dhp.pem -text \\",
            "-pkeyopt pbits:2048 -pkeyopt qbits:224 -pkeyopt digest:SHA256 \\",
            "-pkeyopt gindex:1 -pkeyopt dhparamgentype:2",
            "Output 1024 bit X9.42 DH parameters with 160 bit subgroup using FIP186-2 keygen:",
            "openssl genpkey -genparam -algorithm DHX -out dhp.pem -text \\",
            "-pkeyopt pbits:1024 -pkeyopt qbits:160 -pkeyopt digest:SHA1 \\",
            "-pkeyopt gindex:1 -pkeyopt dhparamgentype:1",
            "Output 2048 bit DH parameters:",
            "openssl genpkey -genparam -algorithm DH -out dhp.pem \\",
            "-pkeyopt dhparamgenprimelen:2048",
            "Output 2048 bit DH parameters using a generator:",
            "openssl genpkey -genparam -algorithm DH -out dhpx.pem \\",
            "-pkeyopt dhparamgenprimelen:2048 \\",
            "-pkeyopt dhparamgentype:1",
            "Generate EC parameters:",
            "openssl genpkey -genparam -algorithm EC -out ecp.pem \\",
            "-pkeyopt ecparamgencurve:secp384r1 \\",
            "-pkeyopt ecparamenc:namedcurve",
            "Generate EC key from parameters:",
            "openssl genpkey -paramfile ecp.pem -out eckey.pem",
            "Generate EC key directly:",
            "openssl genpkey -algorithm EC -out eckey.pem \\",
            "-pkeyopt ecparamgencurve:P-384 \\",
            "-pkeyopt ecparamenc:namedcurve",
            "Generate an X25519 private key:",
            "openssl genpkey -algorithm X25519 -out xkey.pem",
            "Generate an ED448 private key:",
            "openssl genpkey -algorithm ED448 -out xkey.pem"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-help",
                        "lines": 2
                    },
                    {
                        "name": "-out",
                        "lines": 3
                    },
                    {
                        "name": "-outform",
                        "lines": 5
                    },
                    {
                        "name": "-quiet",
                        "lines": 2
                    },
                    {
                        "name": "-pass",
                        "lines": 7
                    },
                    {
                        "name": "-algorithm",
                        "lines": 13
                    },
                    {
                        "name": "-pkeyopt",
                        "lines": 4
                    },
                    {
                        "name": "-genparam",
                        "lines": 3
                    },
                    {
                        "name": "-paramfile",
                        "lines": 5
                    },
                    {
                        "name": "-text",
                        "lines": 3
                    },
                    {
                        "name": "-engine",
                        "lines": 2
                    },
                    {
                        "name": "-provider",
                        "lines": 1
                    },
                    {
                        "name": "-provider-path",
                        "lines": 1
                    },
                    {
                        "name": "-propquery",
                        "lines": 2
                    },
                    {
                        "name": "-config",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "KEY GENERATION OPTIONS",
                "lines": 4,
                "subsections": [
                    {
                        "name": "RSA Key Generation Options",
                        "lines": 10
                    },
                    {
                        "name": "RSA-PSS Key Generation Options",
                        "lines": 14
                    },
                    {
                        "name": "EC Key Generation Options",
                        "lines": 9
                    },
                    {
                        "name": "DH Key Generation Options",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "PARAMETER GENERATION OPTIONS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "DSA Parameter Generation Options",
                        "lines": 34
                    },
                    {
                        "name": "DH Parameter Generation Options",
                        "lines": 87
                    },
                    {
                        "name": "EC Parameter Generation Options",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 90,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            }
        ]
    }
}