Generate a Data Encryption Key from a given KMS Key.
Responses
-
Data Encryption Key in the clear and in its base64 encoded encrypted format.
-
Errors
Key Not Found: The request was rejected because the specified KMS Key could not be found.
Key is Disabled: The request was rejected because the specified KMS key is disabled.
Invalid Usage: The request was rejected because the operation is only allowed on symmetric keys with usage "encrypt-decrypt".
POST
/kms-key/{id}/generate-data-key
curl \
--request POST 'https://api-ch-gva-2.exoscale.com/v2/kms-key/{id}/generate-data-key' \
--header "Content-Type: application/json" \
--data '{"key-spec":"AES-256","bytes-count":42,"encryption-context":"string"}'
Request examples
{
"key-spec": "AES-256",
"bytes-count": 42,
"encryption-context": "string"
}
Response examples (200)
{
"plaintext": "string",
"ciphertext": "string"
}
Response examples (400)
{
"type": "string",
"title": "string",
"status": 42,
"detail": "string"
}