kms

package
v1.0.103 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegion          = "cn-north-1"
	ServiceVersion20210218 = "2021-02-18"
	ServiceName            = "kms"
)

Variables

View Source
var (
	ServiceInfo = &base.ServiceInfo{
		Timeout: 5 * time.Second,
		Host:    "open.volcengineapi.com",
		Header: http.Header{
			"Accept": []string{"application/json"},
		},
	}

	ApiInfoList = map[string]*base.ApiInfo{
		"CreateKeyring": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreateKeyring"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"DescribeKeyrings": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DescribeKeyrings"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"UpdateKeyring": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"UpdateKeyring"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"QueryKeyring": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"QueryKeyring"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"CreateKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreateKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"DescribeKeys": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DescribeKeys"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"DescribeKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DescribeKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"UpdateKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"UpdateKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"GenerateDataKey": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GenerateDataKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"Encrypt": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"Encrypt"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"Decrypt": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"Decrypt"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"EnableKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"EnableKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"DisableKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DisableKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"ScheduleKeyDeletion": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ScheduleKeyDeletion"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"CancelKeyDeletion": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CancelKeyDeletion"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"ArchiveKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ArchiveKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"CancelArchiveKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CancelArchiveKey"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"EnableKeyRotation": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"EnableKeyRotation"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"DisableKeyRotation": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DisableKeyRotation"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
		"ReEncrypt": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ReEncrypt"},
				"Version": []string{ServiceVersion20210218},
			},
			Retry: defaultRetrySetting,
		},
	}
)
View Source
var DefaultInstance = NewInstance()

DefaultInstance 默认的实例

Functions

This section is empty.

Types

type ArchiveKeyRequest

type ArchiveKeyRequest struct {
	KeyringName string `json:"KeyringName,required" query:"KeyringName,required" form:"KeyringName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
	KeyName     string `json:"KeyName,required" query:"KeyName,required" form:"KeyName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
}

ArchiveKeyRequest ...

type ArchiveKeyResponse

type ArchiveKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
}

ArchiveKeyResponse ...

type Base

type Base struct {
	ID           uuid.UUID
	CreationDate int64
	UpdateDate   int64
}

Base ...

type CancelArchiveKeyRequest

type CancelArchiveKeyRequest struct {
	KeyringName string `json:"KeyringName,required" query:"KeyringName,required" form:"KeyringName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
	KeyName     string `json:"KeyName,required" query:"KeyName,required" form:"KeyName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
}

CancelArchiveKeyRequest ...

type CancelArchiveKeyResponse

type CancelArchiveKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
}

CancelArchiveKeyResponse ...

type CancelKeyDeletionRequest

type CancelKeyDeletionRequest struct {
	KeyringName string
	KeyName     string
}

CancelKeyDeletionRequest ...

type CancelKeyDeletionResponse

type CancelKeyDeletionResponse struct {
	ResponseMetadata base.ResponseMetadata
}

CancelKeyDeletionResponse ...

type CreateKeyRequest

type CreateKeyRequest struct {
	KeyringName     string
	KeyName         string
	KeySpec         *string
	Description     *string
	KeyUsage        *string
	ProtectionLevel *string
}

CreateKeyRequest ...

type CreateKeyResponse

type CreateKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *CreateKeyResult `json:",omitempty"`
}

CreateKeyResponse ...

type CreateKeyResult

type CreateKeyResult struct {
	Key *CustomerMasterKey
}

CreateKeyResult ...

type CreateKeyringRequest

type CreateKeyringRequest struct {
	KeyringName string
	KeyringType *string
	Description *string
}

CreateKeyringRequest ...

type CreateKeyringResponse

type CreateKeyringResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *CreateKeyringResult `json:",omitempty"`
}

CreateKeyringResponse ...

type CreateKeyringResult

type CreateKeyringResult struct {
	Keyring *Keyring
}

CreateKeyringResult ...

