kms

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(scheme string, service Cipher)

Register register cipher with supplied scheme

Types

type Cipher

type Cipher interface {
	//Decrypt decrypts data with supplied key
	Decrypt(ctx context.Context, key *Key, data []byte) ([]byte, error)

	//Encrypt encrypts data with supplied key
	Encrypt(ctx context.Context, key *Key, data []byte) ([]byte, error)
}

Cipher defines cipher interface

func Lookup

func Lookup(scheme string) (Cipher, error)

Lookup lookups cipher for supplied scheme

type Key

type Key struct {
	Raw    string
	Path   string
	Auth   string
	Scheme string
}

Key represents secret key

func NewKey

func NewKey(raw string) (*Key, error)

NewKey creates a new key

func (*Key) Key

func (k *Key) Key(ctx context.Context, defaultValue []byte) ([]byte, error)

Key returns key data

type Securable

type Securable interface {
	Cipher(ctx context.Context, key *Key) error
	Decipher(ctx context.Context, key *Key) error
}

Securable interface defininf operation to cipher/decipher sensitive data points

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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