secrets

package
v0.10.262 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0, MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encrypter

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

func WithSource

func WithSource(s SecretSource) (*Encrypter, error)

WithSource can be used to create an Encrypter, for example in secrettest for testing purposes.

func (*Encrypter) Close

func (e *Encrypter) Close()

func (*Encrypter) CreateNonce

func (e *Encrypter) CreateNonce() ([]byte, error)

func (*Encrypter) Decrypt

func (e *Encrypter) Decrypt(cipherText []byte) ([]byte, error)

Decrypt decrypts given cipher text

func (*Encrypter) Encrypt

func (e *Encrypter) Encrypt(plaintext []byte) ([]byte, error)

Encrypt encrypts given plaintext

func (*Encrypter) RefreshCiphers

func (e *Encrypter) RefreshCiphers() error

type Encryption

type Encryption interface {
	CreateNonce() ([]byte, error)
	Decrypt([]byte) ([]byte, error)
	Encrypt([]byte) ([]byte, error)
	Close()
}

type Registry

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

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns a Registry to store and manage secrets

func (*Registry) Close

func (r *Registry) Close()

Close will close all Encryption of the Registry

func (*Registry) NewEncrypter

func (r *Registry) NewEncrypter(refreshInterval time.Duration, file string) (Encryption, error)

type SecretSource

type SecretSource interface {
	GetSecret() ([][]byte, error)
}

SecretSource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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