Encrypt

<p class="shortdesc"></p> <section class="section" id="Encrypt__section_tjg_k2j_mlb"><h2 class="doc-tairway">Encrypt </h2> <p class="p"><strong class="ph b">Description</strong></p> <p class="p">Using a customer masker key (CMK) to encrypt plaintext into ciphertext. </p> <p class="p"><strong class="ph b">Request Parameters</strong></p> <table class="table" id="Encrypt__table_gqd_l2j_mlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="Encrypt__table_gqd_l2j_mlb__entry__1"> <p class="p">Name </p> </th> <th class="entry" id="Encrypt__table_gqd_l2j_mlb__entry__2"> <p class="p">Type </p> </th> <th class="entry" id="Encrypt__table_gqd_l2j_mlb__entry__3"> <p class="p">Necessary or Not </p> </th> <th class="entry" id="Encrypt__table_gqd_l2j_mlb__entry__4"> <p class="p">Description </p> </th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__1 "> <p class="p">keyId </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__2 "> <p class="p">String </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__3 "> <p class="p">Yes </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__4 "> <p class="p">Globally unique identifier of the CMK. </p> </td> </tr> <tr class="row"> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__1 "> <p class="p">plaintext </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__2 "> <p class="p">String </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__3 "> <p class="p">Yes </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__4 "> <p class="p">Plaintext to be encrypted. </p> </td> </tr> <tr class="row"> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__1 "> <p class="p">encryptionContext </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__2 "> <p class="p">String </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__3 "> <p class="p">No </p> </td> <td class="entry" headers="Encrypt__table_gqd_l2j_mlb__entry__4 "> <p class="p">Additional salt value. If you specify this parameter, you need to provide the same parameter when calling the Decrypt API. </p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">Return Parameters</strong></p> <table class="table" id="Encrypt__table_hqd_l2j_mlb"><caption></caption><colgroup><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="Encrypt__table_hqd_l2j_mlb__entry__1"> <p class="p">Name </p> </th> <th class="entry" id="Encrypt__table_hqd_l2j_mlb__entry__2"> <p class="p">Type </p> </th> <th class="entry" id="Encrypt__table_hqd_l2j_mlb__entry__3"> <p class="p">Description </p> </th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__1 "> <p class="p">code </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__2 "> <p class="p">String </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__3 "> <p class="p">Return code. “SUCCESS” will be returned if the request is succeeded. </p> </td> </tr> <tr class="row"> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__1 "> <p class="p">keyId </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__2 "> <p class="p">String </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__3 "> <p class="p">Globally unique identifier of the CMK. </p> </td> </tr> <tr class="row"> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__1 "> <p class="p">cipherTextBlob </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__2 "> <p class="p">String </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__3 "> <p class="p">Ciphertext after encryption. </p> </td> </tr> <tr class="row"> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__1 "> <p class="p">requestId </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__2 "> <p class="p">String </p> </td> <td class="entry" headers="Encrypt__table_hqd_l2j_mlb__entry__3 "> <p class="p">ID of the current request. </p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">Request Example</strong></p> <pre class="pre codeblock"><code>https://kms-cn-shanghai.yun.pingan.com/?action=Encrypt &keyId=<cmkid> &plainText=<your plain text> &encryptionContext=< encryption context > &<公共请求参数> </code></pre> <p class="p"><strong class="ph b">Return Example</strong></p> <pre class="pre codeblock"><code>{ "code": "SUCCESS", "cipherTextBlob": "your cipher text blob", "keyId": "your key id", "requestId": "338c8960-7f4a-4e31-9690-ff1de2921e06" } </code></pre> </section>
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products