我有带有密码的RSA加密私钥,如何解密私钥文件?

huangapple go评论60阅读模式
英文:

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

问题

基本上我想在Java命令中执行以下操作
```shell
openssl rsa -in enc_private.key -out private.key -passin pass:passphrase_xyz

我的加密密钥文件开头如下

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

请协助。


<details>
<summary>英文:</summary>

Basically I want to do this in command in java
```shell
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

得分: 1

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?

英文:

You could use

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

Maybe a bash or PowerShell script would be better suited?

huangapple
  • 本文由 发表于 2023年2月16日 02:53:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75464287.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定