type CustomerMasterKey

type CustomerMasterKey struct {
	Base
	KeyName            string
	KeySpec            string
	Description        string
	KeyState           string
	KeyUsage           string
	ProtectionLevel    string
	ScheduleDeleteTime *time.Time `json:",omitempty"`
}

CustomerMasterKey ...

type DecryptRequest

type DecryptRequest struct {
	EncryptionContext map[string]string
	CiphertextBlob    []byte
}

DecryptRequest ...

type DecryptResponse

type DecryptResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *DecryptResult `json:",omitempty"`
}

DecryptResponse ...

type DecryptResult

type DecryptResult struct {
	Plaintext []byte
}

DecryptResult ...

type DescribeKeyRequest

type DescribeKeyRequest struct {
	KeyringName string
	KeyName     string
}

DescribeKeyRequest ...

type DescribeKeyResponse

type DescribeKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *DescribeKeyResult `json:",omitempty"`
}

DescribeKeyResponse ...

type DescribeKeyResult

type DescribeKeyResult struct {
	Key *CustomerMasterKey
}

DescribeKeyResult ...

type DescribeKeyringsRequest

type DescribeKeyringsRequest struct {
	CurrentPage *int
	PageSize    *int
}

DescribeKeyringsRequest ...

type DescribeKeyringsResponse

type DescribeKeyringsResponse struct {
	PageInfo         *PaginationInfo `json:",omitempty"`
	ResponseMetadata base.ResponseMetadata
	Result           *DescribeKeyringsResult `json:",omitempty"`
}

DescribeKeyringsResponse ...

type DescribeKeyringsResult

type DescribeKeyringsResult struct {
	Keyrings []*Keyring
}

DescribeKeyringsResult ...

type DescribeKeysRequest

type DescribeKeysRequest struct {
	KeyringName string
	CurrentPage *int
	PageSize    *int
}

DescribeKeysRequest ...

type DescribeKeysResponse

type DescribeKeysResponse struct {
	PageInfo         *PaginationInfo `json:",omitempty"`
	ResponseMetadata base.ResponseMetadata
	Result           *DescribeKeysResult `json:",omitempty"`
}

DescribeKeysResponse ...

type DescribeKeysResult

type DescribeKeysResult struct {
	Keys []*CustomerMasterKey
}

DescribeKeysResult ...

type DisableKeyRequest

type DisableKeyRequest struct {
	KeyringName string
	KeyName     string
}

DisableKeyRequest ...

type DisableKeyResponse

type DisableKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
}

DisableKeyResponse ...

type DisableKeyRotationRequest

type DisableKeyRotationRequest struct {
	KeyringName string `json:"KeyringName,required" query:"KeyringName,required" form:"KeyringName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
	KeyName     string `json:"KeyName,required" query:"KeyName,required" form:"KeyName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
}

DisableKeyRotationRequest ...

type DisableKeyRotationResponse

type DisableKeyRotationResponse struct {
	ResponseMetadata base.ResponseMetadata
}

DisableKeyRotationResponse ...

type EnableKeyRequest

type EnableKeyRequest struct {
	KeyringName string
	KeyName     string
}

EnableKeyRequest ...

type EnableKeyResponse

type EnableKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
}

EnableKeyResponse ...

type EnableKeyRotationRequest

type EnableKeyRotationRequest struct {
	KeyringName string `json:"KeyringName,required" query:"KeyringName,required" form:"KeyringName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
	KeyName     string `json:"KeyName,required" query:"KeyName,required" form:"KeyName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
}

EnableKeyRotationRequest ...

type EnableKeyRotationResponse

type EnableKeyRotationResponse struct {
	ResponseMetadata base.ResponseMetadata
}

EnableKeyRotationResponse ...

type EncryptRequest

type EncryptRequest struct {
	KeyringName       string
	KeyName           string
	EncryptionContext map[string]string
	Plaintext         []byte
}

