OPENSSL-RSA(1ossl)
π OPENSSL-RSA(1ossl) β the RSA key glow-up station π
ok so this is the openssl-rsa page from the OpenSSL manual set (that's the 1ossl bit, iykyk), and bestie⦠it's literally the RSA key processing command. keys go in, keys come out, keys get printed, keys get their whole vibe changed. slay.
β¨ SYNOPSIS β¨
openssl rsa [-help] [-inform DER|PEM|P12|ENGINE] [-outform DER|PEM] [-in
filename|uri] [-passin arg] [-out filename] [-passout arg] [-aes128]
[-aes192] [-aes256] [-aria128] [-aria192] [-aria256] [-camellia128]
[-camellia192] [-camellia256] [-des] [-des3] [-idea] [-text] [-noout]
[-modulus] [-traditional] [-check] [-pubin] [-pubout] [-RSAPublicKey_in]
[-RSAPublicKey_out] [-pvk-strong] [-pvk-weak] [-pvk-none] [-engine id]
[-provider name] [-provider-path path] [-provparam [name:]key=value]
[-propquery propq]
yeah it's a lot. it's giving "too many options" but honestly every single one is pulling its weight π
πΈ DESCRIPTION πΈ
okay so this command processes RSA keys. that's the whole thing. they can be converted between various forms and their components printed out. like, the key can change its outfit (DER? PEM? you decide bestie) and also justβ¦ tell you what it's made of. main character energy fr π₯
π OPTIONS π
-helpβ prints out a usage message. the "what do i even do here" option π«Ά-inform DER|PEM|P12|ENGINEβ the key input format; unspecified by default. seeopenssl-format-options(1)for the deets.-outform DER|PEMβ the key output format; the default isPEM. again,openssl-format-options(1)has the lore.-traditionalβ when writing a private key, use the traditional PKCS#1 format instead of the PKCS#8 format. vintage aesthetic β¨-in filename|uriβ this specifies the input to read a key from, or standard input if this option is not specified. and heads up: if the key is encrypted a pass phrase will be prompted for. π-passin arg,-passout argβ the password source for the input and output file. for more info about the format of arg, seeopenssl-passphrase-options(1).-out filenameβ 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. like. respectfully. don't. π
-aes128,-aes192,-aes256,-aria128,-aria192,-aria256,-camellia128,-camellia192,-camellia256,-des,-des3,-ideaβ 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.
so yeah β this means the command can be used to remove the pass phrase from a key (by not giving any encryption option) or to add or change the pass phrase by setting them. cute right?
π«Ά small catch: these options can only be used with PEM format output files.
-textβ prints out the various public or private key components in plain text, in addition to the encoded version. it's giving "show me your insides" π-nooutβ this option prevents output of the encoded version of the key.-modulusβ this option prints out the value of the modulus of the key.-checkβ this option checks the consistency of an RSA private key. a little vibe check for your key, basically π§-pubinβ by default a private key is read from the input. with this option a public key is read instead. and if the input contains no public key but a private key, its public part is used. flexible!-puboutβ 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. β-RSAPublicKey_in,-RSAPublicKey_outβ like-pubinand-puboutexceptRSAPublicKeyformat is used instead. same idea, different fit π-pvk-strongβ enable 'Strong' PVK encoding level (this is the default, bestie π).-pvk-weakβ enable 'Weak' PVK encoding level.-pvk-noneβ don't enforce PVK encoding.-engine idβ see "Engine Options" inopenssl(1).
π this option is deprecated. not the vibe anymore.
-provider name-provider-path path-provparam [name:]key=value-propquery propqβ see "Provider Options" inopenssl(1),provider(7), andproperty(7).
π¦ NOTES π¦
the openssl-pkey(1) command is capable of performing all the operations this command can, as well as supporting other public key types. so likeβ¦ pkey is the overachiever here. rsa walked so pkey could run, honestly π
π EXAMPLES π
the documentation for the openssl-pkey(1) command contains examples equivalent to the ones listed here. but here they are anyway because we love a visual π
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 -RSAPublicKey_out -out pubkey.pem
π BUGS π
there should be an option that automatically handles .key files, without having to manually edit them. likeβ¦ not me having to hand-edit a file in 2k26 π fix it pls.
π SEE ALSO π
openssl(1), openssl-pkey(1), openssl-pkcs8(1), openssl-dsa(1), openssl-genrsa(1), openssl-gendsa(1) β go read the whole friend group π
π HISTORY π
the -engine option was deprecated in OpenSSL 3.0. rip bozo, you had a good run π«‘
π COPYRIGHT π
Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, bestie! π this one's from OpenSSL 3.5.9, dated 2026-09-29 β no cap, go forth and process those keys π¦β¨π
π¦ where this page comes from
- alpine 3.23: openssl-doc 3.5.9-r0 Β· Apache-2.0
- alpine 3.24: openssl-doc 3.5.9-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms