Yoshua Nahar
Yoshua Nahar

Reputation: 1344

Azure Keyvault Sign API - Response body “value” encoding format

When I do a post request to the Azure Key Vault Sign API: https://pkitstencryptkeyvault.vault.azure.net/keys/openssl-rbi-test/1ccc8fc0e0224bb1a65eb159e2b12df1/sign?api-version=7.0 with body:

{
    "alg": "ES256",
    "value": "RkQ4y5rDgxeaaOzeqeAFT3IGLAEZMz2ztbTbMNzxuMc"
}

The response is:

{
    "kid": "https://pkitstencryptkeyvault.vault.azure.net/keys/openssl-rbi-test/1ccc8fc0e0224bb1a65eb159e2b12df1",
    "value": "d9J4G06FRMBEKy_FJJj1PEAXhtlezvd6-3_5yo9yeYAFZ_Du583AJzqu3NMTzJAUMoKhnVBx2obnkM0gI1LnoQ"
}

I can't find that information on the Azure Sign API doc.

So what is the format of the value in the response body?

I'm asking this, because when I send a verify request to: https://pkitstencryptkeyvault.vault.azure.net/keys/openssl-rbi-test/1ccc8fc0e0224bb1a65eb159e2b12df1/verify?api-version=7.0 with body:

{
    "alg": "ES256",
    "value": "d9J4G06FRMBEKy_FJJj1PEAXhtlezvd6-3_5yo9yeYAFZ_Du583AJzqu3NMTzJAUMoKhnVBx2obnkM0gI1LnoQ"
}

I get the following error:

{
    "error": {
        "code": "BadParameter",
        "message": "Property  has invalid value\r\n"
    }
}

Upvotes: 1

Views: 548

Answers (1)

Michiel Leegwater
Michiel Leegwater

Reputation: 1180

Although the example does not show it: The digest parameter is missing in your verify request body. This parameter is defined in the API.

Upvotes: 1

Related Questions