|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectme.edwards.des.block.Ballot
public class Ballot
Data structure to store and maintain a single cast Ballot for a single entity
(user). Ballots are created in an Election Application when a user votes.
The Ballot contains the Votes
chosen by the user in addition to
the user's unique UUID (created by the Election Authority). To prevent
changes from being made to the Ballot, its hash is signed using the ECDSA
private key generated by the Election Application. After the Ballot is
signed, the private key is destroyed and the public key is sent to the
Election Authority, marking the Ballot as cast. When the Node
receives
a Ballot, the signature is authenticated with the Ballot's hash to
ensure that the Ballot was not changed en-route to the Node.
Created on: Nov 1, 2015 at 11:30:16 PM
Field Summary | |
---|---|
private byte[] |
bytes
|
private java.lang.String |
id
|
private java.lang.String |
root
|
private java.lang.String |
signature
|
private java.lang.String |
signatureRoot
|
private byte |
version
|
static byte |
VERSION
This class' Ballot version |
private byte[] |
votes
|
Constructor Summary | |
---|---|
Ballot(byte[] binary)
Initializes Ballot from binary data as a byte array. |
|
Ballot(java.lang.String id,
java.lang.String signature,
java.util.ArrayList<Vote> votes)
Creates new Ballot from a UUID, Signatures, and list of votes. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
byte[] |
getBytes()
Returns the Ballot in binary format as a byte array. |
java.lang.String |
getID()
Returns this Ballot's (user) UUID |
java.lang.String |
getRoot()
Returns the root hash of this ballot. |
java.lang.String |
getSignature()
Returns this Ballot's signature. |
java.lang.String |
getSignatureRoot()
Returns the signature root hash of this ballot. |
java.util.ArrayList<Vote> |
getVotes()
Returns the Votes contained in this Ballot as an ArrayList. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte VERSION
private byte version
private java.lang.String id
private byte[] votes
private java.lang.String signature
private java.lang.String signatureRoot
private java.lang.String root
private byte[] bytes
Constructor Detail |
---|
public Ballot(java.lang.String id, java.lang.String signature, java.util.ArrayList<Vote> votes)
Nodes
and
Blocks
only create Ballots from
binary data
.
id
- UUID of Ballot signer (User who cast this Ballot)signature
- Signature on this ballot generated using user's private ECDSA
keyvotes
- List of Votes
on this Ballotpublic Ballot(byte[] binary)
Nodes
and Blocks
to load Ballots.
binary
- Byte array representing this BallotMethod Detail |
---|
public java.lang.String getID()
public java.lang.String getSignature()
Node
.
public java.lang.String getSignatureRoot()
Node
.
public java.lang.String getRoot()
Inventory requests
and in the Node's memory.
public byte[] getBytes()
public java.util.ArrayList<Vote> getVotes()
Votes
contained in this Ballot as an ArrayList.
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |