tencent cloud

Key Management Service

Product Introduction
Product Overview
Product Strengths
Use Cases
Concepts
Purchase Guide
Billing Overview
Purchase Method
Renewal Instructions
Payment Overdue
Console Guide
Getting Started
Key Management
Access Control
Audit
TCCLI Management Guide
Operation Overview
Creating Key
Viewing Key
Editing Key
Enabling/Disabling Key
Key Rotation
Encryption and Decryption
Asymmetric key decryption
Deleting Key
Practical Tutorial
Symmetrical Encryption and Decryption
Asymmetric Encryption and Decryption
Post-Quantum Cryptography Practice In KMS
Importing External Key
Implementing Exponential Backoff to Deal with Service Frequency
Cloud Product Integration with KMS for Transparent Encryption
API documentation
History
Introduction
API Category
Key APIs
Making API Requests
Asymmetric Key APIs
Data Types
Error Codes
Service Level Agreement
FAQS
FAQs
General
KMS Policy
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Creating Key

PDF
Focus Mode
Font Size
Last updated: 2024-01-11 16:28:54

Overview

The CreateKey API can be called to create a customer master key (CMK) used for DEK management. The CMK can be used in other APIs to create DEKs, perform encryption and decryption, and do more.
The Alias parameter is required for this API. You can add other descriptions for the CMK as instructed in the CreateKey API document.
The examples below are called with TCCLI, which can also be called with any supported programming languages.

Examples

This example shows you how to create a key named test-gz01 in Guangzhou region with the description this is test for gz key.

Input

tccli kms CreateKey --region ap-guangzhou --Alias test-gz01 --Description 'this is test for gz key'

Output

After creation, the key will be enabled by default, with the key rotation feature disabled.
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09",
"Description": "this is test for gz key",
"Alias": "test-gz01",
"KeyUsage": "ENCRYPT_DECRYPT",
"RequestId": "994bbd90-7c8e-4522-85f2-c712da23f863",
"KeyState": "Enabled",
"CreateTime": 1571903621
}

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback