Convert GCP key from .pem to PKCS8
search cancel

Convert GCP key from .pem to PKCS8

book

Article ID: 377591

calendar_today

Updated On:

Products

CloudHealth

Issue/Introduction

If you source GCP key from .pem file and upload it then the account will show healthy, but won't pull in costs.

Resolution

The .pem file needs to be converted to PKCS8 first. You may refer the stackoverflow articles below

https://stackoverflow.com/questions/8290435/convert-pem-traditional-private-key-to-pkcs8-private-key
https://stackoverflow.com/questions/20065304/differences-between-begin-rsa-private-key-and-begin-private-key/20065522#20065522 

You can also use openssl

openssl pkcs8 -topk8 -inform PEM -outform DER -in filename -out filename -nocrypt
 
# openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in pkcs1.key -out pkcs8.key