keys

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCMKImport added in v0.9.4

func DeleteCMKImport(client *golangsdk.ServiceClient, opts DeleteCMKImportOpts) error

func DisableKeyRotation added in v0.5.13

func DisableKeyRotation(client *golangsdk.ServiceClient, keyID string) error

func EnableKeyRotation added in v0.5.13

func EnableKeyRotation(client *golangsdk.ServiceClient, keyID string) error

func ImportCMKMaterial added in v0.9.4

func ImportCMKMaterial(client *golangsdk.ServiceClient, opts ImportCMKOpts) error

func UpdateKeyRotationInterval added in v0.5.13

func UpdateKeyRotationInterval(client *golangsdk.ServiceClient, opts RotationOpts) error

Types

type CMKImport added in v0.9.4

type CMKImport struct {
	KeyId          string `json:"key_id"`
	ImportToken    string `json:"import_token"`
	ExpirationTime int    `json:"expiration_time"`
	PublicKey      string `json:"public_key"`
}

func GetCMKImport added in v0.9.4

func GetCMKImport(client *golangsdk.ServiceClient, opts GetCMKImportOpts) (*CMKImport, error)

type CreateOpts

type CreateOpts struct {
	// Alias of a CMK
	KeyAlias string `json:"key_alias" required:"true"`
	// CMK description
	KeyDescription string `json:"key_description,omitempty"`
	// Region where a CMK resides
	Realm string `json:"realm,omitempty"`
	// Purpose of a CMK (The default value is Encrypt_Decrypt)
	KeyUsage string `json:"key_usage,omitempty"`
	// Origin of a CMK. The default value is kms. Possible values: `kms` / `external`
	Origin string `json:"origin,omitempty"`
}

type DataEncryptOpts

type DataEncryptOpts struct {
	// ID of a CMK
	KeyID string `json:"key_id" required:"true"`
	// CMK description
	EncryptionContext string `json:"encryption_context,omitempty"`
	// 36-byte serial number of a request message
	DatakeyLength string `json:"datakey_length,omitempty"`
}

type DataKey

type DataKey struct {
	// Current ID of a CMK
	KeyID      string `json:"key_id"`
	PlainText  string `json:"plain_text"`
	CipherText string `json:"cipher_text"`
}

func DataEncryptGet

func DataEncryptGet(client *golangsdk.ServiceClient, opts DataEncryptOpts) (*DataKey, error)

type DecryptDataOpts added in v0.9.2

type DecryptDataOpts struct {
	CipherText          string `json:"cipher_text" required:"true"`
	KeyID               string `json:"key_id,omitempty"`
	EncryptionAlgorithm string `json:"encryption_algorithm,omitempty"`
	Sequence            string `json:"sequence,omitempty"`
}

type DecryptResp added in v0.9.2

type DecryptResp struct {
	KeyID           string `json:"key_id"`
	PlainText       string `json:"plain_text"`
	PlainTextBase64 string `json:"plain_text_base64"`
}

func DecryptData added in v0.9.2

func DecryptData(client *golangsdk.ServiceClient, opts DecryptDataOpts) (*DecryptResp, error)

type DeleteCMKImportOpts added in v0.9.4

type DeleteCMKImportOpts struct {
	KeyId    string `json:"key_id" required:"true"`
	Sequence string `json:"sequence,omitempty"`
}

type DeleteOpts

type DeleteOpts struct {
	// ID of a CMK
	KeyID string `json:"key_id" required:"true"`
	// Number of days after which a CMK is scheduled to be deleted
	// (The value ranges from 7 to 1096.)
	PendingDays string `json:"pending_days" required:"true"`
}

type EncryptDEK

type EncryptDEK struct {
	KeyID         string `json:"key_id"`
	DataKeyLength string `json:"datakey_length"`
	CipherText    string `json:"cipher_text"`
}

func EncryptDEKGet

func EncryptDEKGet(client *golangsdk.ServiceClient, opts EncryptDEKOpts) (*EncryptDEK, error)

type EncryptDEKOpts

type EncryptDEKOpts struct {
	// ID of a CMK
	KeyID string `json:"key_id" required:"true"`
	// CMK description
	EncryptionContext string `json:"encryption_context,omitempty"`
	// 36-byte serial number of a request message
	DataKeyPlainLength string `json:"datakey_plain_length,omitempty"`
	// Both the plaintext (64 bytes) of a DEK and the SHA-256 hash value (32 bytes)
	// of the plaintext are expressed as a hexadecimal character string.
	PlainText string `json:"plain_text" required:"true"`
}

type EncryptDataOpts added in v0.9.2

type EncryptDataOpts struct {
	KeyID               string `json:"key_id" required:"true"`
	PlainText           string `json:"plain_text" required:"true"`
	EncryptionAlgorithm string `json:"encryption_algorithm,omitempty"`
	Sequence            string `json:"sequence,omitempty"`
}

type EncryptResp added in v0.9.2

type EncryptResp struct {
	KeyID      string `json:"key_id"`
	CipherText string `json:"cipher_text"`
}

func EncryptData added in v0.9.2

func EncryptData(client *golangsdk.ServiceClient, opts EncryptDataOpts) (*EncryptResp, error)

type GetCMKImportOpts added in v0.9.4

