You need to enable JavaScript to run this app.
密钥管理系统

密钥管理系统

复制全文
密钥管理
ReEncrypt - 对称重加密
复制全文
ReEncrypt - 对称重加密

对称重加密

调试

请求参数

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

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

ReEncrypt

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

Version
String

2021-02-18

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

NewKeyID
String

0324d9b3-c5d9-4b6f-94e7-884010a16fee

主密钥ID,二选一:
NewKeyringName 和 NewKeyName
NewKeyID

NewKeyringName
String

keyring-test1

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

NewKeyName
String

key-test1

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

OldEncryptionContext
String

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

旧密文数据加密上下文

NewEncryptionContext
String

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

新密文数据加密上下文

CiphertextBlob
String

858AeEPZQpCdjfXwvXFWeAAAXN1exNPCoOnjug2Lvd1kKX+QTETi3ZkJdwvDMcC7HPFzlRHGrrhzPTeiIz9gumyuP10myXqyUoI3bh+GMW4t

重加密密文数据,取值 > 18

返回参数

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

参数
类型
示例值
描述
CiphertextBlob
String

3v097jlrRhy9W+ssK8F3EgAAQcr9UmlnESCTDWt5h9Sc63pqck0Vg+xuLp4TNSzsAFVAROVCe2djOVTRyPMmevZ/SbI2VqjSznApk352COmh

重加密后的密文,Base64编码

请求示例

POST /?Action=ReEncrypt&Version=2021-02-18&NewKeyringName=demo1&NewKeyName=demo1 HTTP/1.1
Host: kms.cn-beijing.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20240708T100424Z
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": "858AeEPZQpCdjfXwvXFWeAAAXN1exNPCoOnjug2Lvd1kKX+QTETi3ZkJdwvDMcC7HPFzlRHGrrhzPTeiIz9gumyuP10myXqyUoI3bh+GMW4t"
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "202407081805351152540521739F8055",
    "Action": "ReEncrypt",
    "Version": "2021-02-18",
    "Service": "kms",
    "Region": "cn-beijing"
  },
  "Result": {
    "OldKeyringName": "demo",
    "OldKeyName": "demo",
    "CiphertextBlob": "3v097jlrRhy9W+ssK8F3EgAAQcr9UmlnESCTDWt5h9Sc63pqck0Vg+xuLp4TNSzsAFVAROVCe2djOVTRyPMmevZ/SbI2VqjSznApk352COmh"
  }
}

错误码

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

状态码
错误码
错误信息
说明
400
InvalidParameter

The request parameter %s is invalid.

400
InvalidKeyStatus

Current key status: %s does not allow to perform this action

400
XksProxyUriUnreachable

The external key store proxy is in an unhealthy state. If you see this message repeatedly, notify your external key store proxy administrator.

400
XksProxyIncorrectAuthenticationCredential

The external key store proxy rejected the request because it could not authenticate CloudKMS. Verify the XKS proxy authentication credentials for your external key store and update if necessary.

400
CustomKeyStoreInvalidState

The request was rejected because of the ConnectionState of the custom key store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores operation.

400
XksProxyInvalidResponse

CloudKMS cannot interpret the response from the external key store proxy. If you see this error repeatedly, report it to your external key store proxy administrator.

400
XksProxyInvalidUriPath

The external key store proxy rejected the request because of an invalid URI path. Verify the URI path for your external key store and update if necessary.

403
AccessDenied

User is not authorized to do this action

403
Reject.Throttling.CMK

The request of CMK: %s upper limit is exceeded.

403
KeyMaterialExpire

Key expire in, %s

403
KMS_ServiceNotOpen

KMS service not open yet, please open the service and try again later.

403
XksProxyAccessDenied

The external key store proxy denied access to the operation. Verify that the user and the external key are both authorized for this operation, and try the request again.

404
Not Found

Not found %s [%s].

500
UndefinedError

Undefined Internal Error. Pls Contact With Admin.

最近更新时间:2025.12.01 20:00:12
这个页面对您有帮助吗?
有用
有用
无用
无用