Skip to content

Instantly share code, notes, and snippets.

@niw
niw / create_apple_push_pem.sh
Created January 7, 2012 04:53
Create combined PEM file from private key and certificate for Apple Push Notification.
#!/bin/sh
if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage: $0 private_key.p12 certificate.{p12, der}"
echo "You can export the private key (and certificate) in PKCS12 format from Keychain.app."
exit 0
fi
# Create private key in PEM format from PKCS12 format without password.
openssl pkcs12 -in "$1" -nocerts -nodes -out _key.pem