xencryptopts

package
v1.10.10 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt added in v1.5.1

func Decrypt(passStr string, decryption map[string]interface{}) (string, error)

Decrypt is a function that accepts a base64 encoded encrypted string and a decryption map. The map should contain the base64 encoded attributes: "salt" and "initial_value". These attributes are used to decrypt the input string. The function returns the decrypted string.

func Encrypt added in v1.5.1

func Encrypt(input string, encryption map[string]interface{}) (string, error)

Encrypt is a function accepts and input string to be encoded and an encryption map. The map should contain the base64 encoded attributes: "salt" and "initial_value". These attributes are used to encrypt the input string. The function returns the base64 encoded encrypted string.

func LoadSecretFromSecretStore added in v1.5.1

func LoadSecretFromSecretStore(mod *helperkv.Modifier) (map[string]interface{}, error)

LoadSecretFromSecretStore is a function that loads a secret from the secret store. It returns a map with the secret contained in the attribute named "encryptionSecret".

func MakeNewEncryption added in v1.5.1

func MakeNewEncryption() (string, string, error)

MakeNewEncryption is a function that returns a new encryption key and a new encryption salt

func NewOptionsBuilder

func NewOptionsBuilder(opts ...Option)

Types

type Option

type Option func(*OptionsBuilder)

func LoadOptions

func LoadOptions() Option

type OptionsBuilder

type OptionsBuilder struct {
	LoadSecretFromSecretStore func(mod *helperkv.Modifier) (map[string]interface{}, error)
	MakeNewEncryption         func() (string, string, error)
	Encrypt                   func(input string, encryption map[string]interface{}) (string, error)
	Decrypt                   func(passStr string, decryption map[string]interface{}) (string, error)
}
var BuildOptions *OptionsBuilder

Jump to

Keyboard shortcuts

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