crypto

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 6 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

func Hash

func Hash(salt []byte, data string) []byte

func Salt

func Salt() ([]byte, error)

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