After requesting the certificate from Apple (to do this, go to Apple Developer site -> APNs Auth key -> [+]),
download the .cer file (usually named aps_production.cer or aps_development.cer) from the iOS Provisioning Portal, save in a clean directory, and import it into Keychain Access.
It should now appear in the keyring under the "Certificates" category, as Apple Push Services. Inside the certificate you should see a private key (only when filtering for the "Certificates" category).
Export this private key as a .p12 file:
- Right click in the certificate we are interested in Keychain and select Export...
- Accept the default
.p12file format and then click Save