Created
August 26, 2013 06:34
-
-
Save rudyryk/6338583 to your computer and use it in GitHub Desktop.
Helper script for generating push notification certificates based on tutorial:
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Helper script for generating push notification certificates based on tutorial: | |
# http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1 | |
function show_help_and_exit | |
{ | |
echo "usage:" $0 \<certificate output\> \<private key output\> \<combined output\> | |
echo | |
echo "Input files are not specified, they are supposed to have" | |
echo "standard names: aps_development.cer and Certificates.p12." | |
echo | |
echo " example:" $0 MyCertificate.pem MyPrivateKey.pem MyCombined.pem | |
echo | |
exit | |
} | |
if [ "$1" != "" ]; then | |
openssl x509 -in aps_development.cer -inform der -out $1 | |
else | |
show_help_and_exit | |
fi | |
if [ "$2" != "" ]; then | |
openssl pkcs12 -nocerts -out $2 -in Certificates.p12 | |
else | |
show_help_and_exit | |
fi | |
if [ "$3" != "" ]; then | |
cat $1 $2 > $3 | |
else | |
show_help_and_exit | |
fi | |
echo "Now test connection with command:" | |
echo | |
echo " openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert $1 -key $2" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment