获取导入密钥参数

<p class="shortdesc"></p> <section class="section" id="getparameters__section_o3b_ydj_mlb"><h2 class="doc-tairway">获取导入密钥参数:GetParametersForImport</h2> <p class="p"><strong class="ph b">描述</strong></p> <p class="p">获取导入主密钥(CMK)材料的参数,获取到的返回数据作为导入密钥材料接口(ImportKeyMaterial)参数</p> <div class="note note note_note"><span class="note__title">说明:</span> <ol class="ol" id="getparameters__ol_kdl_wcj_mlb"> <li class="li">主密钥(CMK)材料来源必须是“外部导入”,即origin为EXTERNAL;</li> <li class="li">每次调用接口获取的公钥与导入令牌都不相同;</li> <li class="li">该接口返回了加密密钥材料的公钥(public key),导入密钥材料的令牌(import token),以及导入令牌的过期时间。公钥和令牌都是十六进制的字符串,导入令牌的有效期为24小时;</li> <li class="li">需要指定用于加密密钥材料的公钥类型(支持:RSA_2048),并且需要指定加密算法(支持:RSAES_PKCS1_V1_5、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256三种加密算法);</li> <li class="li">同次获取到的公钥和导入令牌,必须搭配使用并且只能用于本次调用中指定的CMK;</li> <li class="li">获取导入密钥材料参数时指定的算法必须与加密密钥材料时使用的算法一致.</li> </ol> </div> <p class="p"><strong class="ph b">请求参数</strong></p> <table class="table" id="getparameters__table_ldl_wcj_mlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="getparameters__table_ldl_wcj_mlb__entry__1"> <p class="p">名称</p> </th> <th class="entry" id="getparameters__table_ldl_wcj_mlb__entry__2"> <p class="p">类型</p> </th> <th class="entry" id="getparameters__table_ldl_wcj_mlb__entry__3"> <p class="p">是否必须</p> </th> <th class="entry" id="getparameters__table_ldl_wcj_mlb__entry__4"> <p class="p">描述</p> </th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__1 "> <p class="p">keyId</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__3 "> <p class="p">是</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__4 "> <p class="p">CMK全局唯一标识符。密钥材料来源必须是外部(origin为EXTERNAL)</p> </td> </tr> <tr class="row"> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__1 "> <p class="p">wrappingAlgorithm</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__3 "> <p class="p">是</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__4 "> <p class="p">用于加密密钥材料的算法</p> </td> </tr> <tr class="row"> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__1 "> <p class="p">wrappingKeySpec</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__3 "> <p class="p">是</p> </td> <td class="entry" headers="getparameters__table_ldl_wcj_mlb__entry__4 "> <p class="p">用于加密密钥材料的公钥类型(RSA)</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">返回参数:</strong></p> <table class="table" id="getparameters__table_mdl_wcj_mlb"><caption></caption><colgroup><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="getparameters__table_mdl_wcj_mlb__entry__1"> <p class="p">名称</p> </th> <th class="entry" id="getparameters__table_mdl_wcj_mlb__entry__2"> <p class="p">类型</p> </th> <th class="entry" id="getparameters__table_mdl_wcj_mlb__entry__3"> <p class="p">描述</p> </th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__1 "> <p class="p">code</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__3 "> <p class="p">返回码,成功返回"SUCCESS"</p> </td> </tr> <tr class="row"> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__1 "> <p class="p">keyId</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__3 "> <p class="p">CMK全局唯一标识符。调用ImportKeyMaterial时需要指定该参数</p> </td> </tr> <tr class="row"> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__1 "> <p class="p">importToken</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__3 "> <p class="p">调用ImportKeyMaterial的导入令牌</p> </td> </tr> <tr class="row"> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__1 "> <p class="p">publicKey</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__3 "> <p class="p">密钥材料导入前,使用该公钥将密钥材料进行加密。</p> </td> </tr> <tr class="row"> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__1 "> <p class="p">tokenExpireTime</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__2 "> <p class="p">String</p> </td> <td class="entry" headers="getparameters__table_mdl_wcj_mlb__entry__3 "> <p class="p">导入令牌的过期时间。</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">请求示例</strong></p> <pre class="pre codeblock"><code>https://kms-cn-shanghai.yun.pingan.com/?action=GetParametersForImport &wrappingKeySpec=RSA &keyId=<cmkid> &wrappingAlgorithm=<wrapping algorithm> &<公共请求参数></code></pre> <p class="p"><strong class="ph b">返回示例</strong></p> <pre class="pre codeblock"><code>{ "code": "SUCCESS", "importToken": "import token", "keyId": "your key id", "publicKey": "public key", "tokenExpireTime": "2018-12-05 15:58:27", "requestId": "2ef5c013-0662-453c-9f63-ed43c1c20f63" }</code></pre> </section>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询 - 7x24 小时

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

7x24 小时,急速解答

工单支持

解决云产品相关技术问题