alibabacloud-dkms-gcs-go-sdk

module
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2023 License: Apache-2.0

README

English | 简体中文

AlibabaCloud DKMS-GCS SDK for Go

Requirements

  • Go 1.13 or later.

Installation

If you use go mod to manage your dependence, You can declare the dependency on AlibabaCloud DKMS SDK for Go in the go.mod file:

require (
	github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1
	github.com/alibabacloud-go/tea v1.1.17
)

Or, Run the following command to get the remote code package:

$ go get -u github.com/aliyun/alibabacloud-dkms-gcs-go-sdk

Quick Examples

package example

import (
	"fmt"
	"github.com/alibabacloud-go/tea/tea"
	dedicatedkmsopenapi "github.com/aliyun/alibabacloud-dkms-gcs-go-sdk/openapi"
	dedicatedkmsopenapiutil "github.com/aliyun/alibabacloud-dkms-gcs-go-sdk/openapi-util"
	dedicatedkmssdk "github.com/aliyun/alibabacloud-dkms-gcs-go-sdk/sdk"
)

func main() {
	config := &dedicatedkmsopenapi.Config{
		Protocol:         tea.String("https"),
		ClientKeyContent: tea.String("<your client key content>"),
		Password:         tea.String("<your client key password>"),
		Endpoint:         tea.String("<your dkms instance service endpoint>"),
	}
	client, err := dedicatedkmssdk.NewClient(config)
	if err != nil {
		panic(err)
	}
	runtimeOptions := &dedicatedkmsopenapiutil.RuntimeOptions{
		IgnoreSSL: tea.Bool(true),
	}
	encryptRequest := &dedicatedkmssdk.EncryptRequest{
		KeyId:     tea.String("<your key id>"),
		Plaintext: []byte("plaintext"),
	}
	encryptResponse, err := client.EncryptWithOptions(encryptRequest, runtimeOptions)
	if err != nil {
		panic(err)
	}
	fmt.Println(encryptResponse)
}

License

Apache-2.0

Copyright (c) 2009-present, Alibaba Cloud All rights reserved.

Directories

Path Synopsis
This file is auto-generated, don't edit it.
This file is auto-generated, don't edit it.
This file is auto-generated, don't edit it.
This file is auto-generated, don't edit it.
This file is auto-generated, don't edit it.
This file is auto-generated, don't edit it.
This file is auto-generated, don't edit it.
This file is auto-generated, don't edit it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL