ukms

package
v0.22.124 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ukms include resources of ucloud ukms product

See also

for detail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliasInfo

type AliasInfo struct {

	// 别名,含 alias/ 前缀。
	AliasName string

	// 创建时间,Unix 时间戳。
	CreationDate int

	// 最后更新时间,Unix 时间戳。
	LastUpdatedDate int

	// 别名指向的密钥资源长 ID。
	TargetKeyId string
}

AliasInfo - ListAliases 返回的别名项

type CancelKeyDeletionRequest

type CancelKeyDeletionRequest struct {
	request.CommonBase

	// 密钥  ID。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

CancelKeyDeletionRequest is request schema for CancelKeyDeletion action

type CancelKeyDeletionResponse

type CancelKeyDeletionResponse struct {
	response.CommonBase
}

CancelKeyDeletionResponse is response schema for CancelKeyDeletion action

type CreateAliasRequest

type CreateAliasRequest struct {
	request.CommonBase

	// 密钥别名,格式为 alias/name。
	AliasName *string `required:"true"`

	// 密钥 ID 或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

CreateAliasRequest is request schema for CreateAlias action

type CreateAliasResponse

type CreateAliasResponse struct {
	response.CommonBase
}

CreateAliasResponse is response schema for CreateAlias action

type CreateKeyRequest

type CreateKeyRequest struct {
	request.CommonBase

	// 可选密钥别名,格式为 alias/name。
	Alias *string `required:"false"`

	// 是否开启删除保护。可选值:true、false;默认 false。
	DeletionProtection *bool `required:"false"`

	// 密钥描述,最多 8192 字符。
	Description *string `required:"false"`

	// 密钥规格,默认 SYMMETRIC_DEFAULT(AES_256)。可选值:SYMMETRIC_DEFAULT(AES_256)、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
	KeySpec *string `required:"false"`

	// 密钥用途
	KeyUsage *string `required:"false"`

	// 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 1230。
	Origin *string `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"true"`
}

CreateKeyRequest is request schema for CreateKey action

type CreateKeyResponse

type CreateKeyResponse struct {
	response.CommonBase

	// 密钥 ID。
	KeyId string
}

CreateKeyResponse is response schema for CreateKey action

type DEK

type DEK struct {

	// 创建时间,Unix 时间戳。
	CreatedTime int

	// 密钥描述。
	Description string

	// 对外主密钥 ID(ukms_key_info.key_id)。
	KeyId string

	// 是否已开启自动轮转;未配置或已关闭均为 false
	KeyRotationEnabled bool

	// 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
	KeySpec string

	// 按 KeySpec 派生的密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
	KeyUsage []string

	// 下次自动轮转时间(Unix 时间戳,秒);仅在已开启自动轮转时返回。
	NextRotationDate int

	// 密钥所属组织的数字 ID,来源于密钥关联的资源交易记录。
	OrganizationId int

	// 密钥来源,由 Origin 派生。取值:UCLOUD_KMS、EXTERNAL。当前 CreateKey 仅支持 UCLOUD_KMS。
	Origin string

	// 计划删除时间,Unix 时间戳。
	PlanDeleteTime int

	// 密钥所属项目的对外别名,格式为 org-xxx。该值由项目数字 ID 解析得到,可能因项目别名查询失败而为空。
	ProjectId string

	// 密钥所属的 UKMS 实例资源 ID。
	ResourceId string

	// 自动轮转周期(天);未开启时为 0
	RotationPeriodInDays int

	// 数据库密钥状态。常见取值:Active、Deactivated、PendingDeletion。
	Status string

	// 更新时间,Unix 时间戳。
	UpdateTime int
}

DEK - ListKeys 返回项(代码结构 DEK)

type DecryptRequest

type DecryptRequest struct {
	request.CommonBase

	// 待解密密文。
	CiphertextBlob *string `required:"true"`

	// 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填。
	EncryptionAlgorithm *string `required:"false"`

	// 加密上下文,JSON Object。该参数内容会记录在日志中,请勿传入密码、密钥、令牌等敏感信息。
	EncryptionContext *string `required:"false"`

	// 主密钥 KeyId;对称密钥可空,从 CiphertextBlob 自动识别;非对称必填。
	KeyId *string `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

DecryptRequest is request schema for Decrypt action

type DecryptResponse

type DecryptResponse struct {
	response.CommonBase

	// 实际使用的解密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。
	EncryptionAlgorithm string

	// 密钥资源长 ID。
	KeyId string

	// 解密后的明文,Base64 编码。
	Plaintext string
}

DecryptResponse is response schema for Decrypt action

type DeleteAliasRequest

type DeleteAliasRequest struct {
	request.CommonBase

	// 密钥别名,格式为 alias/name。
	AliasName *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

DeleteAliasRequest is request schema for DeleteAlias action

type DeleteAliasResponse

type DeleteAliasResponse struct {
	response.CommonBase
}

DeleteAliasResponse is response schema for DeleteAlias action

type DescribeKeyRequest

type DescribeKeyRequest struct {
	request.CommonBase

	// 密钥资源长 ID、ARN 或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

DescribeKeyRequest is request schema for DescribeKey action

type DescribeKeyResponse

type DescribeKeyResponse struct {
	response.CommonBase

	// 密钥元数据。
	KeyMetadata KeyMetadata
}

DescribeKeyResponse is response schema for DescribeKey action

type DisableKeyRequest

type DisableKeyRequest struct {
	request.CommonBase

	// 密钥资源长 ID
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

DisableKeyRequest is request schema for DisableKey action

type DisableKeyResponse

type DisableKeyResponse struct {
	response.CommonBase
}

DisableKeyResponse is response schema for DisableKey action

type DisableKeyRotationRequest

type DisableKeyRotationRequest struct {
	request.CommonBase

	// 密钥 ID或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"true"`
}

DisableKeyRotationRequest is request schema for DisableKeyRotation action

type DisableKeyRotationResponse

type DisableKeyRotationResponse struct {
	response.CommonBase
}

DisableKeyRotationResponse is response schema for DisableKeyRotation action

type EnableKeyRequest

type EnableKeyRequest struct {
	request.CommonBase

	// 密钥资源长 ID
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

EnableKeyRequest is request schema for EnableKey action

type EnableKeyResponse

type EnableKeyResponse struct {
	response.CommonBase
}

EnableKeyResponse is response schema for EnableKey action

type EnableKeyRotationRequest

type EnableKeyRotationRequest struct {
	request.CommonBase

	// 密钥 ID、ARN 或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"true"`

	// 轮转周期,单位天。取值范围 1~2560,默认 365。仅 SYMMETRIC_DEFAULT 且 Origin=UCLOUD_KMS 的密钥支持轮转。
	RotationPeriodInDays *int `required:"false"`
}

EnableKeyRotationRequest is request schema for EnableKeyRotation action

type EnableKeyRotationResponse

type EnableKeyRotationResponse struct {
	response.CommonBase
}

EnableKeyRotationResponse is response schema for EnableKeyRotation action

type EncryptRequest

type EncryptRequest struct {
	request.CommonBase

	// 加密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;对称密钥默认 SYMMETRIC_DEFAULT,RSA 默认 RSAES_OAEP_SHA_256。
	EncryptionAlgorithm *string `required:"false"`

	// 加密上下文,JSON Object。该参数内容会记录在日志中,请勿传入密码、密钥、令牌等敏感信息。
	EncryptionContext *string `required:"false"`

	// 密钥资源长 ID 或别名。
	KeyId *string `required:"true"`

	// 待加密明文,Base64 编码。
	Plaintext *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

EncryptRequest is request schema for Encrypt action

type EncryptResponse

type EncryptResponse struct {
	response.CommonBase

	// 加密后的密文。
	CiphertextBlob string

	// 实际使用的加密算法。取值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。
	EncryptionAlgorithm string

	// 密钥资源长 ID。
	KeyId string
}

EncryptResponse is response schema for Encrypt action

type GenerateDataKeyPairRequest

type GenerateDataKeyPairRequest struct {
	request.CommonBase

	// 加密上下文
	EncryptionContext *string `required:"false"`

	// 密钥ID
	KeyId *string `required:"true"`

	// 密钥类型
	KeyPairSpec *string `required:"true"`
}

GenerateDataKeyPairRequest is request schema for GenerateDataKeyPair action

type GenerateDataKeyPairResponse

type GenerateDataKeyPairResponse struct {
	response.CommonBase

	// 公钥(明文)。
	DataPublicKey string

	// 用于加密私钥的 KMS 密钥
	KeyId string

	// 生成的数据键对类型。
	KeyPairSpec string

	// 私钥的加密副本。
	PrivateKeyCiphertextBlob string

	// 私钥的明文副本。
	PrivateKeyPlaintext string
}

GenerateDataKeyPairResponse is response schema for GenerateDataKeyPair action

type GenerateDataKeyPairWithoutPlaintextRequest

type GenerateDataKeyPairWithoutPlaintextRequest struct {
	request.CommonBase

	// 指定加密私钥时使用的加密上下文。
	EncryptionContext *string `required:"false"`

	// 密钥ID
	KeyId *string `required:"true"`

	// 指定生成的数据密钥对类型。
	KeyPairSpec *string `required:"true"`
}

GenerateDataKeyPairWithoutPlaintextRequest is request schema for GenerateDataKeyPairWithoutPlaintext action

type GenerateDataKeyPairWithoutPlaintextResponse

type GenerateDataKeyPairWithoutPlaintextResponse struct {
	response.CommonBase
}

GenerateDataKeyPairWithoutPlaintextResponse is response schema for GenerateDataKeyPairWithoutPlaintext action

type GenerateDataKeyRequest

type GenerateDataKeyRequest struct {
	request.CommonBase

	// 加密上下文,JSON Object。该参数内容会记录在日志中,请勿传入密码、密钥、令牌等敏感信息。
	EncryptionContext *string `required:"false"`

	// 密钥资源长 ID、ARN 或别名。
	KeyId *string `required:"true"`

	// 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。
	KeySpec *string `required:"false"`

	// 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。
	NumberOfBytes *int `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

GenerateDataKeyRequest is request schema for GenerateDataKey action

type GenerateDataKeyResponse

type GenerateDataKeyResponse struct {
	response.CommonBase

	// 加密后的数据密钥。
	CiphertextBlob string

	// 加密该数据密钥的密钥资源长 ID。
	KeyId string

	// 数据密钥明文,Base64 编码。
	Plaintext string
}

GenerateDataKeyResponse is response schema for GenerateDataKey action

type GenerateDataKeyWithoutPlaintextRequest

type GenerateDataKeyWithoutPlaintextRequest struct {
	request.CommonBase

	// 加密上下文,JSON Object。
	EncryptionContext *string `required:"false"`

	// 密钥资源长 ID或别名。
	KeyId *string `required:"true"`

	// 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。
	KeySpec *string `required:"false"`

	// 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。
	NumberOfBytes *int `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

GenerateDataKeyWithoutPlaintextRequest is request schema for GenerateDataKeyWithoutPlaintext action

type GenerateDataKeyWithoutPlaintextResponse

type GenerateDataKeyWithoutPlaintextResponse struct {
	response.CommonBase

	// 加密后的数据密钥。
	CiphertextBlob string

	// 加密该数据密钥的密钥资源长 ID。
	KeyId string
}

GenerateDataKeyWithoutPlaintextResponse is response schema for GenerateDataKeyWithoutPlaintext action

type GenerateMacRequest

type GenerateMacRequest struct {
	request.CommonBase

	// 密钥ID
	KeyId *string `required:"true"`

	// 用于生成消息认证码的 MAC 算法。
	MacAlgorithm *string `required:"true"`

	// 待哈希的消息。
	MacMessage *string `required:"true"`
}

GenerateMacRequest is request schema for GenerateMac action

type GenerateMacResponse

type GenerateMacResponse struct {
	response.CommonBase

	// 针对指定消息生成的基于哈希的消息认证码 (HMAC)、HMAC KMS 密钥和 MAC 算法。
	Mac string

	// 用于生成 HMAC 的 MAC 算法。
	MacAlgorithm string
}

GenerateMacResponse is response schema for GenerateMac action

type GenerateRandomRequest

type GenerateRandomRequest struct {
	request.CommonBase

	// 随机数长度,最大1024
	NumberOfBytes *int `required:"true"`
}

GenerateRandomRequest is request schema for GenerateRandom action

type GenerateRandomResponse

type GenerateRandomResponse struct {
	response.CommonBase

	// 随机字节串。
	Plaintext string
}

GenerateRandomResponse is response schema for GenerateRandom action

type GetKeyRotationStatusRequest

type GetKeyRotationStatusRequest struct {
	request.CommonBase

	// 密钥资源长 ID 或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"true"`
}

GetKeyRotationStatusRequest is request schema for GetKeyRotationStatus action

type GetKeyRotationStatusResponse

type GetKeyRotationStatusResponse struct {
	response.CommonBase

	// 密钥资源长 ID。
	KeyId string

	// 是否开启自动轮转。取值:true、false。
	KeyRotationEnabled bool

	// 最后一次轮转时间,Unix 时间戳。
	LastRotationDate int

	// 下次轮转时间,Unix 时间戳。
	NextRotationDate int

	// 按需轮转开始时间,Unix 时间戳。
	OnDemandRotationStartDate int

	// 轮转周期,单位天;未开启时返回 0。
	RotationPeriodInDays int
}

GetKeyRotationStatusResponse is response schema for GetKeyRotationStatus action

type GetPublicKeyRequest

type GetPublicKeyRequest struct {
	request.CommonBase

	// 密钥 ID 或 别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

GetPublicKeyRequest is request schema for GetPublicKey action

type GetPublicKeyResponse

type GetPublicKeyResponse struct {
	response.CommonBase

	// 支持的加密算法列表。取值范围:RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256。
	EncryptionAlgorithms []string

	// 密钥 ID。
	KeyId string

	// 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
	KeySpec string

	// 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
	KeyUsage []string

	// PEM 或 DER 编码的公钥。
	KmsPublicKey string

	// 支持的签名算法列表。取值范围:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。
	SigningAlgorithms []string
}

GetPublicKeyResponse is response schema for GetPublicKey action

type KeyMetadata

type KeyMetadata struct {

	// ucs:ukms:{Region}:{CompanyId}:key/{KeyId}
	Arn string

	// 创建时间,Unix 时间戳。
	CreationDate int

	// 计划删除时间,Unix 时间戳。
	DeletionDate int

	// 是否开启删除保护。取值:true、false。
	DeletionProtection bool

	// 密钥描述。
	Description string

	// 是否启用。取值:true、false。
	Enabled string

	// 密钥资源长 ID。
	KeyId string

	// 密钥规格。取值:SYMMETRIC_DEFAULT、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
	KeySpec string

	// 密钥对外状态。取值:Enabled、Disabled、PendingDeletion、PendingImport、Unavailable。
	KeyState string

	// 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
	KeyUsage []string

	// 当前密钥版本。
	KeyVersion int

	// 所属组织数字 ID
	OrganizationId int

	// 密钥材料来源。取值:UCLOUD_KMS、EXTERNAL;当前 CreateKey 仅支持 UCLOUD_KMS。
	Origin string

	// 密钥所属项目ID。
	ProjectId string

	// 密钥所属的 UKMS 实例资源 ID。
	ResourceId string
}

KeyMetadata - DescribeKey 返回的密钥元数据

type ListAliasesRequest

type ListAliasesRequest struct {
	request.CommonBase

	// 按完整别名(含 alias/ 前缀)进行子串模糊匹配
	Alias *string `required:"false"`

	// 可选:筛选指定密钥资源长 ID 的别名。
	KeyId *string `required:"false"`

	// 返回数据长度。
	Limit *int `required:"false"`

	// 列表起始位置偏移量。
	Offset *int `required:"false"`

	// 排序字段
	OrderBy *string `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`

	// 排序方向,默认 desc
	Sort *string `required:"false"`
}

ListAliasesRequest is request schema for ListAliases action

type ListAliasesResponse

type ListAliasesResponse struct {
	response.CommonBase

	// 别名列表,每项为 AliasInfo。
	Aliases []AliasInfo

	// 别名总数。
	TotalCount int
}

ListAliasesResponse is response schema for ListAliases action

type ListKeysRequest

type ListKeysRequest struct {
	request.CommonBase

	// 按密钥 ID 或别名模糊过滤。
	Alias *string `required:"false"`

	// 返回数据长度。最大1000
	Limit *int `required:"false"`

	// 列表起始位置偏移量。
	Offset *int `required:"false"`

	// 排序字段
	OrderBy *string `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`

	// 排序方向,默认 desc
	Sort *string `required:"false"`

	// 状态筛选:Active、Deactivated、PendingDeletion
	Status *string `required:"false"`
}

ListKeysRequest is request schema for ListKeys action

type ListKeysResponse

type ListKeysResponse struct {
	response.CommonBase

	// 密钥信息数组,每项为 DEK/ListKeys item。
	Data []DEK

	// 符合条件的总数,不同于 Limit。
	TotalCount int
}

ListKeysResponse is response schema for ListKeys action

type RotateKeyOnDemandRequest

type RotateKeyOnDemandRequest struct {
	request.CommonBase

	// 密钥 ID 或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"true"`
}

RotateKeyOnDemandRequest is request schema for RotateKeyOnDemand action

type RotateKeyOnDemandResponse

type RotateKeyOnDemandResponse struct {
	response.CommonBase

	// 密钥 ID。
	KeyId string
}

RotateKeyOnDemandResponse is response schema for RotateKeyOnDemand action

type ScheduleKeyDeletionRequest

type ScheduleKeyDeletionRequest struct {
	request.CommonBase

	// 删除等待天数,取值范围为 7~30 天;未填写时默认为 30 天。
	DeleteDay *int `required:"false"`

	// 密钥资源长 ID
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

ScheduleKeyDeletionRequest is request schema for ScheduleKeyDeletion action

type ScheduleKeyDeletionResponse

type ScheduleKeyDeletionResponse struct {
	response.CommonBase
}

ScheduleKeyDeletionResponse is response schema for ScheduleKeyDeletion action

type SignRequest

type SignRequest struct {
	request.CommonBase

	// 密钥资源长 ID 或别名。
	KeyId *string `required:"true"`

	// 消息类型。可选值:RAW、DIGEST;默认 RAW。
	MessageType *string `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`

	// 签名算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。
	SigningAlgorithm *string `required:"true"`

	// 待签名消息,Base64 编码,最大 4096 字节。
	SigningMessage *string `required:"true"`
}

SignRequest is request schema for Sign action

type SignResponse

type SignResponse struct {
	response.CommonBase

	// 密钥资源长 ID。
	KeyId string

	// 签名结果,Base64 编码。
	SignatureResult string

	// 实际使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。
	SigningAlgorithm string
}

SignResponse is response schema for Sign action

type UKMSClient

type UKMSClient struct {
	*ucloud.Client
}

UKMSClient is the client of UKMS

func NewClient

func NewClient(config *ucloud.Config, credential *auth.Credential) *UKMSClient

NewClient will return a instance of UKMSClient

func (*UKMSClient) CancelKeyDeletion

func (c *UKMSClient) CancelKeyDeletion(req *CancelKeyDeletionRequest) (*CancelKeyDeletionResponse, error)

API: CancelKeyDeletion

取消计划删除中的密钥。

func (*UKMSClient) CreateAlias

func (c *UKMSClient) CreateAlias(req *CreateAliasRequest) (*CreateAliasResponse, error)

API: CreateAlias

为密钥创建别名。

func (*UKMSClient) CreateKey

func (c *UKMSClient) CreateKey(req *CreateKeyRequest) (*CreateKeyResponse, error)

API: CreateKey

创建密钥。

func (*UKMSClient) Decrypt

func (c *UKMSClient) Decrypt(req *DecryptRequest) (*DecryptResponse, error)

API: Decrypt

您可以使用此操作解密使用对称加密 KMS 密钥或非对称加密 KMS 密钥加密的密文。当 KMS 密钥为非对称密钥时,您必须指定用于加密密文的 KMS 密钥和加密算法。

func (*UKMSClient) DeleteAlias

func (c *UKMSClient) DeleteAlias(req *DeleteAliasRequest) (*DeleteAliasResponse, error)

API: DeleteAlias

删除密钥别名。

func (*UKMSClient) DescribeKey

func (c *UKMSClient) DescribeKey(req *DescribeKeyRequest) (*DescribeKeyResponse, error)

API: DescribeKey

查看指定密钥的元数据。

func (*UKMSClient) DisableKey

func (c *UKMSClient) DisableKey(req *DisableKeyRequest) (*DisableKeyResponse, error)

API: DisableKey

禁用指定密钥。

func (*UKMSClient) DisableKeyRotation

func (c *UKMSClient) DisableKeyRotation(req *DisableKeyRotationRequest) (*DisableKeyRotationResponse, error)

API: DisableKeyRotation

关闭密钥自动轮转。

func (*UKMSClient) EnableKey

func (c *UKMSClient) EnableKey(req *EnableKeyRequest) (*EnableKeyResponse, error)

API: EnableKey

启用指定密钥。

func (*UKMSClient) EnableKeyRotation

func (c *UKMSClient) EnableKeyRotation(req *EnableKeyRotationRequest) (*EnableKeyRotationResponse, error)

API: EnableKeyRotation

开启对称密钥自动轮转。

func (*UKMSClient) Encrypt

func (c *UKMSClient) Encrypt(req *EncryptRequest) (*EncryptResponse, error)

API: Encrypt

使用指定密钥加密明文数据。

func (*UKMSClient) GenerateDataKey

func (c *UKMSClient) GenerateDataKey(req *GenerateDataKeyRequest) (*GenerateDataKeyResponse, error)

API: GenerateDataKey

生成数据密钥,返回明文和密文。

func (*UKMSClient) GenerateDataKeyPair

API: GenerateDataKeyPair

创建数据密钥对

func (*UKMSClient) GenerateDataKeyPairWithoutPlaintext

API: GenerateDataKeyPairWithoutPlaintext

创建数据密钥对(无明文返回)

func (*UKMSClient) GenerateDataKeyWithoutPlaintext

API: GenerateDataKeyWithoutPlaintext

创建数据密钥(无明文),仅返回加密后的数据密钥。

func (*UKMSClient) GenerateMac

func (c *UKMSClient) GenerateMac(req *GenerateMacRequest) (*GenerateMacResponse, error)

API: GenerateMac

使用HMAC密钥管理服务(KMS)密钥和该密钥支持的MAC算法,为消息生成基于哈希的消息认证码(HMAC)。

func (*UKMSClient) GenerateRandom

func (c *UKMSClient) GenerateRandom(req *GenerateRandomRequest) (*GenerateRandomResponse, error)

API: GenerateRandom

生成随机数

func (*UKMSClient) GetKeyRotationStatus

API: GetKeyRotationStatus

查询密钥自动轮转状态。

func (*UKMSClient) GetPublicKey

func (c *UKMSClient) GetPublicKey(req *GetPublicKeyRequest) (*GetPublicKeyResponse, error)

API: GetPublicKey

获取非对称密钥的公钥。

func (*UKMSClient) ListAliases

func (c *UKMSClient) ListAliases(req *ListAliasesRequest) (*ListAliasesResponse, error)

API: ListAliases

获取 UKMS 实例下的别名列表。

func (*UKMSClient) ListKeys

func (c *UKMSClient) ListKeys(req *ListKeysRequest) (*ListKeysResponse, error)

API: ListKeys

查询用户的主密钥信息列表。

func (*UKMSClient) NewCancelKeyDeletionRequest

func (c *UKMSClient) NewCancelKeyDeletionRequest() *CancelKeyDeletionRequest

NewCancelKeyDeletionRequest will create request of CancelKeyDeletion action.

func (*UKMSClient) NewCreateAliasRequest

func (c *UKMSClient) NewCreateAliasRequest() *CreateAliasRequest

NewCreateAliasRequest will create request of CreateAlias action.

func (*UKMSClient) NewCreateKeyRequest

func (c *UKMSClient) NewCreateKeyRequest() *CreateKeyRequest

NewCreateKeyRequest will create request of CreateKey action.

func (*UKMSClient) NewDecryptRequest

func (c *UKMSClient) NewDecryptRequest() *DecryptRequest

NewDecryptRequest will create request of Decrypt action.

func (*UKMSClient) NewDeleteAliasRequest

func (c *UKMSClient) NewDeleteAliasRequest() *DeleteAliasRequest

NewDeleteAliasRequest will create request of DeleteAlias action.

func (*UKMSClient) NewDescribeKeyRequest

func (c *UKMSClient) NewDescribeKeyRequest() *DescribeKeyRequest

NewDescribeKeyRequest will create request of DescribeKey action.

func (*UKMSClient) NewDisableKeyRequest

func (c *UKMSClient) NewDisableKeyRequest() *DisableKeyRequest

NewDisableKeyRequest will create request of DisableKey action.

func (*UKMSClient) NewDisableKeyRotationRequest

func (c *UKMSClient) NewDisableKeyRotationRequest() *DisableKeyRotationRequest

NewDisableKeyRotationRequest will create request of DisableKeyRotation action.

func (*UKMSClient) NewEnableKeyRequest

func (c *UKMSClient) NewEnableKeyRequest() *EnableKeyRequest

NewEnableKeyRequest will create request of EnableKey action.

func (*UKMSClient) NewEnableKeyRotationRequest

func (c *UKMSClient) NewEnableKeyRotationRequest() *EnableKeyRotationRequest

NewEnableKeyRotationRequest will create request of EnableKeyRotation action.

func (*UKMSClient) NewEncryptRequest

func (c *UKMSClient) NewEncryptRequest() *EncryptRequest

NewEncryptRequest will create request of Encrypt action.

func (*UKMSClient) NewGenerateDataKeyPairRequest

func (c *UKMSClient) NewGenerateDataKeyPairRequest() *GenerateDataKeyPairRequest

NewGenerateDataKeyPairRequest will create request of GenerateDataKeyPair action.

func (*UKMSClient) NewGenerateDataKeyPairWithoutPlaintextRequest

func (c *UKMSClient) NewGenerateDataKeyPairWithoutPlaintextRequest() *GenerateDataKeyPairWithoutPlaintextRequest

NewGenerateDataKeyPairWithoutPlaintextRequest will create request of GenerateDataKeyPairWithoutPlaintext action.

func (*UKMSClient) NewGenerateDataKeyRequest

func (c *UKMSClient) NewGenerateDataKeyRequest() *GenerateDataKeyRequest

NewGenerateDataKeyRequest will create request of GenerateDataKey action.

func (*UKMSClient) NewGenerateDataKeyWithoutPlaintextRequest

func (c *UKMSClient) NewGenerateDataKeyWithoutPlaintextRequest() *GenerateDataKeyWithoutPlaintextRequest

NewGenerateDataKeyWithoutPlaintextRequest will create request of GenerateDataKeyWithoutPlaintext action.

func (*UKMSClient) NewGenerateMacRequest

func (c *UKMSClient) NewGenerateMacRequest() *GenerateMacRequest

NewGenerateMacRequest will create request of GenerateMac action.

func (*UKMSClient) NewGenerateRandomRequest

func (c *UKMSClient) NewGenerateRandomRequest() *GenerateRandomRequest

NewGenerateRandomRequest will create request of GenerateRandom action.

func (*UKMSClient) NewGetKeyRotationStatusRequest

func (c *UKMSClient) NewGetKeyRotationStatusRequest() *GetKeyRotationStatusRequest

NewGetKeyRotationStatusRequest will create request of GetKeyRotationStatus action.

func (*UKMSClient) NewGetPublicKeyRequest

func (c *UKMSClient) NewGetPublicKeyRequest() *GetPublicKeyRequest

NewGetPublicKeyRequest will create request of GetPublicKey action.

func (*UKMSClient) NewListAliasesRequest

func (c *UKMSClient) NewListAliasesRequest() *ListAliasesRequest

NewListAliasesRequest will create request of ListAliases action.

func (*UKMSClient) NewListKeysRequest

func (c *UKMSClient) NewListKeysRequest() *ListKeysRequest

NewListKeysRequest will create request of ListKeys action.

func (*UKMSClient) NewRotateKeyOnDemandRequest

func (c *UKMSClient) NewRotateKeyOnDemandRequest() *RotateKeyOnDemandRequest

NewRotateKeyOnDemandRequest will create request of RotateKeyOnDemand action.

func (*UKMSClient) NewScheduleKeyDeletionRequest

func (c *UKMSClient) NewScheduleKeyDeletionRequest() *ScheduleKeyDeletionRequest

NewScheduleKeyDeletionRequest will create request of ScheduleKeyDeletion action.

func (*UKMSClient) NewSignRequest

func (c *UKMSClient) NewSignRequest() *SignRequest

NewSignRequest will create request of Sign action.

func (*UKMSClient) NewUpdateAliasRequest

func (c *UKMSClient) NewUpdateAliasRequest() *UpdateAliasRequest

NewUpdateAliasRequest will create request of UpdateAlias action.

func (*UKMSClient) NewUpdateKeyDescriptionRequest

func (c *UKMSClient) NewUpdateKeyDescriptionRequest() *UpdateKeyDescriptionRequest

NewUpdateKeyDescriptionRequest will create request of UpdateKeyDescription action.

func (*UKMSClient) NewVerifyMacRequest

func (c *UKMSClient) NewVerifyMacRequest() *VerifyMacRequest

NewVerifyMacRequest will create request of VerifyMac action.

func (*UKMSClient) NewVerifyRequest

func (c *UKMSClient) NewVerifyRequest() *VerifyRequest

NewVerifyRequest will create request of Verify action.

func (*UKMSClient) RotateKeyOnDemand

func (c *UKMSClient) RotateKeyOnDemand(req *RotateKeyOnDemandRequest) (*RotateKeyOnDemandResponse, error)

API: RotateKeyOnDemand

立即触发一次密钥轮转。

func (*UKMSClient) ScheduleKeyDeletion

API: ScheduleKeyDeletion

计划删除指定密钥。

func (*UKMSClient) Sign

func (c *UKMSClient) Sign(req *SignRequest) (*SignResponse, error)

API: Sign

使用非对称密钥对消息或消息摘要签名。

func (*UKMSClient) UpdateAlias

func (c *UKMSClient) UpdateAlias(req *UpdateAliasRequest) (*UpdateAliasResponse, error)

API: UpdateAlias

将别名更新到另一个密钥。

func (*UKMSClient) UpdateKeyDescription

API: UpdateKeyDescription

更新指定密钥的描述信息。

func (*UKMSClient) Verify

func (c *UKMSClient) Verify(req *VerifyRequest) (*VerifyResponse, error)

API: Verify

使用非对称密钥验证签名。

func (*UKMSClient) VerifyMac

func (c *UKMSClient) VerifyMac(req *VerifyMacRequest) (*VerifyMacResponse, error)

API: VerifyMac

验证指定消息、HMAC KMS 密钥和 MAC 算法的基于哈希的消息认证码 (HMAC)。为了验证 HMAC,VerifyMac 会使用您指定的消息、HMAC KMS 密钥和 MAC 算法计算 HMAC,并将计算出的 HMAC 与您指定的 HMAC 进行比较。如果两个 HMAC 完全相同,则验证成功;否则,验证失败。 验证结果表明,自计算 HMAC 以来,消息未发生更改,并且使用了指定的密钥来生成和验证 HMAC。

type UpdateAliasRequest

type UpdateAliasRequest struct {
	request.CommonBase

	// 密钥别名,格式为 alias/name。
	AliasName *string `required:"true"`

	// 密钥 ID 或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

UpdateAliasRequest is request schema for UpdateAlias action

type UpdateAliasResponse

type UpdateAliasResponse struct {
	response.CommonBase
}

UpdateAliasResponse is response schema for UpdateAlias action

type UpdateKeyDescriptionRequest

type UpdateKeyDescriptionRequest struct {
	request.CommonBase

	// 新的密钥描述,最多 8192 字符;空字符串表示清空描述。
	Description *string `required:"true"`

	// 密钥资源长 ID或别名。
	KeyId *string `required:"true"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`
}

UpdateKeyDescriptionRequest is request schema for UpdateKeyDescription action

type UpdateKeyDescriptionResponse

type UpdateKeyDescriptionResponse struct {
	response.CommonBase

	// 此次请求唯一标识符。
	RequestUuid string

	// 返回状态。
	Status string
}

UpdateKeyDescriptionResponse is response schema for UpdateKeyDescription action

type VerifyMacRequest

type VerifyMacRequest struct {
	request.CommonBase

	// 密钥ID
	KeyId *string `required:"true"`

	// 要验证的 HMAC。请输入由 GenerateMac 操作生成的 HMAC,前提是您指定的消息、HMAC KMS 密钥和 MAC 算法与此请求中指定的值相同。
	Mac *string `required:"true"`

	// 验证过程中将使用的 MAC 算法。请输入与计算 HMAC 时相同的 MAC 算法。此算法必须受 KeyId 参数标识的 HMAC KMS 密钥支持。
	MacAlgorithm *string `required:"true"`

	// 用于验证的消息。请输入与生成 HMAC 时所用消息相同的消息。
	MacMessage *string `required:"true"`
}

VerifyMacRequest is request schema for VerifyMac action

type VerifyMacResponse

type VerifyMacResponse struct {
	response.CommonBase

	// 密钥ID
	KeyId string

	// 验证中使用的 MAC 算法。
	MacAlgorithm string

	// 一个布尔值,表示 HMAC 是否已验证。
	MacValid bool
}

VerifyMacResponse is response schema for VerifyMac action

type VerifyRequest

type VerifyRequest struct {
	request.CommonBase

	// 密钥 ID或别名。
	KeyId *string `required:"true"`

	// 消息类型。可选值:RAW、DIGEST;默认 RAW。
	MessageType *string `required:"false"`

	// UKMS 实例资源 ID。
	ResourceId *string `required:"false"`

	// 待验证的签名,Base64 编码。
	SignatureResult *string `required:"true"`

	// 签名时使用的算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。
	SigningAlgorithm *string `required:"true"`

	// 待验签的消息或消息摘要,Base64 编码。
	SigningMessage *string `required:"true"`
}

VerifyRequest is request schema for Verify action

type VerifyResponse

type VerifyResponse struct {
	response.CommonBase

	// 密钥 ID。
	KeyId string

	// 签名是否有效。
	SignatureValid bool

	// 使用的签名算法。取值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512。
	SigningAlgorithm string
}

VerifyResponse is response schema for Verify action

Jump to

Keyboard shortcuts

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