passwdstore

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package passwdstore implements basic functionality for storing key value pairs. It does this with proper encryption and hashing mechanism in a file securely. Also note that this package only works after you run the Init function which creates the password store file.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrFilePathNotAbsolute is the error thrown when
	// the passwdstore.Init function does not get an absolute path as an argument.
	ErrFilePathNotAbsolute = errors.New("passwdstore: given filepath not absolute")
	// ErrPasswdFileManuallyEdited is the error thrown when
	// the passwdstore file at $HOME/.vault/.passwdstore is not parsable as it is manually edited.
	ErrPasswdFileManuallyEdited = errors.New("passwdstore: password file manually edited")
	// ErrPasswdFileIntegrityFail is the error thrown when
	// the passwdstore file at $HOME/.vault/.passwdstore fails
	// the integrity check which means that the contents are edited.
	ErrPasswdFileIntegrityFail = errors.New("passwdstore: password file integrity fail")
	// ErrVaultPasswdNotSet is the error thrown when the
	// vault password is empty or not set. Use the passwdstore.ChangePasswd
	// function to set the password initially as it is empty.
	ErrVaultPasswdNotSet = errors.New("passwdstore: vault password not set")
)

Functions

func ChangePasswd

func ChangePasswd(np, op []byte) error

ChangePasswd changes the password for the store.

func Clear

func Clear(p []byte) error

Clear clears all the key value pairs in the store.

func Delete

func Delete(k string, p []byte) error

Delete deletes the key value pair in the store.

func Get

func Get(k string, p []byte) (string, error)

Get gets the key value pair from the store.

func Init

func Init(f string) error

Init sets the given filepath for password store file.

func ListEntries added in v1.1.0

func ListEntries(p []byte) ([][2]string, error)

ListEntries lists all the key value pairs in the store.

func ListKeys added in v1.1.0

func ListKeys(p []byte) ([]string, error)

ListKeys lists all the keys in the store.

func Put

func Put(k, v string, p []byte) error

Put puts the key value pair in the store.

Types

This section is empty.

Jump to

Keyboard shortcuts

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