All Projects → cternes → Openkeepass

cternes / Openkeepass

Licence: apache-2.0
[Deprecated] A java library for reading and writing KeePass databases. It is an intuitive java library that supports KeePass 2.x database files.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Openkeepass

Keepass2 Haveibeenpwned
Simple Have I Been Pwned checker for KeePass
Stars: ✭ 381 (+197.66%)
Mutual labels:  keepass
Winhellounlock
KeePass 2 plugin to automatically unlock databases with Windows Hello
Stars: ✭ 61 (-52.34%)
Mutual labels:  keepass
Passhole
A secure hole for your passwords (KeePass CLI)
Stars: ✭ 108 (-15.62%)
Mutual labels:  keepass
Keepassium
KeePass-compatible password manager for iOS
Stars: ✭ 445 (+247.66%)
Mutual labels:  keepass
Authpass
AuthPass - Password Manager based on Flutter for all platforms. Keepass 2.x (kdbx 3.x) compatible.
Stars: ✭ 591 (+361.72%)
Mutual labels:  keepass
Libkeepass
Python module to read KeePass 1.x/KeePassX (v3) and KeePass 2.x (v4) files
Stars: ✭ 94 (-26.56%)
Mutual labels:  keepass
Keetraytotp
Tray TOTP Plugin for KeePass2.
Stars: ✭ 331 (+158.59%)
Mutual labels:  keepass
Keeweb
Free cross-platform password manager compatible with KeePass
Stars: ✭ 10,587 (+8171.09%)
Mutual labels:  keepass
Keemob
Cordova wrapper for Keeweb
Stars: ✭ 27 (-78.91%)
Mutual labels:  keepass
Keepassdx
📱 KeePass implementation for android with material design and deluxe features
Stars: ✭ 1,395 (+989.84%)
Mutual labels:  keepass
Keepassrpc
The KeePassRPC plugin that needs to be installed inside KeePass in order for Kee to be able to connect your browser to your passwords
Stars: ✭ 450 (+251.56%)
Mutual labels:  keepass
Keeanywhere
A cloud storage provider plugin for KeePass Password Safe
Stars: ✭ 496 (+287.5%)
Mutual labels:  keepass
Awesome Keepass
Curated list of KeePass-related projects
Stars: ✭ 99 (-22.66%)
Mutual labels:  keepass
Browser Addon
Kee adds free, secure and easy password management features to your browser which save time and keep your private data more secure.
Stars: ✭ 386 (+201.56%)
Mutual labels:  keepass
Keepasskit
KeePass Database loading, storing and manipulation framework
Stars: ✭ 109 (-14.84%)
Mutual labels:  keepass
Keepass Yet Another Favicon Downloader
Yet Another Favicon Downloader for KeePass 2.x
Stars: ✭ 354 (+176.56%)
Mutual labels:  keepass
Passafari.safariextension
Extensions to allow Safari to auto form-fill passwords via KeePassHTTP
Stars: ✭ 86 (-32.81%)
Mutual labels:  keepass
Keepassxc
KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
Stars: ✭ 11,623 (+8980.47%)
Mutual labels:  keepass
Keepass4web
An application that serves KeePass database entries on a web frontend
Stars: ✭ 115 (-10.16%)
Mutual labels:  keepass
Keepmenu
Dmenu/Rofi frontend for Keepass databases
Stars: ✭ 105 (-17.97%)
Mutual labels:  keepass

DEPRECATED - unfortunately no longer actively maintained, because I don't have time

Build Status

openkeepass

openkeepass is a java library for reading and writing KeePass databases. It is an intuitive java library that supports KeePass 2.x database files.

Only KeePass files created with version 2.x are supported. KeePass files created with version 1.x are NOT supported.

Features included so far:

  • Reading and writing support for KeePass 2.x
  • Password or Keyfile credentials: openkeepass can open password protected databases as well as keyfile protected databases.
  • Android Support: Will run on Android devices.
  • Easy to learn API: openkeepass has a simple API with convenient methods that makes it easy to read data from a KeePass database.
  • Very lean: openkeepass tries to keep the necessary dependencies to an absolute minimum.
  • Backward compatible until Java 6

Installation

The easiest way is to add openkeepass as a maven dependency.

<dependency>
    <groupId>de.slackspace</groupId>
	<artifactId>openkeepass</artifactId>
    <version>0.8.1</version>
</dependency>

Prerequisites

Before using this library make sure that you have the Java Cryptography Extension (JCE) installed on your system.

You can download JCE here:

Android

Android users should apply the following dependency to avoid an error regarding build-in xml libraries:

compile ('de.slackspace:openkeepass:0.6.0') {
    exclude module: 'stax'
    exclude module: 'stax-api'
    exclude module: 'xpp3'
}

Examples for reading

The basic usage is very simple. This example will show you how to retrieve all entries and the top groups of the KeePass database.

    // Open Database
	KeePassFile database = KeePassDatabase.getInstance("Database.kdbx").openDatabase("MasterPassword");
		
	// Retrieve all entries
	List<Entry> entries = database.getEntries();
	for (Entry entry : entries) {
		System.out.println("Title: " + entry.getTitle() + " Password: " + entry.getPassword());
	}

	// Retrieve all top groups
	List<Group> groups = database.getTopGroups();
	for (Group group : groups) {
		System.out.println(group.getName());
	}

You can also search for specific entries in the database:

	// Search for single entry
	Entry sampleEntry = database.getEntryByTitle("Sample Entry");
	System.out.println("Title: " + sampleEntry.getTitle() + " Password: " + sampleEntry.getPassword());

	// Search for all entries that contain 'Sample' in title
	List<Entry> entriesByTitle = database.getEntriesByTitle("Sample", false);
	for (Entry entry : entriesByTitle) {
		System.out.println("Title: " + entry.getTitle() + " Password: " + entry.getPassword());
	}

Open a database with a key file:

	// Open database with keyfile
	KeePassFile database = KeePassDatabase.getInstance("DatabaseProtectedByKeyfile.kdbx").openDatabase(new File("Keyfile.key"));
		
	// Print all entries		
	List<Entry> entries = database.getEntries();
	for (Entry entry : entries) {
		System.out.println(entry.getTitle() + ":" + entry.getPassword());
	}

Retrieve custom string fields (Advanced tab) from a database:

	// Retrieve all properties including custom string fields of an entry
	Set<Property> properties = database.getEntryByTitle("1st Entry").getProperties();
	for (Property property : properties) {
		System.out.println(property.getKey() + ":" + property.getValue());
	}

For more usages have a look into the unit test classes.

Examples for writing

If you want to start writing a new KeePass file from scratch you first have to build up your database model. This will be done using the provided builders. After the model has been constructed you can use the KeePassDatabase class to write the KeePass database to a stream.

	// Build KeePass model
	Group root = new GroupBuilder()
					.addEntry(new EntryBuilder("First entry").username("Peter").password("Peters secret").build())
					.addGroup(new GroupBuilder("Banking")
							.addEntry(new EntryBuilder("Second entry").username("Paul").password("secret").build())
							.build())
					.build();
				
	KeePassFile keePassFile = new KeePassFileBuilder("writingDB")
					.addTopGroups(root)
					.build();
				
	// Write KeePass file to disk
	KeePassDatabase.write(keePassFile, "MasterPassword", new FileOutputStream("Database.kdbx"));

For more usages have a look into the unit test classes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].