pio

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: MIT Imports: 12 Imported by: 19

Documentation

Index

Constants

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

Variables

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

Functions

func GetConfigPath

func GetConfigPath() (p string, err error)

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

func GetEncryptedFilesDir

func GetEncryptedFilesDir() (p string, err error)

GetFilesDir 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 passgo 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 passgo vault.

func PassConfigExists

func PassConfigExists() (bool, error)

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

func PassDirExists

func PassDirExists() (bool, error)

PassDirExists is used to determine if the passgo 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 passgo 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 passgo config file.

func ReadConfig

func ReadConfig() (c ConfigFile, err error)

ReadConfig is used to return the passgo ConfigFile.

func (*ConfigFile) SaveFile

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

SaveFile is used by ConfigFiles to update the passgo config.

type PassFile

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

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

type SiteFile

type SiteFile []SiteInfo

SiteFile represents the entire passgo 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