1.在桌面上建一個"apns_p12"文件夾,全部的保存和生成文件都放在這裏服務器
2.從鑰匙串中生成CertificateSigningRequest.certSigningRequest工具
3.從服務器上下載aps_development.cer和aps_production.cer文件,並導入到本機網站
4.從將"系統"鑰匙串中「證書」的:Apple Development iOS Push Services:com.xxx.xxx和Apple Production iOS Push Services:com.xxx.xxx兩項,拖到「登陸」鑰匙串中(由於在「系統」中時,沒法導出成p12文件)spa
5.將以上兩項分別,導出p12文件,將設置好密碼,命名爲:apns_development.p12和apns_Production.p12命令行
6.打開「終端」命令行工具,輸入:code
cd /users/bill/desktop/apns_p12
openssl x509 -in aps_development.cer -inform der -out push_development.pem
openssl x509 -in aps_production.cer -inform der -out push_production.pem
openssl pkcs12 -nocerts -out push_p12_development.pem -in apns_development.p12 //須要輸入密碼
openssl pkcs12 -nocerts -out push_p12_production.pem -in apns_production.p12 //須要輸入密碼
openssl pkcs12 -export -in push_development.pem -inkey push_p12_development.pem -certfile CertificateSigningRequest.certSigningRequest -name "final_push_development" -out final_push_development.p12 //須要輸入密碼
openssl pkcs12 -export -in push_production.pem -inkey push_p12_production.pem -certfile CertificateSigningRequest.certSigningRequest -name "final_push_production" -out final_push_production.p12 //須要輸入密碼
7.最終生成了,final_push_development.p12和final_push_production.p12文件,把他們放在網站的根目錄中就能夠了orm