crypt

package
v0.0.0-...-abf98e0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncryptionProviders = make(map[string]EncryptionProvider)
View Source
var (
	ErrEncryptionPassphraseNotSet = errors.New("TF_BACKEND_HTTP_ENCRYPTION_PASSPHRASE was not set")
)

Functions

func MD5

func MD5(key string) (string, error)

MD5 returns an md5 hash for a given string

Types

type AESEncryptionProvider

type AESEncryptionProvider struct{}

func (*AESEncryptionProvider) Decrypt

func (p *AESEncryptionProvider) Decrypt(data []byte) ([]byte, error)

Decrypt will decrypt the data in buffer. For a key it will use md5 hash from the passphrase.

func (*AESEncryptionProvider) Encrypt

func (p *AESEncryptionProvider) Encrypt(data []byte) ([]byte, error)

Encrypt will encrypt the data in buffer and return encrypted result. For a key it will use md5 hash from the passphrase.

type EncryptionProvider

type EncryptionProvider interface {
	Encrypt([]byte) ([]byte, error)
	Decrypt([]byte) ([]byte, error)
}

type SOPSEncryptionProvider

type SOPSEncryptionProvider struct{}

func (*SOPSEncryptionProvider) Decrypt

func (p *SOPSEncryptionProvider) Decrypt(data []byte) ([]byte, error)

Decrypt will decrypt the data in buffer.

func (*SOPSEncryptionProvider) Encrypt

func (p *SOPSEncryptionProvider) Encrypt(data []byte) ([]byte, error)

Encrypt will encrypt the data in buffer and return encrypted result.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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