public class KeePassDatabase extends Object
Currently the following KeePass files are supported:
// open database
KeePassFile database = KeePassDatabase.getInstance("keePassDatabasePath").openDatabase("secret");
// get password entries
List<Entry> entries = database.getEntries();
...
If the database could not be opened a RuntimeException will be thrown.KeePassFile| Modifier and Type | Field and Description |
|---|---|
protected Decrypter |
decrypter |
protected KeePassDatabaseXmlParser |
keePassDatabaseXmlParser |
protected KeyFileXmlParser |
keyFileXmlParser |
static int |
VERSION_SIGNATURE_LENGTH |
| Modifier and Type | Method and Description |
|---|---|
KeePassHeader |
getHeader()
Gets the KeePassDatabase header.
|
static KeePassDatabase |
getInstance(File keePassDatabaseFile)
Retrieves a KeePassDatabase instance.
|
static KeePassDatabase |
getInstance(InputStream keePassDatabaseStream)
Retrieves a KeePassDatabase instance.
|
static KeePassDatabase |
getInstance(String keePassDatabaseFile)
Retrieves a KeePassDatabase instance.
|
KeePassFile |
openDatabase(File keyFile)
Opens a KeePass database with the given password and returns the KeePassFile for further processing.
|
KeePassFile |
openDatabase(InputStream keyFileStream)
Opens a KeePass database with the given keyfile stream and returns the KeePassFile for further processing.
|
KeePassFile |
openDatabase(String password)
Opens a KeePass database with the given password and returns the KeePassFile for further processing.
|
public static final int VERSION_SIGNATURE_LENGTH
protected Decrypter decrypter
protected KeePassDatabaseXmlParser keePassDatabaseXmlParser
protected KeyFileXmlParser keyFileXmlParser
public static KeePassDatabase getInstance(String keePassDatabaseFile)
keePassDatabaseFile - a KeePass database filename, must not be NULLpublic static KeePassDatabase getInstance(File keePassDatabaseFile)
keePassDatabaseFile - a KeePass database file, must not be NULLpublic static KeePassDatabase getInstance(InputStream keePassDatabaseStream)
keePassDatabaseStream - an input stream of a KeePass database, must not be NULLpublic KeePassFile openDatabase(String password)
If the database cannot be decrypted with the provided password an exception will be thrown.
password - the password to open the databaseKeePassFilepublic KeePassFile openDatabase(File keyFile)
If the database cannot be decrypted with the provided password an exception will be thrown.
keyFile - the password to open the databaseKeePassFilepublic KeePassFile openDatabase(InputStream keyFileStream)
If the database cannot be decrypted with the provided keyfile an exception will be thrown.
keyFileStream - the keyfile to open the database as streamKeePassFilepublic KeePassHeader getHeader()
Copyright © 2015. All rights reserved.