Install KMS instance SDK (C#)
The KMS instance SDK for C# lets you perform cryptographic operations and retrieve secret values using keys stored in a KMS instance.
Resources: Source code and releases
Prerequisites
Before you begin, make sure you have:
A KMS instance that is purchased and enabled. See Purchase and enable a KMS instance.
A key created in the instance. See Software-protected keys and Hardware-protected keys.
(Optional) A secret created in the instance, if your application retrieves secret values. See Create a secret.
Network access from your application's runtime environment to the KMS instance Virtual Private Cloud (VPC) address (
<KMS_INSTANCE_ID>.cryptoservice.kms.aliyuncs.com). See Network requirements.
Install the SDK
Requirements: .NET Framework 5.0 or later, or .NET Standard 2.0 or later.
Using the .NET CLI
Run the following command in your project directory:
dotnet add package AlibabaCloud.Dkms.Gcs.SdkUse the latest version of the SDK. For version history, see the open source code repository.
Network requirements
Your application's runtime environment must be able to reach the KMS instance VPC address: <KMS_INSTANCE_ID>.cryptoservice.kms.aliyuncs.com.
| Scenario | Configuration required |
|---|---|
| Application and KMS instance are in the same region and same VPC | None. They are connected by default. |
| Application and KMS instance are in the same region but different VPCs | Associate the application's VPC with the KMS instance. See Access a KMS instance from multiple VPCs in the same region. |
| Application runs in an on-premises data center | Configure network connectivity to the KMS instance without using domain names. See Application access FAQ. |