Versions in this module Expand all Collapse all v1 v1.0.0 May 12, 2024 Changes in this version + const TokenTypeHOTP + const TokenTypeTOTP + var ERR_FOLDER_EMPTY = errors.New("Folder name cannot be empty") + var ERR_FOLDER_EXISTS = errors.New("Folder with that name already exists") + var ERR_PASSWORD_INVALID = errors.New("Wrong password, please try again") + var ERR_TOKEN_EMPTY = errors.New("Secret value cannot be empty") + var ERR_TOKEN_EXISTS = errors.New("Token with that secret already exists") + var ERR_TOKEN_INVALID = errors.New("Secret is invalid, are you sure it is typed correctly?") + var ERR_VAULT_DELETED = errors.New("The vault does not exist, did you delete it?") + var SALT_SIZE = 32 + func Decrypt(password string, data []byte) ([]byte, error) + func Encrypt(password string, data []byte) ([]byte, error) + func GenerateKey(password string, salt []byte) ([]byte, []byte, error) + type Folder struct + Name string + Tokens []Token + type Token struct + Account string + Digits int + HashingAlgorithm otp.Algorithm + InitialCounter int + Issuer string + Period int + Secret string + Type TokenType + UsageCounter int + type TokenType int + type Vault struct + Folders []Folder + func Initialize(at, password string) (*Vault, error) + func Load(path, password string) (*Vault, error) + func (vault *Vault) AddFolder(name string) error + func (vault *Vault) AddToken(folder string, uri string) error + func (vault *Vault) AddTokenFromToken(folder string, token Token) error + func (vault *Vault) ChangePassword(password string) + func (vault *Vault) DeleteFolder(name string) + func (vault *Vault) DeleteToken(folder string, token Token) + func (vault *Vault) GetTokens(folder string) []Token + func (vault *Vault) IncreaseCounter(folder string, token Token) + func (vault *Vault) MoveFolderDown(name string) bool + func (vault *Vault) MoveFolderUp(name string) bool + func (vault *Vault) MoveToken(token Token, fromFolder, toFolder string) + func (vault *Vault) MoveTokenDown(folder string, token Token) bool + func (vault *Vault) MoveTokenUp(folder string, token Token) bool + func (vault *Vault) PostInit() + func (vault *Vault) RenameFolder(old, newName string) error + func (vault *Vault) ReplaceToken(fromFolder string, token, newToken Token) error + func (vault Vault) ValidateToken(secret string) (string, error)