Skip to content

Instantly share code, notes, and snippets.

@guruguruman
Last active August 29, 2015 14:02
Show Gist options
  • Save guruguruman/29b54b8e11114063677e to your computer and use it in GitHub Desktop.
Save guruguruman/29b54b8e11114063677e to your computer and use it in GitHub Desktop.
Create pem file from certificate and keys on Apple Push Notification Service (APNs).sh
################################################################################
#
# Apple Push Notification Certificate Creator v 0.1
#
################################################################################
#After exporting APNs certificates for development as "apns_dev.p12" and the one for production as "apns_pro.p12"
# Development
openssl pkcs12 -clcerts -nokeys -out apns_dev_cert.pem -in apns_dev.p12
openssl pkcs12 -nocerts -out apns_dev_key.pem -in apns_dev.p12
openssl rsa -in apns_dev_key.pem -out apns_dev_nopass_key.pem
cat apns_dev_cert.pem apns_dev_nopass_key.pem > apns_dev.pem
# Production
openssl pkcs12 -clcerts -nokeys -out apns_pro_cert.pem -in apns_pro.p12
openssl pkcs12 -nocerts -out apns_pro_key.pem -in apns_pro.p12
openssl rsa -in apns_pro_key.pem -out apns_pro_nopass_key.pem
cat apns_pro_cert.pem apns_pro_nopass_key.pem > apns_pro.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment