Does CredHub support certificate with key types in addition to RSA
search cancel

Does CredHub support certificate with key types in addition to RSA

book

Article ID: 419176

calendar_today

Updated On:

Products

VMware Tanzu Platform - Cloud Foundry

Issue/Introduction

You want to create a certificate on CredHub with non RSA private key such as ECDSA, it fails as below: 

$ credhub set -n  <PATH>  -t certificate -p <PRIVATE_KEY> -c <CERTIFICATE>
Private key is malformed. Key file does not contain an RSA private key

Cause

Non-RSA private key is not supported by CredHub. 

Resolution

If you need to store a ECDSA private key (in PEM or PKCS#8 format), you will have to use one of the generic credential types:

  • value: store the entire PEM-encoded ECDSA private key as a single string.
  • json: store the key along with metadata in a JSON object

Note: using these generic types means CredHub loses the ability to perform key-specific operations like key generation or rotation.