keepasshttp

package
v0.0.0-...-c82cf67 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package keepasshttp provide tools to see and manipulate KeePass credentials through keePassHTTP plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAES256CBCPksc7

func NewAES256CBCPksc7(key []byte, iv []byte) (aes256cbc *aes256CBCPksc7, err error)

NewAES256CBCPksc7 is an simple helper to do AES256 encryption/decryption.

Types

type Credential

type Credential struct {
	Login        string
	Password     string
	Url          string
	Uuid         string
	StringFields map[string]string
	// contains filtered or unexported fields
}

Credential is a container for KeePass credential.

func (*Credential) Commit

func (credential *Credential) Commit() error

Commit update an existing entry in KeePass database. It won't work on a newly created Credential, use use `kph.update(credential)` instead.

type Filter

type Filter struct {
	Url       string
	SubmitUrl string
	Realm     string
}

Filter is a group of string used for filtering KeePass entries. All fields are optional.

type KeePassHTTP

type KeePassHTTP struct {
	// Url is the listening keePassHTTP's server address.
	Url string
	// Storage is the file path to store private association key (default to "~/.python_keepass_http").
	Storage string
	// contains filtered or unexported fields
}

KeePassHTTP is a class to manipulate KeePass credentials using keePassHTTP protocol.

func New

func New() *KeePassHTTP

New creates a keePassHTTP instance with default values

func (*KeePassHTTP) Count

func (kph *KeePassHTTP) Count(filter *Filter) (credentialsCount int, err error)

Count entries for a given `Filter`. Filtering is done the same as `Search` method.

func (*KeePassHTTP) Create

func (kph *KeePassHTTP) Create(credential *Credential) (err error)

Create a new credential into KeePass

func (*KeePassHTTP) Get

func (kph *KeePassHTTP) Get(filter *Filter) (credential *Credential, err error)

Get a single matching entry for a given `Filter`. For every entry, the Levenshtein Distance of his Entry-URL (or Title, if Entry-URL is not set) to the “key“ is calculated. Only the entry with the minimal distance is returned

func (*KeePassHTTP) List

func (kph *KeePassHTTP) List() (credentials []*Credential, err error)

List all entries that look like an url. Passwords are omitted.

func (*KeePassHTTP) Search

func (kph *KeePassHTTP) Search(filter *Filter) (credentials []*Credential, err error)

Search all matching entries for a given `Filter`. For every entry, the Levenshtein Distance of his Entry-URL (or Title, if Entry-URL is not set) to the `Url` is calculated. Only the entries with the minimal distance are returned.

func (*KeePassHTTP) Update

func (kph *KeePassHTTP) Update(credential *Credential) (err error)

Update a credential into KeePass. KeePass will prompt for validation only when a change is detected.

Jump to

Keyboard shortcuts

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