EncryptRequest ...

type EncryptResponse

type EncryptResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *EncryptResult `json:",omitempty"`
}

EncryptResponse ...

type EncryptResult

type EncryptResult struct {
	CiphertextBlob []byte
}

EncryptResult ...

type GenerateDataKeyRequest

type GenerateDataKeyRequest struct {
	KeyringName       string
	KeyName           string
	EncryptionContext map[string]string
	NumberOfBytes     *int
}

GenerateDataKeyRequest ...

type GenerateDataKeyResponse

type GenerateDataKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *GenerateDataKeyResult `json:",omitempty"`
}

GenerateDataKeyResponse ...

type GenerateDataKeyResult

type GenerateDataKeyResult struct {
	Plaintext      []byte
	CiphertextBlob []byte
}

GenerateDataKeyResult ...

type KMS

type KMS struct {
	Client *base.Client
}

KMS .

func NewInstance

func NewInstance() *KMS

NewInstance 创建一个实例

func (*KMS) ArchiveKey

func (p *KMS) ArchiveKey(req *ArchiveKeyRequest) (*ArchiveKeyResponse, int, error)

func (*KMS) CancelArchiveKey

func (p *KMS) CancelArchiveKey(req *CancelArchiveKeyRequest) (*CancelArchiveKeyResponse, int, error)

func (*KMS) CancelKeyDeletion

func (p *KMS) CancelKeyDeletion(req *CancelKeyDeletionRequest) (*CancelKeyDeletionResponse, int, error)

func (*KMS) CreateKey

func (p *KMS) CreateKey(req *CreateKeyRequest) (*CreateKeyResponse, int, error)

func (*KMS) CreateKeyring

func (p *KMS) CreateKeyring(req *CreateKeyringRequest) (*CreateKeyringResponse, int, error)

func (*KMS) CtxArchiveKey

func (p *KMS) CtxArchiveKey(ctx context.Context, req *ArchiveKeyRequest) (*ArchiveKeyResponse, int, error)

func (*KMS) CtxCancelArchiveKey

func (p *KMS) CtxCancelArchiveKey(ctx context.Context, req *CancelArchiveKeyRequest) (*CancelArchiveKeyResponse, int, error)

func (*KMS) CtxCancelKeyDeletion

func (p *KMS) CtxCancelKeyDeletion(ctx context.Context, req *CancelKeyDeletionRequest) (*CancelKeyDeletionResponse, int, error)

func (*KMS) CtxCreateKey

func (p *KMS) CtxCreateKey(ctx context.Context, req *CreateKeyRequest) (*CreateKeyResponse, int, error)

func (*KMS) CtxCreateKeyring

func (p *KMS) CtxCreateKeyring(ctx context.Context, req *CreateKeyringRequest) (*CreateKeyringResponse, int, error)

func (*KMS) CtxDecrypt

func (p *KMS) CtxDecrypt(ctx context.Context, req *DecryptRequest) (*DecryptResponse, int, error)

func (*KMS) CtxDescribeKey

func (p *KMS) CtxDescribeKey(ctx context.Context, req *DescribeKeyRequest) (*DescribeKeyResponse, int, error)

func (*KMS) CtxDescribeKeyrings

func (p *KMS) CtxDescribeKeyrings(ctx context.Context, req *DescribeKeyringsRequest) (*DescribeKeyringsResponse, int, error)

func (*KMS) CtxDescribeKeys

func (p *KMS) CtxDescribeKeys(ctx context.Context, req *DescribeKeysRequest) (*DescribeKeysResponse, int, error)

func (*KMS) CtxDisableKey

func (p *KMS) CtxDisableKey(ctx context.Context, req *DisableKeyRequest) (*DisableKeyResponse, int, error)

func (*KMS) CtxDisableKeyRotation

