简体   繁体   English

如何从PKCS#7生成.key和.crt

[英]How to generate .key and .crt from PKCS#7

I purchased SSL certificate from slss.com and I've downloaded a file to my local pc there are .crt, ca-bundle, and p7b file and I've copied the files to the server and I'm trying to install the cert. 我从slss.com购买了SSL证书,并且已将文件下载到本地PC,其中包含.crt,ca-bundle和p7b文件,并且已将文件复制到服务器,并且正在尝试安装证书。 to an apache2 web server but it requires a .key file and I don't know how to locate(if it exists) or how to convert one of the files to .key file using openssl or other methods 到apache2 Web服务器,但它需要一个.key文件,我不知道如何定位(如果存在)或如何使用openssl或其他方法将其中一个文件转换为.key文件

A '.p7b' file only contains certificates and chain certificates (Intermediate CAs), not the private key. “ .p7b”文件仅包含证书和链式证书(中间CA),而不包含私钥。 The private key already exists, as the provided certificate should be related to the existed private key. 私钥已存在,因为提供的证书应与现有私钥相关。 You provided CA with your private key when requested a certificate. 要求证书时,您向CA提供了私钥。 For this, you should further clarify it with CA which provided you with a certificate. 为此,您应该向提供证书的CA进一步澄清。

Certificates with '.p7b' extension can be converted in the standard '.pem' format using online services such as https://www.sslshopper.com/ssl-converter.html or by using OpenSSL CLI utility with following command: 可以使用诸如https://www.sslshopper.com/ssl-converter.html之类的在线服务,或通过使用带有以下命令的OpenSSL CLI实用程序 ,将扩展名为“ .p7b”的证书转换为标准“ .pem”格式:

# openssl pkcs7 -print_certs -in certificate.p7b -out certificate.pem

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM