enpass

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptValue added in v1.9.0

func EncryptValue(plaintext string, uuid string) (encryptedValue string, itemKey []byte, err error)

EncryptValue encrypts a plaintext value using AES-256-GCM. Returns the hex-encoded ciphertext and the 44-byte key (32-byte AES key + 12-byte nonce). The uuid (without dashes) is used as Additional Authenticated Data (AAD).

Types

type Card

type Card struct {
	// plaintext
	UUID      string
	CreatedAt int64
	Type      string
	UpdatedAt int64
	Title     string
	Subtitle  string
	Note      string
	Trashed   int64
	Deleted   int64
	Category  string
	Label     string
	LastUsed  int64
	Sensitive bool
	Icon      string
	RawValue  string
	// contains filtered or unexported fields
}

func (*Card) Decrypt

func (c *Card) Decrypt() (string, error)

func (*Card) IsDeleted

func (c *Card) IsDeleted() bool

func (*Card) IsTrashed added in v1.1.0

func (c *Card) IsTrashed() bool

type EntryData added in v1.9.0

type EntryData struct {
	Title    string
	Username string
	Password string
	URL      string
	Notes    string
	Category string
}

EntryData holds the data for creating or updating an entry

type Keyfile

type Keyfile struct {
	Key string `xml:",innerxml"`
}

type Vault

type Vault struct {

	// settings for filtering entries
	FilterFields []string
	FilterAnd    bool
	// contains filtered or unexported fields
}

Vault : vault is the container object for vault-related operations

func NewVault added in v1.4.0

func NewVault(vaultPath string, logLevel logrus.Level) (*Vault, error)

NewVault : Create new instance of vault and load vault info

func (*Vault) Close

func (v *Vault) Close()

Close : close the connection to the underlying database. Always call this in the end.

func (*Vault) CreateEntry added in v1.9.0

func (v *Vault) CreateEntry(entry *EntryData) (string, error)

CreateEntry creates a new password entry in the vault

func (*Vault) DeleteEntry added in v1.9.0

func (v *Vault) DeleteEntry(entryUUID string) error

DeleteEntry permanently deletes an entry from the vault

func (*Vault) GetEntries

func (v *Vault) GetEntries(cardType string, filters []string) ([]Card, error)

GetEntries : return the cardType entries in the Enpass database filtered by filters. Note: Each item in Enpass can have multiple fields (e.g., email accounts have login, incoming server, outgoing server fields). This function deduplicates by UUID, preferring the sensitive field (typically the password).

func (*Vault) GetEntry added in v1.4.0

func (v *Vault) GetEntry(cardType string, filters []string, unique bool) (*Card, error)

func (*Vault) GetEntryByUUID added in v1.9.0

func (v *Vault) GetEntryByUUID(entryUUID string) (*Card, error)

GetEntryByUUID retrieves a single entry by its UUID (including trashed)

func (*Vault) Open added in v1.4.0

func (v *Vault) Open(credentials *VaultCredentials) error

Open : setup a connection to the Enpass database. Call this before doing anything.

func (*Vault) RestoreEntry added in v1.9.0

func (v *Vault) RestoreEntry(entryUUID string) error

RestoreEntry restores an entry from the trash

func (*Vault) TrashEntry added in v1.9.0

func (v *Vault) TrashEntry(entryUUID string) error

TrashEntry moves an entry to the trash

func (*Vault) UpdateEntry added in v1.9.0

func (v *Vault) UpdateEntry(entryUUID string, updates *EntryData) error

UpdateEntry updates an existing entry in the vault

type VaultCredentials added in v1.4.0

type VaultCredentials struct {
	KeyfilePath string
	Password    string
	DBKey       []byte
}

func (*VaultCredentials) IsComplete added in v1.4.0

func (credentials *VaultCredentials) IsComplete() bool

type VaultInfo

type VaultInfo struct {
	EncryptionAlgo string `json:"encryption_algo"`
	HasKeyfile     int    `json:"have_keyfile"`
	KDFAlgo        string `json:"kdf_algo"`
	KDFIterations  int    `json:"kdf_iter"`
	VaultNumItems  int    `json:"vault_items_count"`
	VaultName      string `json:"vault_name"`
	VaultVersion   int    `json:"version"`
}

Jump to

Keyboard shortcuts

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