All Products
Search
Document Center

Key Management Service:Install the KMS instance SDK (Java)

Last Updated:Feb 08, 2025

You can integrate Key Management Service (KMS) instance SDK to perform cryptographic operations and obtain secret values using keys. This topic describes how to install the KMS instance SDK (Java).

Network environment description

Ensure the application's runtime environment has network access to the KMS instance VPC address <KMS_INSTANCE_ID>.cryptoservice.kms.aliyuncs.com.

  • If the application's runtime environment and the KMS instance are in the same region and VPC, they are connected by default with no additional configuration required.

  • If the application runtime environment and the KMS instance are located in the same region but within different VPCs, you must associate the VPC of the application with the KMS instance. For instructions, see how to access the KMS instance from multiple VPCs in the same region.

  • If the application's runtime environment is within a local IDC, refer to this guide for configuring network connectivity to ensure access to the KMS instance without using Domain Names.

Prerequisites

Environment requirements

Java 8 or a later version must be downloaded and installed.

To check the Java (JDK) version, launch the terminal and enter java -version.

Install SDK

To install KMS instance SDK, add a Maven dependency to your project. The Java package will then be automatically downloaded from the Maven repository.

For installation details and source code, see alibabacloud-dkms-gcs-java-sdk.

Important
  • We recommend using the latest version of the SDK.

  • Ensure you have installed com.aliyun.tea version 1.2.3 or later.

<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>alibabacloud-dkms-gcs-sdk</artifactId>
  <version>xx.xx.xx</version>
</dependency>
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>tea</artifactId>
    <version>[1.2.3)</version>
</dependency>