有奖捉虫:办公协同&微信生态&物联网文档专题 HOT

概述

调用 CreateKey 来创建用户管理数据密钥的主密钥 CMK(Custom Master Key),后续可以通过 CMK 来调用其他接口,例如创建数据密钥、加解密等操作。
该 API 操作中的 Alias 为必选参数,您可以查看 CreateKey 接口文档来对 CMK 添加其他描述。

本文示例使用腾讯云 命令行工具 TCCLI,后续您可以使用任何受支持的编程语言调用。

示例

创建一个广州区域,密钥名称为 test-gz01,密钥描述为 this is test for gz key 的 CMK。

输入

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

输出

该密钥创建后默认启用,并且默认禁用密钥轮换功能。
{
"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
}