I have RSA encrypted private key with passphrase how do I decrypt the private key file

806 Views Asked by At

Basically I want to do this in command in java

openssl rsa -in enc_private.key -out private.key -passin pass:passphrase_xyz

beginning of my encrypted key file looks like this

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,59e5e15b3d9474e6

please assist.

1

There are 1 best solutions below

1
Valerij Dobler On BEST ANSWER

You could use

Runtime.getRuntime().exec("openssl rsa -in enc_private.key -out private.key -passin pass:passphrase_xyz");

Maybe a bash or PowerShell script would be better suited?