WifImporter { public List<BitmessageAddress> getIdentities() { return identities; } WifImporter(BitmessageContext ctx, File file);  WifImporter(BitmessageContext ctx, String data);  WifImporter(BitmessageContext ctx, InputStream in, Pubkey.Feature... features); List<BitmessageAddress> getIdentities(); WifImporter importAll(); WifImporter importAll(Collection<BitmessageAddress> identities); WifImporter importIdentity(BitmessageAddress identity);  }
@Test public void testImportSingleIdentity() throws Exception { importer = new WifImporter(ctx, "[BM-2cWJ4UFRTCehWuWNsW8fJkAYMxU4S8jxci]\n" + "label = Nuked Address\n" + "enabled = true\n" + "decoy = false\n" + "noncetrialsperbyte = 320\n" + "payloadlengthextrabytes = 14000\n" + "privsigningkey = 5JU5t2JA58sP5aJwKAcrYg5EpBA9bJPrBSaFfaZ7ogmwTMDCfHL\n" + "privencryptionkey = 5Kkx5MwjQcM4kyduKvCEPM6nVNynMdRcg88VQ5iVDWUekMz1igH"); assertEquals(1, importer.getIdentities().size()); BitmessageAddress identity = importer.getIdentities().get(0); assertEquals("BM-2cWJ4UFRTCehWuWNsW8fJkAYMxU4S8jxci", identity.getAddress()); assertEquals("Nuked Address", identity.getAlias()); assertEquals(320, identity.getPubkey().getNonceTrialsPerByte()); assertEquals(14000, identity.getPubkey().getExtraBytes()); assertNotNull("Private key", identity.getPrivateKey()); assertEquals(32, identity.getPrivateKey().getPrivateEncryptionKey().length); assertEquals(32, identity.getPrivateKey().getPrivateSigningKey().length); assertFalse(identity.isChan()); }
@Test public void testGetIdentities() throws Exception { List<BitmessageAddress> identities = importer.getIdentities(); assertEquals(81, identities.size()); }
@Test public void ensureChanIsImported() throws Exception { importer = new WifImporter(ctx, "[BM-2cW67GEKkHGonXKZLCzouLLxnLym3azS8r]\n" + "label = [chan] general\n" + "enabled = true\n" + "decoy = false\n" + "chan = true\n" + "noncetrialsperbyte = 1000\n" + "payloadlengthextrabytes = 1000\n" + "privsigningkey = 5Jnbdwc4u4DG9ipJxYLznXSvemkRFueQJNHujAQamtDDoX3N1eQ\n" + "privencryptionkey = 5JrDcFtQDv5ydcHRW6dfGUEvThoxCCLNEUaxQfy8LXXgTJzVAcq\n"); assertEquals(1, importer.getIdentities().size()); BitmessageAddress chan = importer.getIdentities().get(0); assertTrue(chan.isChan()); }