Skip to content

Instantly share code, notes, and snippets.

@nuthatch
Created February 20, 2012 21:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuthatch/1871625 to your computer and use it in GitHub Desktop.
Save nuthatch/1871625 to your computer and use it in GitHub Desktop.
Automate conversion of Apple Push Certificates into .p12 format for Urban Airship
#!/bin/bash
if [ -e aps_production.cer ]
then
echo "Converting production push certificate"
security -v create-keychain -p '' temp-production.keychain
security -v import aps_production.cer -k temp-production.keychain
security -v export -k temp-production.keychain -f pkcs12 -P '' -o push-production.p12
security -v delete-keychain temp-production.keychain
fi
if [ -e aps_development.cer ]
then
echo "Converting development push certificate"
security -v create-keychain -p '' temp-development.keychain
security -v import aps_development.cer -k temp-development.keychain
security -v export -k temp-development.keychain -f pkcs12 -P '' -o push-development.p12
security -v delete-keychain temp-development.keychain
fi
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment