OpenSSL将仅包含RSA私钥的.PEM转换为.PKCS12 [英] Openssl convert .PEM containing only RSA Private Key to .PKCS12
问题描述
当前,我有一个仅包含私钥的.PEM文件.我需要将此文件转换为.PKCS12文件.目前,我正在尝试使用openssl来实现此目的,并且遇到了一些问题.
Currently I have a .PEM file containing only a private key. I need to convert this file into a .PKCS12 file. Currently I'm trying to use openssl to achieve this and I'm running into some problems.
我正在使用的.PEM文件的格式为:
The .PEM file I'm using is of the form:
-----BEGIN RSA PRIVATE KEY-----
Some key
-----END RSA PRIVATE KEY-----
我使用以下Openssl命令尝试将此.PEM文件转换为.PKCS12:
I use the following Openssl command to attempt to convert this .PEM file into a .PKCS12:
openssl pkcs12 -export -inkey file.pem -out file.p12
然后控制台挂起并显示以下消息:
The console then hangs with the message:
Loading 'screen' into random state -done
我在做什么错了?
将寻求任何帮助.
推荐答案
我遇到了这个问题,并通过在导出后添加-nocerts
选项解决了该问题.我对冻结"原因的猜测是,openssl可能正试图从控制台读取其他输入.
I ran into this problem and resolved it by adding the -nocerts
option after export. My guess regarding the cause of the "freeze up" is that openssl is probably trying to read additional input from the console.
openssl pkcs12 -export -nocerts -inkey your.private.key.pem -out your.private.key.p12
这篇关于OpenSSL将仅包含RSA私钥的.PEM转换为.PKCS12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!