SecurePlayLibray J2SE
v2.1

com.SecurePlay
Class SPTSecretClass

java.lang.Object
  extended bycom.SecurePlay.SPRootTransactionClass
      extended bycom.SecurePlay.SPAbstractTransactionClass
          extended bycom.SecurePlay.SPTSecretClass
All Implemented Interfaces:
SPAbstractTransactionInterface

public class SPTSecretClass
extends SPAbstractTransactionClass

This class implements the Secret Transaction type - the ability for a single party, the Transaction Master, to send a single secret to other participants in a non-refutable fashion. The Secret is committed to irrevokably at the time it is initially sent in hidden form and then can be subsequently revealed.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Field Summary
private static java.lang.String mt_revealSecret
          Static message types that this transaction supports.
private  int prpadlength
          This is a private,constant property.
private  java.lang.String secret
          This is the secret that is being protected through the Secret transaction.
private  java.lang.String secretpadded
          This property holds the secret string padded with its random string to protect against dictionary attacks.
private  java.lang.String secrettransform
          This property is the irreversible transform of the secretpadded string.
protected static java.lang.String status_secretrevealed
          transaction status complete variable
protected static java.lang.String status_secretrevealedlist
          transaction status error variable
protected static java.lang.String status_secretsent
          transaction status ready variable
 
Fields inherited from class com.SecurePlay.SPAbstractTransactionClass
AGE, configuration, gameinstance, mt_completeTransaction, mt_error, privateflag, releaseversion, status_error, status_ready, transactionstatus, transtype
 
Fields inherited from class com.SecurePlay.SPRootTransactionClass
comms, EventListenerList, gameID, insend, master, playerIDList, ReSend_altmessage, ReSend_encryptflag, ReSend_messagebody, ReSend_messageID, ReSend_messagetype, ReSend_privateflag, ReSend_receivers, ReSend_sender, secureplay, transactionID
 
Constructor Summary
SPTSecretClass()
          Default Constructor
SPTSecretClass(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID, java.lang.String AGE, java.lang.String transform)
          Overloaded Constructor
 
Method Summary
 SPAbstractTransactionInterface APIcreateTransaction(SPGameInterface gameapiobj, SPMessageClass message)
          Creates a new instance of an SPSecretClass class.
 java.lang.String APIgetSecret()
          This method returns the actual secret that this transaction is protecting, if available.
 java.lang.String APIgetTransactionType()
          This method returns a String of the transactiontype.
 boolean APIrevealSecret(java.lang.String sender, java.lang.String[] recievers, boolean listonly)
          This method sends the secretpadded value to the specified remote players.
 boolean APIverifySecret()
          This method verifies the paddedsecret that was sent.
private  java.lang.String configureSecretTransaction(java.lang.String newsecret)
          This method configures the Secret Transaction
static SPAbstractTransactionInterface createSecret(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String AGE, java.lang.String newsecret)
          This method creates a SPSecretClass transaction.
 int getPrpadlength()
          Getter function that returns the property: prpadlength
 java.lang.String getSecretpadded()
          Getter function that returns the property: secretpadded
 java.lang.String getSecrettransform()
          Getter function that returns the property: secrettransform
static java.lang.String gettranstype()
          This method gets the transaction type.
 boolean onrevealSecret(SPMessageClass incoming)
          This method handles the incoming message to reveal a secret.
 boolean pronincomingTransaction(SPMessageClass incoming)
          This method provides the unique handlers for incoming Secret turn message types
static boolean registerTransaction()
          Registers this transaction.
 
Methods inherited from class com.SecurePlay.SPAbstractTransactionClass
APIcompleteTransaction, APIgetAGE, APIgetConfiguration, APIgetGameinstance, APIgetPrivacyFlag, APIgetTransactionstatus, APIisPlayerInternal, APIisTransError, APIsetTransactionID, logError, onincomingTransaction, prinit, pruniqueinit, setAGE
 
Methods inherited from class com.SecurePlay.SPRootTransactionClass
APIaddListener, APIclearListeners, APIgetGameID, APIgetGetReplayList, APIgetListenerCount, APIgetListeners, APIgetMaster, APIgetPlayerIDList, APIgetTransactionID, APIisPlayerIncluded, APIremoveListener, APIReplayRemoveOldSender, APIresendLastMessage, APIsetReplayList, APIsetSecurePlayClass, detectReplay, sendMessage, SPnotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.SecurePlay.SPAbstractTransactionInterface
APIgetGameID, APIgetMaster, APIgetPlayerIDList, APIgetTransactionID, sendMessage
 

Field Detail

prpadlength

private int prpadlength
This is a private,constant property. It is used to specify the length of the random padding to a transmitted secret. The random padding is necessary to prevent dictionary attacks against secrets. The default setting is 20. Please set appropriately to meet the specific client needs.


secret

private java.lang.String secret
This is the secret that is being protected through the Secret transaction.


secretpadded

private java.lang.String secretpadded
This property holds the secret string padded with its random string to protect against dictionary attacks. This is the string that is actually operated on by the transform and sent to remote players.


secrettransform

