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. js高级-函数变量提升

    var a = 10; function f1(){ console.log(a) //undefined  函数变量提升了 函数执行之前想创建了函数的EC 把函数里面声明的变量初始化undefine ...

  2. SQL server 2012完全删除

    第一步,在控制面板里面找到程序——卸载程序这一项,打开之后就会是这样的了 第二步,经过第一步打开卸载程序后,在里面找到Microsoft SQLserver 2012 (64-bit)这一项,可以通过 ...

  3. echart生成饼状图

    //绘制图表. echarts.init(document.getElementById('main')).setOption({ tooltip : { trigger: 'item', //触发类 ...

  4. vue --轮播图

    轮播图,可以使用mint-ui中的swipe HTML: <Swipe :auto="4000"> <SwipeItem v-for="item in ...

  5. Numpy random arange zeros

    seed( ) 用于指定随机数生成时所用算法开始的整数值. .如果使用相同的seed( )值,则每次生成的随即数都相同: .如果不设置这个值,则系统根据时间来自己选择这个值,此时每次生成的随机数因时间 ...

  6. 手机不弹toast解决方法

    经常遇到华为手机不弹toast的问题     华为手机--设置--通知栏和状态栏--通知中心--自己的项目  用户可能允许通知关了 就收不到提示了     在手机的设置 -> (某些手机前面可能 ...

  7. python 文件操作: 文件操作的函数, 模式及常用操作.

    1.文件操作的函数: open("文件名(路径)", mode = '模式', encoding = "字符集") 2.模式: r , w , a , r+ , ...

  8. oracle存储过程与存储函数的区别和联系

    相同点:1.创建语法结构相似,都可以携带多个传入参数和传出参数.      2.都是一次编译,多次执行. 不同点:1.存储过程定义关键字用procedure,函数定义用function. 2.存储过程 ...

  9. oracle数据库连接不上

    Oracle数据库1521端口telnet不通 现象:服务器的ip地址可以ping通,但是安装oracle过程中的指定的“1521”端口telnet不通过 解决办法:1.确保防火墙对1521端口开启: ...

  10. 虚拟机安装的ubutun全屏

    虚拟机下面安装了ubuntu系统,显示的屏幕只有那么一小块儿,不知道如何才能全屏,那么如何全屏呢?且看下面经验.   方法/步骤     打开虚拟机,并点击要更改成全屏的那个ubuntu系统的电源 我 ...