Updated on 2025-12-02 GMT+08:00

Creating a Key

This section describes how to create a custom key on the KMS console.

Custom keys can be categorized into symmetric keys and asymmetric keys.

Prerequisites

When you create a key as an IAM user, you have granted the KMS CMKFullAccess or higher permissions to the IAM user. For details, see Creating a User and Authorizing the User the Permission to Access DEW.

Constraints

  • You can create up to 20 custom keys, excluding default keys.
  • Symmetric keys are created using the AES key. The AES-256 key can be used to encrypt and decrypt a small amount of data or data keys.
  • Asymmetric keys are created using RSA or ECC algorithms. RSA keys can be used for encryption, decryption, digital signature, and signature verification. ECC keys can be used only for digital signature and signature verification.
  • Aliases of default keys end with /default. When choosing aliases for your custom keys, do not use aliases ending with /default.
  • DEW does not limit the number of times that a key can be called.

Scenarios

  • Encrypt data in OBS.
  • Encrypt data in EVS.
  • Encrypt data in IMS.
  • Encrypt an RDS DB instance.
  • Use custom keys to directly encrypt and decrypt small volumes of data.
  • DEK encryption and decryption for user applications
  • Message authentication code generation and verification
  • Asymmetric keys can be used for digital signatures and signature verification.

Creating a Key

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select a region or project.
  3. Click on the left and choose Security > Data Encryption Workshop.
  4. Click Create Key in the upper right corner.
  5. Configure the parameters as follows:

    • Key Algorithm: Select a key algorithm. For more information, see Table 1.
      Table 1 Key algorithms supported by KMS

      Key Type

      Algorithm Type

      Key Specifications

      Description

      Application Scenario

      Symmetric key

      AES

      AES_256

      AES symmetric key

      • Data encryption and decryption
      • DEKs encryption and decryption
        NOTE:

        You can encrypt and decrypt a small amount of data using the online tool on the console.

        You need to call APIs to encrypt and decrypt a large amount of data.

      Asymmetric key

      RSA

      • RSA_2048
      • RSA_3072
      • RSA_4096

      RSA asymmetric password

      • Digital signature and signature verification
      • Data encryption and decryption
        NOTE:

        Asymmetric keys are applicable to signature and signature verification scenarios. Asymmetric keys are not efficient enough for data encryption. Symmetric keys are suitable for encrypting and decrypting data.

      ECC

      • EC_P256
      • EC_P384

      Elliptic curve recommended by NIST

      Digital signature and signature verification

    • Usage: Select SIGN_VERIFY or ENCRYPT_DECRYPT.
      • For an AES_256 symmetric key, the default value is ENCRYPT_DECRYPT.
      • For RSA asymmetric keys, select ENCRYPT_DECRYPT or SIGN_VERIFY. The default value is SIGN_VERIFY.
      • For an ECC asymmetric key, the default value is SIGN_VERIFY.

      The key usage can only be configured during key creation and cannot be modified afterwards.

    • The Enterprise Project parameter needs to be set only for enterprise users.

      If you are an enterprise user and have created an enterprise project, select the required enterprise project from the drop-down list. The default project is default.

      If there are no Enterprise Management options displayed, you do not need to configure it.

  6. Click OK.

Related Operations

  • For details about how to upload objects with server-side encryption, see section "Uploading a File with Server-Side Encryption" in Object Storage Service (OBS) User Guide.
  • For details about how to encrypt data on EVS disks, see section "Creating an EVS Disk" in Elastic Volume Service (EVS) User Guide.
  • For details about how to encrypt private images, see section "Encrypting an Image" in Image Management Service (IMS) User Guide.
  • For details about how to encrypt disks for a database instance in RDS, see section "Purchasing an Instance" in the Relational Database Service User Guide.
  • For details about how to create a DEK and a plaintext-free DEK, see sections "Creating a DEK" and "Creating a Plaintext-Free DEK" in Data Encryption Workshop API Reference.
  • For details about how to encrypt and decrypt a DEK for a user application, see sections "Encrypting a DEK" and "Decrypting a DEK" in Data Encryption Workshop API Conference.