doc-exports/docs/kms/api-ref/kms_02_0036.html
Li, Qiao dfe65b9551 KMS API 20230817 version.
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: Li, Qiao <qiaoli@huawei.com>
Co-committed-by: Li, Qiao <qiaoli@huawei.com>
2024-04-02 13:42:22 +00:00

144 lines
15 KiB
HTML

<a name="kms_02_0036"></a><a name="kms_02_0036"></a>
<h1 class="topictitle1">Importing CMK Material</h1>
<div id="body1501490663475"><div class="section" id="kms_02_0036__en-us_topic_0112992337_section2809137816511"><h4 class="sectiontitle">Function</h4><p id="kms_02_0036__en-us_topic_0112992337_p4072185016521">This API allows you to import CMK material.</p>
</div>
<div class="section" id="kms_02_0036__en-us_topic_0112992337_section3802320916511"><h4 class="sectiontitle">URI</h4><ul id="kms_02_0036__en-us_topic_0112992337_ul5998110316511"><li id="kms_02_0036__en-us_topic_0112992337_li295902016511">URI format<p id="kms_02_0036__en-us_topic_0112992337_p58775332165237"><a name="kms_02_0036__en-us_topic_0112992337_li295902016511"></a><a name="en-us_topic_0112992337_li295902016511"></a>POST /v1.0/{project_id}/kms/import-key-material</p>
</li><li id="kms_02_0036__en-us_topic_0112992337_li3835404516511">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0036__en-us_topic_0112992337_table964209216511" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="kms_02_0036__en-us_topic_0112992337_row1607974516511"><th align="left" class="cellrowborder" valign="top" width="22.74%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="kms_02_0036__en-us_topic_0112992337_p2739096916511"><strong id="kms_02_0036__en-us_topic_0112992337_b842352706195551">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.919999999999998%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="kms_02_0036__en-us_topic_0112992337_p407603016511"><strong id="kms_02_0036__en-us_topic_0112992337_b842352706195553">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.55%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="kms_02_0036__en-us_topic_0112992337_p6172299916511">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.79%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="kms_02_0036__en-us_topic_0112992337_p3350702116511">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0036__en-us_topic_0112992337_row2971415116511"><td class="cellrowborder" valign="top" width="22.74%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="kms_02_0036__en-us_topic_0112992337_p5803601316511">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.919999999999998%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="kms_02_0036__en-us_topic_0112992337_p329664916511">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.55%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="kms_02_0036__en-us_topic_0112992337_p4386100291125">String</p>
</td>
<td class="cellrowborder" valign="top" width="40.79%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="kms_02_0036__en-us_topic_0112992337_p2026050816511">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="kms_02_0036__en-us_topic_0112992337_section4812685216511"><h4 class="sectiontitle">Requests</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0036__en-us_topic_0112992337_table1307199216511" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="kms_02_0036__en-us_topic_0112992337_row2216064416511"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.1"><p id="kms_02_0036__en-us_topic_0112992337_p16445506549"><strong id="kms_02_0036__en-us_topic_0112992337_b815402140">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.3.2.2.5.1.2"><p id="kms_02_0036__en-us_topic_0112992337_p19645165016541"><strong id="kms_02_0036__en-us_topic_0112992337_b158968825">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.3"><p id="kms_02_0036__en-us_topic_0112992337_p26451450155411">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.2.5.1.4"><p id="kms_02_0036__en-us_topic_0112992337_p126453508548">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0036__en-us_topic_0112992337_row990996316511"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0036__en-us_topic_0112992337_p6450954916511">key_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0036__en-us_topic_0112992337_p5865974316511">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0036__en-us_topic_0112992337_p739071615716">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0036__en-us_topic_0112992337_p5381875116511">36-byte ID of a CMK that matches the regular expression <span class="parmvalue" id="kms_02_0036__en-us_topic_0112992337_parmvalue80435593163333"><b>^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$</b></span></p>
<p id="kms_02_0036__en-us_topic_0112992337_p4509346016511">Example: 0d0466b0-e727-4d9c-b35d-f84bb474a37f</p>
</td>
</tr>
<tr id="kms_02_0036__en-us_topic_0112992337_row2869160916511"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0036__en-us_topic_0112992337_p1322852165315">import_token</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0036__en-us_topic_0112992337_p2539755516511">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0036__en-us_topic_0112992337_p1839414165712">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0036__en-us_topic_0112992337_p43447950172527">CMK import token in Base64 format that matches the regular expression <strong id="kms_02_0036__en-us_topic_0112992337_b84235270616524">^[0-9a-zA-Z+/=]{200,6144}$</strong></p>
</td>
</tr>
<tr id="kms_02_0036__en-us_topic_0112992337_row4675342116511"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0036__en-us_topic_0112992337_p35037151172738">encrypted_key_material</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0036__en-us_topic_0112992337_p3090833716511">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0036__en-us_topic_0112992337_p1139612168718">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0036__en-us_topic_0112992337_p79390172758">Encrypted CMK material in Base64 format that matches the regular expression ^[0-9a-zA-Z+/=]{344,360}$</p>
</td>
</tr>
<tr id="kms_02_0036__en-us_topic_0112992337_row19978824172316"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0036__en-us_topic_0112992337_p35515283172331">expiration_time</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0036__en-us_topic_0112992337_p45942097172315">No</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0036__en-us_topic_0112992337_p22936807172315">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0036__en-us_topic_0112992337_p6745480102415">Expiration time of the key material. The value is a timestamp expressed in the number of seconds since 00:00:00 UTC on January 1, 1970. KMS will delete the key material within 24 hours after the expiration.</p>
<p id="kms_02_0036__en-us_topic_0112992337_p4189223172358">Example: 1550291833</p>
</td>
</tr>
<tr id="kms_02_0036__en-us_topic_0112992337_row32405724172319"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0036__en-us_topic_0112992337_p43470570172317">sequence</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0036__en-us_topic_0112992337_p64847261172317">No</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0036__en-us_topic_0112992337_p16911172712717">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0036__en-us_topic_0112992337_p3371101522920">36-byte serial number of a request message</p>
<p id="kms_02_0036__en-us_topic_0112992337_p18136822172317">Example: 919c82d4-8046-4722-9094-35c3c6524cff</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0036__en-us_topic_0112992337_section5661868116511"><h4 class="sectiontitle">Responses</h4><p id="kms_02_0036__en-us_topic_0112992337_p8755536173534">None</p>
</div>
<div class="section" id="kms_02_0036__en-us_topic_0112992337_section1169411326275"><h4 class="sectiontitle">Examples</h4><p id="kms_02_0036__en-us_topic_0112992337_p10112152812">The following example describes how to import the CMK material and the import-token to the CMK whose ID is <span class="parmvalue" id="kms_02_0036__en-us_topic_0112992337_parmvalue1637406680201154"><b>bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e</b></span>, and set the expiration time of the CMK material to <span class="parmvalue" id="kms_02_0036__en-us_topic_0112992337_parmvalue2047658191201313"><b>1521578672</b></span>.</p>
<ul id="kms_02_0036__en-us_topic_0112992337_ul3743143292713"><li id="kms_02_0036__en-us_topic_0112992337_li5743163219273">Example request<pre class="screen" id="kms_02_0036__en-us_topic_0112992337_screen2074353222713">{
"key_id": "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
"import_token":"AACIBjY2ZTQxYjBmLTY3ZWItNDU4Ny04OTIxLWVhZTVhZjg5NDZmYQAAuihvPN7Hly3uhp7cWw4cfuwDIem9mGwaIl7/HTx10+8ENsRR4FB7DCR+zG1s7UIZMAZRLx7LD1lkXY+rfN5ibDOOHZkoIiVSh+9u7xtC5m/mNpIFeyqumxHei2I8CNdsNuJtjLV5bDU3tQrIkj72HCWpC0k9yf1ZSvi3yCwD4wyULXBsYwUa76bTK85MIZNGGtqfOyV6w74MT6m70gLhog8r7oWe6Gbof58uyYfFMbc+s0OpkzMjvlvl1HApyOTijled26VgbgoGbPm9QvgjxC7mQEJpzQeg1/uNiziAG0YKo7wuD2mojwMBnr+XGJrrFgmdO0pUaK+53KtDr8dtpGrVfJ+0zvebA45c4A4VfvaQQDCI5nJvB2Zz3LM4oiullVt+0xrwDJYn9KRNZto2/zsGzrc/iBVASKE2UpIH7IikALJuDNrla8MVP5lzxdE0I+905U2O7HLOsIwlDKMXx3CFao+4qLTb2O+Mq6xMQUwR2pwLcQA1cw+BypJe4XE3z4fqFejO6VzjX5yd5pDVQ19eAzr9RgvSCi/IuyefFUci+aX7xB4jx5MNwej3aePsOC9afsXBulhFyGgS/dZoPQ9kyG5TE2ELqAN6obERYoiZcyvq8RW9w/uItLS99nGjwVe3U1yW4P6ColV+u7ygWxXm/Zs+QTJHUDwl2ysbrebnN9PLNJSpHbBmuLJiMX02xtDAIt1meB2hGLqw+Mj/n1jF5rnt5eXrNiG94pHZEvbp2BEDawJrRpaGj15C984WVw8ja/ZrTYfWklcNKW84cLvJXl9vxsuUp3/ZYKh32M/ORUT46o6KtB/xEltkaDJiSBBK4utuxQ8wO5UXW6FRkmAuV2naxhF6Obk7kEKYnuj4jxWAODtL9GcoNwq04ylSXj/ZzaYbqXo1O34fjyz3QG5ZChXGgg52+wPj2LBDjUvlriuARg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Ehq6YN1Q/44NqUdDjrVCozBxXyDOab5tdsWCvfGXruGa/wq7I1kH7K76s7TeL0a3pc0H5zt8qU/UT7uoLv0G7H+vVulGmqcl5pbsHYxTqNtSu2w9OBQ6PC8g+MCS/fnXIcAhS7Lmvy8TFK4x0N+MhZqVbozVW37apCXFg6m1I9N0Sa4=",
"encrypted_key_material":"K+ixymtl90e+B5Rdan89KjDslBIoOexrIwzkYHGz3odS7FDXDkogqbWwwJg5wQ6zjUbEvsR/+Fi+A0SSkhhqtijivOKHu4Z86RWjOCBdrr9es+ZhJ0zYBNMN+7Rf2fd9vxbb873Q7VBkJRyH1hi3Wh+kLmDW4rpWZm4+YGCtWylz7ZKbV1KBlhSNLDtZzT4nxUra0p7Die4HgUUxSjZTOr/0s71yF6o2eysreIzIl+GbpCft0WpRsxN2Ng++ntgOcwOf2zOC9o/tjraxeAvgGw+Dwt4cjF4znnFf0LPQ2YvpNUo248LjAGxdFvzUABNzfYSj3RZ0K3wQCNAcXU3HYw==",
"expiration_time":1521578672
}</pre>
</li><li id="kms_02_0036__en-us_topic_0112992337_li574363262719">Example response<pre class="screen" id="kms_02_0036__en-us_topic_0112992337_screen1674363202720">{
}</pre>
<p id="kms_02_0036__en-us_topic_0112992337_p17743332102717">or</p>
<pre class="screen" id="kms_02_0036__en-us_topic_0112992337_screen1474303211279">{
"error": {
"error_code": "KMS.XXXX",
"error_msg": "XXX"
}
}</pre>
</li></ul>
</div>
<div class="section" id="kms_02_0036__en-us_topic_0112992337_section655115613254"><h4 class="sectiontitle">Status Codes</h4><div class="p" id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_p17772351"><a href="#kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_table20596071">Table 3</a> lists the normal status code returned by the response.
<div class="tablenoborder"><a name="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><a name="en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_table20596071" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Status codes</caption><thead align="left"><tr id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_row9746163"><th align="left" class="cellrowborder" valign="top" width="16.16%" id="mcps1.3.6.2.2.2.4.1.1"><p id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_p57545694203043">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.28%" id="mcps1.3.6.2.2.2.4.1.2"><p id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_p4531342288">Status</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.559999999999995%" id="mcps1.3.6.2.2.2.4.1.3"><p id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_p30689603203043">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_row48621261"><td class="cellrowborder" valign="top" width="16.16%" headers="mcps1.3.6.2.2.2.4.1.1 "><p id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_en-us_topic_0079615001_p46008046">200</p>
</td>
<td class="cellrowborder" valign="top" width="28.28%" headers="mcps1.3.6.2.2.2.4.1.2 "><p id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_p7538425819">OK</p>
</td>
<td class="cellrowborder" valign="top" width="55.559999999999995%" headers="mcps1.3.6.2.2.2.4.1.3 "><p id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_p1885682315512">Request processed successfully.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="kms_02_0036__en-us_topic_0112992337_en-us_topic_0112992294_p5626181018551">Exception status code. For details, see <a href="kms_02_0301.html#kms_02_0301">Status Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="kms_02_0011.html">CMK Management</a></div>
</div>
</div>