vault

package
v0.0.0-...-7ada4f3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(file, output, keyFile, keyString string, inplace bool) ([]byte, error)

Decrypt takes an encrypted file, decrypts its content using AES-256 algorithm, and writes the decrypted content to an output file or stdout. If inplace is true, the original file is overwritten with the decrypted content.

func Encrypt

func Encrypt(file, output, keyFile, keyString string, inplace bool) error

Encrypt encrypts the specified file using AES-256-GCM encryption. It takes input file, output file (optional), key file, key string, and an inplace flag. If inplace is true, it overwrites the input file with the encrypted content. If output is specified, it writes the encrypted content to the output file.

func Load

func Load(file, binary, envType, keyFile, keyString string) error

Load reads environment configuration from a file, decrypts if necessary, and loads it into a binary by executing a command based on environmental value.

Types

type KeyManager

type KeyManager interface {
	// contains filtered or unexported methods
}

KeyManager is an interface for managing encryption keys.

type KeyType

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

KeyType represents the type of encryption key and its source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