怎样才能在iPhone推送通知PEM文件? [英] How can I generate pem file for push notifications in iphone?

查看:163
本文介绍了怎样才能在iPhone推送通知PEM文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用该<一个href=\"http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html\">link对于产生推送通知PEM文件,但我无法理解下面的步骤...


  

在服务器上安装SSL证书和密钥


  
  

您应该安装SSL证书的分布和私人
  您之前在服务器计算机上获取密钥上
  提供商code运行,并从它与沙箱连接或
  的APN的产品版本。要做到这一点,请完成以下步骤:


  
  

      
  1. 打开钥匙串访问实用程序,并单击左侧窗格中的我的证书类别。


  2.   
  3. 找到要安装并披露其内容的证书。
      你会看到两个证书和私钥。


  4.   
  5. 选择证书和密钥,选择文件>导出项目,并将其导出为个人信息交换(或.p12)文件。


  6.   
  7. 在语言如Ruby和Perl的实现服务器通常能够更好的个人信息处理证书
      交换格式。将证书转换为这种格式,完整
      以下步骤:


      
      

        
    • 在钥匙串访问,选择证书,然后选择文件>导出项目。选择个人信息交换(或.p12)选项,
        选择一个保存位置,然后单击保存。


    •   
    • 启动终端应用程序和提示后输入以下命令:OpenSSL的PKCS12 -in CertificateName.p12退房手续
        CertificateName.pem -nodes。


    •   

  8.   
  9. 在质子交换膜证书复制到新的计算机,并在适当的地方进行安装。


  10.   


解决方案

最后我sloved产生推送通知荣誉证书

有关生成推送通知证书完成步骤.....

1)打开钥匙链和证书申请显示在下面的形象。

2)更改通用名称作为您PROJECT_NAME

3)在钥匙串开关键可以显示两个主要公共和私人

4)写点击私钥和导出。

5)使名称project_name_key.p12

6)加密码的前1234

7)进入系统登录密码并保存。现在你有以下证书。

8)现在后藤开发者帐户(<一个href=\"https://developer.apple.com/devcenter/ios/index.action\">https://developer.apple.com/devcenter/ios/index.action)和GOTO标识符创建新的如果不退出。和编辑设置。


如果推送通知禁用然后编辑启用它。

9)的开发,您可以创建第一个配送可以选择最后一个。


10)后选择并生成下载APNS证书并投入桌面并双击它。

11),然后打开钥匙链和转到证书。你可以展示你的推送服务打开,然后告诉你的私钥。

与1234密码导出。

12),现在你有以下的文件。

13),打开终端,并转到桌面。

14)使用以下行push_cert.p12文件生成.pem文件

  OpenSSL的PKCS12 -clcerts -nokeys退房手续APNS-DEV-cert.pem -in push_cert.p12

然后输入密码:-1234

15),使用以下行project_name_key.p12文件生成.pem文件

  OpenSSL的PKCS12 -nocerts退房手续APNS-DEV-ke​​y.pem -in project_name_key.p12

然后输入密码:-1234
输入PEM密码短语:1234
验证 - 输入PEM密码短语:1234

16),输入以下终端3行

  OpenSSL的RSA -in APNS-DEV-ke​​y.pem -out APNS-DEV-关键noenc.pem

输入密码短语APNS-DEV-ke​​y.pem:1234

 猫APNS-DEV-cert.pem APNS-DEV-键noenc.pem&GT; APNS-dev.pem

17)你有以下证书。

18)APNS-dev.pem文件服务器发送和它传递是1234

19)的发展就必须使用gateway.sandbox.push.apple.com服务器。
和分配可以使用gateway.push.apple.com服务器。

Using this link for generate pem file for push notification, but I can't understand following steps...

Installing the SSL Certificate and Key on the Server

You should install the SSL distribution certificate and private cryptographic key you obtained earlier on the server computer on which the provider code runs and from which it connects with the sandbox or production versions of APNs. To do so, complete the following steps:

  1. Open Keychain Access utility and click the My Certificates category in the left pane.

  2. Find the certificate you want to install and disclose its contents. You'll see both a certificate and a private key.

  3. Select both the certificate and key, choose File > Export Items, and export them as a Personal Information Exchange (.p12) file.

  4. Servers implemented in languages such as Ruby and Perl often are better able to deal with certificates in the Personal Information Exchange format. To convert the certificate to this format, complete the following steps:

    • In KeyChain Access, select the certificate and choose File > Export Items. Select the Personal Information Exchange (.p12) option, select a save location, and click Save.

    • Launch the Terminal application and enter the following command after the prompt: openssl pkcs12 -in CertificateName.p12 -out CertificateName.pem -nodes.

  5. Copy the .pem certificate to the new computer and install it in the appropriate place.

解决方案

finally i sloved generate push notification certifcates

complete step for generate push notification certificates.....

1) open key chain and request certificate show in below image.

2) change common name as your project_name.

3) in keychain open key you can show two key public and private

4) write click on private key and export it.

5) make name project_name_key.p12

6) add password ex-1234

7) enter system login password and save it. now you have following certificates.

8) now goto developer account (https://developer.apple.com/devcenter/ios/index.action) and goto identifier create new if not exits. and edit setting.

if push notification disable then enable it from edit.

9) for development you can create first one and distribution you can select last one.

10) after select and generate download apns certificate and put into desktop and double click on it.

11) then open key chain and goto certificates. and you can show your push service open then you show private key.

export it with 1234 password.

12) now you have following file.

13) open terminal and goto desktop.

14) generate .pem file using following line for push_cert.p12 file

openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in push_cert.p12

then enter password:-1234

15) generate .pem file using following line for project_name_key.p12 file

openssl pkcs12 -nocerts -out apns-dev-key.pem -in project_name_key.p12

then enter password:-1234 Enter PEM pass phrase:1234 Verifying - Enter PEM pass phrase:1234

16) enter following 3 line in terminal

openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem

Enter pass phrase for apns-dev-key.pem:1234

cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem

17) you have following certificate.

18) apns-dev.pem file send on server and it pass is 1234

19) for development you must use gateway.sandbox.push.apple.com server. and distribution you can use gateway.push.apple.com server.

这篇关于怎样才能在iPhone推送通知PEM文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