question

azure-7678 avatar image
0 Votes"
azure-7678 asked JamesTran-MSFT commented

azure create csr keytype issue

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JamesTran-MSFT avatar image
0 Votes"
JamesTran-MSFT answered JamesTran-MSFT commented

@azure-7678
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.


image.png (78.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@azure-7678
I just wanted to check in and see if you had any other questions or if you were able to resolve this issue?

0 Votes 0 ·