OPENSSL-DSA(1ossl)

πŸ’… openssl-dsa β€” like, the DSA key processing page, bestie ✨

okay so this is openssl-dsa from the OpenSSL manual set (section 1ossl, if you're keeping track πŸŽ€). It's the lil command that handles DSA key processing β€” and we're gonna go through the whole thing together, no skipping, no cap. 🫢


🌸 SYNOPSIS 🌸

openssl dsa [-help] [-inform DER|PEM] [-outform DER|PEM] [-in filename]
[-passin arg] [-out filename] [-passout arg] [-aes128] [-aes192]
[-aes256] [-aria128] [-aria192] [-aria256] [-camellia128] [-camellia192]
[-camellia256] [-des] [-des3] [-idea] [-text] [-noout] [-modulus]
[-pubin] [-pubout] [-pvk-strong] [-pvk-weak] [-pvk-none] [-engine id]
[-provider name] [-provider-path path] [-provparam [name:]key=value]
[-propquery propq]

like yes that's a lot of flags, but we're gonna meet every single one, don't even worry πŸ’œ


✨ DESCRIPTION ✨

So this command processes DSA keys. That's the whole vibe. They can be converted between various forms and their components printed out β€” like a glow-up but for key files. πŸ’…

🚨 lowkey important note: this command uses the traditional SSLeay compatible format for private key encryption. Newer applications should use the more secure PKCS#8 format using the pkcs8 β€” that's the safer route, fr fr. Don't be out here using the old thing when you don't have to. 😭

πŸŽ€ OPTIONS πŸŽ€

okay buckle up, here's every single one:

  • -help β€” prints out a usage message. That's it, that's the whole thing. The "help me help you" flag πŸ¦‹
  • -inform DER|PEM β€” the key input format. It's unspecified by default, so like... you gotta say what you mean. See openssl-format-options(1) for the details ✨
  • -outform DER|PEM β€” the key output format. Default is PEM. See openssl-format-options(1) for the deets πŸ’–
  • -in filename β€” this specifies the input filename 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. πŸ”‘
  • -out filename β€” this specifies the output filename to write a key to, or standard output if it's not specified. If any encryption options are set, then a pass phrase will be prompted for.
πŸ™ˆ also: the output filename should not be the same as the input filename. Like, don't do that. Please.
  • -passin arg, -passout arg β€” the password source for the input and output file. For more info about the format of arg, see openssl-passphrase-options(1). πŸ“

🧚 the cipher squad (private key encryption) 🧚

These options encrypt the private key with the specified cipher before outputting it. A pass phrase is prompted for. 🫢

  • -aes128 β€” encrypt with aes128
  • -aes192 β€” encrypt with aes192
  • -aes256 β€” encrypt with aes256
  • -aria128 β€” encrypt with aria128
  • -aria192 β€” encrypt with aria192
  • -aria256 β€” encrypt with aria256
  • -camellia128 β€” encrypt with camellia128
  • -camellia192 β€” encrypt with camellia192
  • -camellia256 β€” encrypt with camellia256
  • -des β€” encrypt with des
  • -des3 β€” encrypt with des3
  • -idea β€” encrypt with idea

now the group lore 🌈: if none of these options is specified, the key is written in plain text. Which means β€” and this is kind of iconic β€” this 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. πŸ’€

⚠️ these options can only be used with PEM format output files. DER girlies, this ain't for you.

🌸 the rest of the flags 🌸

  • -text β€” prints out the public, private key components and parameters. All the juicy bits πŸ‘‘
  • -noout β€” this option prevents output of the encoded version of the key. Like "show me the tea, not the file" 🍡
  • -modulus β€” this option prints out the value of the public key component of the key. Just that one part, main character energy ⭐
  • -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. bestie is 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. convenient much? ✨
  • -pvk-strong β€” enable 'Strong' PVK encoding level (this is the default). πŸ’ͺ
  • -pvk-weak β€” enable 'Weak' PVK encoding level. πŸ™ˆ
  • -pvk-none β€” don't enforce PVK encoding. free spirit πŸ¦‹
  • -engine id β€” see "Engine Options" in openssl(1).
πŸ’€ this option is deprecated. we don't stan anymore.
  • -provider name β€” see "Provider Options" in openssl(1), provider(7), and property(7)
  • -provider-path path β€” same refs as above, bestie πŸŽ€
  • -provparam [name:]key=value β€” same refs again πŸ’œ
  • -propquery propq β€” yep, same refs 🌸

🌟 one last thing about this command 🌟

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 upgraded version. But dsa still slays for DSA specifically. 🫢


πŸ”₯ EXAMPLES πŸ”₯

The documentation for the openssl-pkey(1) command contains examples equivalent to the ones listed here. But here they are anyway, because we're thorough like that πŸ’…

To remove the pass phrase on a DSA private key:

openssl dsa -in key.pem -out keyout.pem

To encrypt a private key using triple DES:

openssl dsa -in key.pem -des3 -out keyout.pem

To convert a private key from PEM to DER format:

openssl dsa -in key.pem -outform DER -out keyout.der

To print out the components of a private key to standard output:

openssl dsa -in key.pem -text -noout

To just output the public part of a private key:

openssl dsa -in key.pem -pubout -out pubkey.pem

πŸ¦‹ SEE ALSO πŸ¦‹

like a whole little family, iykyk πŸ’–


πŸ“œ HISTORY πŸ“œ

The -engine option was deprecated in OpenSSL 3.0. rip to a real one πŸ•―οΈ


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 was OpenSSL 3.5.9, dated 2026-09-29 β€” go forth and process those DSA keys responsibly, mwah πŸ’‹πŸ’œ

πŸ“¦ where this page comes from