Documentation
¶
Index ¶
- Variables
- type Client
- type DeleteOptions
- type InvalidStateError
- type Key
- type KeyAlgorithm
- type KeyInput
- type KeyState
- type KeyVersion
- type Provider
- func (p *Provider) CreateKey(ctx context.Context, input KeyInput) (*Key, error)
- func (p *Provider) DeleteKey(ctx context.Context, key *Key, deleteKeyOptions DeleteOptions) error
- func (p *Provider) DisableKey(ctx context.Context, key *Key) error
- func (p *Provider) EnableKey(ctx context.Context, key *Key) error
- func (p *Provider) RotateKey(ctx context.Context, key *Key) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrCreateKeyFailed = errors.New("create key failed") ErrCreateKeyVersionFailed = errors.New("key version creation failed") ErrRotateKeyFailed = errors.New("rotate key failed") ErrKeyVersions = errors.New("key has no previous keyVersions") ErrEnableKeyFailed = errors.New("enabling key failed") ErrDisableKeyFailed = errors.New("disabling key failed") ErrDeleteKeyFailed = errors.New("deleting key failed") )
Errs defines the errors that can be returned by the provider
var (
ErrDeleteKeyVersionFailed = errors.New("delete key version failed")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
CreateKeyVersion(ctx context.Context, options KeyInput) (*string, error)
DeleteKeyVersion(ctx context.Context, keyID string, options DeleteOptions) error
EnableKeyVersion(ctx context.Context, keyID string) error
DisableKeyVersion(ctx context.Context, keyID string) error
}
Client is the interface for native KMS. Any KMS providers client we intend to use must implement this interface. This requires wrapping an SDK client to conform to this interface. For instance, refer to aws.client.
type DeleteOptions ¶
type DeleteOptions struct {
Window *int32 // The grace period after deletion where the key material still exists in the provider
}
DeleteOptions holds the aws_options for delete actions.
type InvalidStateError ¶
type InvalidStateError struct {
Message string
}
InvalidStateError it is error that points out that action in Client cannot be executed due to the state of the key. For example, trying to delete a key that is already deleted.
func (*InvalidStateError) Error ¶
func (e *InvalidStateError) Error() string
type Key ¶
type Key struct {
ID *string
KeyType KeyAlgorithm
Provider string
Region string
Version int
KeyVersions []KeyVersion
}
Key represents a key.
type KeyAlgorithm ¶
type KeyAlgorithm string
KeyAlgorithm represents the algorithm of the key.
const ( AES256 KeyAlgorithm = "AES256" RSA3072 KeyAlgorithm = "RSA3072" RSA4096 KeyAlgorithm = "RSA4096" )
type KeyInput ¶
type KeyInput struct {
KeyType KeyAlgorithm
ID *string
}
KeyInput holds the aws_options for creating a key.
type KeyVersion ¶
type KeyVersion struct {
ExternalID *string
CreatedAt *time.Time
UpdatedAt *time.Time
Version int
State KeyState
}
KeyVersion represents the version of a key.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the implementation of the KMS provider
func NewProvider ¶
NewProvider creates a new instance of Provider
func (*Provider) DeleteKey ¶
func (p *Provider) DeleteKey( ctx context.Context, key *Key, deleteKeyOptions DeleteOptions, ) error
DeleteKey deletes all versions of a key. Takes into consideration manually deleted versions.
func (*Provider) DisableKey ¶
DisableKey disables all versions of a key