Browse Source

由丰鲁成发起的KMS SDK自动发布, 版本号:1.4.9

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
haowei.yao 7 năm trước cách đây
mục cha
commit
59c063fe16

+ 5 - 0
ChangeLog.txt

@@ -1,3 +1,8 @@
+2018-03-29 Version: 1.4.9
+1, Add APIs: CreateAlias, UpdateAlias, DeleteAlias, ListAliases, ListAliasesByKeyId.
+2, Add APIs: GetParametersForImport, ImportKeyMaterial, DeleteKeyMaterial.
+3, Update KeyMetadata for CreateKey and DescribeKey.
+
 2018-03-29 Version: 1.4.8
 1, Cloud Enterprise Network SDK initial release.
 

+ 104 - 0
services/kms/cancel_key_deletion.go

@@ -0,0 +1,104 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// CancelKeyDeletion invokes the kms.CancelKeyDeletion API synchronously
+// api document: https://help.aliyun.com/api/kms/cancelkeydeletion.html
+func (client *Client) CancelKeyDeletion(request *CancelKeyDeletionRequest) (response *CancelKeyDeletionResponse, err error) {
+	response = CreateCancelKeyDeletionResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CancelKeyDeletionWithChan invokes the kms.CancelKeyDeletion API asynchronously
+// api document: https://help.aliyun.com/api/kms/cancelkeydeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CancelKeyDeletionWithChan(request *CancelKeyDeletionRequest) (<-chan *CancelKeyDeletionResponse, <-chan error) {
+	responseChan := make(chan *CancelKeyDeletionResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CancelKeyDeletion(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CancelKeyDeletionWithCallback invokes the kms.CancelKeyDeletion API asynchronously
+// api document: https://help.aliyun.com/api/kms/cancelkeydeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CancelKeyDeletionWithCallback(request *CancelKeyDeletionRequest, callback func(response *CancelKeyDeletionResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CancelKeyDeletionResponse
+		var err error
+		defer close(result)
+		response, err = client.CancelKeyDeletion(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CancelKeyDeletionRequest is the request struct for api CancelKeyDeletion
+type CancelKeyDeletionRequest struct {
+	*requests.RpcRequest
+	KeyId    string `position:"Query" name:"KeyId"`
+	STSToken string `position:"Query" name:"STSToken"`
+}
+
+// CancelKeyDeletionResponse is the response struct for api CancelKeyDeletion
+type CancelKeyDeletionResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateCancelKeyDeletionRequest creates a request to invoke CancelKeyDeletion API
+func CreateCancelKeyDeletionRequest() (request *CancelKeyDeletionRequest) {
+	request = &CancelKeyDeletionRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "CancelKeyDeletion", "kms", "openAPI")
+	return
+}
+
+// CreateCancelKeyDeletionResponse creates a response to parse from CancelKeyDeletion response
+func CreateCancelKeyDeletionResponse() (response *CancelKeyDeletionResponse) {
+	response = &CancelKeyDeletionResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 81 - 0
services/kms/client.go

@@ -0,0 +1,81 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+// Client is the sdk client struct, each func corresponds to an OpenAPI
+type Client struct {
+	sdk.Client
+}
+
+// NewClient creates a sdk client with environment variables
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	return
+}
+
+// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
+// this is the common api to create a sdk client
+func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithOptions(regionId, config, credential)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// usage: https://help.aliyun.com/document_detail/66217.html
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	return
+}
+
+// NewClientWithStsToken is a shortcut to create sdk client with sts token
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	return
+}
+
+// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
+// usage: https://help.aliyun.com/document_detail/66223.html
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	return
+}
+
+// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
+// attention: rsa key pair auth is only Japan regions available
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	return
+}

+ 105 - 0
services/kms/create_alias.go

