iOS推送消息证书三步搞定

[参考]:http://hb.qq.com/a/20111128/000536.htm

appname_dev_2012.p12 是导出的账号

======================Development============================

## 从苹果证书管理后台下载的证书aps_development.cer转成pem格式

1,  openssl x509 -in aps_development.cer -inform DER -out aps_development.pem -outform PEM

## 从钥匙串中导出的p12秘钥转成pem格式

2,  openssl pkcs12 -nocerts -out appname_dev_2012.pem -in appname_dev_2012.p12 

(需要输入密码--password123)

## 把上面两个pem文件加上"CertificateSigningRequest.certSigningRequest"签名文件共三个文件导出一个PKCS12格式文件(用于服务端与苹果push服务器通信)

(
1, aps_development.pem
2, appname_dev_2012.pem
3, CertificateSigningRequest.certSigningRequest
)

3,  openssl pkcs12 -export -in aps_development.pem -inkey appname dev_2012.pem -certfile CertificateSigningRequest.certSigningRequest -name "appname_developer_indentity" -out appname_developer_identity.p12

(需要输入三次密码--password123)

appname_dis_2012.p12 是导出的账号

======================Production===================(操作同Development)

1,  openssl x509 -in aps_production.cer -inform DER -out aps_production.pem -outform PEM

2,  openssl pkcs12 -nocerts -out appname_dis_2012.pem -in appname_dis_2012.p12 

3,  openssl pkcs12 -export -in aps_production.pem -inkey appname dis_2012.pem -certfile CertificateSigningRequest.certSigningRequest -name "appname_production_indentity" -out appname_production_identity.p12

--------------------------------------------------------------------------------------------------------------------------------------------------