Examples of parseSerializedKey()


Examples of com.bitsofproof.supernode.wallet.KeyFormatter.parseSerializedKey()

      String passphrase = p.toString ();

      KeyFormatter formatter = new KeyFormatter (passphrase, Network.PRODUCTION);
      ECKeyPair kp = ECKeyPair.createNew (i % 2 == 0);
      String serialized = formatter.serializeKey (kp);
      ECKeyPair kp2 = formatter.parseSerializedKey (serialized);
      assertTrue (Arrays.equals (kp.getPublic (), kp2.getPublic ()));
      assertTrue (Arrays.equals (kp.getPrivate (), kp2.getPrivate ()));
    }
  }
}
View Full Code Here

Examples of com.bitsofproof.supernode.wallet.KeyFormatter.parseSerializedKey()

    KeyFormatter formatter = new KeyFormatter (null, Network.PRODUCTION);
    JSONArray testData = readObjectArray (WIF);
    for ( int i = 0; i < testData.length (); ++i )
    {
      JSONArray test = testData.getJSONArray (i);
      ECKeyPair kp = formatter.parseSerializedKey (test.getString (1));
      String address = Address.toSatoshiStyle (Hash.keyHash (kp.getPublic ()), 0x0);
      assertTrue (test.getString (0).equals (address));
      String serialized = formatter.serializeKey (kp);
      assertTrue (test.getString (1).equals (serialized));
    }
View Full Code Here

Examples of com.bitsofproof.supernode.wallet.KeyFormatter.parseSerializedKey()

    {
      final JSONArray test = testData.getJSONArray (i);

      KeyFormatter formatter = new KeyFormatter (test.getString (2), Network.PRODUCTION);

      ECKeyPair kp = formatter.parseSerializedKey (test.getString (0));
      String decrypted = ECKeyPair.serializeWIF (kp);
      assertTrue (test.getString (1).equals (decrypted));
      ECKeyPair kp2 = formatter.parseSerializedKey (decrypted);
      assertTrue (formatter.serializeKey (kp2).equals (test.getString (0)));
    }
View Full Code Here

Examples of com.bitsofproof.supernode.wallet.KeyFormatter.parseSerializedKey()

      KeyFormatter formatter = new KeyFormatter (test.getString (2), Network.PRODUCTION);

      ECKeyPair kp = formatter.parseSerializedKey (test.getString (0));
      String decrypted = ECKeyPair.serializeWIF (kp);
      assertTrue (test.getString (1).equals (decrypted));
      ECKeyPair kp2 = formatter.parseSerializedKey (decrypted);
      assertTrue (formatter.serializeKey (kp2).equals (test.getString (0)));
    }
  }

  @Test
View Full Code Here

Examples of com.bitsofproof.supernode.wallet.KeyFormatter.parseSerializedKey()

    for ( int i = 0; i < testData.length (); ++i )
    {
      final JSONArray test = testData.getJSONArray (i);

      KeyFormatter formatter = new KeyFormatter (test.getString (2), Network.PRODUCTION);
      ECKeyPair kp = formatter.parseSerializedKey (test.getString (0));
      String decrypted = ECKeyPair.serializeWIF (kp);
      assertTrue (test.getString (1).equals (decrypted));
    }
  }
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.