Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
298 views
in Technique[技术] by (71.8m points)

ios - How can I generate pem file for push notifications in iphone?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

enter image description here

2) change common name as your project_name.

enter image description here

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

enter image description here

4) write click on private key and export it.

enter image description here

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.

enter image description here

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

enter image description here enter image description here

if push notification disable then enable it from edit.

enter image description here

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

enter image description here enter image description here

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.

enter image description here

12) now you have following file.

enter image description here

13) open terminal and goto desktop.

enter image description here

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

enter image description here

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

enter image description here

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

enter image description here

17) you have following certificate.

enter image description here

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...