2
votes

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

2
Did you ever find the solution for this? Having the same problem here.Wim Haanstra
No, unfortunately I have not found a solution for this yet.jsherk

2 Answers

1
votes

I haven't tried this on Mac, but there is instruction from Adobe (read the second part) how to do this on Windows. AFAIK openssl cli for Mac and Window has has common interface.

0
votes

I had to do this in order to get the certificates to play nice with our .NET push provider service application, so I turned the conversion process into a shell script. I'm not an expert on the tools being used in the process, so feedback would be appreciated, but it certainly is working for us.

Check the script's opening comments for the steps necessary to get it all to work, and it should spit out a usage line to you if you don't use it properly.

https://gist.github.com/misterwell/7e27d7396724580352f1