Class KmsClient
- java.lang.Object
-
- com.tencentcloudapi.common.AbstractClient
-
- com.tencentcloudapi.kms.v20190118.KmsClient
-
public class KmsClient extends AbstractClient
-
-
Field Summary
-
Fields inherited from class com.tencentcloudapi.common.AbstractClient
gson, HTTP_RSP_OK, SDK_VERSION
-
-
Constructor Summary
Constructors Constructor Description KmsClient(Credential credential, String region)KmsClient(Credential credential, String region, ClientProfile profile)
-
Method Summary
-
Methods inherited from class com.tencentcloudapi.common.AbstractClient
call, callOctetStream, getClientProfile, getCredential, getRegion, getRegionBreaker, internalRequest, retry, setClientProfile, setCredential, setRegion, setRegionBreaker
-
-
-
-
Constructor Detail
-
KmsClient
public KmsClient(Credential credential, String region)
-
KmsClient
public KmsClient(Credential credential, String region, ClientProfile profile)
-
-
Method Detail
-
ArchiveKey
public ArchiveKeyResponse ArchiveKey(ArchiveKeyRequest req) throws TencentCloudSDKException
对密钥进行归档,被归档的密钥只能用于解密,不能加密- Parameters:
req- ArchiveKeyRequest- Returns:
- ArchiveKeyResponse
- Throws:
TencentCloudSDKException
-
AsymmetricRsaDecrypt
public AsymmetricRsaDecryptResponse AsymmetricRsaDecrypt(AsymmetricRsaDecryptRequest req) throws TencentCloudSDKException
使用指定的RSA非对称密钥的私钥进行数据解密,密文必须是使用对应公钥加密的。处于Enabled 状态的非对称密钥才能进行解密操作。- Parameters:
req- AsymmetricRsaDecryptRequest- Returns:
- AsymmetricRsaDecryptResponse
- Throws:
TencentCloudSDKException
-
AsymmetricSm2Decrypt
public AsymmetricSm2DecryptResponse AsymmetricSm2Decrypt(AsymmetricSm2DecryptRequest req) throws TencentCloudSDKException
使用指定的SM2非对称密钥的私钥进行数据解密,密文必须是使用对应公钥加密的。处于Enabled 状态的非对称密钥才能进行解密操作。传入的密文的长度不能超过256字节。- Parameters:
req- AsymmetricSm2DecryptRequest- Returns:
- AsymmetricSm2DecryptResponse
- Throws:
TencentCloudSDKException
-
BindCloudResource
public BindCloudResourceResponse BindCloudResource(BindCloudResourceRequest req) throws TencentCloudSDKException
记录当前key被哪个云产品的那个资源所使用。如果当前key设置了自动过期,则取消该设置,确保当前key不会自动失效。如果当前关联关系已经创建,也返回成功。- Parameters:
req- BindCloudResourceRequest- Returns:
- BindCloudResourceResponse
- Throws:
TencentCloudSDKException
-
CancelKeyArchive
public CancelKeyArchiveResponse CancelKeyArchive(CancelKeyArchiveRequest req) throws TencentCloudSDKException
取消密钥归档,取消后密钥的状态变为Enabled。- Parameters:
req- CancelKeyArchiveRequest- Returns:
- CancelKeyArchiveResponse
- Throws:
TencentCloudSDKException
-
CancelKeyDeletion
public CancelKeyDeletionResponse CancelKeyDeletion(CancelKeyDeletionRequest req) throws TencentCloudSDKException
取消CMK的计划删除操作- Parameters:
req- CancelKeyDeletionRequest- Returns:
- CancelKeyDeletionResponse
- Throws:
TencentCloudSDKException
-
CreateKey
public CreateKeyResponse CreateKey(CreateKeyRequest req) throws TencentCloudSDKException
创建用户管理数据密钥的主密钥CMK(Custom Master Key)。- Parameters:
req- CreateKeyRequest- Returns:
- CreateKeyResponse
- Throws:
TencentCloudSDKException
-
CreateWhiteBoxKey
public CreateWhiteBoxKeyResponse CreateWhiteBoxKey(CreateWhiteBoxKeyRequest req) throws TencentCloudSDKException
创建白盒密钥。 密钥个数的上限为 50。- Parameters:
req- CreateWhiteBoxKeyRequest- Returns:
- CreateWhiteBoxKeyResponse
- Throws:
TencentCloudSDKException
-
Decrypt
public DecryptResponse Decrypt(DecryptRequest req) throws TencentCloudSDKException
本接口用于解密密文,得到明文数据。- Parameters:
req- DecryptRequest- Returns:
- DecryptResponse
- Throws:
TencentCloudSDKException
-
DeleteImportedKeyMaterial
public DeleteImportedKeyMaterialResponse DeleteImportedKeyMaterial(DeleteImportedKeyMaterialRequest req) throws TencentCloudSDKException
用于删除导入的密钥材料,仅对EXTERNAL类型的CMK有效,该接口将CMK设置为PendingImport 状态,并不会删除CMK,在重新进行密钥导入后可继续使用。彻底删除CMK请使用 ScheduleKeyDeletion 接口。- Parameters:
req- DeleteImportedKeyMaterialRequest- Returns:
- DeleteImportedKeyMaterialResponse
- Throws:
TencentCloudSDKException
-
DeleteWhiteBoxKey
public DeleteWhiteBoxKeyResponse DeleteWhiteBoxKey(DeleteWhiteBoxKeyRequest req) throws TencentCloudSDKException
删除白盒密钥, 注意:必须先禁用后,才可以删除。- Parameters:
req- DeleteWhiteBoxKeyRequest- Returns:
- DeleteWhiteBoxKeyResponse
- Throws:
TencentCloudSDKException
-
DescribeKey
public DescribeKeyResponse DescribeKey(DescribeKeyRequest req) throws TencentCloudSDKException
用于获取指定KeyId的主密钥属性详情信息。- Parameters:
req- DescribeKeyRequest- Returns:
- DescribeKeyResponse
- Throws:
TencentCloudSDKException
-
DescribeKeys
public DescribeKeysResponse DescribeKeys(DescribeKeysRequest req) throws TencentCloudSDKException
该接口用于批量获取主密钥属性信息。- Parameters:
req- DescribeKeysRequest- Returns:
- DescribeKeysResponse
- Throws:
TencentCloudSDKException
-
DescribeWhiteBoxDecryptKey
public DescribeWhiteBoxDecryptKeyResponse DescribeWhiteBoxDecryptKey(DescribeWhiteBoxDecryptKeyRequest req) throws TencentCloudSDKException
获取白盒解密密钥- Parameters:
req- DescribeWhiteBoxDecryptKeyRequest- Returns:
- DescribeWhiteBoxDecryptKeyResponse
- Throws:
TencentCloudSDKException
-
DescribeWhiteBoxDeviceFingerprints
public DescribeWhiteBoxDeviceFingerprintsResponse DescribeWhiteBoxDeviceFingerprints(DescribeWhiteBoxDeviceFingerprintsRequest req) throws TencentCloudSDKException
获取指定密钥的设备指纹列表- Parameters:
req- DescribeWhiteBoxDeviceFingerprintsRequest- Returns:
- DescribeWhiteBoxDeviceFingerprintsResponse
- Throws:
TencentCloudSDKException
-
DescribeWhiteBoxKey
public DescribeWhiteBoxKeyResponse DescribeWhiteBoxKey(DescribeWhiteBoxKeyRequest req) throws TencentCloudSDKException
展示白盒密钥的信息- Parameters:
req- DescribeWhiteBoxKeyRequest- Returns:
- DescribeWhiteBoxKeyResponse
- Throws:
TencentCloudSDKException
-
DescribeWhiteBoxKeyDetails
public DescribeWhiteBoxKeyDetailsResponse DescribeWhiteBoxKeyDetails(DescribeWhiteBoxKeyDetailsRequest req) throws TencentCloudSDKException
获取白盒密钥列表- Parameters:
req- DescribeWhiteBoxKeyDetailsRequest- Returns:
- DescribeWhiteBoxKeyDetailsResponse
- Throws:
TencentCloudSDKException
-
DescribeWhiteBoxServiceStatus
public DescribeWhiteBoxServiceStatusResponse DescribeWhiteBoxServiceStatus(DescribeWhiteBoxServiceStatusRequest req) throws TencentCloudSDKException
获取白盒密钥服务状态- Parameters:
req- DescribeWhiteBoxServiceStatusRequest- Returns:
- DescribeWhiteBoxServiceStatusResponse
- Throws:
TencentCloudSDKException
-
DisableKey
public DisableKeyResponse DisableKey(DisableKeyRequest req) throws TencentCloudSDKException
本接口用于禁用一个主密钥,处于禁用状态的Key无法用于加密、解密操作。- Parameters:
req- DisableKeyRequest- Returns:
- DisableKeyResponse
- Throws:
TencentCloudSDKException
-
DisableKeyRotation
public DisableKeyRotationResponse DisableKeyRotation(DisableKeyRotationRequest req) throws TencentCloudSDKException
对指定的CMK禁止密钥轮换功能。- Parameters:
req- DisableKeyRotationRequest- Returns:
- DisableKeyRotationResponse
- Throws:
TencentCloudSDKException
-
DisableKeys
public DisableKeysResponse DisableKeys(DisableKeysRequest req) throws TencentCloudSDKException
该接口用于批量禁止CMK的使用。- Parameters:
req- DisableKeysRequest- Returns:
- DisableKeysResponse
- Throws:
TencentCloudSDKException
-
DisableWhiteBoxKey
public DisableWhiteBoxKeyResponse DisableWhiteBoxKey(DisableWhiteBoxKeyRequest req) throws TencentCloudSDKException
禁用白盒密钥- Parameters:
req- DisableWhiteBoxKeyRequest- Returns:
- DisableWhiteBoxKeyResponse
- Throws:
TencentCloudSDKException
-
DisableWhiteBoxKeys
public DisableWhiteBoxKeysResponse DisableWhiteBoxKeys(DisableWhiteBoxKeysRequest req) throws TencentCloudSDKException
批量禁用白盒密钥- Parameters:
req- DisableWhiteBoxKeysRequest- Returns:
- DisableWhiteBoxKeysResponse
- Throws:
TencentCloudSDKException
-
EnableKey
public EnableKeyResponse EnableKey(EnableKeyRequest req) throws TencentCloudSDKException
用于启用一个指定的CMK。- Parameters:
req- EnableKeyRequest- Returns:
- EnableKeyResponse
- Throws:
TencentCloudSDKException
-
EnableKeyRotation
public EnableKeyRotationResponse EnableKeyRotation(EnableKeyRotationRequest req) throws TencentCloudSDKException
对指定的CMK开启密钥轮换功能。- Parameters:
req- EnableKeyRotationRequest- Returns:
- EnableKeyRotationResponse
- Throws:
TencentCloudSDKException
-
EnableKeys
public EnableKeysResponse EnableKeys(EnableKeysRequest req) throws TencentCloudSDKException
该接口用于批量启用CMK。- Parameters:
req- EnableKeysRequest- Returns:
- EnableKeysResponse
- Throws:
TencentCloudSDKException
-
EnableWhiteBoxKey
public EnableWhiteBoxKeyResponse EnableWhiteBoxKey(EnableWhiteBoxKeyRequest req) throws TencentCloudSDKException
启用白盒密钥- Parameters:
req- EnableWhiteBoxKeyRequest- Returns:
- EnableWhiteBoxKeyResponse
- Throws:
TencentCloudSDKException
-
EnableWhiteBoxKeys
public EnableWhiteBoxKeysResponse EnableWhiteBoxKeys(EnableWhiteBoxKeysRequest req) throws TencentCloudSDKException
批量启用白盒密钥- Parameters:
req- EnableWhiteBoxKeysRequest- Returns:
- EnableWhiteBoxKeysResponse
- Throws:
TencentCloudSDKException
-
Encrypt
public EncryptResponse Encrypt(EncryptRequest req) throws TencentCloudSDKException
本接口用于加密最多为4KB任意数据,可用于加密数据库密码,RSA Key,或其它较小的敏感信息。对于应用的数据加密,使用GenerateDataKey生成的DataKey进行本地数据的加解密操作- Parameters:
req- EncryptRequest- Returns:
- EncryptResponse
- Throws:
TencentCloudSDKException
-
EncryptByWhiteBox
public EncryptByWhiteBoxResponse EncryptByWhiteBox(EncryptByWhiteBoxRequest req) throws TencentCloudSDKException
使用白盒密钥进行加密- Parameters:
req- EncryptByWhiteBoxRequest- Returns:
- EncryptByWhiteBoxResponse
- Throws:
TencentCloudSDKException
-
GenerateDataKey
public GenerateDataKeyResponse GenerateDataKey(GenerateDataKeyRequest req) throws TencentCloudSDKException
本接口生成一个数据密钥,您可以用这个密钥进行本地数据的加密。- Parameters:
req- GenerateDataKeyRequest- Returns:
- GenerateDataKeyResponse
- Throws:
TencentCloudSDKException
-
GenerateRandom
public GenerateRandomResponse GenerateRandom(GenerateRandomRequest req) throws TencentCloudSDKException
随机数生成接口。- Parameters:
req- GenerateRandomRequest- Returns:
- GenerateRandomResponse
- Throws:
TencentCloudSDKException
-
GetKeyRotationStatus
public GetKeyRotationStatusResponse GetKeyRotationStatus(GetKeyRotationStatusRequest req) throws TencentCloudSDKException
查询指定的CMK是否开启了密钥轮换功能。- Parameters:
req- GetKeyRotationStatusRequest- Returns:
- GetKeyRotationStatusResponse
- Throws:
TencentCloudSDKException
-
GetParametersForImport
public GetParametersForImportResponse GetParametersForImport(GetParametersForImportRequest req) throws TencentCloudSDKException
获取导入主密钥(CMK)材料的参数,返回的Token作为执行ImportKeyMaterial的参数之一,返回的PublicKey用于对自主导入密钥材料进行加密。返回的Token和PublicKey 24小时后失效,失效后如需重新导入,需要再次调用该接口获取新的Token和PublicKey。- Parameters:
req- GetParametersForImportRequest- Returns:
- GetParametersForImportResponse
- Throws:
TencentCloudSDKException
-
GetPublicKey
public GetPublicKeyResponse GetPublicKey(GetPublicKeyRequest req) throws TencentCloudSDKException
该接口用于获取非对称密钥的公钥信息,可用于本地数据加密或验签。只有处于Enabled状态的非对称密钥才可能获取公钥。- Parameters:
req- GetPublicKeyRequest- Returns:
- GetPublicKeyResponse
- Throws:
TencentCloudSDKException
-
GetRegions
public GetRegionsResponse GetRegions(GetRegionsRequest req) throws TencentCloudSDKException
获取可以提供KMS服务的地域列表- Parameters:
req- GetRegionsRequest- Returns:
- GetRegionsResponse
- Throws:
TencentCloudSDKException
-
GetServiceStatus
public GetServiceStatusResponse GetServiceStatus(GetServiceStatusRequest req) throws TencentCloudSDKException
用于查询该用户是否已开通KMS服务- Parameters:
req- GetServiceStatusRequest- Returns:
- GetServiceStatusResponse
- Throws:
TencentCloudSDKException
-
ImportKeyMaterial
public ImportKeyMaterialResponse ImportKeyMaterial(ImportKeyMaterialRequest req) throws TencentCloudSDKException
用于导入密钥材料。只有类型为EXTERNAL 的CMK 才可以导入,导入的密钥材料使用 GetParametersForImport 获取的密钥进行加密。可以为指定的 CMK 重新导入密钥材料,并重新指定过期时间,但必须导入相同的密钥材料。CMK 密钥材料导入后不可以更换密钥材料。导入的密钥材料过期或者被删除后,指定的CMK将无法使用,需要再次导入相同的密钥材料才能正常使用。CMK是独立的,同样的密钥材料可导入不同的 CMK 中,但使用其中一个 CMK 加密的数据无法使用另一个 CMK解密。 只有Enabled 和 PendingImport状态的CMK可以导入密钥材料。- Parameters:
req- ImportKeyMaterialRequest- Returns:
- ImportKeyMaterialResponse
- Throws:
TencentCloudSDKException
-
ListAlgorithms
public ListAlgorithmsResponse ListAlgorithms(ListAlgorithmsRequest req) throws TencentCloudSDKException
列出当前Region支持的加密方式- Parameters:
req- ListAlgorithmsRequest- Returns:
- ListAlgorithmsResponse
- Throws:
TencentCloudSDKException
-
ListKeyDetail
public ListKeyDetailResponse ListKeyDetail(ListKeyDetailRequest req) throws TencentCloudSDKException
根据指定Offset和Limit获取主密钥列表详情。- Parameters:
req- ListKeyDetailRequest- Returns:
- ListKeyDetailResponse
- Throws:
TencentCloudSDKException
-
ListKeys
public ListKeysResponse ListKeys(ListKeysRequest req) throws TencentCloudSDKException
列出账号下面状态为Enabled, Disabled 和 PendingImport 的CMK KeyId 列表- Parameters:
req- ListKeysRequest- Returns:
- ListKeysResponse
- Throws:
TencentCloudSDKException
-
OverwriteWhiteBoxDeviceFingerprints
public OverwriteWhiteBoxDeviceFingerprintsResponse OverwriteWhiteBoxDeviceFingerprints(OverwriteWhiteBoxDeviceFingerprintsRequest req) throws TencentCloudSDKException
覆盖指定密钥的设备指纹信息- Parameters:
req- OverwriteWhiteBoxDeviceFingerprintsRequest- Returns:
- OverwriteWhiteBoxDeviceFingerprintsResponse
- Throws:
TencentCloudSDKException
-
PostQuantumCryptoDecrypt
public PostQuantumCryptoDecryptResponse PostQuantumCryptoDecrypt(PostQuantumCryptoDecryptRequest req) throws TencentCloudSDKException
本接口使用后量子密码算法密钥,解密密文,并得到明文数据。- Parameters:
req- PostQuantumCryptoDecryptRequest- Returns:
- PostQuantumCryptoDecryptResponse
- Throws:
TencentCloudSDKException
-
PostQuantumCryptoEncrypt
public PostQuantumCryptoEncryptResponse PostQuantumCryptoEncrypt(PostQuantumCryptoEncryptRequest req) throws TencentCloudSDKException
本接口使用后量子密码算法密钥,可加密最多为4KB任意数据,可用于加密数据库密码,RSA Key,或其它较小的敏感信息。对于应用的数据加密,使用GenerateDataKey生成的DataKey进行本地数据的加解密操作。- Parameters:
req- PostQuantumCryptoEncryptRequest- Returns:
- PostQuantumCryptoEncryptResponse
- Throws:
TencentCloudSDKException
-
PostQuantumCryptoSign
public PostQuantumCryptoSignResponse PostQuantumCryptoSign(PostQuantumCryptoSignRequest req) throws TencentCloudSDKException
使用后量子密码算法签名验签密钥进行签名。- Parameters:
req- PostQuantumCryptoSignRequest- Returns:
- PostQuantumCryptoSignResponse
- Throws:
TencentCloudSDKException
-
PostQuantumCryptoVerify
public PostQuantumCryptoVerifyResponse PostQuantumCryptoVerify(PostQuantumCryptoVerifyRequest req) throws TencentCloudSDKException
使用后量子密码算法密钥对签名进行验证。- Parameters:
req- PostQuantumCryptoVerifyRequest- Returns:
- PostQuantumCryptoVerifyResponse
- Throws:
TencentCloudSDKException
-
ReEncrypt
public ReEncryptResponse ReEncrypt(ReEncryptRequest req) throws TencentCloudSDKException
使用指定CMK对密文重新加密。- Parameters:
req- ReEncryptRequest- Returns:
- ReEncryptResponse
- Throws:
TencentCloudSDKException
-
ScheduleKeyDeletion
public ScheduleKeyDeletionResponse ScheduleKeyDeletion(ScheduleKeyDeletionRequest req) throws TencentCloudSDKException
CMK计划删除接口,用于指定CMK删除的时间,可选时间区间为[7,30]天- Parameters:
req- ScheduleKeyDeletionRequest- Returns:
- ScheduleKeyDeletionResponse
- Throws:
TencentCloudSDKException
-
SignByAsymmetricKey
public SignByAsymmetricKeyResponse SignByAsymmetricKey(SignByAsymmetricKeyRequest req) throws TencentCloudSDKException
非对称密钥签名。 注意:只有 KeyUsage 为 ASYMMETRIC_SIGN_VERIFY_SM2、ASYMMETRIC_SIGN_VERIFY_ECC 或其他支持的 ASYMMETRIC_SIGN_VERIFY_${ALGORITHM} 的密钥才可以使用签名功能。- Parameters:
req- SignByAsymmetricKeyRequest- Returns:
- SignByAsymmetricKeyResponse
- Throws:
TencentCloudSDKException
-
UnbindCloudResource
public UnbindCloudResourceResponse UnbindCloudResource(UnbindCloudResourceRequest req) throws TencentCloudSDKException
删除指定(key, 资源,云产品)的记录,以表明:指定的云产品的资源已不再使用当前的key。- Parameters:
req- UnbindCloudResourceRequest- Returns:
- UnbindCloudResourceResponse
- Throws:
TencentCloudSDKException
-
UpdateAlias
public UpdateAliasResponse UpdateAlias(UpdateAliasRequest req) throws TencentCloudSDKException
用于修改CMK的别名。对于处于PendingDelete状态的CMK禁止修改。- Parameters:
req- UpdateAliasRequest- Returns:
- UpdateAliasResponse
- Throws:
TencentCloudSDKException
-
UpdateKeyDescription
public UpdateKeyDescriptionResponse UpdateKeyDescription(UpdateKeyDescriptionRequest req) throws TencentCloudSDKException
该接口用于对指定的cmk修改描述信息。对于处于PendingDelete状态的CMK禁止修改。- Parameters:
req- UpdateKeyDescriptionRequest- Returns:
- UpdateKeyDescriptionResponse
- Throws:
TencentCloudSDKException
-
VerifyByAsymmetricKey
public VerifyByAsymmetricKeyResponse VerifyByAsymmetricKey(VerifyByAsymmetricKeyRequest req) throws TencentCloudSDKException
使用非对称密钥验签- Parameters:
req- VerifyByAsymmetricKeyRequest- Returns:
- VerifyByAsymmetricKeyResponse
- Throws:
TencentCloudSDKException
-
-