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);
}
Aggregations