到目前为止,我曾按照以下步骤创建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.cer
,Certificates.p12
,CertificateSigningRequest.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 pods。
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
即可。