如何在 iphone 中为推送通知生成 pem 文件? [英] How can I generate pem file for push notifications in iphone?

查看:23
本文介绍了如何在 iphone 中为推送通知生成 pem 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用这个) 和 goto identifier create new if not exits.并编辑设置.

如果禁用推送通知,则从编辑中启用它.

9) 对于开发,您可以创建第一个,分发您可以选择最后一个.

10) 选择生成下载apns证书后放入桌面双击即可.

11) 然后打开钥匙链并转到证书.然后你可以显示你的推送服务打开然后你显示私钥.

使用 1234 密码导出.

12) 现在您有以下文件.

13) 打开终端并转到桌面.

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

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

然后输入密码:-1234

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

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

然后输入密码:-1234输入 PEM 密码:1234正在验证 - 输入 PEM 密码:1234

16) 在终端输入以下 3 行

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

输入 apns-dev-key.pem:1234 的密码短语

cat apns-dev-cert.pem apns-dev-key-noenc.pem >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天全站免登陆