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. 移动端调起qq聊天

    <div class="item item-right" style='width:3rem;padding-left:0rem;'>QQ:<a target=& ...

  2. 解决iframe在iphone不兼容的问题

    <div class="scroll-wrapper"> <iframe src="地址"></iframe> </d ...

  3. 编译模块的Makefile解析

    Makefile # if not defined KERNELRELEASE, command is running from command line,need invoke kbuild sys ...

  4. c 语言的复杂声明

    简化的声明语法: dcl: optional *'s direct-dcl direct-dcl: name (dcl)  direct-dcl() direct-dcl[optional size] ...

  5. java第一课总结

    转眼间开学了,我们也正式进入了大二.心里既有激动,又有些感慨,还带有一些担忧.激动的是我们褪去了大一的稚气成为了一名大二的学长了,第一次体会到了大学学长的感觉,心里很是激动.感慨的是我们又成长了一岁, ...

  6. MyBatis数据库连接的基本使用-补充Mapper映射器

    补充 Mapper映射器的使用: Mapper映射器,google添加.Mapper映射器是将mapper.xml中配置的sql id,parameterType和resultMap按照规则一一映射到 ...

  7. Unity&Sqlite数据库

    Sqlite是一个跨平台关系型小型数据库,非常便利,适合于嵌入式设备:对于Sqlite数据库来说,这个数据库是以文件的形成存在的(比如data.db):数据库是由表组成的,在一个数据库里面可以存储多个 ...

  8. oracle导入大sql文件

    最近遇到一个需要导入大SQL文件的问题,最先直接用SQL developer 导入大SQL文件,结果报IO Exception,只好采用sqlplus 导入,操作过程如下: sqlplus 用户名/密 ...

  9. artTemplate js模板引擎动态给html赋值

    html放到$("#area").append(html);之前,否则文档流获取不到#area <table width="90%" class=&quo ...

  10. 使用scaleBitmap类缩放和拉伸

    使用scaleBitmap类缩放和拉伸 位图,画架,图形,小贴士我们一直在寻找在createJS中优化.简化或创建更好工作流的方法,scaleBitmap就是一个很好的例子.使用旧的flash方法,在 ...