tencentyun / cos-java-sdk-v5

java sdk for qcloud cos v5 (xml api)
MIT License
155 stars 142 forks source link

support to set KMS Server endpoint when use client-side-encryption #170

Open sinjoywong opened 9 months ago

sinjoywong commented 9 months ago

在测试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);
      }