Generating .pem from .p12 for google cloud applications

Today I was trying to use the django app django-push-notifications to work with Google cloud messaging. However, the app required .pem file as input. After some research, I found out how to get the file. Following are the steps.

  1. Create new client ID from respective project in Google cloud console.
  2. Choose Service account and save the .p12 file.
  3. While saving it will show the password, note it down. I guess default password key is 'notasecret'.
  4.  Now download openssl binary from the openssl download page.
  5. Depending on your operating system the files might vary. I am using openssl on windows x64 box.
  6. Extract files to a folder.
  7. Now from command line navigate to the folder and run
    openssl pkcs12 -in path/to/key.p12 -nodes -nocerts > path/to/key.pem
  8. You can find more information about authentication in this page.

No comments :

Post a Comment