创建主密钥

<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:&quot;ENCRYPT/DECRYPT&quot;)</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: &quot;平台产生&quot;),(1:&quot;外部导入&quot;)</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>返回码,成功返回&quot;SUCCESS&quot;</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 &amp;keyUsage=0 &amp;origin=&lt;origin&gt; &amp;alias=&lt;your key alias&gt; &amp;algorithm=&lt;algorithm&gt; &amp;description=&lt;your key description&gt; &amp;&lt;公共请求参数&gt;</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>&nbsp;</p>
以上内容是否解决了您的问题?
请补全提交信息!
联系我们

电话咨询

400-151-8800

邮件咨询

fincloud@ocft.com

在线客服

工单支持

解决云产品相关技术问题