Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've started playing around with Google's Cloud Platform recently and one of the first things I wanted to do was to secure my app's static pages so they could be delivered over HTTPS. This meant that I needed to upload my certificate and private key to Google. I went ahead and generated my key as usual and I thought I had an RSA key already, but Google didn't seem to like it.

This was the error I was getting - "The private key that you've seleted does not appear to be valid."
invalid_private_key.png


I did some searching around and it appeared that my key had to be converted first. The header of my key started with:
 Private Key
-----BEGIN PRIVATE KEY-----


That was a sign that Google wouldn't accept that key. Luckily openssl can easily convert the key to an expected format with the following command:
 Terminal
openssl rsa -in private_key.rsa -out private_key2.rsa


Now after loading the second, converted, RSA key, Google accepted it without error!



-i

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.