Last active
July 22, 2018 16:59
-
-
Save fieldAbyss/89d30e834b19d5f03fdd9372fd350004 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.nem.core.crypto.KeyPair; | |
import org.nem.core.model.Address; | |
import org.nem.core.model.NetworkInfos; | |
public class KeyGenerator { | |
public static void main(String[] args) { | |
while (true){ | |
final KeyPair someKey = new KeyPair(); | |
final Address anAddress = Address.fromPublicKey( | |
NetworkInfos.getTestNetworkInfo().getVersion(), | |
someKey.getPublicKey()); | |
if(anAddress.getEncoded().contains("TEST")){ | |
printKey(someKey, anAddress); | |
break; | |
} | |
} | |
} | |
private static void printKey(KeyPair someKey, Address anAddress){ | |
System.out.println(String.format("Private Key: %s", someKey.getPrivateKey())); | |
System.out.println(String.format(" Public Key: %s", someKey.getPublicKey())); | |
System.out.println(String.format(" Address: %s", anAddress)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment