创建主密钥
<p><span style="font-size:18px"><strong>创建密钥:CreateCmk</strong></span></p>
<p><span style="font-size:14px"><strong>描述:</strong></span></p>
<p>创建用户主密钥(Customer Master Key, CMK)。主密钥可以直接用来对小包数据进行加密(一般小于4KB),同时也用来产生数据密钥(DataKey,DK),该数据密钥可用来对本地大量磁盘数据进行加解密操作。</p>
<p><span style="font-size:14px"><strong>请求参数:</strong></span></p>
<table border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td style="background-color:#ededed"><strong>名称</strong></td>
<td style="background-color:#ededed"><strong>类型</strong></td>
<td style="background-color:#ededed; width:69px"><strong>是否必需</strong></td>
<td style="background-color:#ededed; width:576px"><strong>描述</strong></td>
</tr>
<tr>
<td>description</td>
<td>String</td>
<td style="width:69px">否</td>
<td style="width:576px">密钥的描述</td>
</tr>
<tr>
<td>keyUsage</td>
<td>Integer</td>
<td style="width:69px">是</td>
<td style="width:576px">
<p>密钥用途。目前该版本仅支持值为0,默认传0。注:(0:"ENCRYPT/DECRYPT")</p>
</td>
</tr>
<tr>
<td>alias</td>
<td>String</td>
<td style="width:69px">是</td>
<td style="width:576px">密钥名称。注:唯一,不能重复</td>
</tr>
<tr>
<td>algorithm</td>
<td>String</td>
<td style="width:69px">是</td>
<td style="width:576px">加密算法。默认RSA(国际标准支持:RSA,国密标准支持SM2)</td>
</tr>
<tr>
<td>origin</td>
<td>Integer</td>
<td style="width:69px">是</td>
<td style="width:576px">
<p>密钥材料来源。支持平安金融云KMS平台产生、外部导入两种来源。注:(0: "平台产生"),(1:"外部导入")</p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-size:14px"><strong>返回参数:</strong></span></p>
<table border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td style="background-color:#ededed"><strong>名称</strong></td>
<td style="background-color:#ededed"><strong>类型</strong></td>
<td style="background-color:#ededed"><strong>描述</strong></td>
</tr>
<tr>
<td>code</td>
<td>String</td>
<td>返回码,成功返回"SUCCESS"</td>
</tr>
<tr>
<td>keyMetadata</td>
<td>KeyMetadata</td>
<td>返回密钥信息</td>
</tr>
<tr>
<td>requestId</td>
<td>String</td>
<td>当前请求Id</td>
</tr>
</tbody>
</table>
<p><span style="font-size:14px"><strong>KeyMetadata:</strong></span></p>
<table border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<td style="background-color:#ededed"><strong>名称</strong></td>
<td style="background-color:#ededed"><strong>类型</strong></td>
<td style="background-color:#ededed"><strong>描述</strong></td>
</tr>
<tr>
<td>keyId</td>
<td>String</td>
<td>密钥的全局唯一标识符</td>
</tr>
<tr>
<td>alias</td>
<td>String</td>
<td>密钥名称</td>
</tr>
<tr>
<td>keyUsage</td>
<td>String</td>
<td>密钥用途,加密/解密</td>
</tr>
<tr>
<td>description</td>
<td>String</td>
<td>密钥描述</td>
</tr>
<tr>
<td>creationDate</td>
<td>String</td>
<td>密钥创建时间(yyyy-MM-dd HH:mm:ss)</td>
</tr>
<tr>
<td>deleteDate</td>
<td>String</td>
<td>
<p>密钥预计被删除时间(yyyy-MM-dd HH:mm:ss)</p>
当该值为空时,表示密钥不会被删除。只有当密钥状态keyState是待删除PendingDeletion时,会返回这个参数</td>
</tr>
<tr>
<td>ownerId</td>
<td>String</td>
<td>密钥拥有者</td>
</tr>
<tr>
<td>keyState</td>
<td>String</td>
<td>密钥状态。0启用;1禁用;2待删除。</td>
</tr>
<tr>
<td>origin</td>
<td>String</td>
<td>密钥材料来源。</td>
</tr>
</tbody>
</table>
<p><span style="font-size:14px"><strong>请求示例:</strong></span></p>
<pre>
<code>https:// kms-cn-shanghai.ocftcloud.com/?action=CreateCmk
&keyUsage=0
&origin=<origin>
&alias=<your key alias>
&algorithm=<algorithm>
&description=<your key description>
&<公共请求参数></code></pre>
<p><span style="font-size:14px"><strong>返回示例:</strong></span></p>
<pre>
<code>{
"code":"SUCCESS",
"keyMetadata":{
"keyUsage":"ENCRYPT_DECRYPT",
"origin":"平安金融云产生",
"keyState":"ENABLE|已启用",
"keyId":"your key id",
"description":"key description example",
"alias":"your key alias",
"ownerId":"123456",
"creationDate":"2018-12-04 15:07:54"
}
"requestId":"53912b71-3435-409e-ad05-1882ced04f1f"
}</code></pre>
<p> </p>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!