Generating push certificates | Gamooga

Generating push certificates

Generating SSL Certificate for APP ID

  1. Log in to the iOS Dev Center and select the Certificates, Identifiers and Profiles
  2. Go to App IDs in the Identifiers Section of the sidebar and select your app if automatically created. Skip to Step 6.
  3. To create new App click + and fill the details for App ID, App Services (Check the push notification Checkbox) and Explicit App ID(Should be same as Bundle ID in your App)
  4. You will be asked to verify the details of the app id, if everything seems okay click Register.
  5. In the Push Notification row there are two orange lights that say “Configurable” in the Development and Distribution column.
  6. Select your App ID and click on EDIT.
  7. If Push Notification is not enabled, enable it to make it configurable.
  8. Select the Create Certificate in the Development/Production SSL Certificate
  9. In the next step it will ask you for generating a CSR

Generating the Certificate Signing Request

  1. Open Keychain Access on your Mac and choose the menu option Certificate Assistant -> Request a Certificate from a Certificate Authority
  2. Enter some descriptive name for Common Name (Give your app name appended by Gamooga preferably to identify it)
  3. Check Save to disk option and click continue
  4. In the Keys section of the Keychain Access, a new private key would have appeared with Common name specified
  5. Choose the CSR that you generated to create the push certificate
  6. Click Continue and download the certificate
  7. Double click on the downloaded certificate. This will add your certificate to your private key in your keychain
  8. Go to Keys section in the Keychain and find your private key
  9. You should be able to expand the private key and find your certificate with it. Select both the private key and the certificate after expanding (as shown in the snapshot).
  10. Right click on it to export it as .p12 file. Make sure you are exporting 2 items as shown´┐╝
  11. Name your file as your_app_name and save it with file format .p12
  12. You will be prompted to enter a password. Directly click Ok to save without any password.
  13. In the next step, you will require your system password to finally save the file.

Creating a pem file from p12 file

  1. Create Certificate .pem from Certificate .p12
    openssl pkcs12 -clcerts -nokeys -out your_app_name_cert.pem -in your_app_name.p12
  2. Create Key .pem from Key .p12
    openssl pkcs12 -nocerts -out your_app_name_key.pem -in your_app_name_key.p12
  3. Optional (If you have entered a passphrase asked in second step you need to remove it. This step is mandatory if you have entered a password to encrypt your key)
    openssl rsa -in your_app_name_key.pem -out your_app_name_key_noenc.pem
  4. Check certificate validity and connectivity to APNS
    If 3rd step is not performed

    openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert your_app_name_cert.pem -key your_app_name_key.pem

    If 3rd step had to be performed
    openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert your_app_name_cert.pem -key your_app_name_key_noenc.pem