azure create csr keytype issue

azure 1 Reputation point
2021-08-24T17:23:17.5+00:00

while i am creating azure certificate using keytype EC getting error.

 "key_props": {
      "exportable": true,
      "kty": "EC",
      "key_size": P-256,
      "reuse_key": false
    },

this is the json object with key type ec passing i am getting below error. Please help me how to use key type EC to create certificate

Error: "error": { "code": "BadParameter", "message": "Property policy.key_props has invalid value. Invalid Kty EC\r\n" }

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,451 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 36,911 Reputation points Microsoft Employee Moderator
    2021-08-25T22:22:13.72+00:00

    @azure
    Thank you for your post!

    In order to create an EC certificate, you'll have to add the appropriate parameters to the key properties section, I'll share my JSON Body below to hopefully help resolve your issue.

    EC JSON Body:

    • Added the key property crv, which is the JsonWebKeyCurveName.
    • Changed kty, the JsonWebKeyType to EC
    • Changed the key_size to one of the supported sizes - 256, 384, 521 {
      "policy": {
      "key_props": {
      "exportable": true,
      "crv": "P-256",
      "kty": "EC",
      "key_size": 256,
      "reuse_key": false
      },
      "secret_props": {
      "contentType": "application/x-pkcs12"
      },
      "x509_props": {
      "subject": "CN=*.microsoft.com",
      "sans": {
      "dns_names": [
      "onedrive.microsoft.com",
      "xbox.microsoft.com"
      ]
      }
      },
      "issuer": {
      "name": "Self"
      }
      }
      }

    126511-image.png

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.


    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.