02.openssl-密钥的格式转换

1.PEM and DER Conversion(格式转换)
convert a certificate from PEM to DER format:
$ openssl x509 -inform PEM -in fd.pem -outform DER -out fd.der

To convert a certificate from DER to PEM format:
$ openssl x509 -inform DER -in fd.der -outform PEM -out fd.pem

2.PKCS#12 (PFX) Conversion
$ openssl pkcs12 -export -name “My Certificate” -out fd.p12 -inkey fd.key -in fd.crt -certfile fd-chain.crt

命令:
$ openssl pkcs12 -in fd.p12 -nocerts -out fd.key -nodes

$ openssl pkcs12 -in fd.p12 -nokeys -clcerts -out fd.crt

$ openssl pkcs12 -in fd.p12 -nokeys -cacerts -out fd-chain.crt

3.PKCS#7 Conversion
To convert from PEM to PKCS#7, use the crl2pkcs7 command:
$ openssl crl2pkcs7 -nocrl -out fd.p7b -certfile fd.crt -certfile fd-chain.crt

To convert from PKCS#7 to PEM, use the pkcs7 command with the -print_certs switch:
openssl pkcs7 -in fd.p7b -print_certs -out fd.pem

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值