You need to enable JavaScript to run this app.
导航

对称加密

最近更新时间2023.06.21 16:55:00

首次发布时间2021.11.24 19:45:10

描述
对称密钥数据加密

请求业务参数

名称类型是否必选示范值描述
ActionStringEncrypt接口名,取值:Encrypt
VersionString2021-02-18版本号,取值:2021-02-18
KeyringNameStringtest_keyring-1密钥环的别名。长度为 2 - 31 个字符合法字符:[a-zA-Z0-9-_]
KeyNameStringtest_key-1密钥的别名。长度为 2 - 31 个字符合法字符:[a-zA-Z0-9-_]
EncryptionContextString{"user": "bob","path": "/path/to/plaintext.txt"}key/value的JSON字符串。如果指定了该参数,则在调用Decrypt时需要提供同样的参数。
PlaintextStringtWB54tTvEu47YjRjuuj+fAt5PskpUaqwsjLeEy4YMNg=加密的明文的Base64 编码,取值:[1,4096],

返回业务参数

名称类型描述
ResponseMetaDataResponseMetaData返回公共参数
CiphertextBlobString明文加密后的密文,Base64编码

请求示例

Post https://kms.volcengineapi.com?Action=Encrypt&Version=2021-02-18&KeyringName=test_keyring-1&KeyName=test_key-1
{
"Plaintext":"tWB54tTvEu47YjRjuuj+fAt5PskpUaqwsjLeEy4YMNg="
}


返回示例

{
    "ResponseMetadata": {
        "RequestId": "202107121937490102252431000312DA6D",
        "Action": "Encrypt",
        "Version": "2021-02-18",
        "Service": "kms",
        "Region": "cn-north-1"
    },
    "Result": {
        "CiphertextBlob": "43y7grE9TjamX4P7ZOHFbwAAqoNHFtMZ6RNyblKlEhIhrfP6zy034cwJN6MSqFGiDm8oiGqu2Rahs1aKPIcMjaOuodVCE1zYpDFg1QvgOHtVQxkQWhfpE8i8NibiJ1pL8ILgAE+TogQZuIglAoo="
    }
}