{
    "content": [
        {
            "type": "text",
            "text": "# openssl-rsa (man)\n\n## NAME\n\nopenssl-rsa - RSA key processing command\n\n## SYNOPSIS\n\nopenssl rsa [-help] [-inform DER|PEM|P12|ENGINE] [-outform DER|PEM] [-in filename|uri]\n[-passin arg] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-aria128]\n[-aria192] [-aria256] [-camellia128] [-camellia192] [-camellia256] [-des] [-des3] [-idea]\n[-text] [-noout] [-modulus] [-traditional] [-check] [-pubin] [-pubout] [-RSAPublicKeyin]\n[-RSAPublicKeyout] [-pvk-strong] [-pvk-weak] [-pvk-none] [-engine id] [-provider name]\n[-provider-path path] [-propquery propq]\n\n## DESCRIPTION\n\nThis command processes RSA keys. They can be converted between various forms and their\ncomponents printed out.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (23 subsections)\n- **NOTES**\n- **EXAMPLES**\n- **BUGS**\n- **SEE ALSO**\n- **HISTORY**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "openssl-rsa",
        "section": "",
        "mode": "man",
        "summary": "openssl-rsa - RSA key processing command",
        "synopsis": "openssl rsa [-help] [-inform DER|PEM|P12|ENGINE] [-outform DER|PEM] [-in filename|uri]\n[-passin arg] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-aria128]\n[-aria192] [-aria256] [-camellia128] [-camellia192] [-camellia256] [-des] [-des3] [-idea]\n[-text] [-noout] [-modulus] [-traditional] [-check] [-pubin] [-pubout] [-RSAPublicKeyin]\n[-RSAPublicKeyout] [-pvk-strong] [-pvk-weak] [-pvk-none] [-engine id] [-provider name]\n[-provider-path path] [-propquery propq]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Print out a usage message."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The key input format; unspecified by default. See openssl-format-options(1) for details."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The key output format; the default is PEM. See openssl-format-options(1) for details."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "When writing a private key, use the traditional PKCS#1 format instead of the PKCS#8 format."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This specifies the input to read a key from or standard input if this option is not specified. If the key is encrypted a pass phrase will be prompted for."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The password source for the input and output file. For more information about the format of arg see openssl-passphrase-options(1)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This specifies the output filename to write a key to or standard output if this option is not specified. If any encryption options are set then a pass phrase will be prompted for. The output filename should not be the same as the input filename."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "These options encrypt the private key with the specified cipher before outputting it. A pass phrase is prompted for. If none of these options is specified the key is written in plain text. This means that this command can be used to remove the pass phrase from a key by not giving any encryption option is given, or to add or change the pass phrase by setting them. These options can only be used with PEM format output files."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Prints out the various public or private key components in plain text in addition to the encoded version."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option prevents output of the encoded version of the key."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option prints out the value of the modulus of the key."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option checks the consistency of an RSA private key."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "By default a private key is read from the input file: with this option a public key is read instead."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "By default a private key is output: with this option a public key will be output instead. This option is automatically set if the input is a public key."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Like -pubin and -pubout except RSAPublicKey format is used instead."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Enable 'Strong' PVK encoding level (default)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Enable 'Weak' PVK encoding level."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Don't enforce PVK encoding."
            },
            {
                "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)."
            }
        ],
        "examples": [
            "The documentation for the openssl-pkey(1) command contains examples equivalent to the ones",
            "listed here.",
            "To remove the pass phrase on an RSA private key:",
            "openssl rsa -in key.pem -out keyout.pem",
            "To encrypt a private key using triple DES:",
            "openssl rsa -in key.pem -des3 -out keyout.pem",
            "To convert a private key from PEM to DER format:",
            "openssl rsa -in key.pem -outform DER -out keyout.der",
            "To print out the components of a private key to standard output:",
            "openssl rsa -in key.pem -text -noout",
            "To just output the public part of a private key:",
            "openssl rsa -in key.pem -pubout -out pubkey.pem",
            "Output the public part of a private key in RSAPublicKey format:",
            "openssl rsa -in key.pem -RSAPublicKeyout -out pubkey.pem"
        ],
        "see_also": [
            {
                "name": "openssl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/openssl/1/json"
            },
            {
                "name": "openssl-pkey",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/openssl-pkey/1/json"
            },
            {
                "name": "openssl-pkcs8",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/openssl-pkcs8/1/json"
            },
            {
                "name": "openssl-dsa",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/openssl-dsa/1/json"
            },
            {
                "name": "openssl-genrsa",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/openssl-genrsa/1/json"
            },
            {
                "name": "openssl-gendsa",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/openssl-gendsa/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-help",
                        "lines": 2
                    },
                    {
                        "name": "-inform",
                        "lines": 2
                    },
                    {
                        "name": "-outform",
                        "lines": 2
                    },
                    {
                        "name": "-traditional",
                        "lines": 3
                    },
                    {
                        "name": "-in",
                        "lines": 3
                    },
                    {
                        "name": "-passin -passout",
                        "lines": 3
                    },
                    {
                        "name": "-out",
                        "lines": 4
                    },
                    {
                        "name": "-aes128 -aes192 -aes256 -aria128 -aria192 -aria256 -camellia128 -camellia192",
                        "lines": 1
                    },
                    {
                        "name": "-camellia256 -des -des3 -idea",
                        "lines": 6
                    },
                    {
                        "name": "-text",
                        "lines": 3
                    },
                    {
                        "name": "-noout",
                        "lines": 2
                    },
                    {
                        "name": "-modulus",
                        "lines": 2
                    },
                    {
                        "name": "-check",
                        "lines": 2
                    },
                    {
                        "name": "-pubin",
                        "lines": 3
                    },
                    {
                        "name": "-pubout",
                        "lines": 3
                    },
                    {
                        "name": "-RSAPublicKey -RSAPublicKey",
                        "lines": 2
                    },
                    {
                        "name": "-pvk-strong",
                        "lines": 2
                    },
                    {
                        "name": "-pvk-weak",
                        "lines": 2
                    },
                    {
                        "name": "-pvk-none",
                        "lines": 2
                    },
                    {
                        "name": "-engine",
                        "lines": 2
                    },
                    {
                        "name": "-provider",
                        "lines": 1
                    },
                    {
                        "name": "-provider-path",
                        "lines": 1
                    },
                    {
                        "name": "-propquery",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "openssl-rsa - RSA key processing command\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "openssl rsa [-help] [-inform DER|PEM|P12|ENGINE] [-outform DER|PEM] [-in filename|uri]\n[-passin arg] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-aria128]\n[-aria192] [-aria256] [-camellia128] [-camellia192] [-camellia256] [-des] [-des3] [-idea]\n[-text] [-noout] [-modulus] [-traditional] [-check] [-pubin] [-pubout] [-RSAPublicKeyin]\n[-RSAPublicKeyout] [-pvk-strong] [-pvk-weak] [-pvk-none] [-engine id] [-provider name]\n[-provider-path path] [-propquery propq]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This command processes RSA keys. They can be converted between various forms and their\ncomponents printed out.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-help",
                        "content": "Print out a usage message.\n"
                    },
                    {
                        "name": "-inform",
                        "content": "The key input format; unspecified by default.  See openssl-format-options(1) for details.\n"
                    },
                    {
                        "name": "-outform",
                        "content": "The key output format; the default is PEM.  See openssl-format-options(1) for details.\n"
                    },
                    {
                        "name": "-traditional",
                        "content": "When writing a private key, use the traditional PKCS#1 format instead of the PKCS#8\nformat.\n"
                    },
                    {
                        "name": "-in",
                        "content": "This specifies the input to read a key from or standard input if this option is not\nspecified. If the key is encrypted a pass phrase will be prompted for.\n"
                    },
                    {
                        "name": "-passin -passout",
                        "content": "The password source for the input and output file.  For more information about the format\nof arg see openssl-passphrase-options(1).\n"
                    },
                    {
                        "name": "-out",
                        "content": "This specifies the output filename to write a key to or standard output if this option is\nnot specified. If any encryption options are set then a pass phrase will be prompted for.\nThe output filename should not be the same as the input filename.\n"
                    },
                    {
                        "name": "-aes128 -aes192 -aes256 -aria128 -aria192 -aria256 -camellia128 -camellia192",
                        "content": ""
                    },
                    {
                        "name": "-camellia256 -des -des3 -idea",
                        "content": "These options encrypt the private key with the specified cipher before outputting it. A\npass phrase is prompted for.  If none of these options is specified the key is written in\nplain text. This means that this command can be used to remove the pass phrase from a key\nby not giving any encryption option is given, or to add or change the pass phrase by\nsetting them.  These options can only be used with PEM format output files.\n"
                    },
                    {
                        "name": "-text",
                        "content": "Prints out the various public or private key components in plain text in addition to the\nencoded version.\n"
                    },
                    {
                        "name": "-noout",
                        "content": "This option prevents output of the encoded version of the key.\n"
                    },
                    {
                        "name": "-modulus",
                        "content": "This option prints out the value of the modulus of the key.\n"
                    },
                    {
                        "name": "-check",
                        "content": "This option checks the consistency of an RSA private key.\n"
                    },
                    {
                        "name": "-pubin",
                        "content": "By default a private key is read from the input file: with this option a public key is\nread instead.\n"
                    },
                    {
                        "name": "-pubout",
                        "content": "By default a private key is output: with this option a public key will be output instead.\nThis option is automatically set if the input is a public key.\n"
                    },
                    {
                        "name": "-RSAPublicKey -RSAPublicKey",
                        "content": "Like -pubin and -pubout except RSAPublicKey format is used instead.\n"
                    },
                    {
                        "name": "-pvk-strong",
                        "content": "Enable 'Strong' PVK encoding level (default).\n"
                    },
                    {
                        "name": "-pvk-weak",
                        "content": "Enable 'Weak' PVK encoding level.\n"
                    },
                    {
                        "name": "-pvk-none",
                        "content": "Don't enforce PVK encoding.\n"
                    },
                    {
                        "name": "-engine",
                        "content": "See \"Engine Options\" in openssl(1).  This option is deprecated.\n"
                    },
                    {
                        "name": "-provider",
                        "content": ""
                    },
                    {
                        "name": "-provider-path",
                        "content": ""
                    },
                    {
                        "name": "-propquery",
                        "content": "See \"Provider Options\" in openssl(1), provider(7), and property(7).\n"
                    }
                ]
            },
            "NOTES": {
                "content": "The openssl-pkey(1) command is capable of performing all the operations this command can, as\nwell as supporting other public key types.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "The documentation for the openssl-pkey(1) command contains examples equivalent to the ones\nlisted here.\n\nTo remove the pass phrase on an RSA private key:\n\nopenssl rsa -in key.pem -out keyout.pem\n\nTo encrypt a private key using triple DES:\n\nopenssl rsa -in key.pem -des3 -out keyout.pem\n\nTo convert a private key from PEM to DER format:\n\nopenssl rsa -in key.pem -outform DER -out keyout.der\n\nTo print out the components of a private key to standard output:\n\nopenssl rsa -in key.pem -text -noout\n\nTo just output the public part of a private key:\n\nopenssl rsa -in key.pem -pubout -out pubkey.pem\n\nOutput the public part of a private key in RSAPublicKey format:\n\nopenssl rsa -in key.pem -RSAPublicKeyout -out pubkey.pem\n",
                "subsections": []
            },
            "BUGS": {
                "content": "There should be an option that automatically handles .key files, without having to manually\nedit them.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "openssl(1), openssl-pkey(1), openssl-pkcs8(1), openssl-dsa(1), openssl-genrsa(1),\nopenssl-gendsa(1)\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "The -engine option was deprecated in OpenSSL 3.0.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2000-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                            OPENSSL-RSA(1SSL)",
                "subsections": []
            }
        }
    }
}