I am able to generate the required .pem file for Apple Push Notification Service by using the following method:
On Mac, use Keychain Access app to create CSR from Private Key and upload to Provisioning Portal and generate the required Certificate. Download the .cer file and drag/drop it into Keychain Access app. Select both this .cer file and the Private Key and choose Export 2 Items. Save it as .p12 file. Use openssl to convert .p12 to .pem
This method all works fine, except I want to create a script to automate this more.
So is there a way to use Terminal (bash script, Apple script) to create the .p12 file from the downloaded .cer file) and the Private Key stored in Keychain Access?
Thanks