To send Push notification to an application/device couple you need an unique device token (see the ObjectiveC page) and a certificate.

Generate a Push Certificate

To generate a certificate on a Mac OS X:

  1. Log-in to the iPhone Developer Program Portal
  2. Choose App IDs from the menu on the right (or click here)
  3. Create an App ID without a wildcard. For example 3L223ZX9Y3.com.armiento.test
  4. Click the Configure link next to this App ID and then click on the button to start the wizard to generate a new Development Push SSL Certificate (Apple Documentation: Creating the SSL Certificate and Keys)
  5. Download this certificate and double click on aps_developer_identity.cer to import it into your Keychain
  6. Launch Keychain Assistant (located in Application, Utilities or search for it with Spotlight) and click on My Certificates on the left
  7. Expand Apple Development Push Services and select Apple Development Push Services AND your private key (just under Apple Development Push Services)
  8. Right-click and choose "Export 2 elements..." and save as server_certificates_bundle_sandbox.p12 (don't type a password).
  9. Open Terminal and change directory to location used to save server_certificates_bundle_sandbox.p12 and convert the PKCS12 certificate bundle into PEM format using this command (press enter when asked for Import Password):
    openssl pkcs12 -in server_certificates_bundle_sandbox.p12 -out server_certificates_bundle_sandbox.pem -nodes -clcerts
  10. Now you can use this PEM file as your certificate in ApnsPHP!

Verify peer using Entrust Root Certification Authority

Download the Entrust Root Authority certificate directly from Entrust Inc. website:

  1. Navigate to https://www.entrust.net/downloads/root_index.cfm
  2. Choose "Personal Use"
  3. Download the Entrust CA (2048) file (entrust_2048_ca.cer) https://www.entrust.net/downloads/binary/entrust_2048_ca.cer for the Sandbox environment; download the Entrust Secure Server CA file (entrust_ssl_ca.cer) https://www.entrust.net/downloads/binary/entrust_ssl_ca.cerfor the Production environment until December 22nd (after December 22nd, 2010 you have to use entrust_2048_ca.cer also for the Production Environment as Apple said: "To ensure you can continue to validate your server's connection to the Apple Push Notification service, you will need to update your push notification server with a copy of the 2048-bit root certificate from Entrust's website.").

If you want to use the same file for the Sandbox and the Production environment please concat the two certificates. For example:

wget https://www.entrust.net/downloads/binary/entrust_2048_ca.cer -O - > entrust_root_certification_authority.pem
echo >> entrust_root_certification_authority.pem
wget https://www.entrust.net/downloads/binary/entrust_ssl_ca.cer -O - >> entrust_root_certification_authority.pem

Otherwise (for use only in a Mac OS X environment), export the Entrust Root Authority certificate:

  1. Launch Keychain Assistant (located in Application, Utilities or search for it with Spotlight) and click on System Root Certificate on top-left and Certificates on the bottom-left
  2. Right-click on Entrust Root Certification Authority and export with entrust_root_certification_authority.pem file name and choose as document format Privacy Enhanced Mail (.pem).
  3. Now you can use this PEM file as Entrust Root Certification Authority in ApnsPHP to verify Apple Peer!

Please, use ApnsPHP Google Group for help requests or to discuss about this project. To report an issue use Issues. Thanks!

原文:http://code.google.com/p/apns-php/wiki/CertificateCreation
 
也可参考此文:http://blog.csdn.net/yinchuanhui/article/details/7875872

一个非常好的中文介绍:http://www.cnblogs.com/menghe/archive/2012/02/20/2359278.html

Generate a Push Certificate的更多相关文章

  1. push certificate

    developer_identity.cer <= download from Applemykey.p12 <= Your private key openssl x509 -in de ...

  2. iOS APNS配置(转)

    Introduction To send Push notification to an application/device couple you need an unique device tok ...

  3. (转)How to renew your Apple Push Notification Push SSL Certificate

    转自:https://blog.serverdensity.com/how-to-renew-your-apple-push-notification-push-ssl-certificate/ It ...

  4. [ScreenOS] How to manually generate a new system self-signed certificate to replace the expired system self-signed certificate without resetting the firewall

    SUMMARY: This article provides information on how to manually generate a new system self-signed cert ...

  5. (转)How to build an Apple Push Notification provider server (tutorial)

    转自:https://blog.serverdensity.com/how-to-build-an-apple-push-notification-provider-server-tutorial/ ...

  6. (转)Apple Push Notification Services in iOS 6 Tutorial: Part 1/2

    转自:http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1 Upda ...

  7. Windows Store Apps, Error: The certificate specified has expired.(转)

    Windows Store Apps, Error: The certificate specified has expired. 0 comments|Posted on October 7th, ...

  8. [ScreenOS] How to change the certificate that is used for SSL (HTTPS) WebUI Management

    SUMMARY: This article provides information on how to change the certificate that is used for SSL (HT ...

  9. Glossary

    Glossary term terminology Certificate authority A norganization that authorizes a certificate. Certi ...

随机推荐

  1. ubuntu16 安装openssh-server 一直安装不上Unable to correct problems, you have held broken packages

    zengqi@zengqi:~$ sudo apt-get install openssh-server Reading package lists... DoneBuilding dependenc ...

  2. keras初探

    1.对网络的理解: 2.怎样训练,输入已经数据,经过训练,输入测试数据,得到相似数据 3.RNNs  循环神经网络

  3. Java String和StringBuffer和StringBuilder

    最近在牛课网上做了几道字符串操作的题目,好久没有做题了,之前用的也是大一时C语言做的,对Java字符串操作不太了解,所以深入了解一下String类的相关用法 String构造方法 String() 空 ...

  4. javaService

    JavaService.exe -install TestService "%JAVA_HOME%\jre\bin\server\jvm.dll" -Djava.class.pat ...

  5. vmware 共享文件夹

    参考 https://jingyan.baidu.com/article/7f766daf7866be4101e1d0ed.html 只是设置共享文件夹选项还不行,需要从安装vmware的安装路径中找 ...

  6. linux 升级python2.7

    linux为centos6,系统默认安装了python2.6,需要执行的python脚本内容包含标准库之xml.etree.ElementTree  用到库里的一个iter方法是python2.7的新 ...

  7. java多线程与并发笔记

    0.多线程,主要用来提高程序效率,处理耗时的操作. 多个线程写在同一个类里调用,并不是说写在前面的线程就会先运行.各个线程会进行争抢,能抢到系统资源的才会先运行. 因此,同一个程序,多个线程运行,可能 ...

  8. vue-cli 配置 proxyTable pathRewrite

    vue-config-index.js中,proxyTable中的pathRewrite有什么用呢? 首先,在ProxyTable模块中设置了‘/api’,target中设置服务器地址,也就是接口的开 ...

  9. POJ-2386.Lakecounting(DFS求连通块)

    本题是一道连通块的入门题,用来练手,后续还会更新连通块的题目. 本题大意:一个n * m 的陆地上面有很多水洼,让你统计水洼的个数并输出. 本题思路:按照顺序遍历陆地,如果发现水洼就将它的八连块都进行 ...

  10. c#的Boolean.Parse用法

    bool val; string input; input = bool.TrueString; val = bool.Parse(input); Console.WriteLine("'{ ...