Documentation
¶
Index ¶
- Variables
- func ValidatePassword(password string) error
- type Vault
- func (v *Vault) ChangePassword(newPassword string) error
- func (v *Vault) Close() error
- func (v *Vault) KeyDelete(key string) error
- func (v *Vault) KeyExists(key string) bool
- func (v *Vault) KeyGet(key string) (string, error)
- func (v *Vault) KeyList() []string
- func (v *Vault) KeySet(key, value string) error
- func (v *Vault) Save() error
- type VaultParams
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidFormat = errors.New("invalid vault file format") ErrInvalidAuth = errors.New("authentication failed: wrong password or corrupted data") )
var ( ErrVaultNotFound = errors.New("vault file not found") ErrKeyNotFound = errors.New("key not found in vault") )
var ErrWeakPassword = errors.New("password must be at least 8 characters and contain uppercase, lowercase, and digit")
ErrWeakPassword is returned when a password does not meet strength requirements.
Functions ¶
func ValidatePassword ¶
ValidatePassword checks that a password meets minimum strength requirements.
Types ¶
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault represents an encrypted vault
func Create ¶
Create creates a new vault file. Returns an error if the file already exists or the password does not meet strength requirements.
func TryOpen ¶
TryOpen opens a vault, returning (vault, true, nil) on success or (nil, false, nil) on auth failure. Other errors (missing file, permission denied, etc.) are returned as (nil, false, err).
func (*Vault) ChangePassword ¶
ChangePassword changes the vault password and re-encrypts with new password. Returns an error if the new password does not meet strength requirements.
type VaultParams ¶
VaultParams represents Argon2 parameters