-1

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.

kaliiiiiiiii
  • 925
  • 1
  • 2
  • 21
Manth
  • 358
  • 3
  • 4
  • 14

1 Answers1

1

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?

Valerij Dobler
  • 1,848
  • 15
  • 25
  • I ran this command form docker file but suggestion was to make it part of application once it is started so I guess will settle for above suggested approach. I was trying to understand if there is a way to achieve this using java libraries. – Manth Feb 16 '23 at 14:24