Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

Generating Certificates

Julian Russell edited this page Jun 17, 2013 · 6 revisions

Mac OSX

  1. Open up Keychain Access and select the Certificates category in the sidebar.
  2. Expand the disclosure arrow next to the iOS Push Services certificate you want to export.
  3. Select both the certificate and private key.
  4. Right click and select Export 2 items....
  5. Save the file as cert.p12, make sure the File Format is Personal Information Exchange (p12).
  6. Convert the certificate to a .pem, where <environment> should be sandbox or production, depending on the certificate you exported.

Without a password

openssl pkcs12 -nodes -clcerts -in cert.p12 -out <environment>.pem

With a password

openssl pkcs12 -clcerts -in cert.p12 -out <environment>.pem

Linux

Exporting to p12 (steps 1 to 5 above):

openssl pkcs12 -export -in certificate.pem -inkey privkey.pem  -out cert.p12

To join the certificate and private key to a single .pem file:

Without a password

openssl pkcs12 -nodes -clcerts -in cert.p12 -out <environment>.pem

With a password

openssl pkcs12 -clcerts -in cert.p12 -out <environment>.pem