type GetCMKImportOpts struct {
	KeyId             string `json:"key_id" required:"true"`
	WrappingAlgorithm string `json:"wrapping_algorithm" required:"true"`
	Sequence          string `json:"sequence,omitempty"`
}

type ImportCMKOpts added in v0.9.4

type ImportCMKOpts struct {
	KeyId                string `json:"key_id" required:"true"`
	ImportToken          string `json:"import_token" required:"true"`
	EncryptedKeyMaterial string `json:"encrypted_key_material" required:"true"`
	ExpirationTime       string `json:"expiration_time,omitempty"`
	Sequence             string `json:"sequence,omitempty"`
}

type Key

type Key struct {
	// Current ID of a CMK
	KeyID string `json:"key_id"`
	// ID of a user domain for the key.
	DomainID string `json:"domain_id"`
	// Alias of a CMK
	KeyAlias string `json:"key_alias"`
	// Region where a CMK resides
	Realm string `json:"realm"`
	// Description of a CMK
	KeyDescription string `json:"key_description"`
	// Creation time (time stamp) of a CMK
	CreationDate string `json:"creation_date"`
	// Scheduled deletion time (time stamp) of a CMK
	ScheduledDeletionDate string `json:"scheduled_deletion_date"`
	// State of a CMK
	KeyState string `json:"key_state"`
	// Identification of a Master Key. The value 1 indicates a Default
	// Master Key, and the value 0 indicates a CMK
	DefaultKeyFlag string `json:"default_key_flag"`
	// Expiration time
	ExpirationTime string `json:"expiration_time"`
	// Origin of a CMK. The default value is kms. The following values
	// are enumerated: kms indicates that the CMK material is generated by KMS.
	Origin string `json:"origin"`
}

func CancelDelete added in v0.5.16

func CancelDelete(client *golangsdk.ServiceClient, keyID string) (*Key, error)

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Key, error)

func Get

func Get(client *golangsdk.ServiceClient, keyID string) (*Key, error)

type KeyRotationResult added in v0.5.13

type KeyRotationResult struct {
	// Key rotation status. The default value is false, indicating that key rotation is disabled.
	Enabled bool `json:"key_rotation_enabled"`
	// Rotation interval. The value is an integer in the range 30 to 365.
	Interval int `json:"rotation_interval"`
	// Last key rotation time. The timestamp indicates the total microseconds past the start of the epoch date (January 1, 1970).
	LastRotationTime string `json:"last_rotation_time"`
	// Number of key rotations.
	NumberOfRotations int `json:"number_of_rotations"`
}

func GetKeyRotationStatus added in v0.5.13

func GetKeyRotationStatus(client *golangsdk.ServiceClient, opts RotationOpts) (*KeyRotationResult, error)

type ListKey

type ListKey struct {
	Keys       []string `json:"keys"`
	KeyDetails []Key    `json:"key_details"`
	NextMarker string   `json:"next_marker"`
	Truncated  string   `json:"truncated"`
}

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListKey, error)

type ListOpts

type ListOpts struct {
	KeyState string `q:"key_state"`
	Limit    string `q:"limit"`
	Marker   string `q:"marker"`
}

type RotationOpts added in v0.5.13

type RotationOpts struct {
	// ID of a CMK
	KeyID string `json:"key_id" required:"true"`
	// Rotation interval of a CMK
	Interval int `json:"rotation_interval"`
	// 36-byte serial number of a request message
	Sequence string `json:"sequence,omitempty"`
}

type RotationOptsBuilder added in v0.5.13

type RotationOptsBuilder interface {
	ToKeyRotationMap() (map[string]interface{}, error)
}

type UpdateAliasOpts

type UpdateAliasOpts struct {
	// ID of a CMK
	KeyID string `json:"key_id" required:"true"`
	// CMK description
	KeyAlias string `json:"key_alias" required:"true"`
}

type UpdateDesOpts

type UpdateDesOpts struct {
	// ID of a CMK
	KeyID string `json:"key_id" required:"true"`
	// CMK description
	KeyDescription string `json:"key_description" required:"true"`
}

type UpdateKeyAlias added in v0.9.4

type UpdateKeyAlias struct {
	KeyID    string `json:"key_id"`
	KeyAlias string `json:"key_alias"`
}

func UpdateAlias

func UpdateAlias(client *golangsdk.ServiceClient, opts UpdateAliasOpts) (*UpdateKeyAlias, error)

type UpdateKeyDes added in v0.9.4

type UpdateKeyDes struct {
	KeyID    string `json:"key_id"`
	KeyState string `json:"key_state"`
}

func UpdateDes

func UpdateDes(client *golangsdk.ServiceClient, opts UpdateDesOpts) (*UpdateKeyDes, error)

type UpdateKeyState

type UpdateKeyState struct {
	KeyID    string `json:"key_id"`
	KeyState string `json:"key_state"`
}

func Delete

func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) (*UpdateKeyState, error)

func DisableKey

func DisableKey(client *golangsdk.ServiceClient, keyID string) (*UpdateKeyState, error)

func EnableKey

func EnableKey(client *golangsdk.ServiceClient, keyID string) (*UpdateKeyState, error)

Jump to

Keyboard shortcuts

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