|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectVoteProcessor
This is the most important class. This class processes the votes and uses other
classes to do this. It sets status codes and if an error occurs the status
code is sent to Errorhander class that will handle the error.
Please refer to the doProcessing method to see how the program works.
doProcessing(),
Errorhandler.pushError(int)| Field Summary | |
private boolean |
calculatevotes
indicates whether the main- and sub vote process has to be processed |
private RSAToString |
crypter
generate a RSAToString as a null object (used for decryption of votes) |
private RSAToString |
crypterhashserver
generate a RSAToString as a null object (used for server signature checking of votes) |
private RSAToString |
crypterhashverifier
generate a RSAToString as a null object (used for verifier signature checking of votes) |
private Errorhandler |
error
generate an error handler as a null object. |
private GUI |
gui
generate a GUI class for graphical user interface as a null object. |
private boolean |
hasverifier
indicates whether a signature check with a verifier key is needed or not if true a verifier key is set and a verifier key checking is needed |
private boolean |
invalidallchosen
indicates whether an invalid all option was choosen (true) or not (false) |
private boolean |
invalidmainchosen
indicates whether an invalid main option was choosen (true) or not (false) |
private KeyReader |
key
generate a KeyReader as null object |
private Optionprocessor |
Option
generate an Optionprocessor for creating and handling options. |
private Output |
out
generate an Output class for writing votes into a csv file without signature strings |
private boolean |
outfile
indicates status of writting an output file without signature string if true a file is written |
private boolean |
outfilesign
indicates status of writing an output file with signature string if true a file is written |
private Output |
outsign
generate an Output class for writing votes into a csv file with signature strings |
private int |
signaturestatus
intialize signature status, every vote gets its own status (see 'see also') |
private int |
status
status codes of program (used for error handling) |
private VoteReader |
vote
generate a VoteReader as null object |
int |
votecounts
shows the number of votes that are processed |
| Constructor Summary | |
VoteProcessor(GUI gui)
This constructor is used by the GUI class constructor so that the current GUI is 'connected' to VoteProcessor. |
|
| Method Summary | |
boolean |
checkKeyFile()
This method checks if key file is ok, if not an errorstatus is sent to Errorhandler. |
boolean |
CheckOptionfile()
This method checks if option file is ok and starts parsing, if not an errorstatus is send to Errorhandler. |
private boolean |
checkPanager(java.lang.String id,
Option[] mainoption,
Option[] suboption,
Vote[] vote)
check if subvote meets panager requirements. |
private boolean |
checkSign(java.lang.String vtrvote,
java.lang.String[] sign)
This method checks the signature with help of the String.equals() method. |
boolean |
CheckVoteFile()
This method checks if vote file is ok and starts parsing, if not an errorstatus is send to Errorhandler. |
void |
doCalculation(boolean b)
this method sets boolean status whether the program calculate votes or not |
private int |
doCheckSigning(java.lang.String vote,
java.lang.String token)
This method calculates the signature status of one vote. |
private java.lang.String |
doDecryption(java.lang.String s)
This method is used to decrypt a given String. |
void |
doProcessing()
This is the main processing method. |
private void |
doTransferInternToExternVoteCounter(Option[] intern,
Option[] extern)
This method transfers intern to extern Option array (=vote counter). |
int |
getContestIdentifier(java.lang.String vote)
This method captures the ContestIdentifier from a given vote string . |
Errorhandler |
getErrorhandler()
Getter class for error object |
KeyReader |
getKeyReader()
Getter method for KeyReader class |
private Vote[] |
getMainVotes(java.lang.String vote)
This method captures from one decrypted vote String the id and values of the voted main options. |
Optionprocessor |
getOptions()
Getter class for options |
private java.lang.String[] |
getServerSign(java.lang.String token)
This method retrieves "VTokenRequest" and "VTokenResponseServer" string from a token. |
int |
getSignatureStatus()
Getter method for signaturestatus of one(!!!) |
int |
getStatus()
Getter method for status code of program (error codes) |
private Vote[] |
getSubVotes(java.lang.String vote)
This method captures from one decrypted vote String the id and values of the voted sub options. |
private java.lang.String[] |
getVerifierSign(java.lang.String token)
This method retrieves "VTokenRequest" and "VFTokenResponse" string from a vote token. |
java.lang.String |
getVFTokenResponse(java.lang.String token)
This method captures the "VFTokenResponse" content from a token String. |
VoteReader |
getVoteReader()
Getter class for votes |
java.lang.String |
getVTokenRequest(java.lang.String token)
This method captures the "VTokenRequest" content from a token String . |
java.lang.String |
getVTokenResponseServer(java.lang.String token)
This method captures the "VTokenResponseServer" content from a token String. |
java.lang.String |
getVtrFromVote(java.lang.String vote)
This method captures the "VTR" content from a vote String. |
private Option[] |
makeLocalVoteCounter(Option[] global)
This method makes the local option counter = local Option[] array. |
void |
makeOutfile(boolean b)
indicates whether an Outfile is written or not |
void |
makeSignOutfile(boolean b)
indicates whether an Outfile with signature status is written or not |
void |
resetAllOutputfileerrors()
this method resets all error coming from Outputfiles |
void |
setKeys(java.lang.String s)
This method sets a new KeyReader class for reading keys |
void |
setOptions(java.lang.String s)
This method sets a new Optionprocessor class |
void |
setSignatureStatus(int n)
This method is used to set the signature status of one(!!!) |
void |
setStatus(int status)
set status codes of program - if an error the corresponding status code will be handled in the Errorhandler Class. |
void |
setVerifier(boolean b)
method checks if a verifier for signature checking is needed |
void |
setVotes(java.lang.String s)
This method sets a new VoteReader for parsing votes |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Errorhandler error
Errorhandler,
Go to Codeprivate GUI gui
GUI,
Go to Codeprivate Optionprocessor Option
Optionprocessor,
Go to Codeprivate KeyReader key
private VoteReader vote
private RSAToString crypterhashserver
private RSAToString crypterhashverifier
private RSAToString crypter
private Output out
private Output outsign
private int status
private int signaturestatus
doCheckSigning(String,String),
Go to Codepublic int votecounts
private boolean calculatevotes
doCalculation(boolean),
Go to Codeprivate boolean outfile
private boolean outfilesign
private boolean hasverifier
private boolean invalidmainchosen
private boolean invalidallchosen
| Constructor Detail |
public VoteProcessor(GUI gui)
EPC Main_process 13:
This constructor sets also the Errorhandler with the current GUI so that
Errorhandler can interact with GUI (-> error dialogs).
Also all needed error counters will be created with the init of a new
Errorhandler
GUI,
Errorhandler,
Go to Code| Method Detail |
public void doProcessing()
Errorhandler.pushError(int) method. The Errorhandler class sets the errors so that in this method the errors will be checked
(Errorhandler.getBreakMainLoop(); Errorhandler.getMainVoteError();Errorhandler.getSubVoteError()) and if set the
matching loops are broken.EPC Main_process 15:First temp storage variable for votestring,
vtoken and sub/main options in the doProcessing() method are created. Then the votecounts variable is set
to 0 which should secure that votes are from beginning processed. - Note at this stage a votestring (captured with
VoteReader.setVoteStream() method contains the VToken and the encrypted Vote String.
After that all errors and values (possibly from former runs) are reseted with help of Optionprocessor.resetMainoptionValues(),
Optionprocessor.resetSuboptionValues(), Errorhandler#resetErrorFromDoProcessing(), Errorhandler.resetCounters(),
resetAllOutputfileerrors() and the both invalid indicators (boolean invalidallchosen and invalidmainchosen)
are set to false.
The GUI.jProgressBar1 which is the graphical indicator of process progress will be set with min (=0) and max value with
the javax#swing#JProgressBar#setMinimum(int) and javax#swing#JProgressBar#setMaximum(int)
(=max. amount of votes, getting from VoteReader.getNumberOfVotes() method)
Thereafter if outfiles are set (boolean outfile, outfilesign) - see EPC Main_process 2 - the corresponding header
are written into preselected files with the Output.writeStartLine(String, int, int , boolean) method.
If an error occurs (I/O Exceptions) errors are sent to Errorhandler via the Errorhandler.pushError(int)
Go to Code
EPC Main_process 16:
First mainloop captures one vote and increases the control variable (votecounts) that symbolizes one vote at the end of
current loop by one until the max is reached via the method. Also the GUI.jProgressBar1
is updated via the javax#swing#JProgressBar#setValue() with current value of the votecounts variable and the
ProgressBars graphical component (GUI appearence) is updated via the javax#swing#JProgressBar#paint() method.
So at the begin of every loop a check will be done if loop has to be broken (via the Errorhandler.getBreakMainLoop()). Also all
errors coming from last inning of loop are reseted with Errorhandler.resetErrorsFromDoProcessing() and invalidallchosen
and invalidmainchosen. Finally it will be found out if main and sub options have to be processed or if none are read with the
Errorhandler.getNoSubOptionStatus() and Errorhandler.getNoMainOptionStatus(). Please note, it is absolutely necessary that
main options are set, if not, program can't calculate votes. CheckOptionfile()
Go to Code
EPC Main_process 17:Thereafter the decryption of one votestring will be done and
temporary saved as a string with the doDecryption(String) that captures one Vote with the VoteReader.getAVote(int) method.
Also the Vtoken String is set with the VoteReader.getAVToken(int) method (token string contains tags for signature checking).
Go to Code
EPC Main_process 18:After decryption the next step is to capture voted main options
from the votestring. This is done via the getMainVotes(java.lang.String) method. The voted options are saved in a Vote[] array
for later processing.
Go to Code
EPC Main_process 19:If voted main options are extracted it will be checked if main options
from option file are loaded. If not, and main options are voted, an error is sent to Errorhandler via the Errorhandler.pushError(int)
method. Please note as a consequence of this, program aborts.
Go to Code
EPC Main_process 20:After main vote extraction voted sub options from the votestring will
be captured. This is done via the getSubVotes(java.lang.String) method. The voted options are saved in a Vote[] array for later
processing.
Go to Code
EPC Main_process 21:If voted sub options are extracted it will be checked if sub options
from option file are loaded. If not and sub options are voted, an error is sent to Errorhandler via the Errorhandler.pushError(int)
method. Please note as a consequence of this, program aborts.
Go to Code
EPC Main_process 22:After vote array setting it will be checked if loop can continue or
if serious errors are set so that loop must break. If not, process continues to see if export for csv file without signature status
has put an Output.error. This will be checked with the Errorhandler.getOutfileError() and if an error is found
the outfile is set false. This is important because if an outfile is set loop must continue even if a signature error is set to
secure making a csv file, see which vote has an signature error and set program status adequate.
Go to Code
EPC Main_process 23:The chain continues to see if exported file with signature
status has put an Output.error. This will be checked with the Errorhandler.getOutfileErrorSign() and if an error is found
the outfilesign is set false. This is important because if an outfile is set loop must continue even if a signature error is set to
secure making a csv file, see which vote has an signature error and set program status adequate.
Go to Code
EPC Main_process 24:Then the signatures are checked via the doCheckSigning(String, String)
method. First String is the token from vote string and the second from Vtoken String.
Go to Code
EPC Main_process 25:After determination of signature status the code is set with the
setSignatureStatus(int).
Go to Code
EPC Main_process 26:If signature status getSignatureStatus() != 0, that means that an
problem with the signature has occured (for status codes refer to EPC Chain) the calculated error status according to former set errors from
exporting votes the errorstatus will be reported to Errorhandler with the Errorhandler.pushError(int) method. Please note if no files
for exporting are prebooked program aborts with an error message, if outfile(s) are set program continues but does not do a calculation. Please
refer to Errorhandler and see status codes: 6.. no output is set; 61.. output is set.
Go to Code
EPC Main_process 27:When signature checking is done the ContestID, in other words the election id, will be inspected.
Therefore it is necessary to check the contest id from option file (Optionprocessor.getContestIdentifier()) with that from vote (getContestIdentifier(String)).
If both are not equal an error is pushed Errorhandler.pushError(int). Also it is important to distinguish between the situation if an outfile is set or not, because
if one is set (regardless of with/without signature) process must continue but no calculation may be shown.
Go to Code
EPC Main_process 28:After ContestID is inspected it will be checked if an export file without signature status has been
set to be exported. (see outfile)
Go to Code
EPC Main_process 29:If EPC Main_process 28 is true preselected file will be filled with voted options (2 calls one for
main and one for sub options) without signature status with Output.writefile(String,Vote[],int,String,String,String,String,boolean,int) method.
If an error occurs it will be sent to Errorhandler Errorhandler.pushError(int).
Go to Code
EPC Main_process 30:Then it must be checked if a calculation of votes is set (see GUI.voteresult(java.awt.event.ActionEvent))
or if an export of votes with signature status is set (see outfilesign)
Go to Code
EPC Main_process 31:It will be checked if an export file with signature status has been set to be exported. (see outfilesign)
Go to Code
EPC Main_process 32:If EPC Main_process 31 is true preselected file will be filled with voted options (2 calls one for
main and one for sub options) with signature status string (getVtrFromVote(String), getVTokenRequest(String), getVFTokenResponse(String),
getVTokenResponseServer(String)) with Output.writefile(String,Vote[],int,String,String,String,String,boolean,int) method. If an error occurs it
will be sent to Errorhandler Errorhandler.pushError(int).
Go to Code
EPC Main_process 33:After that it must be checked if no errors are set Errorhandler.getBreakMainLoop() and calculation of votes
is set (see GUI.voteresult(java.awt.event.ActionEvent) )
Go to Code
EPC Main_process 34:Start EPC Vote_process
Go to Code
EPC Main_process 35:At the end of one inning for mainloop is reached and control variable (votecounts) is increased by one so that
the next vote can be analysed.
Go to Code
EPC Vote_process 1.: If votes must be calculated - this depends on two factors: errors
may avoid calculations (checked with the Errorhandler.getNoMainVoteLoop()) or the GUI setting is not to calculate -
(boolean calculatevotes) the mainvoteloop will be started.
Go to Code
EPC Vote_process 2.:First a local counter for voted options of one vote are created
with the makeLocalVoteCounter(Option[]) method. This is necessary because first options of one vote are evaluated and then error checked. If no errors
found counter will be transfered to "extern" counter so that an overall result is possible. If errors are found corresponding error counters
will be increased. This will be done by the Errorhandler.pushError(int) method in Errorhandler.
Go to Code
EPC Vote_process 3.:The mainvoteloop captures one voted main option (done by 'for' loop)
Go to Code
EPC Vote_process 4.:It will be checked if this main option is also in option file with the
OptionUtilities.containsId(java.lang.String, Option[]) method, if not errors are sent to Errorhandler via the Errorhandler.pushError(int) method
Go to Code
EPC Vote_process 5.:If check form EPC Vote_process 4 fails, the corresponding errorcounter is increased.
This will be done in the Errorhandler Class, so the error is send via Errorhandler.pushError(int)
Go to Code
EPC Vote_process 6.:If EPC Vote_process 4 succeeds it will be checked if voted option is a strike out (means its value < 0)
with the Vote.getNumber() method.
Go to Code
EPC Vote_process 12.1:If voted option is a strike out, local vote counter for strike outs is increased by one with
the Option.increaseCancellationby1() method. The right option is found in the local counter array with the Option#Utilities#serachOptionId(String,Option[],int) method.
Go to Code
EPC Vote_process 7.:If voted option isn't an strike out it will be checked if voted option has an invalid status (all/main) with the
OptionUtilities.getInvalidStatusOfChosenOption(int, Option[]).
Go to Code
EPC Vote_process 12.2:If voted option has not an invalid status, it will be found in local counter array with the
OptionUtilities.serachOptionId(java.lang.String, Option[], int) method and will be increased by voted value with the Option.increaseValueby(int) method.
Go to Code
EPC Vote_process 8.:If voted option has an invalid status it will be checked if an invalid option was already chosen. This is not allowed
because election system allows only to choose one invalid status option per vote. So if one is chosen (checked with the boolean variables invalidallchosen, invalidmainchosen)
an error to Errorhandler is sent Errorhandler.pushError(int).
Go to Code
EPC Vote_process 9,10.:The correspondending boolean is set true invalidallchosen -statuscode 2, invalidmainchosen - statuscode 1
and status is pushed to Errorhandler with the Errorhandler.pushError(int) method. Note if the invalidallchosen status is set program stops processing of this vote and goes to next vote.
Go to Code
EPC Vote_process 11:The corresponding option in extern (!) counter array is increased. The right option will be found in extern counter array with
the OptionUtilities.serachOptionId(java.lang.String, Option[], int) method and will be increased by voted value with the Option.increaseValueby(int) method. (Why extern counter? - because program
can abort processing vote at this stage and so intern counter can not be transfered to extern counter). Please note if an option with invalid status is strike out all other options are counted because electors
volition is to strike out invalid status of a vote. At the end it will be checked if Errorhandler has set a mainvoteloop or even the whole mainloop break via the Errorhandler.getMainVoteError()
and Errorhandler.getBreakMainLoop() methods. (For more details refer to programstatus codes)
Go to Code
EPC Vote_process 13:Finally of the mainvoteloop checks with the vote are done:
.) check permissible votes for main options (Optionprocessor.getmaxVotes_main() must be larger than OptionUtilities.getSum(Option[])) status code: 831
.) check number of votes that may be cumulated in a main option (Optionprocessor.getmaxCumVotes_main() must be larger than OptionUtilities.searchvaluebyid(java.lang.String, Option[])) status code: 832
.) check number of main options that may be struck out (Optionprocessor.getMainCancellation() must be larger than OptionUtilities.getCancellationsSum(Option[])) status code: 833
Go to Code
EPC Vote_process 14:If one of these checks fails the corresponding status code is sent to Errorhandler with the Errorhandler.pushError(int) method
that handles further actions like increasing error counters.
Go to Code
EPC Vote_process 15:If all voted main options are processed or errors broke loop the sub voted options are processed with the subvoteloop.
Go to Code
EPC Vote_process 16:If sub votes must be calculated - this depends on two factors: errors
may be avoid calculations or no sub votes are choosen the setting is not to calculate (checked with the Errorhandler#getNoSubVoteLoop())- the
subvoteloop will be started.
Go to Code
EPC Vote_process 17:Like the mainvoteloop first a local counter for voted sub options are created with
the makeLocalVoteCounter(Option[]) method.
Go to Code
EPC Vote_process 18:The subvoteloop captures one voted main option (done by 'for' loop)
Go to Code
EPC Vote_process 19:It will be checked if voted sub option is also in option file with the OptionUtilities.containsId(java.lang.String, Option[]) method.
Go to Code
EPC Vote_process 20.:If check from EPC Vote_process 19 fails, the corresponding errorcounter is increased.
This will be done in the Errorhandler Class, so the error is send via Errorhandler.pushError(int)
Go to Code
EPC Vote_process 21:It will be checked if panager is allowed or not (Optionprocessor.getPanagerStatus().
Go to Code
EPC Vote_process 22:If panager is not allowed the voted sub options must match a voted main option. This is checked
with the checkPanager(java.lang.String, Option[], Option[], Vote[]) method.
Go to Code
EPC Vote_process 23:If check from EPC Vote_process 22 fails an error is sent to Errorhandler via the Errorhandler.pushError(int) method.
Go to Code
EPC Vote_process 24:Thereafter it will be checked if voted option is a strike out (means its value < 0) with the Vote.getNumber() method.
If so, local vote counter for strike outs is increased by one with the Option.increaseCancellationby1() method. The right option is found in local counter array with the
OptionUtilities.serachOptionId(java.lang.String, Option[], int) method. If its not a strike out the local option counter will be increased by the Option.increaseValueby(int) method.
Go to Code
EPC Vote_process 25:At the end of the subvoteloop checks like that for main options are done:
.) check permissible votes for sub options (Optionprocessor.getmaxVotes_sub() must be larger than OptionUtilities.getSum(Option[])) status code: 741
.) check number of votes that may be cumulated in a sub option (Optionprocessor.getmaxCumVotes_sub() must be larger than OptionUtilities.searchvaluebyid(java.lang.String, Option[])) status code: 742
.) check number of sub options that may be struck out (Optionprocessor.getSubCancellation() must be larger than OptionUtilities.getCancellationsSum(Option[])) status code: 743
Go to Code
EPC Vote_process 26:If one of the checks from EPC Vote_process 25 fails the corresponding status code is sent to Errorhandler with the
Errorhandler.pushError(int) method and handles further actions like increasing error counters or setting loop breaks.
Go to Code
EPC Vote_process 27:If all voted sub options are processed or errors broke loop the process continues to EPC Vote_process 28.
Go to Code
EPC Vote_process 28:If subvoteloop are done it will be checked if errors from processing of the sub options are set (Errorhandler.getSubVoteError()
or if no sub options from option file are set (Errorhandler.getNoSubOptionStatus() and Errorhandler.getNoSubvoteLoop().
Go to Code
EPC Vote_process 29:If none from EPC Vote_process 28 are set the intern counter for sub options is transferd to extern counter for sub options with the
doTransferInternToExternVoteCounter(Option[], Option[]) method.
Go to Code
EPC Vote_process 30:If checks for sub votes are done it will be checked if errors from processing of the main options are set (Errorhandler.getMainVoteError()
and Errorhandler.getNoMainVoteLoop()).
Go to Code
EPC Vote_process 31:If none errors from EPC Vote_process 30 are set the intern counter for main options is transfered to extern counter for main options with the
doTransferInternToExternVoteCounter(Option[], Option[]) method.
At this stage the EPC Vote_process ends and goes back to EPC Main_process.
Go to Code
public void doCalculation(boolean b)
b - boolean if true votes are calculated, else notcalculatevotes,
Errorhandler.setShowTable(boolean),
Go to Codepublic void resetAllOutputfileerrors()
Output.resetError(),
Errorhandler#OutputfileError(),
Go to Codepublic void makeOutfile(boolean b)
b - if ture an outfile is written, else notoutfile,
Go to Codepublic void makeSignOutfile(boolean b)
b - if ture an outfile is written, else notoutfilesign,
Go to Codepublic void setVerifier(boolean b)
b - if true a verifier is neededpublic void setStatus(int status)
status - int code of the programstatus,
Errorhandler,
Go to Codepublic void setOptions(java.lang.String s)
s - String with the link to option fileOptionprocessor,
Go to Codepublic void setVotes(java.lang.String s)
s - String with the link to votes fileVoteReader,
Go to Codepublic void setKeys(java.lang.String s)
s - String with the link to fileKeyReader,
Go to Codepublic int getStatus()
status,
Go to Codepublic KeyReader getKeyReader()
key,
KeyReader,
Go to Codepublic VoteReader getVoteReader()
vote,
VoteReader,
Go to Codepublic Optionprocessor getOptions()
Option,
Optionprocessor,
Go to Codepublic Errorhandler getErrorhandler()
error,
Errorhandler,
Go to Codepublic boolean CheckOptionfile()
Optionprocessor.setMainOptions(),
Optionprocessor.getNoMainOptionsError(),
Optionprocessor.setSubOptions(),
Optionprocessor.getNoSubOptionsError(),
Optionprocessor.setparam(),
Optionprocessor.getParamError(),
Optionprocessor.getVerifierStatus(),
Errorhandler.pushError(int),
Go to Codepublic boolean CheckVoteFile()
VoteReader.isReadOk(),
VoteReader.setVoteStream(),
VoteReader.getNoVoteError(),
Errorhandler.pushError(int),
Go to Codepublic boolean checkKeyFile()
KeyReader.isReadOk(),
KeyReader.setEncryptionKey(),
KeyReader.getEncryptionKeyErrorStatus(),
KeyReader.setServerKey(),
KeyReader.getServerKeyErrorStatus(),
KeyReader.setVerifierKey(),
KeyReader.getVerifierErrorStatus(),
hasverifier,
Errorhandler.pushError(int),
Go to Code
private boolean checkPanager(java.lang.String id,
Option[] mainoption,
Option[] suboption,
Vote[] vote)
id - String with the voted sub option idmainoption - Option[] array to be checked if it contains a matching foreign keysuboption - Option[] array with sub optionsvote - Vote[] array for checking the vote
OptionUtilities.serachOptionId(String, Option[], int),
OptionUtilities.containsVoteIdAndGiveValueBack(String,Vote[]),
Option.foreign_key,
Go to Codeprivate Option[] makeLocalVoteCounter(Option[] global)
global - Option[] with the global Option array to be copied
Option,
Go to Code
private void doTransferInternToExternVoteCounter(Option[] intern,
Option[] extern)
intern - Option[] the lokal Option counterextern - Option[] the extern Option counterOption.setValueKum(String),
Option.setValueVote(String),
Option.setCancellation(String),
Go to Codeprivate Vote[] getMainVotes(java.lang.String vote)
vote - a vote String
XmlParser,
XmlParser.getNumOfElements(),
XmlParser.getString(int),
Vote.setId(String),
Vote.setNumber(String),
Go to Codeprivate Vote[] getSubVotes(java.lang.String vote)
vote - a vote String
XmlParser,
XmlParser.getNumOfElements(),
XmlParser.getString(int),
Vote.setId(String),
Vote.setNumber(String),
Go to Codeprivate java.lang.String doDecryption(java.lang.String s)
s - the String to be decrypted
RSAToString.doDecryption(String),
KeyReader.getEncodeRSA(),
XmlParser,
XmlParser.getNumOfElements(),
StringBuffer,
Errorhandler.pushError(int),
Go to Codepublic int getContestIdentifier(java.lang.String vote)
vote - String which should contain the id tag
XmlParser,
Integer.valueOf(String),
Integer.intValue(),
Go to Codepublic int getSignatureStatus()
public void setSignatureStatus(int n)
n - int with the signature status numbersignaturestatus,
doCheckSigning(String,String),
Go to Codepublic java.lang.String getVtrFromVote(java.lang.String vote)
vote - String
#XmlParser,
checkSign(String, String[]),
Go to Codepublic java.lang.String getVTokenRequest(java.lang.String token)
token - String
#XmlParser,
Go to Codepublic java.lang.String getVTokenResponseServer(java.lang.String token)
token - String
#XmlParser,
Go to Codepublic java.lang.String getVFTokenResponse(java.lang.String token)
token - String
#XmlParser,
Go to Codeprivate java.lang.String[] getServerSign(java.lang.String token)
getVtrFromVote(String). For more details to
signature checking please refer to doCheckSigning(String,String).
token - String of a vote
XmlParser,
XmlParser.getNumOfElements(),
getVtrFromVote(String),
doCheckSigning(String,String),
RSAToString.doVerify(String),
Errorhandler.pushError(int),
Go to Codeprivate java.lang.String[] getVerifierSign(java.lang.String token)
getVtrFromVote(String).
For more details to signature checking please refer to doCheckSigning(String,String).
Please note the second element VTokenResponseServer is handled in getServerSign()method
token - String of a vote
XmlParser,
XmlParser.getNumOfElements(),
getVtrFromVote(String),
doCheckSigning(String,String),
RSAToString.doVerify(String),
Errorhandler.pushError(int),
Go to Code
private boolean checkSign(java.lang.String vtrvote,
java.lang.String[] sign)
vtrvote - String with vtr tag element from vote Stringsign - String[0] VTokenRequest content, String[1] VTokenResponse/Server content
String.equals(Object),
Go to Code
private int doCheckSigning(java.lang.String vote,
java.lang.String token)
hasverifier. If
so there will be two booleans created with signature checks of server and verifier,
else only one boolean with server signature checking will be created.
vote - String with vote of one persontoken - String with token of one person
hasverifier,
getVtrFromVote(String),
getVerifierSign(String),
getServerSign(String),
checkSign(String, String[]),
Go to Code
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||