private java.lang.String secrettransform
This property is the irreversible transform of the secretpadded string. The secrettransform is sent first to make the secret unmodifiable.


mt_revealSecret

private static final java.lang.String mt_revealSecret
Static message types that this transaction supports.

See Also:
Constant Field Values

status_secretsent

protected static final java.lang.String status_secretsent
transaction status ready variable

See Also:
Constant Field Values

status_secretrevealed

protected static final java.lang.String status_secretrevealed
transaction status complete variable

See Also:
Constant Field Values

status_secretrevealedlist

protected static final java.lang.String status_secretrevealedlist
transaction status error variable

See Also:
Constant Field Values
Constructor Detail

SPTSecretClass

public SPTSecretClass()
Default Constructor


SPTSecretClass

public SPTSecretClass(SPGameInterface gameobj,
                      java.lang.String master,
                      java.lang.String[] playerIDList,
                      boolean privateflag,
                      java.lang.String transactionID,
                      java.lang.String AGE,
                      java.lang.String transform)
Overloaded Constructor

Parameters:
gameobj - SPGameInterface - the game object to which this transaction will be associated with
master - String - the master of this transaction
playerIDList - String[] - players who will be associated with this transaction
privateflag - boolean - private flag of this transaction
transactionID - String - the id of this transaction
transform - String - transform of secret
Method Detail

APIrevealSecret

public boolean APIrevealSecret(java.lang.String sender,
                               java.lang.String[] recievers,
                               boolean listonly)
This method sends the secretpadded value to the specified remote players.

Parameters:
sender - String - the sender of the secret
recievers - String[] - player ids of recievers
listonly - boolean - false = for all players involved in the transaction or true = for players listed in this method as recievers
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIverifySecret

public boolean APIverifySecret()
This method verifies the paddedsecret that was sent. It computes the transform of the paddedsecret that has been sent and compares it with the previously sent secrettransform. It returns a Boolean flag to indicate success or failure.

Returns:
result - Boolean: TRUE, if able to verify secret, FALSE, if not

APIgetSecret

public java.lang.String APIgetSecret()
This method returns the actual secret that this transaction is protecting, if available.

Returns:
result - String - the secret

onrevealSecret

public boolean onrevealSecret(SPMessageClass incoming)
This method handles the incoming message to reveal a secret. The message should only come from the Transaction master and should include the secretpadded as its sole content.

Parameters:
incoming - SPMessageClass - incoming message
Returns:
result - Boolean: TRUE, if handled, FALSE, if not

pronincomingTransaction

public boolean pronincomingTransaction(SPMessageClass incoming)
This method provides the unique handlers for incoming Secret turn message types

Overrides:
pronincomingTransaction in class SPAbstractTransactionClass
Parameters:
incoming - SPMessageClass - incoming message
Returns:
result - Boolean: TRUE, if message handled by unique transaction messages, FALSE, if not.

getPrpadlength

public int getPrpadlength()
Getter function that returns the property: prpadlength

Returns:
prpadlength - int

getSecretpadded

public java.lang.String getSecretpadded()
Getter function that returns the property: secretpadded

Returns:
secretpadded - String

getSecrettransform

public java.lang.String getSecrettransform()
Getter function that returns the property: secrettransform

Returns:
secrettransform - String

gettranstype

public static java.lang.String gettranstype()
This method gets the transaction type.

Returns:
String - secret

registerTransaction

public static boolean registerTransaction()
Registers this transaction.

Returns:
boolean

createSecret

public static SPAbstractTransactionInterface createSecret(SPGameInterface gameobj,
                                                          java.lang.String master,
                                                          java.lang.String[] playerIDList,
                                                          boolean privateflag,
                                                          java.lang.String AGE,
                                                          java.lang.String newsecret)
This method creates a SPSecretClass transaction.

Parameters:
gameobj - - SPGameInterface - the game object
master - - String - the transaction master
playerIDList -
privateflag -
AGE - - String - Abstract Game Engine
newsecret -
Returns:
SPAbstractTransactionInterface - new object.

configureSecretTransaction

private java.lang.String configureSecretTransaction(java.lang.String newsecret)
This method configures the Secret Transaction

Parameters:
newsecret -
Returns:
String

APIcreateTransaction

public SPAbstractTransactionInterface APIcreateTransaction(SPGameInterface gameapiobj,
                                                           SPMessageClass message)
Creates a new instance of an SPSecretClass class.

Specified by:
APIcreateTransaction in interface SPAbstractTransactionInterface
Overrides:
APIcreateTransaction in class SPAbstractTransactionClass
Parameters:
gameapiobj - SPGameInterface - associated game object
message - SPMessageClass - message that has all the transaction configure info
Returns:
SPAbstractTransactionInterface

APIgetTransactionType

public java.lang.String APIgetTransactionType()
This method returns a String of the transactiontype.

Specified by:
APIgetTransactionType in interface SPAbstractTransactionInterface
Overrides:
APIgetTransactionType in class SPAbstractTransactionClass
Returns:
this.transtype - String - name of transaction type

SecurePlayLibray J2SE
v2.1

2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.