openssl pkcs12 -export返回我错误,因为无法加载证书

时间:2019-03-20 17:36:19

标签: swift ruby push-notification openssl apple-push-notifications

直到今天,我一直按照以下步骤创建要推送的p12文件。

openssl x509 -in aps_development.cer -inform DER -out aps_development_identity.pem -outform PEM}
openssl pkcs12 -nocerts -out private_development_key.pem -in Certificates.p12
openssl rsa -out private_key_noenc.pem -in private_development_key.pem
openssl pkcs12 -export -in aps_development_identity.pem -inkey private_key_noenc.pem -certfile CertificateSigningRequest.certSigningRequest -name "aps_development_identity" -out aps_development_identity.p12

注意:我的文件夹中已经有aps_development.cerCertificates.p12CertificateSigningRequest.certSigningRequest

但是今天我在执行终端中的最后一条语句时出错。

执行完最后一句话后,出现如下错误。

openssl pkcs12 -export -in aps_development_identity.pem -inkey private_key_noenc.pem -certfile CertificateSigningRequest.certSigningRequest -name "aps_development_identity" -out aps_development_identity.p12

unable to load certificates --> this is what I get in response

到现在我还没有收到这样的错误。

任何想法我想念的东西。

我将Swift标记为iOS开发人员可能已经遇到了这个问题。因此,我刚刚添加了Swift标签,将它们带入了这个问题。


我刚刚发现发生这种情况是因为我更新了Ruby for Pod。

在此导出过程中,Ruby是否有任何更新?

2 个答案:

答案 0 :(得分:0)

最后我找到了解决方案。

openssl pkcs12 -export -in aps_development_identity.pem -inkey private_key_noenc.pem -name "aps_development_identity" -out aps_development_identity.p12

只需从上一条语句中删除-certfile CertificateSigningRequest.certSigningRequest,您就完成了。

答案 1 :(得分:0)

我收到此错误,是因为我的cer文件中有一些空格,我需要从网站上粘贴该空格。当我使用没有空格的文件退休时,它可以工作。