Documentation ¶
Index ¶
- Variables
- type Credential
- type Vault
- func (v *Vault) Add(location string, credential Credential) error
- func (v *Vault) Edit(location string, credential Credential) error
- func (v *Vault) Generate(location string, username string) error
- func (v *Vault) Get(location string) (*Credential, error)
- func (v *Vault) Locations() ([]string, error)
- func (v *Vault) Save(filename string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoSuchCredential is returned from a Get call if the requested // credential does not exist ErrNoSuchCredential = errors.New("credential at specified location does not exist in vault") // ErrCouldNotDecrypt is returned if secretbox decryption fails. ErrCouldNotDecrypt = errors.New("provided decryption key is incorrect or the provided vault is corrupt") // ErrCredentialExists is returned from Add if a credential already exists // at the provided location. ErrCredentialExists = errors.New("credential at specified location already exists") )
Functions ¶
This section is empty.
Types ¶
type Credential ¶
Credential defines a Username and Password to store inside the vault.
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault is a secure password vault. It can be created by calling New() with a passphrase. Passwords, usernames, and locations are encrypted using nacl/secretbox.
func Open ¶
Open reads a vault from the location provided to `filename` and decrypts it using `passphrase`. If decryption succeeds, new nonce is chosen and the vault is re-encrypted, ensuring nonces are unique and not reused across sessions.
func (*Vault) Add ¶
func (v *Vault) Add(location string, credential Credential) error
Add adds the credential provided to `credential` at the location provided by `location` to the vault.
func (*Vault) Edit ¶
func (v *Vault) Edit(location string, credential Credential) error
Edit replaces the credential at location with the provided `credential`.
func (*Vault) Generate ¶
Generate generates a new strong mnemonic passphrase and Add()s it to the vault.
func (*Vault) Get ¶
func (v *Vault) Get(location string) (*Credential, error)
Get retrieves a Credential at the provided `location`.