crypto

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecryptionFailed    = errors.New("failed to decrypt secrets")
	ErrEncryptionFailed    = errors.New("failed to encrypt secrets")
	ErrKeyGenerationFailed = errors.New("failed to generate encryption key")
)

Functions

func DecryptSecrets

func DecryptSecrets(secretsPath, keyPath string) (string, error)

DecryptSecrets decrypts the secrets file and returns the plaintext content.

func EncryptSecrets

func EncryptSecrets(secretsPath, keyPath, secrets string) error

EncryptSecrets encrypts the given secrets string using age encryption and saves to the specified path.

func EnsureKeyExists

func EnsureKeyExists(configDir string) error

EnsureKeyExists generates a new encryption key if one doesn't exist at the specified directory.

func GenerateKey

func GenerateKey(keyPath string) error

GenerateKey generates a new X25519 encryption key and saves it to the specified path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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