func (p *KMS) CtxDisableKeyRotation(ctx context.Context, req *DisableKeyRotationRequest) (*DisableKeyRotationResponse, int, error)

func (*KMS) CtxEnableKey

func (p *KMS) CtxEnableKey(ctx context.Context, req *EnableKeyRequest) (*EnableKeyResponse, int, error)

func (*KMS) CtxEnableKeyRotation

func (p *KMS) CtxEnableKeyRotation(ctx context.Context, req *EnableKeyRotationRequest) (*EnableKeyRotationResponse, int, error)

func (*KMS) CtxEncrypt

func (p *KMS) CtxEncrypt(ctx context.Context, req *EncryptRequest) (*EncryptResponse, int, error)

func (*KMS) CtxGenerateDataKey

func (p *KMS) CtxGenerateDataKey(ctx context.Context, req *GenerateDataKeyRequest) (*GenerateDataKeyResponse, int, error)

func (*KMS) CtxQueryKeyring

func (p *KMS) CtxQueryKeyring(ctx context.Context, req *QueryKeyringRequest) (*QueryKeyringResponse, int, error)

func (*KMS) CtxReEncrypt

func (p *KMS) CtxReEncrypt(ctx context.Context, req *ReEncryptRequest) (*ReEncryptResponse, int, error)

func (*KMS) CtxScheduleKeyDeletion

func (p *KMS) CtxScheduleKeyDeletion(ctx context.Context, req *ScheduleKeyDeletionRequest) (*ScheduleKeyDeletionResponse, int, error)

func (*KMS) CtxUpdateKey

func (p *KMS) CtxUpdateKey(ctx context.Context, req *UpdateKeyRequest) (*UpdateKeyResponse, int, error)

func (*KMS) CtxUpdateKeyring

func (p *KMS) CtxUpdateKeyring(ctx context.Context, req *UpdateKeyringRequest) (*UpdateKeyringResponse, int, error)

func (*KMS) Decrypt

func (p *KMS) Decrypt(req *DecryptRequest) (*DecryptResponse, int, error)

func (*KMS) DescribeKey

func (p *KMS) DescribeKey(req *DescribeKeyRequest) (*DescribeKeyResponse, int, error)

func (*KMS) DescribeKeyrings

func (p *KMS) DescribeKeyrings(req *DescribeKeyringsRequest) (*DescribeKeyringsResponse, int, error)

func (*KMS) DescribeKeys

func (p *KMS) DescribeKeys(req *DescribeKeysRequest) (*DescribeKeysResponse, int, error)

func (*KMS) DisableKey

func (p *KMS) DisableKey(req *DisableKeyRequest) (*DisableKeyResponse, int, error)

func (*KMS) DisableKeyRotation

func (p *KMS) DisableKeyRotation(req *DisableKeyRotationRequest) (*DisableKeyRotationResponse, int, error)

func (*KMS) EnableKey

func (p *KMS) EnableKey(req *EnableKeyRequest) (*EnableKeyResponse, int, error)

func (*KMS) EnableKeyRotation

func (p *KMS) EnableKeyRotation(req *EnableKeyRotationRequest) (*EnableKeyRotationResponse, int, error)

func (*KMS) Encrypt

func (p *KMS) Encrypt(req *EncryptRequest) (*EncryptResponse, int, error)

func (*KMS) GenerateDataKey

func (p *KMS) GenerateDataKey(req *GenerateDataKeyRequest) (*GenerateDataKeyResponse, int, error)

func (*KMS) GetAPIInfo

func (p *KMS) GetAPIInfo(api string) *base.ApiInfo

GetAPIInfo interface

func (*KMS) GetServiceInfo

func (p *KMS) GetServiceInfo() *base.ServiceInfo

GetServiceInfo interface

func (*KMS) QueryKeyring

func (p *KMS) QueryKeyring(req *QueryKeyringRequest) (*QueryKeyringResponse, int, error)

func (*KMS) ReEncrypt

