Skip to content

Instantly share code, notes, and snippets.

@Rovel
Created December 12, 2018 20:09
Show Gist options
  • Save Rovel/d83ec7cb186d6e1be0b7f4a8e3833006 to your computer and use it in GitHub Desktop.
Save Rovel/d83ec7cb186d6e1be0b7f4a8e3833006 to your computer and use it in GitHub Desktop.
Commands to convert open ssl files

OpenSSL origina at: https://code.google.com/archive/p/apns-sharp/wikis/HowToCreatePKCS12Certificate.wiki Here is how to create a PKCS12 format file using open ssl, you will need your developer private key (which can be exported from the keychain) and the CertificateSigningRequest??.certSigningRequest

  • Convert apn_developer_identity.cer (der format) to pem:

openssl x509 -in apn_developer_identity.cer -inform DER -out apn_developer_identity.pem -outform PEM

  • Next, Convert p12 private key to pem (requires the input of a minimum 4 char password):

openssl pkcs12 -nocerts -out private_dev_key.pem -in private_dev_key.p12

(Optional): If you want to remove password from the private key:

openssl rsa -out private_key_noenc.pem -in private_key.pem

Take the certificate and the key (with or without password) and create a PKCS#12 format file:

openssl pkcs12 -export -in apn_developer_identity.pem -inkey private_key_noenc.pem -certfile CertificateSigningRequest??.certSigningRequest -name "apn_developer_identity" -out apn_developer_identity.p12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment