Search in sources :

Example 1 with KmsClient

use of com.tencentcloudapi.kms.v20190118.KmsClient in project ranger by apache.

the class RangerTencentKMSProvider method createKMSClient.

public static KmsClient createKMSClient(Configuration conf) throws Exception {
    String tencentClientId = conf.get(TENCENT_CLIENT_ID);
    if (StringUtils.isEmpty(tencentClientId)) {
        throw new Exception("Tencent KMS is enabled, but client id is not configured");
    }
    String tencentClientSecret = conf.get(TENCENT_CLIENT_SECRET);
    String tencentClientRegion = conf.get(TENCENT_CLIENT_REGION);
    return new KmsClient(new Credential(tencentClientId, tencentClientSecret), tencentClientRegion);
}
Also used : Credential(com.tencentcloudapi.common.Credential) KmsClient(com.tencentcloudapi.kms.v20190118.KmsClient) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException)

Aggregations

Credential (com.tencentcloudapi.common.Credential)1 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)1 KmsClient (com.tencentcloudapi.kms.v20190118.KmsClient)1