Search in sources :

Example 6 with ImporterV4

use of com.keepassdroid.database.load.ImporterV4 in project KeePassDX by Kunzisoft.

the class Kdb4 method testParsing.

public void testParsing() throws IOException, InvalidDBException {
    Context ctx = getContext();
    AssetManager am = ctx.getAssets();
    InputStream is = am.open("test.kdbx", AssetManager.ACCESS_STREAMING);
    ImporterV4 importer = new ImporterV4();
    importer.openDatabase(is, "12345", null);
    is.close();
}
Also used : Context(android.content.Context) AssetManager(android.content.res.AssetManager) ByteArrayInputStream(java.io.ByteArrayInputStream) CopyInputStream(com.keepassdroid.stream.CopyInputStream) InputStream(java.io.InputStream) ImporterV4(com.keepassdroid.database.load.ImporterV4)

Example 7 with ImporterV4

use of com.keepassdroid.database.load.ImporterV4 in project KeePassDX by Kunzisoft.

the class Kdb4 method testNoGzip.

public void testNoGzip() throws IOException, InvalidDBException {
    Context ctx = getContext();
    AssetManager am = ctx.getAssets();
    InputStream is = am.open("no-encrypt.kdbx", AssetManager.ACCESS_STREAMING);
    ImporterV4 importer = new ImporterV4();
    importer.openDatabase(is, "12345", null);
    is.close();
}
Also used : Context(android.content.Context) AssetManager(android.content.res.AssetManager) ByteArrayInputStream(java.io.ByteArrayInputStream) CopyInputStream(com.keepassdroid.stream.CopyInputStream) InputStream(java.io.InputStream) ImporterV4(com.keepassdroid.database.load.ImporterV4)

Example 8 with ImporterV4

use of com.keepassdroid.database.load.ImporterV4 in project KeePassDX by Kunzisoft.

the class Kdb4Header method testReadHeader.

public void testReadHeader() throws Exception {
    Context ctx = getContext();
    AssetManager am = ctx.getAssets();
    InputStream is = am.open("test.kdbx", AssetManager.ACCESS_STREAMING);
    ImporterV4 importer = new ImporterV4();
    PwDatabaseV4 db = importer.openDatabase(is, "12345", null);
    assertEquals(6000, db.numKeyEncRounds);
    assertTrue(db.dataCipher.equals(AesEngine.CIPHER_UUID));
    is.close();
}
Also used : Context(android.content.Context) AssetManager(android.content.res.AssetManager) InputStream(java.io.InputStream) ImporterV4(com.keepassdroid.database.load.ImporterV4) PwDatabaseV4(com.keepassdroid.database.PwDatabaseV4)

Example 9 with ImporterV4

use of com.keepassdroid.database.load.ImporterV4 in project KeePassDX by Kunzisoft.

the class SprEngineTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Context ctx = getContext();
    AssetManager am = ctx.getAssets();
    InputStream is = am.open("test.kdbx", AssetManager.ACCESS_STREAMING);
    ImporterV4 importer = new ImporterV4();
    db = importer.openDatabase(is, "12345", null);
    is.close();
    spr = new SprEngineV4();
}
Also used : Context(android.content.Context) AssetManager(android.content.res.AssetManager) InputStream(java.io.InputStream) ImporterV4(com.keepassdroid.database.load.ImporterV4) SprEngineV4(com.keepassdroid.utils.SprEngineV4)

Aggregations

Context (android.content.Context)9 AssetManager (android.content.res.AssetManager)9 ImporterV4 (com.keepassdroid.database.load.ImporterV4)9 InputStream (java.io.InputStream)9 CopyInputStream (com.keepassdroid.stream.CopyInputStream)7 ByteArrayInputStream (java.io.ByteArrayInputStream)7 PwDatabaseV4 (com.keepassdroid.database.PwDatabaseV4)2 Importer (com.keepassdroid.database.load.Importer)1 PwDbV4Output (com.keepassdroid.database.save.PwDbV4Output)1 SprEngineV4 (com.keepassdroid.utils.SprEngineV4)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 FileOutputStream (java.io.FileOutputStream)1