Giter VIP home page Giter VIP logo

keepassxc-client-library's Introduction

keepassxc-client-library

A C++ library to access the browser-plugin-API of KeePassXC to retrieve or create entries.

This library is basically a reimplementation of the communication that the KeePassXC-Browser-Plugin uses to exchange data with KeePassXC. It allows you to connect with a KeePassXC database and use the full browser API in your custom application.

Features

  • A complete, Qt-based implementation of the client side of the keepassxc-protocol
  • Compatible with KeePassXC Version 2.3.0 and above
  • End-to-End encryption based on NaCl-Box
  • Implements all features of the browser extensions in regards of database access
    • Trigger database unlocks
    • Lock the database
    • Be notified when the database gets un/locked
    • Generate random passwords using KeePassXCs internal generator
    • Create new credentials
    • Retrieve existing credentials based on URLs

Installation

For now, no prebuilt binaries exist. You have to compile the library yourself. Only linux (and other unixes) are officially supported (for now), but other platforms should work as well, as long as you manually add libsodium as dependency.

Dependencies

The library only depends on QtCore and libsodium. For Unix-Like systems, the libsodium dependency is resolved via pkgconfig. For systems that do not have pkgconfig (like windows) you will have to install that library yourself and manually edit the src.pro file and add the library by hand.

Note: For Unix-Systems, the library comes with an automatically generated pkgconfig file called libkpxcclient.pc for easy integration of the library into your project. For qmake based projects, this can be done using:

CONFIG += link_pkgconfig
PKGCONFIG += libkpxcclient

Compilation

The library uses qmake as build systems. Simply run qmake [build-options], followed by make and make install. The supported build options are:

  • PREFIX=...: A custom installation prefix, specifying where to install the library to. By default, the library is installed into your Qt-Installation. You can also fine-tune sub-paths. See install.pri for all possible values.
  • CONFIG+=install_private_headers: Install all private headers in addition to the public headers in a subdirectory called private
  • CONFIG+=install_demo: Install the demo-binary as well. By default, only the library itself is installed.

Usage

The primary class of the library is KPXCClient::Client. It manages the connection to KeePassXC and provides all the possible operations and events in form of signals and slots. The use the library, you have to initialize it once in your main:

KPXCClient::init();

After that, you can use the client itself to connect to a database:

KPXCClient::Client client;
QObject::connect(&client, &KPXCClient::Client::databaseOpened, [&](QByteArray dbHash) {
	qDebug() << "Connected to database:" << dbHash.toHex();
	// perform whatever operations you need to perform
});
client.connectToKeePass();

The behaviour of the client is manly dictated by a few properties. Most notably the KPXCClient::Client::options property. Check out the corresponding header files to get a grasp of all its capabilities. A formal API-documentation is planned, but was not created yet.

Demo Application

The library comes with a small demo that presents all of the supported operations as a short linear run on a KeePassXC database. The full code can be found in clidemo/main.cpp. The demo is automatically built with the library, but not installed by default. Please note that it will modify the selected database, so it is recommended to run the demo on a test database.

References

keepassxc-client-library's People

Contributors

skycoder42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.