vault

package
v0.0.0-...-768a7c8 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package vault utilizes age package for secure data encryption and decryption.

Index

Constants

View Source
const (
	Perm600 = 0o600 // For secret files.
	Perm700 = 0o700 // For sensitive files or directories.
)

Variables

View Source
var (
	File = "vault"  // Default vault file name.
	Dir  = ".skunk" // Default vault directory.
)

Functions

func Decode

func Decode(file, pass string) ([]byte, error)

Decode decrypts the specified file using the given passphrase. It returns the decrypted data as a byte slice. It returns error if the decryption or file operations fail.

func Encode

func Encode(file, pass string, value interface{}) error

Encode encrypts given value and writes it to the specified file using the given passphrase. It returns an error if the encryption or file operations fail.

func IsVaultExist

func IsVaultExist() (string, bool)

IsVaultExist checks if the vault file exists and returns the path.

func NewVault

func NewVault(pass string, value interface{}) (string, error)

NewVault creates a new vault file with the provided password and initial value. It return the vault file path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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