Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
org.linguafranca.pwdb:keepassjava2
Advanced tools
A Java 7 API for databases compatible with the renowned KeePass password safe for Windows
A Java 7 API for databases compatible with the renowned KeePass password safe for Windows.
Features to date:
It is licensed under the Apache 2 License and is currently usable.
The work is provided on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY,
or FITNESS FOR A PARTICULAR PURPOSE.
You are solely responsible for determining the appropriateness
of using or redistributing the Work and assume any risks
associated with Your exercise of permissions under this License.
(see license)
<groupId>org.linguafranca.pwdb</groupId>
<artifactId>keepassjava2</artifactId>
<version>2.0.0</version>
at Maven Central, snapshot builds at Sonatype OSS.
It is written for Java 1.7.
The class Javadoc on Interface classes Database, Group and Entry describe how to use the methods of those classes to create and modify entries.
public void loadKdbx() throws IOException {
// get an input stream
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("test123.kdbx");
// password credentials
Credentials credentials = new KdbxCreds("123".getBytes());
// open database
Database database = DomDatabaseWrapper.load(credentials, inputStream);
// visit all groups and entries and list them to console
database.visit(new Visitor.Print());
}
private static Entry entryFactory(DomDatabaseWrapper database, String s, int e) {
return database.newEntry(String.format("Group %s Entry %d", s, e));
}
public void saveKdbx() throws IOException {
// create an empty database
DomDatabaseWrapper database = new DomDatabaseWrapper();
// add some groups and entries
for (Integer g = 0; g < 5; g++){
Group group = database.getRootGroup().addGroup(database.newGroup(g.toString()));
for (int e = 0; e <= g; e++) {
// entry factory is a local helper to populate an entry
group.addEntry(entryFactory(database, g.toString(), e));
}
}
// save to a file with password "123"
FileOutputStream outputStream = new FileOutputStream("test.kdbx");
database.save(new KdbxCreds("123".getBytes()), outputStream);
}
public void loadKdb() throws IOException {
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("test.kdb");
// password credentials
Credentials credentials = new KdbCredentials.Password("123".getBytes());
// load KdbDatabase
Database database = KdbDatabase.load(credentials, inputStream);
// visit all groups and entries and list them to console
database.visit(new Visitor.Print());
}
}
Aside from the JRE the API depends on
It also depends on SLF4J and Junit for tests.
Included POM is for Maven 3.
If you prefer Gradle the automatic conversion gradle init
converts the POM successfully, however you will
need to add the following to your build.gradle
:
test {
include '**/Test*'
include '**/*Test.*'
}
to mimic the behaviour of Maven's surefire plugin.
In this file.
Many thanks to Pavel Ivanov @ivanovpv for his help with Android and Gradle compatibility issues.
Copyright (c) 2016 Jo Rabin
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
A Java 7 API for databases compatible with the renowned KeePass password safe for Windows
We found that org.linguafranca.pwdb:keepassjava2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.