use of com.keepassdroid.database.load.ImporterV3 in project KeePassDX by Kunzisoft.
the class Kdb3 method testKeyfile.
private void testKeyfile(String dbAsset, String keyAsset, String password) throws Exception {
Context ctx = getContext();
File sdcard = Environment.getExternalStorageDirectory();
String keyPath = sdcard.getAbsolutePath() + "/key";
TestUtil.extractKey(ctx, keyAsset, keyPath);
AssetManager am = ctx.getAssets();
InputStream is = am.open(dbAsset, AssetManager.ACCESS_STREAMING);
ImporterV3 importer = new ImporterV3();
importer.openDatabase(is, password, TestUtil.getKeyFileInputStream(ctx, keyPath));
is.close();
}
use of com.keepassdroid.database.load.ImporterV3 in project KeePassDX by Kunzisoft.
the class Kdb3Twofish method testReadTwofish.
public void testReadTwofish() throws Exception {
Context ctx = getContext();
AssetManager am = ctx.getAssets();
InputStream is = am.open("twofish.kdb", AssetManager.ACCESS_STREAMING);
ImporterV3 importer = new ImporterV3();
PwDatabaseV3 db = importer.openDatabase(is, "12345", null);
assertTrue(db.algorithm == PwEncryptionAlgorithm.Twofish);
is.close();
}
Aggregations