pio

package
v5.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SECDIR = "SECDIR"
	// ConfigFileName is the name of the secman config file.
	ConfigFileName = "config"
	// SiteFileName is the name of the secman password store file.
	SiteFileName = "sites.json"
	// EncryptedFileDir is the name of the secman encrypted file dir.
	EncryptedFileDir = "files"
)

Variables

View Source
var (
	// MasterPassPrompt is the standard prompt string for all secman
	MasterPassPrompt = "Enter master password"
)

Functions

func GetConfigPath

func GetConfigPath() (p string, err error)

GetConfigPath is used to get the user's secman directory.

func GetEncryptedFilesDir

func GetEncryptedFilesDir() (p string, err error)

GetEncryptedFilesDir is used to get the directory that we store encrypted files in.

func GetHomeDir

func GetHomeDir() (d string, err error)

func GetPassDir

func GetPassDir() (d string, err error)

GetPassDir is used to return the user's secman directory.

func GetSiteFileBytes

func GetSiteFileBytes() (b []byte)

GetSiteFileBytes returns the bytes instead of a SiteFile

func GetSitesFile

func GetSitesFile() (d string, err error)

GetSitesFile will return the user's secman vault.

func PassConfigExists

func PassConfigExists() (bool, error)

PassConfigExists is used to determine if the secman config file exists in the user's secman directory.

func PassDirExists

func PassDirExists() (bool, error)

PassDirExists is used to determine if the secman directory in the user's home directory exists.

func PassFileDirExists

func PassFileDirExists() (bool, error)

func Prompt

func Prompt(prompt string) (s string, err error)

Prompt will prompt a user for regular data from stdin.

func PromptPass

func PromptPass(prompt string) (pass string, err error)

PromptPass will prompt user's for a password by terminal.

func SitesVaultExists

func SitesVaultExists() (bool, error)

SitesVaultExists is used to determine if the password store exists in the user's secman directory.

func ToClipboard

func ToClipboard(s string)

func UpdateVault

func UpdateVault(s SiteFile) (err error)

UpdateVault is used to replace the current password vault.

Types

type ConfigFile

type ConfigFile struct {
	MasterKeyPrivSealed []byte
	PubKeyHmac          []byte
	SiteHmac            []byte
	MasterPubKey        [32]byte
	MasterPassKeySalt   [32]byte
	HmacSalt            [32]byte
	SiteHmacSalt        [32]byte
}

ConfigFile represents the secman config file.

func ReadConfig

func ReadConfig() (c ConfigFile, err error)

ReadConfig is used to return the secman ConfigFile.

func (*ConfigFile) SaveFile

func (c *ConfigFile) SaveFile() (err error)

SaveFile is used by ConfigFiles to update the secman config.

type PassFile

type PassFile interface {
	SaveFile() (err error)
}

PassFile is an interface for how all secman files should be saved.

type SiteFile

type SiteFile []SiteInfo

SiteFile represents the entire secman password store.

func GetVault

func GetVault() (s SiteFile)

GetVault is used to retrieve the password vault for the user.

type SiteInfo

type SiteInfo struct {
	PubKey     [32]byte
	PassSealed []byte
	Name       string
	FileName   string
	IsFile     bool
}

SiteInfo represents a single saved password entry.

func (*SiteInfo) AddFile

func (s *SiteInfo) AddFile(fileBytes []byte, filename string) error

func (*SiteInfo) AddSite

func (s *SiteInfo) AddSite() (err error)

AddSite is used by individual password entries to update the vault.

Jump to

Keyboard shortcuts

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