怎么申请证书,导出证书就不说了,
最后得到三个文件:
PushChat.p12;
aps_development.cer;
CertificateSigningRequest.certSigningRequest
在命令行下输入:
#将aps_development.cer转换成aps_development.pem格式
openssl x509 -in aps_development.cer -inform DER -out aps_development.pem -outform PEM
#将p12格式的专用密钥转换成pem,依次输入密码
openssl pkcs12 -nocerts -out APNS_Noenc.pem -in PushChat.p12
#创建PKCS#12格式的p12文件
openssl pkcs12 -export -in aps_development.pem -inkey APNS_Noenc.pem -certfile CertificateSigningRequest.certSigningRequest -name "aps_development" -out aps_development.p12
最后就是可用的了
需要注意的是,第一步这里的.p12文件是密钥里面导出来的,而不是证书,这里错了,下面命令行中再怎么去建证书,也是错了。