OpenSSL "pkey -aes*" - Re-Encrypt DSA Keys


How to re-encrypt a DSA key file using OpenSSL "pkey" command? I want to change the encryption password, and maybe change the encryption algorithm.



If you want to encrypt an existing DSA key file again, you can use the "pkey -aes*" command as shown below:


OpenSSL> pkey -in my_dsa_des.key -aes128 -out my_dsa_aes.key
Enter pass phrase for my_dsa_des.key: fyicenter
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:

Options used in this command are:

  • "-in my_dsa_des.key" - Read the DSA private key file.
  • "-out my_dsa_aea.key" - Save the output to a file.
  • "-aes128" - Encrypt the output (DSA private key and public key).
  • "fyicenter" - The password of the input key file.
  • "" - The password of the output key file.


OpenSSL "genpkey" Command for DH Keys

OpenSSL "pkey" - Open Encrypted DSA Keys

OpenSSL "genpkey" Command for DSA Keys

⇑⇑ OpenSSL Tutorials

2017-10-08, 1188👍, 0💬