导出后台可用的 pem p12 证书

导出.p12文件

1. 打开钥匙串,找到安装好的推送证书,右键证书,选择导出。(注意:不要将证书展开再导出)

2. 导出时,需要给私钥一个密码(该密码需要告诉后台)。

导出.pem文件

1. 我上一步导出的.p12叫做cert.p12,然后还需要将私钥导出,并命名为key.p12。(注意:导出私钥的p12需要将证书展开)

2. 现在应该有两种.p12文件了,一个叫cert.p12,另一个为key.p12

3. 打开终端,进入到cert.p12与key.p12所在文件夹,将cert.p12与key.p12分别转为cert.pem与key.pem文件(具体步骤如下)


openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12

openssl pkcs12 -nocerts -out key.pem -in key.p12

openssl rsa -in key.pem -out key.pem

cat cert.pem key.pem > dis.pem

注意要有第三步,   openssl rsa -in key.pem -out key.pem.

开发证书和生产证书的生成方式一样

参考 :

http://blog.csdn.net/zhouleizhao/article/details/36440383

http://www.saitjr.com/ios/ios-export-remote-notification-p12-pem-file.html

你可能感兴趣的:(导出后台可用的 pem p12 证书)