大网数据广告活动
服务器运维问答

How can I create a PKCS12 File using OpenSSL (self signed certs)

· 52CE 我爱测

I have a bit9 server, and I'm fairly new to the environment, as well as certs. The area to upload the cert says " Import Server Certificate From PKCS12 File " I'm going to just use a self signed cert (I'm hoping it's ok with that…

问题原文

原帖链接 · trueCamelType · CC BY-SA 3.0

I have a bit9 server, and I'm fairly new to the environment, as well as certs. The area to upload the cert says "Import Server Certificate From PKCS12 File"

I'm going to just use a self signed cert (I'm hoping it's ok with that), and I'm running the below command to do so.

openssl req -x509 -newkey rsa:4096 -keyout bit9.pem -out cert.pem -days 365

Is that what I should have done, and if so, how do I get this to a PKCS12 File?

I've been looking around, and found the below command:

Convert a PEM certificate file and a private key to PKCS#12

openssl pkcs12 -export -out <certificate.pfx> -inkey <privateKey.key> -in <certificate.crt> -certfile <CACert.crt>

Since I only have a pem file...I'm not sure how to do this.

已采纳解答

原帖链接 · trueCamelType · CC BY-SA 4.0

I found steps that led to the solution here.

Since the answer is spread out across the question, and the answer, I'll just put exactly what I did below.

Create the key and cert (-nodes creates without password, means no DES encryption [thanks to jewbix.cube for correction])

openssl req -x509 -newkey rsa:4096 -keyout myKey.pem -out cert.pem -days 365 -nodes

Create pkcs12 file

openssl pkcs12 -export -out keyStore.p12 -inkey myKey.pem -in cert.pem

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。