Question

An APN server that I'm setting up tells me to...

After requesting the certificate from Apple, export your private key as a .p12 file and download the .cer file from the iOS Provisioning Portal.

Now, in the directory containing cert.cer and key.p12 execute the following commands to generate your .pem files:

$ openssl x509 -in cert.cer -inform DER -outform PEM -out cert.pem
$ openssl pkcs12 -in key.p12 -out key.pem -nodes

I have obtained the .cer from Apple but I do not know how to export my "private key" as a .p12. I'm guessing they just mean my private shh key? How do I convert that to a .p12?

I'm lost on exactly what they're looking for, where do i get the key.p12? Any help is much appreciated, thanks.

Was it helpful?

Solution

Creating the SSL Certificate and Keys

  1. In the provisioning portal of the iOS Dev Center, the team agent selects the application IDs for APNs. He also completes the following steps to create the SSL certificate:

  2. Click App IDs in the sidebar on the left side of the window. The next page displays your valid application IDs. An application ID consists of an application’s bundle ID prefixed with a ten-character code generated by Apple. The team admin must enter the bundle ID. For a certificate, it must incorporate a specific bundle ID; you cannot use a “wildcard” application ID.

  3. Locate the application ID for the development SSL certificate (and that is associated with the Development provisioning profile) and click Configure. You must see “Available” under the Apple Push Notification Service column to configure a certificate for this application ID.

  4. In the Configure App ID page, check the Enable Push Notification Services box and click the Configure button. Clicking this button launches an APNs Assistant, which guides you through the next series of steps.

  5. The first step requires that you launch the Keychain Access application and generate a Certificate Signing Request (CSR). Follow the instructions presented in the assistant. When you are finished generating a CSR, click Continue in Keychain Access to return to the APNs Assistant.

  6. When you create a CSR, Keychain Access generates a private and a public cryptographic key pair. The private key is put into your Login keychain by default. The public key is included in the CSR sent to the provisioning authority. When the provisioning authority sends the certificate back to you, one of the items in that certificate is the public key.

  7. In the Submit Certificate Signing Request pane, click Choose File. Navigate to the CSR file you created in the previous step and select it. Click the Generate button. While displaying the Generate Your Certificate pane, the Assistant configures and generates your Client SSL Certificate. If it succeeds, it displays the message “Your APNs Certificate has been generated.” Click Continue to proceed to the next step.

  8. In the next pane, click the Download Now button to download the certificate file to your download location. Navigate to that location and double-click the certificate file (which has an extension of cer) to install it in your keychain. When you are finished, click Done in the APNs Assistant. Double-clicking the file launches Keychain Access. Make sure you install the certificate in your login keychain on the computer you are using for provider development. In Keychain Access, ensure that your certificate user ID matches your application’s bundle ID. The APNs SSL certificate should be installed on your notification server.

When you finish these steps you are returned to the Configure App ID page of the iOS Dev Center portal. The certificate should be badged with a green circle and the label “Enabled”.

To create a certificate for the production environment, repeat the same procedure but choose the application ID for the production certificate.

Read all the details here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top