secret

package
v3.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestConfig

func NewTestConfig() (interface{}, error)

func NewTestConfigContent

func NewTestConfigContent() ([]byte, error)

func NewTestConfigFile

func NewTestConfigFile() string

func NewTestKeysFile

func NewTestKeysFile() string

func ValuesAtPathsAreEqual

func ValuesAtPathsAreEqual(config interface{}, a, b string) bool

Types

type SecretAgent

type SecretAgent struct {
	// contains filtered or unexported fields
}

SecretAgent loads and holds a keypair needed for encryption/decryption

func NewSecretAgent

func NewSecretAgent(key []byte) *SecretAgent

NewSecretAgent will return a new SecretAgent with the provided key.

func NewSecretAgentFromBase64

func NewSecretAgentFromBase64(keyBase64 string) (*SecretAgent, error)

NewSecretAgentFromBase64 loads from keyBase64

func NewSecretAgentFromFile

func NewSecretAgentFromFile(keyFile string) (*SecretAgent, error)

NewSecretAgentFromFile loads from keyFile

func NewTestSecretAgent

func NewTestSecretAgent() (*SecretAgent, error)

func (*SecretAgent) Decrypt

func (secretAgent *SecretAgent) Decrypt(encrypted string) (string, error)

Decrypt will return the decrypted value represented by encrypted

func (*SecretAgent) DecryptPaths

func (secretAgent *SecretAgent) DecryptPaths(config interface{}, encryptedPaths ...string) error

DecryptPaths will will replace the values at the indicated paths with thier decrypted values

func (*SecretAgent) Encrypt

func (secretAgent *SecretAgent) Encrypt(decrypted string) (string, error)

Encrypt will return the encrypted value represented by decrypted

Jump to

Keyboard shortcuts

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