crypto

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlankConfigs map[string]interface{} = map[string]interface{}{
	"noop": map[string]interface{}{
		"verbose": false,
	},
	"google": map[string]interface{}{
		"project":  "",
		"location": "global",
		"keyring":  "",
		"key":      "",
	},
}

Functions

This section is empty.

Types

type GoogleProvider

type GoogleProvider struct {
	Project  string
	Location string
	Keyring  string
	Key      string
	Options  []option.ClientOption
}

func (GoogleProvider) Decrypt

func (p GoogleProvider) Decrypt(ciphertext []byte, retries uint, timeout time.Duration) (string, error)

func (GoogleProvider) Encrypt

func (p GoogleProvider) Encrypt(plaintext string, retries uint, timeout time.Duration) ([]byte, error)

type NoopProvider

type NoopProvider struct {
	Verbose bool `yaml:"verbose"`
}

func (NoopProvider) Decrypt

func (p NoopProvider) Decrypt(ciphertext []byte, _ uint, _ time.Duration) (string, error)

func (NoopProvider) Encrypt

func (p NoopProvider) Encrypt(plaintext string, _ uint, _ time.Duration) ([]byte, error)

type Operation added in v1.6.0

type Operation func(context.Context) error

type Provider

type Provider interface {
	Encrypt(string, uint, time.Duration) ([]byte, error)
	Decrypt([]byte, uint, time.Duration) (string, error)
}

func NewProvider

func NewProvider(name string, config map[string]interface{}) (Provider, error)

Jump to

Keyboard shortcuts

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