keys

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package keys contains implementations of Master Keys and generic key errors.

Index

Constants

This section is empty.

Variables

View Source
var ErrDecryptKey = errors.New("unable to decrypt data key")

ErrDecryptKey is returned when the data key cannot be decrypted.

View Source
var ErrEncryptKey = errors.New("unable to encrypt data key")

ErrEncryptKey is returned when the data key cannot be encrypted.

View Source
var ErrGenerateDataKey = errors.New("unable to generate data key")

ErrGenerateDataKey is returned when the data key cannot be generated.

Functions

This section is empty.

Types

type BaseKey added in v0.1.0

type BaseKey struct {
	// contains filtered or unexported fields
}

BaseKey is implementation of model.MasterKeyBase that methods can be reused or overridden by other master key implementations.

func NewBaseKey added in v0.1.0

func NewBaseKey(metadata model.KeyMeta) BaseKey

NewBaseKey returns a new instance of BaseKey.

func (*BaseKey) KeyID added in v0.1.0

func (mk *BaseKey) KeyID() string

KeyID returns the key ID of the master key.

func (*BaseKey) Metadata added in v0.1.0

func (mk *BaseKey) Metadata() model.KeyMeta

Metadata returns the model.KeyMeta metadata of the master key.

func (*BaseKey) OwnsDataKey added in v0.1.0

func (mk *BaseKey) OwnsDataKey(key model.Key) bool

OwnsDataKey returns true if key is owned by the master key. In other words, the key was encrypted with the master key.

Raw Master Key and KMS MRK Master Key implementations are using a different logic to determine if the key is owned by the master key.

Directories

Path Synopsis
Package kms contains KMS and KMS MRK Master Key implementations.
Package kms contains KMS and KMS MRK Master Key implementations.
Package raw contains Raw Master Key implementation.
Package raw contains Raw Master Key implementation.

Jump to

Keyboard shortcuts

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