Secret SDKs are a tool for custom encapsulation of Key Management Service (KMS) API and KMS Instance API and encapsulate the capabilities to cache and refresh secrets in applications. Secret SDKs feature high service stability and easy integration with service applications for developers. This topic describes how to integrate secret SDKs.
Integration overview
Secret SDKs support only secret retrieval during service-related operations. Both shared and dedicated gateways can be used for access.
Differences between shared and dedicated gateways
Secret SDKs allow you to call KMS API and KMS Instance API over shared and dedicated gateways to retrieve secrets. Shared gateways are for the entire KMS network and support access over the Internet and virtual private clouds (VPCs). Dedicated gateways are for the network of a specific KMS instance and support only access over private networks.
Difference | Shared gateway | Dedicated gateway |
Recommended scenario |
|
|
Network | Internet or VPC | KMS private network |
Performance | For data encryption and decryption performance, queries per second (QPS) is 1,000 when shared gateways are used to access KMS. | The performance is subject to the computing performance of your KMS instance. For example, the computing performance can be 1,000 or 2,000 QPS. |
Configuration for client initialization |
|
|
API | GetSecretValue of KMS API | GetSecretValue of KMS Instance API |
Identity authentication |
| AAP authentication: client keys (dedicated gateway configuration). |
Types of secret SDKs
The following types of secret SDKs are available: the secret client, the secret Java Database Connectivity (JDBC) client, and the RAM secret plug-in. You can call the GetSecretValue operation of KMS API or KMS Instance API to query a KMS secret value over shared gateways or dedicated gateways. The GetSecretValue operation of KMS Instance API is not recommended. The preceding types of secret SDKs support different authentication methods and APIs. The following table describes the differences.
SDK type | Usage | Gateway and authentication method |
| Shared gateways:
Dedicated gateways (not recommended):
| |
| Shared gateways:
Dedicated gateways (not recommended): AAP authentication: client keys (dedicated gateway configuration). | |
| Shared gateways:
Dedicated gateways (not recommended): AAP authentication: client keys (dedicated gateway configuration). |
Supported APIs
API | Description | Shared gateway | Dedicated gateway |
GetSecretValue (KMS API) | Queries a secret value. | ||
GetSecretValue (KMS Instance API) | Queries a secret value. |
Endpoints
Identity authentication and authorization
Secret SDKs support RAM authentication and AAP authentication. AAP authentication is not recommended. RAM authentication methods include RAM roles, RAM roles of ECS instances, STS tokens, and AccessKey pairs. For AAP authentication, two authentication modes of dedicated gateway configuration and shared gateway configuration are provided for different gateways.
RAM authentication supports only shared gateways.
Dedicated gateways support only AAP authentication of the dedicated gateway configuration mode.
Authentication method | Access credential type | Gateway type |
RAM authentication | ARNs of RAM roles, RAM roles of ECS instances, STS tokens, and AccessKey pairs Note The RAM secret plug-in supports only RAM roles of ECS instances. | Shared gateways |
AAP authentication (not recommended) | Client keys for shared gateway configuration and clients keys for dedicated gateway configuration | Shared and dedicated gateways |
Supported programming languages
The following table describes the supported programming languages.
Secret SDK | Supported programming language |
Java (Java 8 and later), Python, and Go | |
Java (Java 8 and later) | |
Java (Java 8 and later), Python, and Go |