cos-java-sdk-v5
cos-java-sdk-v5 copied to clipboard
support to set KMS Server endpoint when use client-side-encryption
在测试TCE下kms托管的客户端加密功能时,发现sdk没有指定kms服务器的endpoint的配置接口,而是固定了公有云kms服务器地址。因此增加一个构造函数,可以配置kms服务器地址。 使用方法示例:
{
String kmsEndPoint = "";
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint(kmsEndPoint);
httpProfile.setProtocol(HttpProfile.REQ_HTTP);
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
COSEncryptionClient cosEncryptionClient =
new COSEncryptionClient(new COSStaticCredentialsProvider(cred),
new KMSEncryptionMaterialsProvider(encryptionMaterials), clientConfig,
cryptoConf,clientProfile);
}