CreateKey#

Description#

Creates a KMS key. You can use the KMS key to perform cryptographic operations.

Request Parameters#

  • Description — The description of the KMS key.

    • Type: String

    • Required: No

    • Default value: Empty string

    • Length constraints: From 0 to 8192 characters

  • KeySpec — The KMS key type. By default, a 256-bit AES-GCM KMS key is created.

    • Type: String

    • Required: No

    • Valid values: SYMMETRIC_DEFAULT

    • Default value: SYMMETRIC_DEFAULT

Response Elements#

  • KeyMetadata — The KMS key metadata.

Examples#

Sample Request#

POST / HTTP/1.1
Host: kms.<region>.<domain>
Content-Length: <PayloadSizeBytes>
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature>
X-Amz-Date: <Date>
X-Amz-Target: TrentService.CreateKey

{}

Sample Response#

HTTP/1.1 200 OK
Content-Type: application/x-amz-json-1.1

{
    "KeyMetadata": {
        "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
        "CreationDate": 1774428072.694000,
        "Enabled": true,
        "Description": "",
        "KeyState": "Enabled",
        "KeySpec": "SYMMETRIC_DEFAULT"
    }
}