小编art*_*ega的帖子

Ruby-如何从Ruby上的.pfx文件中提取公共,rsa私钥和CA密钥

我有一个.pfx格式的证书,我需要使用ruby提取公共证书,私有证书和CA证书。

使用外壳,我可以这样:

# Extract Public Key (ask for password)
openssl pkcs12 -in file.pfx -out file_public.pem -clcerts -nokeys

# Extract Certificate Authority Key (ask for password)
openssl pkcs12 -in file.pfx -out file_ca.pem -cacerts -nokeys

# Extract Private Key (ask for password)
openssl pkcs12 -in file.pfx -out file_private.pem -nocerts -nodes

# Extract RSA Private Key
openssl rsa -in file_private.pfx -out file_private_rsa.key

# Create Combo file with Public and RSA Private Keys
cat file_private_rsa.key file_public.pem > file_combo.pem
Run Code Online (Sandbox Code Playgroud)

在这篇文章中, DMKE显示了如何将密钥转换为.PFX,但是如何反过来呢?

ruby ssl ruby-on-rails

5
推荐指数
2
解决办法
2209
查看次数

标签 统计

ruby ×1

ruby-on-rails ×1

ssl ×1