Skip to content

This project is a simple header-only addon/helper to `kindahl/libkeepass` for easy traversal of group/entry trees.

Notifications You must be signed in to change notification settings

herhor67/libkeepass-directory-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

libkeepass-directory-helper

This project is a simple header-only helper to kindahl/libkeepass.

Its purpose is to make file reading even simpler, and to implement traversal of group/entry trees by name/title.

Any other ideas or changes, please issue.

Using

The main entry point is the KPHelper class. It takes care of creating a key, choosing version, importing, and traversing the tree.

Examples

Create helper, import file using pasword, read some api key to std::string.

	std::string path = "credentials.kdbx";
	std::string pass = "SuperSeretPaword";

	KPHelper KP(path, pass);

	std::string api_key = KP.findEntry("external/whatever/api_key")->password();
  
//	curl ...

Get a pointer to some entry, then use username() and password() directly.

	auto entry_ptr = KP.findEntry("internal/databases/mysql");
  
//	mysql_connect("localhost:3306", entry_ptr->username()->c_str(), entry_ptr->password()->c_str(), "my_schema");
//	...

Empty group names are skipped, the traverser stays in the same branch.

	// Get root group
	auto root_ptr1 = KP.findGroup("");
	auto root_ptr2 = KP.findGroup("/");
	auto root_ptr3 = KP.findGroup("//////////");

	// Get some entry
	auto entry_ptr1 = KP.findEntry("some/arbitrary/path/to/entry");
	auto entry_ptr2 = KP.findEntry("/some/arbitrary/path/to/entry");
	auto entry_ptr3 = KP.findEntry("///some//arbitrary/path/////to//entry");

About

This project is a simple header-only addon/helper to `kindahl/libkeepass` for easy traversal of group/entry trees.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages