When using any services for your iOS device such as Push Notifications, you need to generate a certificate. It’s quite simple when using Mac OS X as all Apple’s instructions are geared towards it. What do you do, however, if you’re using a Windows machine. There are a few more steps involved, but the whole process is simple enough.
Before you get started, ensure that you have IIS installed on your machine as we’ll need that to generate the certificate request.
To get started, open the Provisioning Portal on Apple’s developer site and add whatever certificate you need. You’ll be promoted with this dialog.
Open the IIS manager, select the machine name on the left hand side and look for the Server Certificates icon in the Features section and double click.
Opening the Server Certificates feature will create a menu on the right hand side of the screen. The second option in that menu list is the “Create Certificate Request”. This will allow us to generate the file that Apple requires in order to generate our certificate.
Click this option opens the Request Certificate wizard.
Fill this form out with some basic details. The Common name I always fill with my email address, but put whatever values you feel are appropriate here.
Next, select the type of request. I always select a key length of 2048. I don’t know what OS X does here, so if anyone knows what size of certificate they request, please let me know in the comments. Click Next to continue.
Next, just select a location to save the request to and hit Finish. Return to the Apple provisioning portal.
Choose the file you’ve just created and hit Generate.
Apple will now generate the certificate file.
We now have the certificate, but this doesn’t contain the private key. We need to complete the process. Hit download and save the cert somewhere. Return to IIS’s Server Certificate Feature. In the menu on the right hand side, as before, you’ll see an option called Complete Certificate Request.
Select the Cert you’ve just downloaded and give it a friendly name. Hit OK. This step will effectively join our Certificate Request with Apple’s certificate to produce a full certificate with both public and private keys. You should now see the certificate in IIS. NOTE: Please ignore the typo in the Friendly name field. Thanks to @nickg_uk for pointing it out!.
You can also choose to export this certificate. If you do, choose the PFX file type to include the Private Key. Once you’ve exported it to a file, you can import it into your certificate store for later use.
I hope this has been helpful and easy to follow. If you have any comments or suggestions on it, please use the comments section below!