OPENSSL-DSA(1ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’œ openssl-dsa β€” DSA key processing πŸ’œ

okay so bestie, welcome to the openssl-dsa page from the OpenSSL manual set (that's the 1ossl one, iykyk) β€” and listen, this whole page is about DSA key processing. that's it. that's the vibe. it converts your DSA keys between forms and prints out their little components like the icon it is ✨


🌸 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]

πŸ¦‹ DESCRIPTION πŸ¦‹

so this command processes DSA keys, periodt. it can convert them between various forms and print out their components β€” very main character of it honestly πŸ’…

okay so important note bestie: this command uses the traditional SSLeay compatible format for private key encryption. newer applications should use the way more secure PKCS#8 format using the pkcs8 (literally, use the newer one, it's giving glow-up).

✨ OPTIONS ✨

  • -help β€” prints out a usage message. your lil "what do i do" button 🫢
  • -inform DER|PEM β€” the key input format; unspecified by default. see openssl-format-options(1) for the deets.
  • -outform DER|PEM β€” the key output format; default is PEM. see openssl-format-options(1) for the deets.

so like, private keys are a sequence of ASN.1 INTEGERs: the version (zero), p, q, g, and the public and private key components. public keys are a SubjectPublicKeyInfo structure with the DSA type. and the PEM format also accepts PKCS#8 data, slay πŸŽ€

  • -in filename β€” this specifies the input filename to read a key from, or standard input if you don't specify this option. if the key is encrypted, a pass phrase will be prompted for (yes, you gotta type it, no shortcuts bestie).
  • -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. and listen β€” the output filename should not be the same as the input filename, fr fr, don't do that πŸ™ˆ
  • -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).
  • -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.

which means β€” icon behaviour β€” 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 πŸ’…

  • -text β€” prints out the public, private key components and parameters. the full reveal ✨
  • -noout β€” this option prevents output of the encoded version of the key.
  • -modulus β€” this option prints out the value of the public key component of the key.
  • -pubin β€” by default, a private key is read from the input. with this option a public key is read instead. if the input contains no public key but a private key, its public part is used. flexible queen πŸ‘‘
  • -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. it knows what it's doing lowkey.
  • -pvk-strong β€” enable 'Strong' PVK encoding level (that's the default, btw).
  • -pvk-weak β€” enable 'Weak' PVK encoding level.
  • -pvk-none β€” don't enforce PVK encoding.
  • -engine id β€” see "Engine Options" in openssl(1). > heads up bestie: this option is deprecated πŸ’€
  • -provider name
  • -provider-path path
  • -provparam [name:]key=value
  • -propquery propq β€” see "Provider Options" in openssl(1), provider(7), and property(7).

also real quick β€” 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, it's the more versatile sibling 🫢


πŸ“ 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 demo:

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 🌈

openssl(1), openssl-pkey(1), openssl-dsaparam(1), openssl-gendsa(1), openssl-rsa(1), openssl-genrsa(1)


πŸŽ€ HISTORY πŸŽ€

the -engine option was deprecated in OpenSSL 3.0. we don't stan anymore, sorry πŸ’€


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 beauty is from OpenSSL 3.5.0, dated 2026-09-25 β€” go forth and process those DSA keys, you absolute icon πŸ’–βœ¨

πŸ“¦ where this page comes from