func (p *KMS) ReEncrypt(req *ReEncryptRequest) (*ReEncryptResponse, int, error)

func (*KMS) ScheduleKeyDeletion

func (p *KMS) ScheduleKeyDeletion(req *ScheduleKeyDeletionRequest) (*ScheduleKeyDeletionResponse, int, error)

func (*KMS) SetHost

func (p *KMS) SetHost(host string)

SetHost .

func (*KMS) SetRegion

func (p *KMS) SetRegion(region string)

SetRegion .

func (*KMS) SetSchema

func (p *KMS) SetSchema(schema string)

SetSchema .

func (*KMS) UpdateKey

func (p *KMS) UpdateKey(req *UpdateKeyRequest) (*UpdateKeyResponse, int, error)

func (*KMS) UpdateKeyring

func (p *KMS) UpdateKeyring(req *UpdateKeyringRequest) (*UpdateKeyringResponse, int, error)

type Keyring

type Keyring struct {
	Base
	KeyringName string
	KeyringType string
	Description string
	UID         string
}

Keyring ...

type PaginationInfo

type PaginationInfo struct {
	TotalCount  int
	PageSize    int
	CurrentPage int
	Count       int
}

PaginationInfo ...

type QueryKeyringRequest

type QueryKeyringRequest struct {
	KeyringName string
}

QueryKeyringRequest ...

type QueryKeyringResponse

type QueryKeyringResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *QueryKeyringResult `json:",omitempty"`
}

QueryKeyringResponse ...

type QueryKeyringResult

type QueryKeyringResult struct {
	Keyring *Keyring
}

QueryKeyringResult ...

type ReEncryptRequest

type ReEncryptRequest struct {
	NewKeyringName       string            `` /* 130-byte string literal not displayed */
	NewKeyName           string            `json:"NewKeyName,required" query:"NewKeyName,required" form:"NewKeyName,required" vd:"regexp('^[a-zA-Z0-9-_]{2,31}$')"`
	OldEncryptionContext map[string]string `json:"" query:"" form:""`
	NewEncryptionContext map[string]string `json:"" query:"" form:""`
	CiphertextBlob       []byte            `json:"CiphertextBlob,required" query:"CiphertextBlob,required" form:"CiphertextBlob,required" vd:"len($)>18"`
}

ReEncryptRequest ...

type ReEncryptResponse

type ReEncryptResponse struct {
	ResponseMetadata base.ResponseMetadata
	Result           *ReEncryptResult `json:",omitempty"`
}

ReEncryptResponse ...

type ReEncryptResult

type ReEncryptResult struct {
	OldKeyringName string `json:"-"`
	OldKeyName     string `json:"-"`
	CiphertextBlob []byte `json:""`
}

ReEncryptResult ...

type ScheduleKeyDeletionRequest

type ScheduleKeyDeletionRequest struct {
	KeyringName         string
	KeyName             string
	PendingWindowInDays *int
}

ScheduleKeyDeletionRequest ...

type ScheduleKeyDeletionResponse

type ScheduleKeyDeletionResponse struct {
	ResponseMetadata base.ResponseMetadata
}

ScheduleKeyDeletionResponse ...

type UpdateKeyRequest

type UpdateKeyRequest struct {
	KeyringName string
	KeyName     string
	NewKeyName  *string
	Description *string
}

UpdateKeyRequest ...

type UpdateKeyResponse

type UpdateKeyResponse struct {
	ResponseMetadata base.ResponseMetadata
}

UpdateKeyResponse ...

type UpdateKeyringRequest

type UpdateKeyringRequest struct {
	KeyringName    string
	NewKeyringName *string
	Description    *string
}

UpdateKeyringRequest ...

type UpdateKeyringResponse

type UpdateKeyringResponse struct {
	ResponseMetadata base.ResponseMetadata
}

UpdateKeyringResponse ...

Jump to

Keyboard shortcuts

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