Skip to content

Instantly share code, notes, and snippets.

@antongaenko
Last active April 17, 2017 18:58
Show Gist options
  • Save antongaenko/f3c92cf8d76abe1f8be0 to your computer and use it in GitHub Desktop.
Save antongaenko/f3c92cf8d76abe1f8be0 to your computer and use it in GitHub Desktop.
Create server APNS certificate
#!/bin/sh
#
# Install by copy/paste
# curl -O https://gist.githubusercontent.com/Just-/f3c92cf8d76abe1f8be0/raw/4181b5fce861037ec10c44c80250bb8a8c38f841/apns-certificate-creator.sh && chmod +x apns-certificate-creator.sh && cp apns-certificate-creator.sh /usr/local/bin/apns-certificate-creator
# Create APNS server certificate
# $1 - APNS SSL cert from developer.apple.com (.cer)
# $2 - developer private key exported from keychain (.p12)
# $3 - output certificate with password (.pem)
openssl x509 -in "$1" -inform der -out cert.pem
openssl pkcs12 -nocerts -out key.pem -in "$2"
cat cert.pem key.pem > "$3"
rm cert.pem key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment