Package com.bitsofproof.supernode.common

Examples of com.bitsofproof.supernode.common.ExtendedKey.serialize()


      JSONObject test = testData.getJSONObject (i);
      byte[] seed = ByteUtils.fromHex (test.getString ("seed"));
      Date birth = dateFormat.parse (test.getString ("birth"));
      ExtendedKey key = ExtendedKey.create (seed);
      assertTrue (key.getMaster ().getAddress ().toString ().equals (test.getString ("address")));
      assertTrue (key.serialize (true).equals (test.getString ("private")));
      assertTrue (key.getReadOnly ().serialize (true).equals (test.getString ("public")));
      assertTrue (EncryptedHDRoot.encode (seed, birth).equals (test.getString ("clear")));
      assertTrue (EncryptedHDRoot.encrypt (seed, birth, test.getString ("password"), ScryptDifficulty.LOW).equals (test.getString ("encryptedLow")));
      // Travis can not run these as they need lots of memory. Uncomment if curious
      // assertTrue (EncryptedHDRoot.encrypt (seed, birth, test.getString ("password"), ScryptDifficulty.MEDIUM).equals (test.getString
View Full Code Here


      assertTrue (EncryptedHDRoot.encrypt (seed, birth, test.getString ("password"), ScryptDifficulty.LOW).equals (test.getString ("encryptedLow")));
      // Travis can not run these as they need lots of memory. Uncomment if curious
      // assertTrue (EncryptedHDRoot.encrypt (seed, birth, test.getString ("password"), ScryptDifficulty.MEDIUM).equals (test.getString
      // ("encryptedMedium")));
      // assertTrue (EncryptedHDRoot.encrypt (seed, birth, test.getString ("password"), ScryptDifficulty.HIGH).equals (test.getString ("encryptedHigh")));
      assertTrue (EncryptedHDRoot.decode (test.getString ("clear")).serialize (true).equals (key.serialize (true)));
      assertTrue (EncryptedHDRoot.decrypt (test.getString ("encryptedLow"), test.getString ("password")).serialize (true).equals (key.serialize
          (true)));
      // Travis can not run these as they need lots of memory. Uncomment if curious
      // assertTrue (EncryptedHDRoot.decrypt (test.getString ("encryptedMedium"), test.getString ("password")).serialize (true)
      // .equals (key.serialize (true)));
View Full Code Here

      // Travis can not run these as they need lots of memory. Uncomment if curious
      // assertTrue (EncryptedHDRoot.encrypt (seed, birth, test.getString ("password"), ScryptDifficulty.MEDIUM).equals (test.getString
      // ("encryptedMedium")));
      // assertTrue (EncryptedHDRoot.encrypt (seed, birth, test.getString ("password"), ScryptDifficulty.HIGH).equals (test.getString ("encryptedHigh")));
      assertTrue (EncryptedHDRoot.decode (test.getString ("clear")).serialize (true).equals (key.serialize (true)));
      assertTrue (EncryptedHDRoot.decrypt (test.getString ("encryptedLow"), test.getString ("password")).serialize (true).equals (key.serialize
          (true)));
      // Travis can not run these as they need lots of memory. Uncomment if curious
      // assertTrue (EncryptedHDRoot.decrypt (test.getString ("encryptedMedium"), test.getString ("password")).serialize (true)
      // .equals (key.serialize (true)));
      // assertTrue (EncryptedHDRoot.decrypt (test.getString ("encryptedHigh"), test.getString ("password")).serialize (true)
View Full Code Here

    {
      JSONObject test = tests.getJSONObject (i);
      ExtendedKey ekprivate = ExtendedKey.create (ByteUtils.fromHex (test.getString ("seed")));
      ExtendedKey ekpublic = ekprivate.getReadOnly ();
      assertTrue (ekprivate.serialize (true).equals (test.get ("private")));
      assertTrue (ekpublic.serialize (true).equals (test.get ("public")));
      JSONArray derived = test.getJSONArray ("derived");
      for ( int j = 0; j < derived.length (); ++j )
      {
        JSONObject derivedTest = derived.getJSONObject (j);
        JSONArray locator = derivedTest.getJSONArray ("locator");
View Full Code Here

            ek = ek.getChild (c.getInt ("sequence") | 0x80000000);
          }
          ep = ek.getReadOnly ();
        }
        assertTrue (ek.serialize (true).equals (derivedTest.getString ("private")));
        assertTrue (ep.serialize (true).equals (derivedTest.getString ("public")));
      }
    }
  }

  @Test
View Full Code Here

    JSONArray tests = readObjectArray ("PassphraseKey.json");
    for ( int i = 0; i < tests.length (); ++i )
    {
      JSONObject test = tests.getJSONObject (i);
      ExtendedKey key = ExtendedKey.createFromPassphrase (test.getString ("passphrase"), ByteUtils.fromHex (test.getString ("seed")));
      assertTrue (key.serialize (true).equals (test.get ("key")));
    }
  }

  @Test
  public void testECDSASpeed () throws ValidationException
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.