public class KmsClient extends AbstractClient
gson, HTTP_RSP_OK, SDK_VERSION
Constructor and Description |
---|
KmsClient(Credential credential,
String region) |
KmsClient(Credential credential,
String region,
ClientProfile profile) |
Modifier and Type | Method and Description |
---|---|
AsymmetricRsaDecryptResponse |
AsymmetricRsaDecrypt(AsymmetricRsaDecryptRequest req)
使用指定的RSA非对称密钥的私钥进行数据解密,密文必须是使用对应公钥加密的。处于Enabled 状态的非对称密钥才能进行解密操作。
|
AsymmetricSm2DecryptResponse |
AsymmetricSm2Decrypt(AsymmetricSm2DecryptRequest req)
使用指定的SM2非对称密钥的私钥进行数据解密,密文必须是使用对应公钥加密的。处于Enabled 状态的非对称密钥才能进行解密操作。传入的密文的长度不能超过256字节。
|
CancelKeyDeletionResponse |
CancelKeyDeletion(CancelKeyDeletionRequest req)
取消CMK的计划删除操作
|
CreateKeyResponse |
CreateKey(CreateKeyRequest req)
创建用户管理数据密钥的主密钥CMK(Custom Master Key)。
|
DecryptResponse |
Decrypt(DecryptRequest req)
本接口用于解密密文,得到明文数据。
|
DeleteImportedKeyMaterialResponse |
DeleteImportedKeyMaterial(DeleteImportedKeyMaterialRequest req)
用于删除导入的密钥材料,仅对EXTERNAL类型的CMK有效,该接口将CMK设置为PendingImport 状态,并不会删除CMK,在重新进行密钥导入后可继续使用。彻底删除CMK请使用 ScheduleKeyDeletion 接口。
|
DescribeKeyResponse |
DescribeKey(DescribeKeyRequest req)
用于获取指定KeyId的主密钥属性详情信息。
|
DescribeKeysResponse |
DescribeKeys(DescribeKeysRequest req)
该接口用于批量获取主密钥属性信息。
|
DisableKeyResponse |
DisableKey(DisableKeyRequest req)
本接口用于禁用一个主密钥,处于禁用状态的Key无法用于加密、解密操作。
|
DisableKeyRotationResponse |
DisableKeyRotation(DisableKeyRotationRequest req)
对指定的CMK禁止密钥轮换功能。
|
DisableKeysResponse |
DisableKeys(DisableKeysRequest req)
该接口用于批量禁止CMK的使用。
|
EnableKeyResponse |
EnableKey(EnableKeyRequest req)
用于启用一个指定的CMK。
|
EnableKeyRotationResponse |
EnableKeyRotation(EnableKeyRotationRequest req)
对指定的CMK开启密钥轮换功能。
|
EnableKeysResponse |
EnableKeys(EnableKeysRequest req)
该接口用于批量启用CMK。
|
EncryptResponse |
Encrypt(EncryptRequest req)
本接口用于加密最多为4KB任意数据,可用于加密数据库密码,RSA Key,或其它较小的敏感信息。对于应用的数据加密,使用GenerateDataKey生成的DataKey进行本地数据的加解密操作
|
GenerateDataKeyResponse |
GenerateDataKey(GenerateDataKeyRequest req)
本接口生成一个数据密钥,您可以用这个密钥进行本地数据的加密。
|
GenerateRandomResponse |
GenerateRandom(GenerateRandomRequest req)
随机数生成接口。
|
GetKeyRotationStatusResponse |
GetKeyRotationStatus(GetKeyRotationStatusRequest req)
查询指定的CMK是否开启了密钥轮换功能。
|
GetParametersForImportResponse |
GetParametersForImport(GetParametersForImportRequest req)
获取导入主密钥(CMK)材料的参数,返回的Token作为执行ImportKeyMaterial的参数之一,返回的PublicKey用于对自主导入密钥材料进行加密。返回的Token和PublicKey 24小时后失效,失效后如需重新导入,需要再次调用该接口获取新的Token和PublicKey。
|
GetPublicKeyResponse |
GetPublicKey(GetPublicKeyRequest req)
该接口用户获取 KeyUsage为ASYMMETRIC_DECRYPT_RSA_2048 和 ASYMMETRIC_DECRYPT_SM2 的非对称密钥的公钥信息,使用该公钥用户可在本地进行数据加密,使用该公钥加密的数据只能通过KMS使用对应的私钥进行解密。只有处于Enabled状态的非对称密钥才可能获取公钥。
|
GetServiceStatusResponse |
GetServiceStatus(GetServiceStatusRequest req)
用于查询该用户是否已开通KMS服务
|
ImportKeyMaterialResponse |
ImportKeyMaterial(ImportKeyMaterialRequest req)
用于导入密钥材料。只有类型为EXTERNAL 的CMK 才可以导入,导入的密钥材料使用 GetParametersForImport 获取的密钥进行加密。可以为指定的 CMK 重新导入密钥材料,并重新指定过期时间,但必须导入相同的密钥材料。CMK 密钥材料导入后不可以更换密钥材料。导入的密钥材料过期或者被删除后,指定的CMK将无法使用,需要再次导入相同的密钥材料才能正常使用。CMK是独立的,同样的密钥材料可导入不同的 CMK 中,但使用其中一个 CMK 加密的数据无法使用另一个 CMK解密。
只有Enabled 和 PendingImport状态的CMK可以导入密钥材料。
|
ListAlgorithmsResponse |
ListAlgorithms(ListAlgorithmsRequest req)
列出当前Region支持的加密方式
|
ListKeyDetailResponse |
ListKeyDetail(ListKeyDetailRequest req)
根据指定Offset和Limit获取主密钥列表详情。
|
ListKeysResponse |
ListKeys(ListKeysRequest req)
列出账号下面状态为Enabled, Disabled 和 PendingImport 的CMK KeyId 列表
|
ReEncryptResponse |
ReEncrypt(ReEncryptRequest req)
使用指定CMK对密文重新加密。
|
ScheduleKeyDeletionResponse |
ScheduleKeyDeletion(ScheduleKeyDeletionRequest req)
CMK计划删除接口,用于指定CMK删除的时间,可选时间区间为[7,30]天
|
UpdateAliasResponse |
UpdateAlias(UpdateAliasRequest req)
用于修改CMK的别名。对于处于PendingDelete状态的CMK禁止修改。
|
UpdateKeyDescriptionResponse |
UpdateKeyDescription(UpdateKeyDescriptionRequest req)
该接口用于对指定的cmk修改描述信息。对于处于PendingDelete状态的CMK禁止修改。
|
call, getClientProfile, getCredential, getRegion, internalRequest, setClientProfile, setCredential, setRegion
public KmsClient(Credential credential, String region)
public KmsClient(Credential credential, String region, ClientProfile profile)
public AsymmetricRsaDecryptResponse AsymmetricRsaDecrypt(AsymmetricRsaDecryptRequest req) throws TencentCloudSDKException
req
- AsymmetricRsaDecryptRequestTencentCloudSDKException
public AsymmetricSm2DecryptResponse AsymmetricSm2Decrypt(AsymmetricSm2DecryptRequest req) throws TencentCloudSDKException
req
- AsymmetricSm2DecryptRequestTencentCloudSDKException
public CancelKeyDeletionResponse CancelKeyDeletion(CancelKeyDeletionRequest req) throws TencentCloudSDKException
req
- CancelKeyDeletionRequestTencentCloudSDKException
public CreateKeyResponse CreateKey(CreateKeyRequest req) throws TencentCloudSDKException
req
- CreateKeyRequestTencentCloudSDKException
public DecryptResponse Decrypt(DecryptRequest req) throws TencentCloudSDKException
req
- DecryptRequestTencentCloudSDKException
public DeleteImportedKeyMaterialResponse DeleteImportedKeyMaterial(DeleteImportedKeyMaterialRequest req) throws TencentCloudSDKException
req
- DeleteImportedKeyMaterialRequestTencentCloudSDKException
public DescribeKeyResponse DescribeKey(DescribeKeyRequest req) throws TencentCloudSDKException
req
- DescribeKeyRequestTencentCloudSDKException
public DescribeKeysResponse DescribeKeys(DescribeKeysRequest req) throws TencentCloudSDKException
req
- DescribeKeysRequestTencentCloudSDKException
public DisableKeyResponse DisableKey(DisableKeyRequest req) throws TencentCloudSDKException
req
- DisableKeyRequestTencentCloudSDKException
public DisableKeyRotationResponse DisableKeyRotation(DisableKeyRotationRequest req) throws TencentCloudSDKException
req
- DisableKeyRotationRequestTencentCloudSDKException
public DisableKeysResponse DisableKeys(DisableKeysRequest req) throws TencentCloudSDKException
req
- DisableKeysRequestTencentCloudSDKException
public EnableKeyResponse EnableKey(EnableKeyRequest req) throws TencentCloudSDKException
req
- EnableKeyRequestTencentCloudSDKException
public EnableKeyRotationResponse EnableKeyRotation(EnableKeyRotationRequest req) throws TencentCloudSDKException
req
- EnableKeyRotationRequestTencentCloudSDKException
public EnableKeysResponse EnableKeys(EnableKeysRequest req) throws TencentCloudSDKException
req
- EnableKeysRequestTencentCloudSDKException
public EncryptResponse Encrypt(EncryptRequest req) throws TencentCloudSDKException
req
- EncryptRequestTencentCloudSDKException
public GenerateDataKeyResponse GenerateDataKey(GenerateDataKeyRequest req) throws TencentCloudSDKException
req
- GenerateDataKeyRequestTencentCloudSDKException
public GenerateRandomResponse GenerateRandom(GenerateRandomRequest req) throws TencentCloudSDKException
req
- GenerateRandomRequestTencentCloudSDKException
public GetKeyRotationStatusResponse GetKeyRotationStatus(GetKeyRotationStatusRequest req) throws TencentCloudSDKException
req
- GetKeyRotationStatusRequestTencentCloudSDKException
public GetParametersForImportResponse GetParametersForImport(GetParametersForImportRequest req) throws TencentCloudSDKException
req
- GetParametersForImportRequestTencentCloudSDKException
public GetPublicKeyResponse GetPublicKey(GetPublicKeyRequest req) throws TencentCloudSDKException
req
- GetPublicKeyRequestTencentCloudSDKException
public GetServiceStatusResponse GetServiceStatus(GetServiceStatusRequest req) throws TencentCloudSDKException
req
- GetServiceStatusRequestTencentCloudSDKException
public ImportKeyMaterialResponse ImportKeyMaterial(ImportKeyMaterialRequest req) throws TencentCloudSDKException
req
- ImportKeyMaterialRequestTencentCloudSDKException
public ListAlgorithmsResponse ListAlgorithms(ListAlgorithmsRequest req) throws TencentCloudSDKException
req
- ListAlgorithmsRequestTencentCloudSDKException
public ListKeyDetailResponse ListKeyDetail(ListKeyDetailRequest req) throws TencentCloudSDKException
req
- ListKeyDetailRequestTencentCloudSDKException
public ListKeysResponse ListKeys(ListKeysRequest req) throws TencentCloudSDKException
req
- ListKeysRequestTencentCloudSDKException
public ReEncryptResponse ReEncrypt(ReEncryptRequest req) throws TencentCloudSDKException
req
- ReEncryptRequestTencentCloudSDKException
public ScheduleKeyDeletionResponse ScheduleKeyDeletion(ScheduleKeyDeletionRequest req) throws TencentCloudSDKException
req
- ScheduleKeyDeletionRequestTencentCloudSDKException
public UpdateAliasResponse UpdateAlias(UpdateAliasRequest req) throws TencentCloudSDKException
req
- UpdateAliasRequestTencentCloudSDKException
public UpdateKeyDescriptionResponse UpdateKeyDescription(UpdateKeyDescriptionRequest req) throws TencentCloudSDKException
req
- UpdateKeyDescriptionRequestTencentCloudSDKException
Copyright © 2020. All rights reserved.