You need to enable JavaScript to run this app.
导航
ImportKeyMaterial - 导入密钥材料
最近更新时间:2024.08.29 17:28:05首次发布时间:2024.08.29 17:28:05

导入密钥材料

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

ImportKeyMaterial

要执行的操作,取值:ImportKeyMaterial。

Version
String

2021-02-18

API的版本,取值:2021-02-18。

KeyringName
String

keyring-test

密钥环名称,长度为 2 - 31 个字符。合法字符:[a-zA-Z0-9-_]

KeyName
String

key-test

主密钥名称,长度为 2 - 31 个字符。合法字符:[a-zA-Z0-9-_]

EncryptedKeyMaterial
String

aA6qb/G1OY1hjADmUXVSciJtAfNFSuUsWOpfNM+em10KLxTjyVcLdrjmes7e+ixDx4Q6I3yCEXNih/AeBCdJ63WHRglh2Zo/hefbyFGRgR5RbjIrNfi0wkeN9jnxRYU+8H/5cmaa1SEWAduPkj64zIBZMWV3A0frmTTebNOaijNC++bqEOWfU5OHtcviPWtKPWRjX17/dQBGXLhGNt+j5BTZoD5ziSciLjahwi+IpPolwPYMI7sof68tpR2JNTvIYXdcUQ8SbvrkEJLK+wpoglB8GI0ztECTuIkSfZVryykMj5SlT14Rli7PK7GU5wgXXUmdr6bz5TxU7EDtJU1thA==

使用调用GetParametersForImport获取的公钥加密并用Base64编码后的密钥材料

ImportToken
String

UlNBXzIwNDg6UlNBRVNfT0FFUF9TSEFfMjU2OpWOVgQfl0s2ji3Y02lzo8Z6IOEDCHFDeqEgmFECycV7WaUqYwAAAAB7pJCNwM8fEITQKnVO479+Of7Ap9PecZL7dl8XV8WNtHaPdenvVr13o/JwcbowWi5/vHWA8+ov747dlHvFMPtPZHX4ma5C9rgzD/hJfNk8vhZFeoCrpQRLes7u2oIja4bFr/Kff1A0XlILu2Xs89vSk3V/6nXhi3TfgXJSYsRZY2pHxXmcw6qll1B8vK6n1nj3mQGyYxAnZ13YRYBGmm12eTL/SmDGMgF86NTKlX/BgLJMt7NBsnHC288U1Ot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bxJztgg9UqrD6pBxNvv8doeRiCqtPZvh9LAMnQrTkhcSRywRM0tDVb2nDO0r8Yu6Jqs7jmsJCgl0OGQQ2ORX9RHSu59lLOD/CPzA2KomLLmPOsBtKW3XvCZCfSZxbQdlJhUc6iUoAa826ApH6pwYpjbMJHiQQ387BDUBPFdi0c52rkGPIwWH2NTrBPxRT9GjS+urBPRI/YG+cNCuap6MpzRxqecISFk2COh+ViAyRJr4orAkfO04yPAL1GL9+MTCn0ETzJIoheQV/Jt1kM2GJEmA6JsBHLhfJJM5IZq5Xo/lYQstZ/152h0qZTzt6j6NV+/FD+24NSubaPZ0n2fhIEnhc

调用GetParametersForImport获取的导入令牌

ExpirationModel
String

KEY_MATERIAL_DOES_NOT_EXPIRE

密钥材料的过期类型,取值:
KEY_MATERIAL_DOES_NOT_EXPIRE(默认)
KEY_MATERIAL_EXPIRES

ValidTo
Long

0

密钥材料的有效期,当ExpirationModel参数为KEY_MATERIAL_EXPIRES时必须填写
必须是当前时间点之后的时间,以服务端时间为准

返回参数

本接口无特有的返回参数。更多信息请见返回结构

请求示例

POST /?Action=ImportKeyMaterial&Version=2021-02-18&KeyringName=demo&KeyName=demo HTTP/1.1
Host: kms.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20240708T135512Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240708/cn-beijing/kms/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

{
  "EncryptedKeyMaterial": "aA6qb/G1OY1hjADmUXVSciJtAfNFSuUsWOpfNM+em10KLxTjyVcLdrjmes7e+ixDx4Q6I3yCEXNih/AeBCdJ63WHRglh2Zo/hefbyFGRgR5RbjIrNfi0wkeN9jnxRYU+8H/5cmaa1SEWAduPkj64zIBZMWV3A0frmTTebNOaijNC++bqEOWfU5OHtcviPWtKPWRjX17/dQBGXLhGNt+j5BTZoD5ziSciL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RDSattuQkCy7JazRTwzXVI5873SL0kwlXdi1fHJJxPjDl4hhC26XHbeQAZunkRZ6MWOY+rV4EmK87KfG6luykOAUKP+m4GbrV6VHindT+bCjfoc+63R7zwtiuSk21iiApPQjdWhuBkHr5CBv1vcl8oXsc7EgmRziZjsSjpJJbBsf6kD5Uq7RQeTcGIzX1v2zPYaZfvK46IpxS6/DGZCAiuLQO1Mjqq0Q21it4+osOlkz9b96FPx212yWsGXSsgC1FwL0jQbzPpD1+sa2ZCJ2e5n9yiYiJ4AlaPfgVTAiq2zExq0+S8yD4EYHeYY1AhQhcpCx63A2D3TY8d8EtDkSi5oGcLT6BF7KEzLtxF3YTPRI8puhJcUAyjFzWJYeaX6uis0RxZrCaTwafGu4xMesn6fAH1Ngxpc3dCdH1n+jnjaCnM4Lv2245VG4PLN3rHG73j7eLrtUt69MJeByL3X9z4QbxJztgg9UqrD6pBxNvv8doeRiCqtPZvh9LAMnQrTkhcSRywRM0tDVb2nDO0r8Yu6Jqs7jmsJCgl0OGQQ2ORX9RHSu59lLOD/CPzA2KomLLmPOsBtKW3XvCZCfSZxbQdlJhUc6iUoAa826ApH6pwYpjbMJHiQQ387BDUBPFdi0c52rkGPIwWH2NTrBPxRT9GjS+urBPRI/YG+cNCuap6MpzRxqecISFk2COh+ViAyRJr4orAkfO04yPAL1GL9+MTCn0ETzJIoheQV/Jt1kM2GJEmA6JsBHLhfJJM5IZq5Xo/lYQstZ/152h0qZTzt6j6NV+/FD+24NSubaPZ0n2fhIEnhc",
  "ExpirationModel": "KEY_MATERIAL_DOES_NOT_EXPIRE",
  "ValidTo": 0
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "2024070821555704510919023235B46A",
    "Action": "ImportKeyMaterial",
    "Version": "2021-02-18",
    "Service": "kms",
    "Region": "cn-beijing"
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
InvalidParameter
The request parameter %s is invalid.
400
InvalidKeyOrigin
Current key origin: %s does not allow to perform this action
400
InvalidImportToken
Invalid import token
400
ImportTokenRevoked
Import token used too many times
400
InvalidKeyMaterial
Invalid key material
400
InvalidKeyStatus
Current key status: %s does not allow to perform this action
403
Reject.Throttling.Action
The request of Action: %s upper limit is exceeded.
403
AccessDenied
User is not authorized to do this action
404
Not Found
Not found %s [%s].
500
UndefinedError
Undefined Internal Error. Pls Contact With Admin.