Creating .pem file for APNS?

Biranchi picture Biranchi · Nov 19, 2009 · Viewed 155.7k times · Source

How do I create a .pem file to be stored in the hosting server for APN payload data?

Answer

zaph picture zaph · Nov 19, 2009

Here is what I did, From:blog.boxedice.com and "iPhone Advanced Projects" chapter 10 byJoe Pezzillo.

With the aps_developer_identity.cer in the keychain:

  1. Launch Keychain Access from your local Mac and from the login keychain, filter by the Certificates category. You will see an expandable option called “Apple Development Push Services”
  2. Right click on “Apple Development Push Services” > Export “Apple Development Push Services ID123″. Save this as apns-dev-cert.p12 file somewhere you can access it. There is no need to enter a password.
  3. The next command generates the cert in Mac’s Terminal for PEM format (Privacy Enhanced Mail Security Certificate):

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

On the server set the file permission of this unencrypted key by using chmod 400.