I am trying to change the password of a private key with 'openssl rsa' command. The original key file, server.key.enc has the following format:
-----BEGIN ENCRYPTED PRIVATE KEY-----
....
-----END ENCRYPTED PRIVATE KEY-----

When I used the command "openssl rsa -in server.key.enc -passin pass:old_password -out server.key", a new decrypted key file is generated with the following format:
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

But when I use the command "openssl rsa -in server.key.enc -passin pass:old_password -out server.key -passout pass:new_password", hoping the new key file will be encrypted with the new password, I still get the same decrypted key file below
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

Do I use the command correctly, or do I misunderstand what the argument meant? What is the correct way to re-encrypt a RSA private key with a new password?

Thanks for any help.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to