This API is used to create customer master keys (CMKs) used to encrypt data encryption keys (DEKs).
Default Master Keys are created by services integrated with KMS. Names of Default Master Keys end with /default. Therefore, in naming your CMKs, do not choose those ending with /default.
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Content-Type |
Yes |
String |
application/json |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
key_alias |
Yes |
String |
Alias of a non-default master key (The alias's length ranges from 1 to 255 characters and matches the regular expression ^[a-zA-Z0-9:/_-]{1,255}$. In addition, it must be different from the alias of a Default Master Key created by the system.) |
key_spec |
No |
String |
Key generation algorithm. The default value is AES_256. The value can be:
|
key_usage |
No |
String |
Key usage. The default value is ENCRYPT_DECRYPT for a symmetric key and SIGN_VERIFY for an asymmetric key. Possible values are as follows:
|
key_description |
No |
String |
CMK description (The value ranges from 0 to 255 characters.) |
origin |
No |
String |
Origin of a CMK. The default value is kms. The following values are enumerated:
|
sequence |
No |
String |
A 36-byte serial number of a request message. For example, 919c82d4-8046-4722-9094-35c3c6524cff |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
key_info |
Yes |
Array of objects |
Information about keys. For details, see Table 5. |
The following example describes how to create a CMK with an alias of test.
{
"key_alias": "test"
}
{
"key_info": {
"key_id": "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
"domain_id": "b168fe00ff56492495a7d22974df2d0b"
}
}
or
{
"error": {
"error_code": "KMS.XXXX",
"error_msg": "XXX"
}
}
Exception status code. For details, see Status Codes.