openssl pkcs12 -export return 我的错误是无法加载证书

openssl pkcs12 -export return me error as unable to load certificates

到目前为止,我曾经按照以下步骤创建用于推送的 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 标签来将他们带入这个问题。


我只是认为这是由于我为 pods 更新了 Ruby 而发生的。

Ruby 中是否有针对此导出的任何更新?

终于找到解决方法了

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,您就完成了。

我收到此错误是因为我从网站复制和粘贴的 cer 文件中有空格。当我带着一个没有空格的文件退休时,它起作用了。