搜索本产品文档关键词
GenerateDataKey
所有文档
menu

密钥管理服务 KMS

GenerateDataKey

GenerateDataKey

  • 接口描述

使用指定的CMK生成Data Key

  • 请求URI
Plain Text
1POST /?action=GenerateDataKey

请求体参数

  • 请求体字段数据结构说明
参数
类型
是否必需
描述
示例值
keyId String CMK的密钥Id 5be45b47-38ba-f055-e892-25ff66c91adc
keySpec String AES_128, AES_256 要生成的密钥规格
numberOfBytes Integer 要生成的data key的长度, 当numberOfBytes 和 keySpec都设置时,以numberOfBytes为准

响应体参数

  • 响应体字段数据结构说明
参数
类型
描述
示例值
keyId String CMK的密钥Id 5be45b47-38ba-f055-e892-25ff66c91adc
plaintext String datakey明文,base64编码
ciphertext Integer datakey密文,base64编码

请求示例

Plain Text
1HTTP/1.1 200 OK
2<公共响应头>
3
4{
5  "keyId" : "ab0cc017-c50f-f4c4-e125-2779a4d969de",
6  "numberOfBytes":16,
7}

响应示例

Plain Text
1POST /?action=GenerateDataKey
2<公共请求头>
3
4
5{
6  "keyId" : "ab0cc017-c50f-f4c4-e125-2779a4d969de",
7  "plaintext":"cGxhaW50ZXh0IHBsYWludGV4dCBwbGFpbnRleHQK",
8  "ciphertext":"Y2lwaGVydGV4dCBjaXBoZXJ0ZXh0IGNpcGhlcnRleHQgaW5mbwo"
9}
上一篇
CreateKey
下一篇
错误码