Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
purejava committed Feb 26, 2021
2 parents 5d2cb11 + cdbb92e commit eb99586
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 13 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,55 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f8c426863d4c46578ef2b7ae8c32e99f)](https://app.codacy.com/gh/purejava/keepassxc-proxy-access?utm_source=github.com&utm_medium=referral&utm_content=purejava/keepassxc-proxy-access&utm_campaign=Badge_Grade)
[![Maven Central](https://img.shields.io/maven-central/v/org.purejava/keepassxc-proxy-access.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.purejava%22%20AND%20a:%22keepassxc-proxy-access%22)
[![License](https://img.shields.io/github/license/purejava/keepassxc-proxy-access.svg)](https://github.com/purejava/keepassxc-proxy-access/blob/master/LICENSE)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate?hosted_button_id=XVX9ZM7WE4ANL)

A Java library to access KeePassXC via its build-in proxy.

# Dependency
Add `keepassxc-proxy-access` as a dependency to your project.
```maven
<dependency>
<groupId>org.purejava</groupId>
<artifactId>keepassxc-proxy-access</artifactId>
<version>0.0.2</version>
</dependency>
```

# Usage
The library uses the JSON data format to communicate with KeePassXC. The underlying TweetNaCL crypto library provides the crypto_box functionality that is used to set up an encrypted and secure channel for the components to communicate with each other.

It's fast, easy to use and cross-platform.

Examples on how to use the library can be found in the Maven test classes.

You need to establish a connection to KeePassXC first:
```java
private KeepassProxyAccess kpa = new KeepassProxyAccess();
kpa.connect();
kpa.associate();
```
You'll get an AssociateID and the public key of an IDKeypair created during the initial connection.
Both pieces of data combined are needed for further connections. As both are public data, there is no need to store them securely.

# keepassxc-protocol
Communication with KeePassXC happens via the KeePassXC protocol. Currently, the following functionality is implemented:
* `change-public-keys`: Request for passing public keys from client to server and back.
* `get-databasehash`: Request for receiving the database hash (SHA256) of the current active database.
* `associate`: Request for associating a new client with KeePassXC.
* `test-associate`: Request for testing if the client has been associated with KeePassXC.
* `generate-password`: Request for generating a password. KeePassXC's settings are used.
* `get-logins`: Requests for receiving credentials for the current URL match.
* `set-login`: Request for adding or updating credentials to the database.
* `lock-database`: Request for locking the database from client.
* `get-database-groups`: Request to retrieve all database groups together with their groupUuids.
* `create-new-group`: Request to create a new group for the given name or path.
* `get-totp`: Request for receiving the current TOTP.

# Donation
If you like this project, you can give me a cup of coffee :)

[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate?hosted_button_id=XVX9ZM7WE4ANL)

# Copyright
Copyright (C) 2021 Ralph Plawetzki

Expand Down
13 changes: 3 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.purejava</groupId>
<artifactId>keepassxc-proxy-access</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>
<packaging>jar</packaging>

<name>keepassxc-proxy-access</name>
Expand Down Expand Up @@ -54,17 +54,10 @@
<maven.compiler.target>1.9</maven.compiler.target>
</properties>

<!-- local repo for tweetnacl-java -->
<repositories>
<repository>
<id>local-repo</id>
<url>file://${basedir}/etc/repo</url>
</repository>
</repositories>

<!-- tweetnacl-java -->
<dependencies>
<dependency>
<groupId>com.iwebpp.crypto</groupId>
<groupId>org.purejava</groupId>
<artifactId>tweetnacl-java</artifactId>
<version>1.1.2</version>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/keepassxc/LinuxMacConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class LinuxMacConnection extends Connection {

static final Logger log = LoggerFactory.getLogger(LinuxMacConnection.class);
private static final Logger log = LoggerFactory.getLogger(LinuxMacConnection.class);

private AFUNIXSocket socket;
private OutputStream os;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/keepassxc/WindowsConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class WindowsConnection extends Connection {

static final Logger log = LoggerFactory.getLogger(WindowsConnection.class);
private static final Logger log = LoggerFactory.getLogger(WindowsConnection.class);

private RandomAccessFile pipe;

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/purejava/UnlockedDatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* For this test, KeePassXC should be started and unlocked.
*/
public class UnlockedDatabaseTest {
static final Logger log = LoggerFactory.getLogger(UnlockedDatabaseTest.class);
private static final Logger log = LoggerFactory.getLogger(UnlockedDatabaseTest.class);

private KeepassProxyAccess kpa = new KeepassProxyAccess();

Expand Down

0 comments on commit eb99586

Please sign in to comment.