doc-exports/docs/kms/api-ref/kms_02_0034.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

158 lines
15 KiB
HTML

<a name="kms_02_0034"></a><a name="kms_02_0034"></a>
<h1 class="topictitle1">Decrypting Data</h1>
<div id="body1501494427004"><div class="section" id="kms_02_0034__en-us_topic_0112992345_s1731a14fb0144c79bf0fa90c694f34f7"><h4 class="sectiontitle">Function</h4><p id="kms_02_0034__en-us_topic_0112992345_p29670483142820">This API enables you to decrypt data.</p>
<div class="note" id="kms_02_0034__en-us_topic_0112992345_note10115114012496"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="kms_02_0034__en-us_topic_0112992345_p1711510407498">By default, the performance threshold for decrypting data is 1000 TPS per customer. To apply for higher performance, submit a service ticket.</p>
</div></div>
</div>
<div class="section" id="kms_02_0034__en-us_topic_0112992345_se70c3e5518a04f60b06032524dddfef4"><h4 class="sectiontitle">URI</h4><ul id="kms_02_0034__en-us_topic_0112992345_en-us_topic_0020091565_ul60390938"><li id="kms_02_0034__en-us_topic_0112992345_en-us_topic_0020091565_li6647531">URI format<p id="kms_02_0034__en-us_topic_0112992345_p138073181080"><a name="kms_02_0034__en-us_topic_0112992345_en-us_topic_0020091565_li6647531"></a><a name="en-us_topic_0112992345_en-us_topic_0020091565_li6647531"></a>POST /v1.0/{project_id}/kms/decrypt-data</p>
</li><li id="kms_02_0034__en-us_topic_0112992345_en-us_topic_0020091565_li14211994">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0034__en-us_topic_0112992345_t982da1e0196d4ec1a28d1fbff2cc8191" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="kms_02_0034__en-us_topic_0112992345_r6e963322c1e740d181726d2f0e91df5a"><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_0034__en-us_topic_0112992345_p13230838154934"><strong id="kms_02_0034__en-us_topic_0112992345_b842352706194637">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_0034__en-us_topic_0112992345_p65064970154934">Mandatory</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_0034__en-us_topic_0112992345_p35771181154934">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_0034__en-us_topic_0112992345_p11784586154934">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0034__en-us_topic_0112992345_r69bf37b65d3f446eab7b3f4d1b2fcec0"><td class="cellrowborder" valign="top" width="22.74%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="kms_02_0034__en-us_topic_0112992345_ae42d73592f58424ea93a11e52d2478dd">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_0034__en-us_topic_0112992345_a56440c0f0ae34ba3b8033d1247673984">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_0034__en-us_topic_0112992345_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_0034__en-us_topic_0112992345_a1314869d2dc147b38461e037d622f7b4">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="kms_02_0034__en-us_topic_0112992345_seb7b7901701247fab30a59b76f1c7f93"><h4 class="sectiontitle">Requests</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0034__en-us_topic_0112992345_table46221022101230" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="kms_02_0034__en-us_topic_0112992345_row9315574101230"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.1"><p id="kms_02_0034__en-us_topic_0112992345_p137351626154818"><strong id="kms_02_0034__en-us_topic_0112992345_b2023708875">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_0034__en-us_topic_0112992345_p16735162684813">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.3"><p id="kms_02_0034__en-us_topic_0112992345_p773582620481">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_0034__en-us_topic_0112992345_p107351526174810">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0034__en-us_topic_0112992345_row44009584101643"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0034__en-us_topic_0112992345_p4340760118534">cipher_text</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0034__en-us_topic_0112992345_p5436032418534">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0034__en-us_topic_0112992345_p19556114218615">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0034__en-us_topic_0112992345_p4111011018534">Ciphertext of encrypted data. The value is the <strong id="kms_02_0034__en-us_topic_0112992345_b84235270615446">cipher_text</strong> value in the data encryption result that matches the regular expression <strong id="kms_02_0034__en-us_topic_0112992345_b84235270615537">^[0-9a-zA-Z+/=]{188,5648}$</strong>.</p>
</td>
</tr>
<tr id="kms_02_0034__en-us_topic_0112992345_row30347711135526"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0034__en-us_topic_0112992345_p5287641135529">encryption_context</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0034__en-us_topic_0112992345_p64039712135529">No</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0034__en-us_topic_0112992345_p89918288593">Object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0034__en-us_topic_0112992345_p299262517255">Key-value pairs with a maximum length of 8192 characters. This parameter is used to record resource context information, excluding sensitive information, to ensure data integrity.</p>
<p id="kms_02_0034__en-us_topic_0112992345_p87033116108">If this parameter is specified during encryption, it is also required for decryption.</p>
<p id="kms_02_0034__en-us_topic_0112992345_p23626609135526">Example: {"<strong id="kms_02_0034__en-us_topic_0112992345_b8256334121211">Key1</strong>":"<strong id="kms_02_0034__en-us_topic_0112992345_b1525623431219">Value1</strong>","<strong id="kms_02_0034__en-us_topic_0112992345_b1425603414122">Key2</strong>":"<strong id="kms_02_0034__en-us_topic_0112992345_b125663411218">Value2</strong>"}</p>
</td>
</tr>
<tr id="kms_02_0034__en-us_topic_0112992345_row35142504101726"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0034__en-us_topic_0112992345_p269135101746">sequence</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0034__en-us_topic_0112992345_p20967256101746">No</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0034__en-us_topic_0112992345_p1782918471464">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0034__en-us_topic_0112992345_p3081640174038">36-byte serial number of a request message</p>
<p id="kms_02_0034__en-us_topic_0112992345_p20626198101746">Example: 919c82d4-8046-4722-9094-35c3c6524cff</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0034__en-us_topic_0112992345_sfadd53a5f4714e8f87811818d62d0296"><h4 class="sectiontitle">Responses</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0034__en-us_topic_0112992345_t98d238e10953421e84a073707024c329" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="kms_02_0034__en-us_topic_0112992345_r144a2c52c5054c6d9243eb2ef3875a21"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.2.5.1.1"><p id="kms_02_0034__en-us_topic_0112992345_p11943134204819"><strong id="kms_02_0034__en-us_topic_0112992345_b721849594">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.2.2.5.1.2"><p id="kms_02_0034__en-us_topic_0112992345_p3943173413484">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.2.5.1.3"><p id="kms_02_0034__en-us_topic_0112992345_p1294317349484">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.2.2.5.1.4"><p id="kms_02_0034__en-us_topic_0112992345_p09436344489">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0034__en-us_topic_0112992345_r3c4af7b36e9240d197ab56255e37b83c"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.1 "><p id="kms_02_0034__en-us_topic_0112992345_p59584906114917">key_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.2.5.1.2 "><p id="kms_02_0034__en-us_topic_0112992345_p27437119114917">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.3 "><p id="kms_02_0034__en-us_topic_0112992345_p18141185018611">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.5.1.4 "><p id="kms_02_0034__en-us_topic_0112992345_p7814132114917">CMK ID</p>
</td>
</tr>
<tr id="kms_02_0034__en-us_topic_0112992345_rf212a916c502452a8e151eba2f118272"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.1 "><p id="kms_02_0034__en-us_topic_0112992345_p54607285114928">plain_text</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.2.5.1.2 "><p id="kms_02_0034__en-us_topic_0112992345_p51283633114928">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.3 "><p id="kms_02_0034__en-us_topic_0112992345_p143871515618">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.5.1.4 "><p id="kms_02_0034__en-us_topic_0112992345_p60333628114928">Plaintext</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0034__en-us_topic_0112992345_section176333387181"><h4 class="sectiontitle">Examples</h4><p id="kms_02_0034__en-us_topic_0112992345_p147011308197">The following example describes how to decrypt data (ciphertext: <span class="parmvalue" id="kms_02_0034__en-us_topic_0112992345_parmvalue66027566719499"><b>AgDoAG7EsEc2OHpQxz4gDFDH54CqwaelpTdEl+RFPjbKn5klPTvOywYIeZX60kPbFsYOpXJwkL32HUM50MY22Eb1fOSpZK7WJpYjx66EWOkJvO+Ey3r1dLdNAjrZrYzQlxRwNS05CaNKoX5rr3NoDnmv+UNobaiS25muLLiqOt6UrStaWow9AUyOHSzl+BrX2Vu0whv74djK+3COO6cXT2CBO6WajTJsOgYdxMfv24KWSKw0TqvHe8XDKASQGKdgfI74hzI1YWJlNjlmLWFlMTAtNDRjZC1iYzg3LTFiZGExZGUzYjdkNwAAAACdcfNpLXwDUPH3023MvZK8RPHe129k6VdNIi3zNb0eFQ==</b></span>).</p>
<ul id="kms_02_0034__en-us_topic_0112992345_ul186634381182"><li id="kms_02_0034__en-us_topic_0112992345_li56637382184">Example request<pre class="screen" id="kms_02_0034__en-us_topic_0112992345_screen2663138191815">{
"cipher_text": "AgDoAG7EsEc2OHpQxz4gDFDH54CqwaelpTdEl+RFPjbKn5klPTvOywYIeZX60kPbFsYOpXJwkL32HUM50MY22Eb1fOSpZK7WJpYjx66EWOkJvO+Ey3r1dLdNAjrZrYzQlxRwNS05CaNKoX5rr3NoDnmv+UNobaiS25muLLiqOt6UrStaWow9AUyOHSzl+BrX2Vu0whv74djK+3COO6cXT2CBO6WajTJsOgYdxMfv24KWSKw0TqvHe8XDKASQGKdgfI74hzI1YWJlNjlmLWFlMTAtNDRjZC1iYzg3LTFiZGExZGUzYjdkNwAAAACdcfNpLXwDUPH3023MvZK8RPHe129k6VdNIi3zNb0eFQ=="
}</pre>
</li><li id="kms_02_0034__en-us_topic_0112992345_li20663638191813">Example response<pre class="screen" id="kms_02_0034__en-us_topic_0112992345_screen36632386183">{
"key_id": "0d0466b0-e727-4d9c-b35d-f84bb474a37f",
"plain_text": "12345678"
}</pre>
<p id="kms_02_0034__en-us_topic_0112992345_p14663133881818">or</p>
<pre class="screen" id="kms_02_0034__en-us_topic_0112992345_screen11663238161816">{
"error": {
"error_code": "KMS.XXXX",
"error_msg": "XXX"
}
}</pre>
</li></ul>
</div>
<div class="section" id="kms_02_0034__en-us_topic_0112992345_section3454223421"><h4 class="sectiontitle">Status Codes</h4><div class="p" id="kms_02_0034__en-us_topic_0112992345_en-us_topic_0112992294_en-us_topic_0079615001_p17772351"><a href="#kms_02_0034__en-us_topic_0112992345_en-us_topic_0112992294_en-us_topic_0079615001_table20596071">Table 4</a> lists the normal status code returned by the response.
<div class="tablenoborder"><a name="kms_02_0034__en-us_topic_0112992345_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><a name="en-us_topic_0112992345_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0034__en-us_topic_0112992345_en-us_topic_0112992294_en-us_topic_0079615001_table20596071" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status codes</caption><thead align="left"><tr id="kms_02_0034__en-us_topic_0112992345_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_0034__en-us_topic_0112992345_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_0034__en-us_topic_0112992345_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_0034__en-us_topic_0112992345_en-us_topic_0112992294_p30689603203043">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0034__en-us_topic_0112992345_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_0034__en-us_topic_0112992345_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_0034__en-us_topic_0112992345_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_0034__en-us_topic_0112992345_en-us_topic_0112992294_p1885682315512">Request processed successfully.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="kms_02_0034__en-us_topic_0112992345_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>