diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-10-08 21:22:43 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-10-08 21:22:43 +0000 |
commit | 5b4933f12a3eadedf84e6adf00e1c1ac15924f6d (patch) | |
tree | 5824cf1236dbdbca515cc7d1f5f7bce1ee3eba6b /src/main/java/org/gnunet/voting/BallotTool.java | |
parent | a8c1c65a00dce604ff829dfe10568cd06c8f8bda (diff) | |
download | gnunet-java-5b4933f12a3eadedf84e6adf00e1c1ac15924f6d.tar.gz gnunet-java-5b4933f12a3eadedf84e6adf00e1c1ac15924f6d.zip |
- identity service implemented
- started with arm implementation
- removed locking from scheduler
- separated TaskConfiguration and TaskIdentifier
- implemented proper message stream tokenizer
- work on voting
Diffstat (limited to 'src/main/java/org/gnunet/voting/BallotTool.java')
-rw-r--r-- | src/main/java/org/gnunet/voting/BallotTool.java | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/main/java/org/gnunet/voting/BallotTool.java b/src/main/java/org/gnunet/voting/BallotTool.java index 619afa5..1abf8fd 100644 --- a/src/main/java/org/gnunet/voting/BallotTool.java +++ b/src/main/java/org/gnunet/voting/BallotTool.java | |||
@@ -25,26 +25,15 @@ import com.google.common.base.Charsets; | |||
25 | import com.google.common.io.ByteStreams; | 25 | import com.google.common.io.ByteStreams; |
26 | import com.google.common.io.Files; | 26 | import com.google.common.io.Files; |
27 | import com.google.common.io.OutputSupplier; | 27 | import com.google.common.io.OutputSupplier; |
28 | import org.gnunet.mesh.Mesh; | ||
29 | import org.gnunet.mesh.MeshRunabout; | ||
30 | import org.gnunet.mesh.TunnelEndHandler; | ||
31 | import org.gnunet.util.Configuration; | ||
32 | import org.gnunet.util.CryptoECC; | 28 | import org.gnunet.util.CryptoECC; |
33 | import org.gnunet.util.PeerIdentity; | ||
34 | import org.gnunet.util.Program; | 29 | import org.gnunet.util.Program; |
35 | import org.gnunet.util.getopt.Argument; | 30 | import org.gnunet.util.getopt.Argument; |
36 | import org.gnunet.util.getopt.ArgumentAction; | 31 | import org.gnunet.util.getopt.ArgumentAction; |
37 | import org.gnunet.voting.messages.BallotRegisterRequestMessage; | ||
38 | import org.gnunet.voting.messages.SubmitMessage; | ||
39 | import org.gnunet.voting.messages.SubmitResponseMessage; | ||
40 | 32 | ||
41 | import java.io.File; | 33 | import java.io.File; |
42 | import java.io.FileOutputStream; | 34 | import java.io.FileOutputStream; |
43 | import java.io.IOException; | 35 | import java.io.IOException; |
44 | import java.io.InputStream; | 36 | import java.io.InputStream; |
45 | import java.nio.charset.Charset; | ||
46 | import java.util.List; | ||
47 | import java.util.regex.Pattern; | ||
48 | 37 | ||
49 | /** | 38 | /** |
50 | * Tool for creating, manipulating and submitting ballot files. | 39 | * Tool for creating, manipulating and submitting ballot files. |
@@ -89,11 +78,11 @@ public class BallotTool { | |||
89 | String select = null; | 78 | String select = null; |
90 | 79 | ||
91 | @Argument( | 80 | @Argument( |
92 | shortname = "p", | 81 | shortname = "G", |
93 | longname = "permission", | 82 | longname = "certify-group", |
94 | action = ArgumentAction.SET, | 83 | action = ArgumentAction.SET, |
95 | description = "request permission to vote from the certificate authority") | 84 | description = "request a certificate that the voter belongs to the ballot's group") |
96 | boolean permission = false; | 85 | boolean certifyGroup = false; |
97 | 86 | ||
98 | @Argument( | 87 | @Argument( |
99 | shortname = "V", | 88 | shortname = "V", |
@@ -226,7 +215,7 @@ public class BallotTool { | |||
226 | System.err.println("key invalid"); | 215 | System.err.println("key invalid"); |
227 | return; | 216 | return; |
228 | } | 217 | } |
229 | CryptoECC.PublicKey publicKey = CryptoECC.computePublicKey(privateKey); | 218 | CryptoECC.PublicSignKey publicKey = CryptoECC.computePublicKey(privateKey); |
230 | System.out.println(publicKey.toString()); | 219 | System.out.println(publicKey.toString()); |
231 | } | 220 | } |
232 | 221 | ||
@@ -302,12 +291,12 @@ public class BallotTool { | |||
302 | c.run(); | 291 | c.run(); |
303 | return; | 292 | return; |
304 | } | 293 | } |
305 | if (permission) { | 294 | if (certifyGroup) { |
306 | if (this.unprocessedArgs.length != 2) { | 295 | if (this.unprocessedArgs.length != 2) { |
307 | System.err.println("-p/--permission requires exactly two positional arguments"); | 296 | System.err.println("-G/--certify-group requires exactly two positional arguments"); |
308 | return; | 297 | return; |
309 | } | 298 | } |
310 | PermissionCommand c = new PermissionCommand(getConfiguration(), | 299 | CertifyGroupCommand c = new CertifyGroupCommand(getConfiguration(), |
311 | unprocessedArgs[0], unprocessedArgs[1]); | 300 | unprocessedArgs[0], unprocessedArgs[1]); |
312 | c.run(); | 301 | c.run(); |
313 | return; | 302 | return; |