@@ -0,0 +1,105 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// CreateAlias invokes the kms.CreateAlias API synchronously
+// api document: https://help.aliyun.com/api/kms/createalias.html
+func (client *Client) CreateAlias(request *CreateAliasRequest) (response *CreateAliasResponse, err error) {
+	response = CreateCreateAliasResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CreateAliasWithChan invokes the kms.CreateAlias API asynchronously
+// api document: https://help.aliyun.com/api/kms/createalias.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateAliasWithChan(request *CreateAliasRequest) (<-chan *CreateAliasResponse, <-chan error) {
+	responseChan := make(chan *CreateAliasResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateAlias(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CreateAliasWithCallback invokes the kms.CreateAlias API asynchronously
+// api document: https://help.aliyun.com/api/kms/createalias.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateAliasWithCallback(request *CreateAliasRequest, callback func(response *CreateAliasResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateAliasResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateAlias(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CreateAliasRequest is the request struct for api CreateAlias
+type CreateAliasRequest struct {
+	*requests.RpcRequest
+	KeyId     string `position:"Query" name:"KeyId"`
+	AliasName string `position:"Query" name:"AliasName"`
+	STSToken  string `position:"Query" name:"STSToken"`
+}
+
+// CreateAliasResponse is the response struct for api CreateAlias
+type CreateAliasResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateCreateAliasRequest creates a request to invoke CreateAlias API
+func CreateCreateAliasRequest() (request *CreateAliasRequest) {
+	request = &CreateAliasRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "CreateAlias", "kms", "openAPI")
+	return
+}
+
+// CreateCreateAliasResponse creates a response to parse from CreateAlias response
+func CreateCreateAliasResponse() (response *CreateAliasResponse) {
+	response = &CreateAliasResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 107 - 0
services/kms/create_key.go

@@ -0,0 +1,107 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// CreateKey invokes the kms.CreateKey API synchronously
+// api document: https://help.aliyun.com/api/kms/createkey.html
+func (client *Client) CreateKey(request *CreateKeyRequest) (response *CreateKeyResponse, err error) {
+	response = CreateCreateKeyResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CreateKeyWithChan invokes the kms.CreateKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/createkey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateKeyWithChan(request *CreateKeyRequest) (<-chan *CreateKeyResponse, <-chan error) {
+	responseChan := make(chan *CreateKeyResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateKey(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CreateKeyWithCallback invokes the kms.CreateKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/createkey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateKeyWithCallback(request *CreateKeyRequest, callback func(response *CreateKeyResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateKeyResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateKey(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CreateKeyRequest is the request struct for api CreateKey
+type CreateKeyRequest struct {
+	*requests.RpcRequest
+	Description string `position:"Query" name:"Description"`
+	KeyUsage    string `position:"Query" name:"KeyUsage"`
+	STSToken    string `position:"Query" name:"STSToken"`
+	Origin      string `position:"Query" name:"Origin"`
+}
+
+// CreateKeyResponse is the response struct for api CreateKey
+type CreateKeyResponse struct {
+	*responses.BaseResponse
+	RequestId   string      `json:"RequestId" xml:"RequestId"`
+	KeyMetadata KeyMetadata `json:"KeyMetadata" xml:"KeyMetadata"`
+}
+
+// CreateCreateKeyRequest creates a request to invoke CreateKey API
+func CreateCreateKeyRequest() (request *CreateKeyRequest) {
+	request = &CreateKeyRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "CreateKey", "kms", "openAPI")
+	return
+}
+
+// CreateCreateKeyResponse creates a response to parse from CreateKey response
+func CreateCreateKeyResponse() (response *CreateKeyResponse) {
+	response = &CreateKeyResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 107 - 0
services/kms/decrypt.go

@@ -0,0 +1,107 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// Decrypt invokes the kms.Decrypt API synchronously
+// api document: https://help.aliyun.com/api/kms/decrypt.html
+func (client *Client) Decrypt(request *DecryptRequest) (response *DecryptResponse, err error) {
+	response = CreateDecryptResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DecryptWithChan invokes the kms.Decrypt API asynchronously
+// api document: https://help.aliyun.com/api/kms/decrypt.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DecryptWithChan(request *DecryptRequest) (<-chan *DecryptResponse, <-chan error) {
+	responseChan := make(chan *DecryptResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.Decrypt(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DecryptWithCallback invokes the kms.Decrypt API asynchronously
+// api document: https://help.aliyun.com/api/kms/decrypt.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DecryptWithCallback(request *DecryptRequest, callback func(response *DecryptResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DecryptResponse
+		var err error
+		defer close(result)
+		response, err = client.Decrypt(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DecryptRequest is the request struct for api Decrypt
+type DecryptRequest struct {
+	*requests.RpcRequest
+	CiphertextBlob    string `position:"Query" name:"CiphertextBlob"`
+	STSToken          string `position:"Query" name:"STSToken"`
+	EncryptionContext string `position:"Query" name:"EncryptionContext"`
+}
+
+// DecryptResponse is the response struct for api Decrypt
+type DecryptResponse struct {
+	*responses.BaseResponse
+	Plaintext string `json:"Plaintext" xml:"Plaintext"`
+	KeyId     string `json:"KeyId" xml:"KeyId"`
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDecryptRequest creates a request to invoke Decrypt API
+func CreateDecryptRequest() (request *DecryptRequest) {
+	request = &DecryptRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "Decrypt", "kms", "openAPI")
+	return
+}
+
+// CreateDecryptResponse creates a response to parse from Decrypt response
+func CreateDecryptResponse() (response *DecryptResponse) {
+	response = &DecryptResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/kms/delete_alias.go

@@ -0,0 +1,104 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DeleteAlias invokes the kms.DeleteAlias API synchronously
+// api document: https://help.aliyun.com/api/kms/deletealias.html
+func (client *Client) DeleteAlias(request *DeleteAliasRequest) (response *DeleteAliasResponse, err error) {
+	response = CreateDeleteAliasResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DeleteAliasWithChan invokes the kms.DeleteAlias API asynchronously
+// api document: https://help.aliyun.com/api/kms/deletealias.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteAliasWithChan(request *DeleteAliasRequest) (<-chan *DeleteAliasResponse, <-chan error) {
+	responseChan := make(chan *DeleteAliasResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DeleteAlias(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DeleteAliasWithCallback invokes the kms.DeleteAlias API asynchronously
+// api document: https://help.aliyun.com/api/kms/deletealias.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteAliasWithCallback(request *DeleteAliasRequest, callback func(response *DeleteAliasResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DeleteAliasResponse
+		var err error
+		defer close(result)
+		response, err = client.DeleteAlias(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DeleteAliasRequest is the request struct for api DeleteAlias
+type DeleteAliasRequest struct {
+	*requests.RpcRequest
+	AliasName string `position:"Query" name:"AliasName"`
+	STSToken  string `position:"Query" name:"STSToken"`
+}
+
+// DeleteAliasResponse is the response struct for api DeleteAlias
+type DeleteAliasResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDeleteAliasRequest creates a request to invoke DeleteAlias API
+func CreateDeleteAliasRequest() (request *DeleteAliasRequest) {
+	request = &DeleteAliasRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "DeleteAlias", "kms", "openAPI")
+	return
+}
+
+// CreateDeleteAliasResponse creates a response to parse from DeleteAlias response
+func CreateDeleteAliasResponse() (response *DeleteAliasResponse) {
+	response = &DeleteAliasResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/kms/delete_key_material.go

@@ -0,0 +1,104 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DeleteKeyMaterial invokes the kms.DeleteKeyMaterial API synchronously
+// api document: https://help.aliyun.com/api/kms/deletekeymaterial.html
+func (client *Client) DeleteKeyMaterial(request *DeleteKeyMaterialRequest) (response *DeleteKeyMaterialResponse, err error) {
+	response = CreateDeleteKeyMaterialResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DeleteKeyMaterialWithChan invokes the kms.DeleteKeyMaterial API asynchronously
+// api document: https://help.aliyun.com/api/kms/deletekeymaterial.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteKeyMaterialWithChan(request *DeleteKeyMaterialRequest) (<-chan *DeleteKeyMaterialResponse, <-chan error) {
+	responseChan := make(chan *DeleteKeyMaterialResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DeleteKeyMaterial(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DeleteKeyMaterialWithCallback invokes the kms.DeleteKeyMaterial API asynchronously
+// api document: https://help.aliyun.com/api/kms/deletekeymaterial.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteKeyMaterialWithCallback(request *DeleteKeyMaterialRequest, callback func(response *DeleteKeyMaterialResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DeleteKeyMaterialResponse
+		var err error
+		defer close(result)
+		response, err = client.DeleteKeyMaterial(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DeleteKeyMaterialRequest is the request struct for api DeleteKeyMaterial
+type DeleteKeyMaterialRequest struct {
+	*requests.RpcRequest
+	KeyId    string `position:"Query" name:"KeyId"`
+	STSToken string `position:"Query" name:"STSToken"`
+}
+
+// DeleteKeyMaterialResponse is the response struct for api DeleteKeyMaterial
+type DeleteKeyMaterialResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDeleteKeyMaterialRequest creates a request to invoke DeleteKeyMaterial API
+func CreateDeleteKeyMaterialRequest() (request *DeleteKeyMaterialRequest) {
+	request = &DeleteKeyMaterialRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "DeleteKeyMaterial", "kms", "openAPI")
+	return
+}
+
+// CreateDeleteKeyMaterialResponse creates a response to parse from DeleteKeyMaterial response
+func CreateDeleteKeyMaterialResponse() (response *DeleteKeyMaterialResponse) {
+	response = &DeleteKeyMaterialResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 105 - 0
services/kms/describe_key.go

@@ -0,0 +1,105 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeKey invokes the kms.DescribeKey API synchronously
+// api document: https://help.aliyun.com/api/kms/describekey.html
+func (client *Client) DescribeKey(request *DescribeKeyRequest) (response *DescribeKeyResponse, err error) {
+	response = CreateDescribeKeyResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeKeyWithChan invokes the kms.DescribeKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/describekey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeKeyWithChan(request *DescribeKeyRequest) (<-chan *DescribeKeyResponse, <-chan error) {
+	responseChan := make(chan *DescribeKeyResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeKey(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeKeyWithCallback invokes the kms.DescribeKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/describekey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeKeyWithCallback(request *DescribeKeyRequest, callback func(response *DescribeKeyResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeKeyResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeKey(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeKeyRequest is the request struct for api DescribeKey
+type DescribeKeyRequest struct {
+	*requests.RpcRequest
+	KeyId    string `position:"Query" name:"KeyId"`
+	STSToken string `position:"Query" name:"STSToken"`
+}
+
+// DescribeKeyResponse is the response struct for api DescribeKey
+type DescribeKeyResponse struct {
+	*responses.BaseResponse
+	RequestId   string      `json:"RequestId" xml:"RequestId"`
+	KeyMetadata KeyMetadata `json:"KeyMetadata" xml:"KeyMetadata"`
+}
+
+// CreateDescribeKeyRequest creates a request to invoke DescribeKey API
+func CreateDescribeKeyRequest() (request *DescribeKeyRequest) {
+	request = &DescribeKeyRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "DescribeKey", "kms", "openAPI")
+	return
+}
+
+// CreateDescribeKeyResponse creates a response to parse from DescribeKey response
+func CreateDescribeKeyResponse() (response *DescribeKeyResponse) {
+	response = &DescribeKeyResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/kms/describe_regions.go

@@ -0,0 +1,104 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeRegions invokes the kms.DescribeRegions API synchronously
+// api document: https://help.aliyun.com/api/kms/describeregions.html
+func (client *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) {
+	response = CreateDescribeRegionsResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeRegionsWithChan invokes the kms.DescribeRegions API asynchronously
+// api document: https://help.aliyun.com/api/kms/describeregions.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRegionsWithChan(request *DescribeRegionsRequest) (<-chan *DescribeRegionsResponse, <-chan error) {
+	responseChan := make(chan *DescribeRegionsResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeRegions(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeRegionsWithCallback invokes the kms.DescribeRegions API asynchronously
+// api document: https://help.aliyun.com/api/kms/describeregions.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRegionsWithCallback(request *DescribeRegionsRequest, callback func(response *DescribeRegionsResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeRegionsResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeRegions(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeRegionsRequest is the request struct for api DescribeRegions
+type DescribeRegionsRequest struct {
+	*requests.RpcRequest
+	STSToken string `position:"Query" name:"STSToken"`
+}
+
+// DescribeRegionsResponse is the response struct for api DescribeRegions
+type DescribeRegionsResponse struct {
+	*responses.BaseResponse
+	RequestId string  `json:"RequestId" xml:"RequestId"`
+	Regions   Regions `json:"Regions" xml:"Regions"`
+}
+
+// CreateDescribeRegionsRequest creates a request to invoke DescribeRegions API
+func CreateDescribeRegionsRequest() (request *DescribeRegionsRequest) {
+	request = &DescribeRegionsRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "DescribeRegions", "kms", "openAPI")
+	return
+}
+
+// CreateDescribeRegionsResponse creates a response to parse from DescribeRegions response
+func CreateDescribeRegionsResponse() (response *DescribeRegionsResponse) {
+	response = &DescribeRegionsResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/kms/disable_key.go

@@ -0,0 +1,104 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DisableKey invokes the kms.DisableKey API synchronously
+// api document: https://help.aliyun.com/api/kms/disablekey.html
+func (client *Client) DisableKey(request *DisableKeyRequest) (response *DisableKeyResponse, err error) {
+	response = CreateDisableKeyResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DisableKeyWithChan invokes the kms.DisableKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/disablekey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DisableKeyWithChan(request *DisableKeyRequest) (<-chan *DisableKeyResponse, <-chan error) {
+	responseChan := make(chan *DisableKeyResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DisableKey(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DisableKeyWithCallback invokes the kms.DisableKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/disablekey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DisableKeyWithCallback(request *DisableKeyRequest, callback func(response *DisableKeyResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DisableKeyResponse
+		var err error
+		defer close(result)
+		response, err = client.DisableKey(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DisableKeyRequest is the request struct for api DisableKey
+type DisableKeyRequest struct {
+	*requests.RpcRequest
+	KeyId    string `position:"Query" name:"KeyId"`
+	STSToken string `position:"Query" name:"STSToken"`
+}
+
+// DisableKeyResponse is the response struct for api DisableKey
+type DisableKeyResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDisableKeyRequest creates a request to invoke DisableKey API
+func CreateDisableKeyRequest() (request *DisableKeyRequest) {
+	request = &DisableKeyRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "DisableKey", "kms", "openAPI")
+	return
+}
+
+// CreateDisableKeyResponse creates a response to parse from DisableKey response
+func CreateDisableKeyResponse() (response *DisableKeyResponse) {
+	response = &DisableKeyResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 104 - 0
services/kms/enable_key.go

@@ -0,0 +1,104 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// EnableKey invokes the kms.EnableKey API synchronously
+// api document: https://help.aliyun.com/api/kms/enablekey.html
+func (client *Client) EnableKey(request *EnableKeyRequest) (response *EnableKeyResponse, err error) {
+	response = CreateEnableKeyResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// EnableKeyWithChan invokes the kms.EnableKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/enablekey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) EnableKeyWithChan(request *EnableKeyRequest) (<-chan *EnableKeyResponse, <-chan error) {
+	responseChan := make(chan *EnableKeyResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.EnableKey(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// EnableKeyWithCallback invokes the kms.EnableKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/enablekey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) EnableKeyWithCallback(request *EnableKeyRequest, callback func(response *EnableKeyResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *EnableKeyResponse
+		var err error
+		defer close(result)
+		response, err = client.EnableKey(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// EnableKeyRequest is the request struct for api EnableKey
+type EnableKeyRequest struct {
+	*requests.RpcRequest
+	KeyId    string `position:"Query" name:"KeyId"`
+	STSToken string `position:"Query" name:"STSToken"`
+}
+
+// EnableKeyResponse is the response struct for api EnableKey
+type EnableKeyResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateEnableKeyRequest creates a request to invoke EnableKey API
+func CreateEnableKeyRequest() (request *EnableKeyRequest) {
+	request = &EnableKeyRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "EnableKey", "kms", "openAPI")
+	return
+}
+
+// CreateEnableKeyResponse creates a response to parse from EnableKey response
+func CreateEnableKeyResponse() (response *EnableKeyResponse) {
+	response = &EnableKeyResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 108 - 0
services/kms/encrypt.go

@@ -0,0 +1,108 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// Encrypt invokes the kms.Encrypt API synchronously
+// api document: https://help.aliyun.com/api/kms/encrypt.html
+func (client *Client) Encrypt(request *EncryptRequest) (response *EncryptResponse, err error) {
+	response = CreateEncryptResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// EncryptWithChan invokes the kms.Encrypt API asynchronously
+// api document: https://help.aliyun.com/api/kms/encrypt.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) EncryptWithChan(request *EncryptRequest) (<-chan *EncryptResponse, <-chan error) {
+	responseChan := make(chan *EncryptResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.Encrypt(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// EncryptWithCallback invokes the kms.Encrypt API asynchronously
+// api document: https://help.aliyun.com/api/kms/encrypt.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) EncryptWithCallback(request *EncryptRequest, callback func(response *EncryptResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *EncryptResponse
+		var err error
+		defer close(result)
+		response, err = client.Encrypt(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// EncryptRequest is the request struct for api Encrypt
+type EncryptRequest struct {
+	*requests.RpcRequest
+	KeyId             string `position:"Query" name:"KeyId"`
+	Plaintext         string `position:"Query" name:"Plaintext"`
+	STSToken          string `position:"Query" name:"STSToken"`
+	EncryptionContext string `position:"Query" name:"EncryptionContext"`
+}
+
+// EncryptResponse is the response struct for api Encrypt
+type EncryptResponse struct {
+	*responses.BaseResponse
+	CiphertextBlob string `json:"CiphertextBlob" xml:"CiphertextBlob"`
+	KeyId          string `json:"KeyId" xml:"KeyId"`
+	RequestId      string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateEncryptRequest creates a request to invoke Encrypt API
+func CreateEncryptRequest() (request *EncryptRequest) {
+	request = &EncryptRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "Encrypt", "kms", "openAPI")
+	return
+}
+
+// CreateEncryptResponse creates a response to parse from Encrypt response
+func CreateEncryptResponse() (response *EncryptResponse) {
+	response = &EncryptResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/kms/generate_data_key.go

@@ -0,0 +1,110 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// GenerateDataKey invokes the kms.GenerateDataKey API synchronously
+// api document: https://help.aliyun.com/api/kms/generatedatakey.html
+func (client *Client) GenerateDataKey(request *GenerateDataKeyRequest) (response *GenerateDataKeyResponse, err error) {
+	response = CreateGenerateDataKeyResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GenerateDataKeyWithChan invokes the kms.GenerateDataKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/generatedatakey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GenerateDataKeyWithChan(request *GenerateDataKeyRequest) (<-chan *GenerateDataKeyResponse, <-chan error) {
+	responseChan := make(chan *GenerateDataKeyResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GenerateDataKey(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GenerateDataKeyWithCallback invokes the kms.GenerateDataKey API asynchronously
+// api document: https://help.aliyun.com/api/kms/generatedatakey.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GenerateDataKeyWithCallback(request *GenerateDataKeyRequest, callback func(response *GenerateDataKeyResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GenerateDataKeyResponse
+		var err error
+		defer close(result)
+		response, err = client.GenerateDataKey(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GenerateDataKeyRequest is the request struct for api GenerateDataKey
+type GenerateDataKeyRequest struct {
+	*requests.RpcRequest
+	KeyId             string           `position:"Query" name:"KeyId"`
+	KeySpec           string           `position:"Query" name:"KeySpec"`
+	NumberOfBytes     requests.Integer `position:"Query" name:"NumberOfBytes"`
+	STSToken          string           `position:"Query" name:"STSToken"`
+	EncryptionContext string           `position:"Query" name:"EncryptionContext"`
+}
+
+// GenerateDataKeyResponse is the response struct for api GenerateDataKey
+type GenerateDataKeyResponse struct {
+	*responses.BaseResponse
+	CiphertextBlob string `json:"CiphertextBlob" xml:"CiphertextBlob"`
+	KeyId          string `json:"KeyId" xml:"KeyId"`
+	Plaintext      string `json:"Plaintext" xml:"Plaintext"`
+	RequestId      string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateGenerateDataKeyRequest creates a request to invoke GenerateDataKey API
+func CreateGenerateDataKeyRequest() (request *GenerateDataKeyRequest) {
+	request = &GenerateDataKeyRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "GenerateDataKey", "kms", "openAPI")
+	return
+}
+
+// CreateGenerateDataKeyResponse creates a response to parse from GenerateDataKey response
+func CreateGenerateDataKeyResponse() (response *GenerateDataKeyResponse) {
+	response = &GenerateDataKeyResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/kms/get_parameters_for_import.go

@@ -0,0 +1,110 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// GetParametersForImport invokes the kms.GetParametersForImport API synchronously
+// api document: https://help.aliyun.com/api/kms/getparametersforimport.html
+func (client *Client) GetParametersForImport(request *GetParametersForImportRequest) (response *GetParametersForImportResponse, err error) {
+	response = CreateGetParametersForImportResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GetParametersForImportWithChan invokes the kms.GetParametersForImport API asynchronously
+// api document: https://help.aliyun.com/api/kms/getparametersforimport.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetParametersForImportWithChan(request *GetParametersForImportRequest) (<-chan *GetParametersForImportResponse, <-chan error) {
+	responseChan := make(chan *GetParametersForImportResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GetParametersForImport(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GetParametersForImportWithCallback invokes the kms.GetParametersForImport API asynchronously
+// api document: https://help.aliyun.com/api/kms/getparametersforimport.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetParametersForImportWithCallback(request *GetParametersForImportRequest, callback func(response *GetParametersForImportResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GetParametersForImportResponse
+		var err error
+		defer close(result)
+		response, err = client.GetParametersForImport(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GetParametersForImportRequest is the request struct for api GetParametersForImport
+type GetParametersForImportRequest struct {
+	*requests.RpcRequest
+	KeyId             string `position:"Query" name:"KeyId"`
+	STSToken          string `position:"Query" name:"STSToken"`
+	WrappingAlgorithm string `position:"Query" name:"WrappingAlgorithm"`
+	WrappingKeySpec   string `position:"Query" name:"WrappingKeySpec"`
+}
+
+// GetParametersForImportResponse is the response struct for api GetParametersForImport
+type GetParametersForImportResponse struct {
+	*responses.BaseResponse
+	KeyId           string `json:"KeyId" xml:"KeyId"`
+	RequestId       string `json:"RequestId" xml:"RequestId"`
+	ImportToken     string `json:"ImportToken" xml:"ImportToken"`
+	PublicKey       string `json:"PublicKey" xml:"PublicKey"`
+	TokenExpireTime string `json:"TokenExpireTime" xml:"TokenExpireTime"`
+}
+
+// CreateGetParametersForImportRequest creates a request to invoke GetParametersForImport API
+func CreateGetParametersForImportRequest() (request *GetParametersForImportRequest) {
+	request = &GetParametersForImportRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "GetParametersForImport", "kms", "openAPI")
+	return
+}
+
+// CreateGetParametersForImportResponse creates a response to parse from GetParametersForImport response
+func CreateGetParametersForImportResponse() (response *GetParametersForImportResponse) {
+	response = &GetParametersForImportResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 107 - 0
services/kms/import_key_material.go

@@ -0,0 +1,107 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ImportKeyMaterial invokes the kms.ImportKeyMaterial API synchronously
+// api document: https://help.aliyun.com/api/kms/importkeymaterial.html
+func (client *Client) ImportKeyMaterial(request *ImportKeyMaterialRequest) (response *ImportKeyMaterialResponse, err error) {
+	response = CreateImportKeyMaterialResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ImportKeyMaterialWithChan invokes the kms.ImportKeyMaterial API asynchronously
+// api document: https://help.aliyun.com/api/kms/importkeymaterial.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ImportKeyMaterialWithChan(request *ImportKeyMaterialRequest) (<-chan *ImportKeyMaterialResponse, <-chan error) {
+	responseChan := make(chan *ImportKeyMaterialResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ImportKeyMaterial(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ImportKeyMaterialWithCallback invokes the kms.ImportKeyMaterial API asynchronously
+// api document: https://help.aliyun.com/api/kms/importkeymaterial.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ImportKeyMaterialWithCallback(request *ImportKeyMaterialRequest, callback func(response *ImportKeyMaterialResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ImportKeyMaterialResponse
+		var err error
+		defer close(result)
+		response, err = client.ImportKeyMaterial(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ImportKeyMaterialRequest is the request struct for api ImportKeyMaterial
+type ImportKeyMaterialRequest struct {
+	*requests.RpcRequest
+	KeyId                 string           `position:"Query" name:"KeyId"`
+	STSToken              string           `position:"Query" name:"STSToken"`
+	EncryptedKeyMaterial  string           `position:"Query" name:"EncryptedKeyMaterial"`
+	ImportToken           string           `position:"Query" name:"ImportToken"`
+	KeyMaterialExpireUnix requests.Integer `position:"Query" name:"KeyMaterialExpireUnix"`
+}
+
+// ImportKeyMaterialResponse is the response struct for api ImportKeyMaterial
+type ImportKeyMaterialResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateImportKeyMaterialRequest creates a request to invoke ImportKeyMaterial API
+func CreateImportKeyMaterialRequest() (request *ImportKeyMaterialRequest) {
+	request = &ImportKeyMaterialRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "ImportKeyMaterial", "kms", "openAPI")
+	return
+}
+
+// CreateImportKeyMaterialResponse creates a response to parse from ImportKeyMaterial response
+func CreateImportKeyMaterialResponse() (response *ImportKeyMaterialResponse) {
+	response = &ImportKeyMaterialResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 109 - 0
services/kms/list_aliases.go

@@ -0,0 +1,109 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ListAliases invokes the kms.ListAliases API synchronously
+// api document: https://help.aliyun.com/api/kms/listaliases.html
+func (client *Client) ListAliases(request *ListAliasesRequest) (response *ListAliasesResponse, err error) {
+	response = CreateListAliasesResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListAliasesWithChan invokes the kms.ListAliases API asynchronously
+// api document: https://help.aliyun.com/api/kms/listaliases.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListAliasesWithChan(request *ListAliasesRequest) (<-chan *ListAliasesResponse, <-chan error) {
+	responseChan := make(chan *ListAliasesResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListAliases(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListAliasesWithCallback invokes the kms.ListAliases API asynchronously
+// api document: https://help.aliyun.com/api/kms/listaliases.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListAliasesWithCallback(request *ListAliasesRequest, callback func(response *ListAliasesResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListAliasesResponse
+		var err error
+		defer close(result)
+		response, err = client.ListAliases(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListAliasesRequest is the request struct for api ListAliases
+type ListAliasesRequest struct {
+	*requests.RpcRequest
+	PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+	PageSize   requests.Integer `position:"Query" name:"PageSize"`
+	STSToken   string           `position:"Query" name:"STSToken"`
+}
+
+// ListAliasesResponse is the response struct for api ListAliases
+type ListAliasesResponse struct {
+	*responses.BaseResponse
+	TotalCount int                  `json:"TotalCount" xml:"TotalCount"`
+	PageNumber int                  `json:"PageNumber" xml:"PageNumber"`
+	PageSize   int                  `json:"PageSize" xml:"PageSize"`
+	RequestId  string               `json:"RequestId" xml:"RequestId"`
+	Aliases    AliasesInListAliases `json:"Aliases" xml:"Aliases"`
+}
+
+// CreateListAliasesRequest creates a request to invoke ListAliases API
+func CreateListAliasesRequest() (request *ListAliasesRequest) {
+	request = &ListAliasesRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "ListAliases", "kms", "openAPI")
+	return
+}
+
+// CreateListAliasesResponse creates a response to parse from ListAliases response
+func CreateListAliasesResponse() (response *ListAliasesResponse) {
+	response = &ListAliasesResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/kms/list_aliases_by_key_id.go

@@ -0,0 +1,110 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ListAliasesByKeyId invokes the kms.ListAliasesByKeyId API synchronously
+// api document: https://help.aliyun.com/api/kms/listaliasesbykeyid.html
+func (client *Client) ListAliasesByKeyId(request *ListAliasesByKeyIdRequest) (response *ListAliasesByKeyIdResponse, err error) {
+	response = CreateListAliasesByKeyIdResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListAliasesByKeyIdWithChan invokes the kms.ListAliasesByKeyId API asynchronously
+// api document: https://help.aliyun.com/api/kms/listaliasesbykeyid.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListAliasesByKeyIdWithChan(request *ListAliasesByKeyIdRequest) (<-chan *ListAliasesByKeyIdResponse, <-chan error) {
+	responseChan := make(chan *ListAliasesByKeyIdResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListAliasesByKeyId(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListAliasesByKeyIdWithCallback invokes the kms.ListAliasesByKeyId API asynchronously
+// api document: https://help.aliyun.com/api/kms/listaliasesbykeyid.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListAliasesByKeyIdWithCallback(request *ListAliasesByKeyIdRequest, callback func(response *ListAliasesByKeyIdResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListAliasesByKeyIdResponse
+		var err error
+		defer close(result)
+		response, err = client.ListAliasesByKeyId(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListAliasesByKeyIdRequest is the request struct for api ListAliasesByKeyId
+type ListAliasesByKeyIdRequest struct {
+	*requests.RpcRequest
+	KeyId      string           `position:"Query" name:"KeyId"`
+	PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+	PageSize   requests.Integer `position:"Query" name:"PageSize"`
+	STSToken   string           `position:"Query" name:"STSToken"`
+}
+
+// ListAliasesByKeyIdResponse is the response struct for api ListAliasesByKeyId
+type ListAliasesByKeyIdResponse struct {
+	*responses.BaseResponse
+	TotalCount int                         `json:"TotalCount" xml:"TotalCount"`
+	PageNumber int                         `json:"PageNumber" xml:"PageNumber"`
+	PageSize   int                         `json:"PageSize" xml:"PageSize"`
+	RequestId  string                      `json:"RequestId" xml:"RequestId"`
+	Aliases    AliasesInListAliasesByKeyId `json:"Aliases" xml:"Aliases"`
+}
+
+// CreateListAliasesByKeyIdRequest creates a request to invoke ListAliasesByKeyId API
+func CreateListAliasesByKeyIdRequest() (request *ListAliasesByKeyIdRequest) {
+	request = &ListAliasesByKeyIdRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "ListAliasesByKeyId", "kms", "openAPI")
+	return
+}
+
+// CreateListAliasesByKeyIdResponse creates a response to parse from ListAliasesByKeyId response
+func CreateListAliasesByKeyIdResponse() (response *ListAliasesByKeyIdResponse) {
+	response = &ListAliasesByKeyIdResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 109 - 0
services/kms/list_keys.go

@@ -0,0 +1,109 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ListKeys invokes the kms.ListKeys API synchronously
+// api document: https://help.aliyun.com/api/kms/listkeys.html
+func (client *Client) ListKeys(request *ListKeysRequest) (response *ListKeysResponse, err error) {
+	response = CreateListKeysResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ListKeysWithChan invokes the kms.ListKeys API asynchronously
+// api document: https://help.aliyun.com/api/kms/listkeys.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListKeysWithChan(request *ListKeysRequest) (<-chan *ListKeysResponse, <-chan error) {
+	responseChan := make(chan *ListKeysResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ListKeys(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ListKeysWithCallback invokes the kms.ListKeys API asynchronously
+// api document: https://help.aliyun.com/api/kms/listkeys.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ListKeysWithCallback(request *ListKeysRequest, callback func(response *ListKeysResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ListKeysResponse
+		var err error
+		defer close(result)
+		response, err = client.ListKeys(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ListKeysRequest is the request struct for api ListKeys
+type ListKeysRequest struct {
+	*requests.RpcRequest
+	PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+	PageSize   requests.Integer `position:"Query" name:"PageSize"`
+	STSToken   string           `position:"Query" name:"STSToken"`
+}
+
+// ListKeysResponse is the response struct for api ListKeys
+type ListKeysResponse struct {
+	*responses.BaseResponse
+	TotalCount int    `json:"TotalCount" xml:"TotalCount"`
+	PageNumber int    `json:"PageNumber" xml:"PageNumber"`
+	PageSize   int    `json:"PageSize" xml:"PageSize"`
+	RequestId  string `json:"RequestId" xml:"RequestId"`
+	Keys       Keys   `json:"Keys" xml:"Keys"`
+}
+
+// CreateListKeysRequest creates a request to invoke ListKeys API
+func CreateListKeysRequest() (request *ListKeysRequest) {
+	request = &ListKeysRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "ListKeys", "kms", "openAPI")
+	return
+}
+
+// CreateListKeysResponse creates a response to parse from ListKeys response
+func CreateListKeysResponse() (response *ListKeysResponse) {
+	response = &ListKeysResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 105 - 0
services/kms/schedule_key_deletion.go

@@ -0,0 +1,105 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// ScheduleKeyDeletion invokes the kms.ScheduleKeyDeletion API synchronously
+// api document: https://help.aliyun.com/api/kms/schedulekeydeletion.html
+func (client *Client) ScheduleKeyDeletion(request *ScheduleKeyDeletionRequest) (response *ScheduleKeyDeletionResponse, err error) {
+	response = CreateScheduleKeyDeletionResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ScheduleKeyDeletionWithChan invokes the kms.ScheduleKeyDeletion API asynchronously
+// api document: https://help.aliyun.com/api/kms/schedulekeydeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ScheduleKeyDeletionWithChan(request *ScheduleKeyDeletionRequest) (<-chan *ScheduleKeyDeletionResponse, <-chan error) {
+	responseChan := make(chan *ScheduleKeyDeletionResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ScheduleKeyDeletion(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ScheduleKeyDeletionWithCallback invokes the kms.ScheduleKeyDeletion API asynchronously
+// api document: https://help.aliyun.com/api/kms/schedulekeydeletion.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ScheduleKeyDeletionWithCallback(request *ScheduleKeyDeletionRequest, callback func(response *ScheduleKeyDeletionResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ScheduleKeyDeletionResponse
+		var err error
+		defer close(result)
+		response, err = client.ScheduleKeyDeletion(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ScheduleKeyDeletionRequest is the request struct for api ScheduleKeyDeletion
+type ScheduleKeyDeletionRequest struct {
+	*requests.RpcRequest
+	KeyId               string           `position:"Query" name:"KeyId"`
+	PendingWindowInDays requests.Integer `position:"Query" name:"PendingWindowInDays"`
+	STSToken            string           `position:"Query" name:"STSToken"`
+}
+
+// ScheduleKeyDeletionResponse is the response struct for api ScheduleKeyDeletion
+type ScheduleKeyDeletionResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateScheduleKeyDeletionRequest creates a request to invoke ScheduleKeyDeletion API
+func CreateScheduleKeyDeletionRequest() (request *ScheduleKeyDeletionRequest) {
+	request = &ScheduleKeyDeletionRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "ScheduleKeyDeletion", "kms", "openAPI")
+	return
+}
+
+// CreateScheduleKeyDeletionResponse creates a response to parse from ScheduleKeyDeletion response
+func CreateScheduleKeyDeletionResponse() (response *ScheduleKeyDeletionResponse) {
+	response = &ScheduleKeyDeletionResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 23 - 0
services/kms/struct_alias.go

@@ -0,0 +1,23 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Alias is a nested struct in kms response
+type Alias struct {
+	AliasArn  string `json:"AliasArn" xml:"AliasArn"`
+	AliasName string `json:"AliasName" xml:"AliasName"`
+	KeyId     string `json:"KeyId" xml:"KeyId"`
+}

+ 21 - 0
services/kms/struct_aliases_in_list_aliases.go

@@ -0,0 +1,21 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// AliasesInListAliases is a nested struct in kms response
+type AliasesInListAliases struct {
+	Alias []Alias `json:"Alias" xml:"Alias"`
+}

+ 21 - 0
services/kms/struct_aliases_in_list_aliases_by_key_id.go

@@ -0,0 +1,21 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// AliasesInListAliasesByKeyId is a nested struct in kms response
+type AliasesInListAliasesByKeyId struct {
+	Alias []Alias `json:"Alias" xml:"Alias"`
+}

+ 22 - 0
services/kms/struct_key.go

@@ -0,0 +1,22 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Key is a nested struct in kms response
+type Key struct {
+	KeyId  string `json:"KeyId" xml:"KeyId"`
+	KeyArn string `json:"KeyArn" xml:"KeyArn"`
+}

+ 30 - 0
services/kms/struct_key_metadata.go

@@ -0,0 +1,30 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// KeyMetadata is a nested struct in kms response
+type KeyMetadata struct {
+	Arn                string `json:"Arn" xml:"Arn"`
+	KeyState           string `json:"KeyState" xml:"KeyState"`
+	CreationDate       string `json:"CreationDate" xml:"CreationDate"`
+	KeyUsage           string `json:"KeyUsage" xml:"KeyUsage"`
+	DeleteDate         string `json:"DeleteDate" xml:"DeleteDate"`
+	Creator            string `json:"Creator" xml:"Creator"`
+	Origin             string `json:"Origin" xml:"Origin"`
+	Description        string `json:"Description" xml:"Description"`
+	KeyId              string `json:"KeyId" xml:"KeyId"`
+	MaterialExpireTime string `json:"MaterialExpireTime" xml:"MaterialExpireTime"`
+}

+ 21 - 0
services/kms/struct_keys.go

@@ -0,0 +1,21 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Keys is a nested struct in kms response
+type Keys struct {
+	Key []Key `json:"Key" xml:"Key"`
+}

+ 21 - 0
services/kms/struct_region.go

@@ -0,0 +1,21 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Region is a nested struct in kms response
+type Region struct {
+	RegionId string `json:"RegionId" xml:"RegionId"`
+}

+ 21 - 0
services/kms/struct_regions.go

@@ -0,0 +1,21 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Regions is a nested struct in kms response
+type Regions struct {
+	Region []Region `json:"Region" xml:"Region"`
+}

+ 105 - 0
services/kms/update_alias.go

@@ -0,0 +1,105 @@
+package kms
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UpdateAlias invokes the kms.UpdateAlias API synchronously
+// api document: https://help.aliyun.com/api/kms/updatealias.html
+func (client *Client) UpdateAlias(request *UpdateAliasRequest) (response *UpdateAliasResponse, err error) {
+	response = CreateUpdateAliasResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// UpdateAliasWithChan invokes the kms.UpdateAlias API asynchronously
+// api document: https://help.aliyun.com/api/kms/updatealias.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateAliasWithChan(request *UpdateAliasRequest) (<-chan *UpdateAliasResponse, <-chan error) {
+	responseChan := make(chan *UpdateAliasResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.UpdateAlias(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// UpdateAliasWithCallback invokes the kms.UpdateAlias API asynchronously
+// api document: https://help.aliyun.com/api/kms/updatealias.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateAliasWithCallback(request *UpdateAliasRequest, callback func(response *UpdateAliasResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *UpdateAliasResponse
+		var err error
+		defer close(result)
+		response, err = client.UpdateAlias(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// UpdateAliasRequest is the request struct for api UpdateAlias
+type UpdateAliasRequest struct {
+	*requests.RpcRequest
+	KeyId     string `position:"Query" name:"KeyId"`
+	AliasName string `position:"Query" name:"AliasName"`
+	STSToken  string `position:"Query" name:"STSToken"`
+}
+
+// UpdateAliasResponse is the response struct for api UpdateAlias
+type UpdateAliasResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUpdateAliasRequest creates a request to invoke UpdateAlias API
+func CreateUpdateAliasRequest() (request *UpdateAliasRequest) {
+	request = &UpdateAliasRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Kms", "2016-01-20", "UpdateAlias", "kms", "openAPI")
+	return
+}
+
+// CreateUpdateAliasResponse creates a response to parse from UpdateAlias response
+func CreateUpdateAliasResponse() (response *UpdateAliasResponse) {
+	response = &UpdateAliasResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}