How to use pem based key's in graphman
search cancel

How to use pem based key's in graphman

book

Article ID: 279499

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

The new version of graphman supports pem based key's but it is unclear how to use them instead of p12.

Resolution

When you update the graphman query to get a key by alias like in  the following example ,you can get the key in a  pem format from a existing key.

query keyByAlias($alias: String!) {

    keyByAlias(alias : $alias) {
        goid
        keystoreId
        alias
        checksum

        keyType
        subjectDn
        p12
        pem
        certChain
    }

 

 

The following graphman payload should work when you replace the example value in the subjectDn , pem and certChain field for the data from the previous query example.

{
  "keys": [
      {
      "keystoreId": "00000000000000000000000000000002",
      "alias": "some-key",
      "keyType": "RSA",
      "subjectDn": "CN=some-key",
      "pem": "-----BEGIN ENCRYPTED PRIVATE KEY-----\n <privatekeydata> \n-----END ENCRYPTED PRIVATE KEY-----\n",
      "certChain": [
      "-----BEGIN CERTIFICATE-----\n <certificatedata> \n-----END CERTIFICATE-----\n"
      ]
    }
  ]
}
 
}
You have to make sure to have installed the latest graphman client to support pem .