local

package
v0.0.0-...-57c6170 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MasterKeyFromEnv

func MasterKeyFromEnv(envPrefix, keyURI string) (io.Reader, error)

MasterKeyFromEnv creates a new instance of a local secret lock Reader to read a master key found in a env variable with key: `envPrefix` + `keyURI`.

func MasterKeyFromPath

func MasterKeyFromPath(path string) (io.Reader, error)

MasterKeyFromPath creates a new instance of a local secret lock Reader to read a master key stored in `path`.

func NewService

func NewService(masterKeyReader io.Reader, secLock secretlock.Service) (secretlock.Service, error)

NewService creates a new instance of local secret lock service using a master key in masterKeyReader. If the masterKey is not protected (secLock=nil) this function will attempt to base64 URL Decode the content of masterKeyReader and if it fails, then will attempt to create a secret lock cipher with the raw key as is.

Types

type Lock

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

Lock is a secret lock service responsible for encrypting keys using a master key.

func (*Lock) Decrypt

func (s *Lock) Decrypt(keyURI string, req *secretlock.DecryptRequest) (*secretlock.DecryptResponse, error)

Decrypt a key in req using master key in the local secret lock service (keyURI is used for remote locks, it is ignored by this implementation).

func (*Lock) Encrypt

func (s *Lock) Encrypt(keyURI string, req *secretlock.EncryptRequest) (*secretlock.EncryptResponse, error)

Encrypt a key in req using master key in the local secret lock service (keyURI is used for remote locks, it is ignored by this implementation).

Directories

Path Synopsis
internal
masterlock

Jump to

Keyboard shortcuts

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