コード例 #1
0
 public static String generateTestAddress(final String hexPublicKey)
     throws IllegalArgumentException {
   checkStringArgument(hexPublicKey);
   AsymmetricPublicKey publicKey = new AsymmetricPublicKey(hexPublicKey);
   AsymmetricKeyCreator keyCreator = new AsymmetricKeyCreator();
   return keyCreator.createTestAddress(publicKey);
 }
コード例 #2
0
 public static String derivePublicKey(final String hexPrivateKey) throws IllegalArgumentException {
   checkStringArgument(hexPrivateKey);
   AsymmetricPrivateKey privateKey = new AsymmetricPrivateKey(new BigInteger(hexPrivateKey, 16));
   AsymmetricKeyCreator keyCreator = new AsymmetricKeyCreator();
   return keyCreator.createPublicKey(privateKey).toString();
 }
コード例 #3
0
 public static String createPrivateKey() {
   AsymmetricKeyCreator keyCreator = new AsymmetricKeyCreator();
   return keyCreator.createPrivateKey().toString();
 }