openssl-p12证书

p12证书导出pem格式证书

一、来由-决定思路

1、最近有个数据要用到SHA256withRSA算法进行签名,用的是openssl中的算法,使用的pem格式的证书;但是证书来源的格式为xxx.p12;是p12格式的。
2、因此就需要将p12格式的证书导出为pem格式的。
3、因为此p12证书有密码,因此需要传入密码。

二、导出命令

openssl pkcs12 -in bestpay.p12 -passin pass:01423744 -nocerts -nodes -out bestpay_pri.key
//导出私钥
openssl rsa -in bestpay_pri.key -out bestpay_pri.pem
//导出公钥
openssl rsa -in bestpay_pri.key -pubout -out bestpay_pub.pem

猜你喜欢

转载自blog.csdn.net/weixin_46089486/article/details/103972625
今日推荐