crypto

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 4 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
}

func (GoogleProvider) Decrypt

func (p GoogleProvider) Decrypt(ciphertext []byte) (string, error)

func (GoogleProvider) Encrypt

func (p GoogleProvider) Encrypt(plaintext string) ([]byte, error)

type NoopProvider

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

func (NoopProvider) Decrypt

func (p NoopProvider) Decrypt(ciphertext []byte) (string, error)

func (NoopProvider) Encrypt

func (p NoopProvider) Encrypt(plaintext string) ([]byte, error)

type Provider

type Provider interface {
	Encrypt(string) ([]byte, error)
	Decrypt([]byte) (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