35 |
|
|
36 |
public class SetPointer { |
public class SetPointer { |
37 |
|
|
38 |
/** Usage is SetPointer keyfile [pool [pointer] target]. |
public static KeyPair readKeyPair(File keyFile) throws Exception { |
|
* If no pointer is given, a new one is generated. |
|
|
* If the key file doesn't exist, it's created. |
|
|
*/ |
|
|
public static void main(String[] argv) throws Exception { |
|
|
System.out.println("Please wait, may need to initialize random number generator..."); |
|
|
|
|
|
File keyFile = new File(argv[0]); |
|
39 |
KeyPair keys; |
KeyPair keys; |
40 |
|
|
41 |
if(keyFile.exists()) { |
if(keyFile.exists()) { |
52 |
out.close(); |
out.close(); |
53 |
} |
} |
54 |
|
|
55 |
|
return keys; |
56 |
|
} |
57 |
|
|
58 |
|
/** Usage is SetPointer keyfile [pool [pointer] target]. |
59 |
|
* If no pointer is given, a new one is generated. |
60 |
|
* If the key file doesn't exist, it's created. |
61 |
|
*/ |
62 |
|
public static void main(String[] argv) throws Exception { |
63 |
|
System.out.println("Please wait, may need to initialize random number generator..."); |
64 |
|
|
65 |
|
File keyFile = new File(argv[0]); |
66 |
|
KeyPair keys = readKeyPair(keyFile); |
67 |
|
|
68 |
if(argv.length == 1) { |
if(argv.length == 1) { |
69 |
PointerId pointer = new PointerId(keys.getPublic()); |
PointerId pointer = new PointerId(keys.getPublic()); |
70 |
System.out.println("Pointer created:"); |
System.out.println("Pointer created:"); |