iOS push certificate from request to use

Source: Internet
Author: User
Tags openssl x509 pkcs12

On this topic, there are very many very good articles written. However, in their own process, even if others have written very well, still will encounter such a problem.

Let's write it again.

This document records the application for a certificate from scratch and can be notified at the end. Of course, the premise is that we have a suitable developer account.

preparatory work

1. Log in to the developer account, assuming the account's permissions are appropriate. We will see for example to:


Or the latest interface should be the following (just found page updated):


2. Click the menu in the red box. Will come to such as the following interface:


Create App ID

The app ID you want to create here is the bundle ID of our app.

3. Click "App IDs" on the left side. You'll see all the app IDs under your current account.

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

4. Click in the top right corner.


Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Add the description of this app ID under app ID description, such as "My Test app".


App ID prefix fill in the bundle ID of the app. Don't take the * number.


Under APP services, tick push notifications.


5. Click Continue. You'll see the information for the app ID you just created. For example, with:


6. Then click on the "App IDs" on the left side and you'll see one more of the list on the right.


Request a Certificate

Push certificates are divided into development certificates and production certificates. We take the production certificate as an example.

7. Click "Production" under "Certificates" on the left side to see all the production certificates under the current account

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

8. Click in the top right corner.

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

9. Select Apple Push Notification service SSL under production. Click Continue


10. Under App ID, select our new app ID. Click Continue


11. Click Continue. Come to such as the following interface. We need to upload a CSR file


Next, we will first generate the CSR file locally.

12. Open the Keychain (Keychain Access) program. Click Keychain Access in the upper-left corner to make choices such as


12. You will then see a hint like the following


13. Fill in the email and other information. Select Save to Disk. After clicking Continue. You are prompted to save the selected save location. Select the appropriate save location to save.

14. Proceed to step #11. We're going to upload the CSR file we just generated. Click "Choose file" to select the files we just generated. then click Continue. It will then come to such interfaces as the following:

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Then. Our certificate has been created. Click Download to download the certificate locally.

I create a directory called Cert on the desktop and place the certificate in that directory.

It will be used for a while.

Create provisioning Profile15. Click on the left side of the provisioning profiles under the distribution


16. Click in the top right corner.

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

17. Click on House under Distribution, click Continue


18. Under App ID, select our new app ID.

Click Continue


19. Select the account that the certificate we just created belongs to.

Click Continue


19. In Profile name. Enter the name of the profile. Click Continue

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Then. Our profile has been created. Click Download, download to local. I put the downloaded profile under the new Cert file in #14 step.

Generate a certificate for use by the server this step is to execute the SSL command on the basis of the certificate that we have already applied for. Generate a certificate for use by our server (that is, when our service is sending notifications. To load the appropriate certificate). 20. Open the Cert directory on the desktop. Double-click on our newly requested certificate and the certificate will be poured into keychain (Keychain Access).

Open the Keychain program, click Certificate, find our new certificate, right-click Export.

For example, with:
21. Enter the file name. Select the location that you want to save (I put it on the desktop).

Click Save

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">
22. When exporting, the input password is required. For example, with:
23. Enter password. Click OK.

The certificate is saved on the desktop

24. All right. The location you just saved is not good.

Drag the certificate you just exported to the Cert directory.

25. Under Cert, create a gen directory to copy the downloaded certificate and the exported certificate to Gen.

And under the Gen file, do the following rename, for example:

Download the certificate->developer_identity.cer

The exported certificate->MYKEY.P12

Note: This step is not required. can be omitted altogether. I just want to make it easier to use the next command (from here).

25. Open Terminal (Terminal) program, CD to Desktop Gen directory. Enter, for example, the following command:

OpenSSL x509-in developer_identity.cer-inform der-out developer_identity.pem-outform Pemopenssl pkcs12-nocerts-in my Key.p12-out mykey.pemopenssl pkcs12-export-inkey mykey.pem-in developer_identity.pem-out iphone_dev.p12
During this time, input password (the password of the exported certificate and the password of the newly generated certificate) will be required, as required. For example, with:


After execution is complete. Several files will be generated under Gen. The IPHONE_DEV.P12 is a certificate for use by the server.

Sign the program with the new certificate of course. We need to use a new certificate and profile when we pack.

For example: Under Project,
Under Target,

Next. It's packing.

Of course, you also need to implement notification push on the server.


References:

http://blog.csdn.net/kepoon/article/details/22672133

Http://stackoverflow.com/questions/7213074/notnoop-java-apns-push

Distributing Enterprise Apps

PPT of distributing Enterprise apps

iOS push certificate from request to use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.