Skip to content

Instantly share code, notes, and snippets.

@lamogura
Created December 9, 2012 11:07
Show Gist options
  • Save lamogura/4244293 to your computer and use it in GitHub Desktop.
Save lamogura/4244293 to your computer and use it in GitHub Desktop.
Convert ApplePushNotificationService Certy&KEY to PEM file
1) Convert to PEM format
These files now need to be converted to the PEM format by executing these 2 commands from the terminal:
openssl pkcs12 -clcerts -nokeys -out apns-prod-cert.pem -in apns-prod-cert.p12
openssl pkcs12 -nocerts -out apns-prod-key.pem -in apns-prod-key.p12
You will be forced to set a PEM passphrase on the second command, so execute the following command to remove it:
openssl rsa -in apns-prod-key.pem -out apns-prod-key-noenc.pem
2) Merge
Finally, you need to combine the key and cert files into a apns-prod.pem file we will use when connecting to APNS:
cat apns-prod-cert.pem apns-prod-key-noenc.pem > apns-prod.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment