infoservice.agreement.multicast.messages
Class CommitmentMessage

java.lang.Object
  extended by infoservice.agreement.multicast.messages.CommitmentMessage

public class CommitmentMessage
extends java.lang.Object

Author:
agamemnon

Field Summary
private  java.lang.String m_proposal
          This variable contains the message itself e.g.
private  java.lang.String m_randomOne
          A random number as String.
private  java.lang.String m_randomTwo
          A second random number as String.
private  char m_separatorCharacter
          This character will be used for string concatenation.
 
Constructor Summary
CommitmentMessage()
          Construct a CommitmentMessage.
CommitmentMessage(java.lang.String a_stringconcat)
          Construct a CommitmentMessage.
 
Method Summary
private  java.lang.String concat(java.util.Vector a_strArray)
           
private  java.util.Vector deconcat(java.lang.String a_string)
           
private static java.util.Vector deconcatenate(java.lang.String a_string)
           
static java.lang.String extractHashFromHashAndRandomOneConcatenation(java.lang.String a_concat)
          Extracts the hash value from given random number and hash value concatenation.
static java.lang.String extractRandomOneFromHashAndRandomOneConcatenation(java.lang.String a_concat)
          Extracts the first random number from given random number and hash value concatenation.
 java.lang.String getConcatenation()
          Creates a string concatenation using all existing variables seperated by m_separatorCharacter.
 java.lang.String getHashCode()
          Creates a unique hash code.
 java.lang.String getHashValueAndRandomOne()
          Creates a string concatenation using the hash code an the first random number seperated by m_separatorCharacter.
 java.lang.String getProposal()
          Get the message itself e.g.
 java.lang.String getRandomOne()
          Gets the first random value according to Bruce Schneiers commitment scheme.
 java.lang.String getRandomTwo()
          Gets the second random value according to Bruce Schneiers commitment scheme.
 char getSeparator()
          Gets the character used as seperator for string concatenation.
 java.lang.String toString()
          Creates a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_randomOne

private java.lang.String m_randomOne
A random number as String.


m_randomTwo

private java.lang.String m_randomTwo
A second random number as String.


m_proposal

private java.lang.String m_proposal
This variable contains the message itself e.g. "Hello"


m_separatorCharacter

private char m_separatorCharacter
This character will be used for string concatenation.

Constructor Detail

CommitmentMessage

public CommitmentMessage()
Construct a CommitmentMessage. All necessary values will be created automaticly.


CommitmentMessage

public CommitmentMessage(java.lang.String a_stringconcat)
                  throws javax.naming.directory.InvalidAttributesException
Construct a CommitmentMessage. All values are given as a concatenated string representation and will be parsed out.

Parameters:
a_stringconcat -
Throws:
javax.naming.directory.InvalidAttributesException
Method Detail

extractHashFromHashAndRandomOneConcatenation

public static java.lang.String extractHashFromHashAndRandomOneConcatenation(java.lang.String a_concat)
                                                                     throws javax.naming.directory.InvalidAttributesException
Extracts the hash value from given random number and hash value concatenation.

Parameters:
a_concat - Random number and hash value concatenation
Returns:
The hash value.
Throws:
javax.naming.directory.InvalidAttributesException

extractRandomOneFromHashAndRandomOneConcatenation

public static java.lang.String extractRandomOneFromHashAndRandomOneConcatenation(java.lang.String a_concat)
                                                                          throws javax.naming.directory.InvalidAttributesException
Extracts the first random number from given random number and hash value concatenation.

Parameters:
a_concat - Random number and hash value concatenation
Returns:
Random number one.
Throws:
javax.naming.directory.InvalidAttributesException

deconcatenate

private static java.util.Vector deconcatenate(java.lang.String a_string)
Parameters:
a_string - The string to deconcatenate.
Returns:
The result vector with substrings.

getConcatenation

public java.lang.String getConcatenation()
Creates a string concatenation using all existing variables seperated by m_separatorCharacter.

Returns:
The string concatenation.

getHashCode

public java.lang.String getHashCode()
Creates a unique hash code.

Returns:
The hash code.

getHashValueAndRandomOne

public java.lang.String getHashValueAndRandomOne()
Creates a string concatenation using the hash code an the first random number seperated by m_separatorCharacter.

Returns:
The string concatenation.

getProposal

public java.lang.String getProposal()
Get the message itself e.g. "Hello".

Returns:
The message.

getRandomOne

public java.lang.String getRandomOne()
Gets the first random value according to Bruce Schneiers commitment scheme.

Returns:
The first random value.

getRandomTwo

public java.lang.String getRandomTwo()
Gets the second random value according to Bruce Schneiers commitment scheme.

Returns:
THe second random value.

getSeparator

public char getSeparator()
Gets the character used as seperator for string concatenation.

Returns:
The seperator.

toString

public java.lang.String toString()
Creates a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string representation.

concat

private java.lang.String concat(java.util.Vector a_strArray)
Parameters:
a_strArray - Vector with strings.
Returns:
The concatenation.

deconcat

private java.util.Vector deconcat(java.lang.String a_string)
Parameters:
a_string - The string to deconcatenate.
Returns:
The result vector with substrings.