You need to enable JavaScript to run this app.
导航
Decrypt - 对称解密
最近更新时间:2024.08.29 17:20:44首次发布时间:2024.08.29 17:20:44

对称解密

调试

请求参数

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

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

Decrypt

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

Version
String

2021-02-18

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

EncryptionContext
String

{"user":"alice","path":"path/to/alice/plaintext.txt"}

key/value的JSON字符串。如果指定了该参数,则在调用Decrypt时需要提供同样的参数。

CiphertextBlob
String

aaSgNwtCRlebbNLMueEN2gAA/Ijt5mhv0QfCLLKxpiF/QfSsTr2Yh8j7X/BWJ6JzhqmTGGXSRBf8RIzZiqZpuZ3ilC389YOnHoLahR5PjcEroYCEcbVxf7k+y8wVBE/O1XDdGK+5iBTzqy9k0y8=

解密数据,取值 > 18

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
Plaintext
String

tWB54tTvEu47YjRjuuj+fAt5PskpUaqwsjLeEy4YMNg=

解密后的明文,Base64编码

请求示例

POST /?Action=Decrypt&Version=2021-02-18 HTTP/1.1
Host: kms.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20240708T073658Z
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

{
  "CiphertextBlob":"aaSgNwtCRlebbNLMueEN2gAA/Ijt5mhv0QfCLLKxpiF/QfSsTr2Yh8j7X/BWJ6JzhqmTGGXSRBf8RIzZiqZpuZ3ilC389YOnHoLahR5PjcEroYCEcbVxf7k+y8wVBE/O1XDdGK+5iBTzqy9k0y8="
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "202407081537241800271190259E510F",
    "Action": "Decrypt",
    "Version": "2021-02-18",
    "Service": "kms",
    "Region": "cn-beijing"
  },
  "Result": {
    "KeyringName": "demo",
    "KeyName": "demo",
    "Plaintext": "tWB54tTvEu47YjRjuuj+fAt5PskpUaqwsjLeEy4YMNg="
  }
}

错误码

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

状态码
错误码
错误信息
说明
400
InvalidParameter
The request parameter %s is invalid.
400
InvalidKeyStatus
Current key status: %s does not allow to perform this action
403
Reject.Throttling.CMK
The request of CMK: %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.