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. Seeopenssl-format-options(1)for the details β¨-outform DER|PEMβ the key output format. Default isPEM. Seeopenssl-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, seeopenssl-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 withaes128-aes192β encrypt withaes192-aes256β encrypt withaes256-aria128β encrypt witharia128-aria192β encrypt witharia192-aria256β encrypt witharia256-camellia128β encrypt withcamellia128-camellia192β encrypt withcamellia192-camellia256β encrypt withcamellia256-desβ encrypt withdes-des3β encrypt withdes3-ideaβ encrypt withidea
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" inopenssl(1).
π this option is deprecated. we don't stan anymore.
-provider nameβ see "Provider Options" inopenssl(1),provider(7), andproperty(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 π
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
- 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