com.SecurePlay
Class SPMessageClass

java.lang.Object
  extended bycom.SecurePlay.SPMessageClass

public class SPMessageClass
extends java.lang.Object

This is a "game-level" message that is sent between SecurePlay library instances for each Player.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Constructor Summary
SPMessageClass(java.lang.String INgameID, java.lang.String INtransactionID, java.lang.String INsenderID, java.lang.String[] INreceiverIDlist, java.lang.String INmessType, boolean INsignedflag, SPUEPrivatePolicy INprivateflag, boolean INencryptedflag, java.lang.String[] INmessagebody, byte[] INsignature, java.lang.String INmessID, SPGameInterface game)
          Constructs an overloaded SPMessageClass()
 
Method Summary
 boolean decrypt(SPGameInterface game)
          This method safely decrypts the message string and loads the results into the message body array using the global SPdecrypt function.
 boolean encrypt(SPGameInterface game)
          This method safely encrypts the message body string using the global SPencrypt function.
 byte[] getBSignature()
          Gets the signature of the message.
 boolean getEncryptedFlag()
          Gets the enrypted flag of the message.
 java.lang.String getGameID()
          Gets the id of the game associated with the message.
 java.lang.String[] getMessageBody()
          Gets the message body.
 java.lang.String getMessageID()
          Gets the message id.
 java.lang.String getMessageType()
          Gets the message type.
 SPUEPrivatePolicy getPrivateflag()
          Gets the private policy of the message.
 java.lang.String[] getReceiverIDlist()
          Gets the reciever id list of the message.
 java.lang.String getSenderID()
          Gets the senderID property of the class.
 java.lang.String getSignature()
          Gets the signature of the message.
 boolean getSignedFlag()
          Gets the signed flag of the message.
 java.lang.String getTransactionID()
          Gets the id of the transaction associated with the message.
 java.lang.String validateMessageLoad()
          This method validates a SPMessageClass instance to check that it is well-formed - that all of the parameters are set from a SPMessageClass perspective.
 boolean verifyMessageSignature(SPGameInterface game)
          This method verifies the signature associated with a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPMessageClass

public SPMessageClass(java.lang.String INgameID,
                      java.lang.String INtransactionID,
                      java.lang.String INsenderID,
                      java.lang.String[] INreceiverIDlist,
                      java.lang.String INmessType,
                      boolean INsignedflag,
                      SPUEPrivatePolicy INprivateflag,
                      boolean INencryptedflag,
                      java.lang.String[] INmessagebody,
                      byte[] INsignature,
                      java.lang.String INmessID,
                      SPGameInterface game)
Constructs an overloaded SPMessageClass()

Parameters:
INgameID - String - this is the ID for the game that this message is associated with
INtransactionID - - this is the ID of the transaction that this message is associated with
INsenderID - String - this is the identity of the sender of the message
INreceiverIDlist - String[] - ids of the recievers
INmessType - String - this is the Message Type of the message (typically one of the basic game transaction methods)
INsignedflag - boolean - a flag to determine if the message has been digitally signed
INprivateflag - SPUtilPrivatePolicy -
INencryptedflag - boolean - This flag describes whether the message is a private message denoted by "P", or public denoted by "A" or an alternate message sent to the other game recipients not part of the private transaction denoted by "Q".
INmessagebody - String[] - the message
INsignature - String - The signature is the either the hash of the "prhashableMessage()" portions of the message or a digital signature function applied to the message hash.
INmessID - String - The message ID is a unique message identifer at the game instance level.
game - SPGameInterface - the game associated with this message.
Method Detail

validateMessageLoad

public java.lang.String validateMessageLoad()
This method validates a SPMessageClass instance to check that it is well-formed - that all of the parameters are set from a SPMessageClass perspective. NOTE: it does not validate that the content of a message is valid.

Returns:
errorinfo - String - errorinfo string. If the incoming message is valid, the empty string "" is returned

verifyMessageSignature

public boolean verifyMessageSignature(SPGameInterface game)
This method verifies the signature associated with a message. Note, if the signedflag is set to TRUE, a real digital signature is used as specified by the game configuration (see SPGame). If the signedflag is set to FALSE, then the message is checked against the hash function.

Returns:
result - Boolean: True if signature verifies, otherwise, False.

getGameID

public java.lang.String getGameID()
Gets the id of the game associated with the message.

Returns:
gameID - String - game id

getTransactionID

public java.lang.String getTransactionID()
Gets the id of the transaction associated with the message.

Returns:
transactionID - String - transaction id

getSenderID

public java.lang.String getSenderID()
Gets the senderID property of the class.

Returns:
senderID - String - sender id

getMessageType

public java.lang.String getMessageType()
Gets the message type.

Returns:
messType - String - message type.

getSignedFlag

public boolean getSignedFlag()
Gets the signed flag of the message.

Returns:
signedflag - Boolean - TRUE, if signed flag is true, FALSE, if signed flag is false

getEncryptedFlag

public boolean getEncryptedFlag()
Gets the enrypted flag of the message.

Returns:
encryptedflag - Boolean - TRUE, if enrypted flag is true, FALSE, if enrypted flag is false

getPrivateflag

public SPUEPrivatePolicy getPrivateflag()
Gets the private policy of the message.

Returns:
pf - SPUtilPrivatePolicy - the private policy.
See Also:
SPUEPrivatePolicy

getMessageID

public java.lang.String getMessageID()
Gets the message id.

Returns:
messageID - String - message id

getSignature

public java.lang.String getSignature()
Gets the signature of the message.

Returns:
signature - String - the signature of the message.

getBSignature

public byte[] getBSignature()
Gets the signature of the message.

Returns:
signature - byte[] - the signature of the message.

getReceiverIDlist

public java.lang.String[] getReceiverIDlist()
Gets the reciever id list of the message.

Returns:
sv - String[] - array of reciever ids.

getMessageBody

public java.lang.String[] getMessageBody()
Gets the message body.

Returns:
v - String[] - gets the message body of the message.

encrypt

public boolean encrypt(SPGameInterface game)
This method safely encrypts the message body string using the global SPencrypt function.

Returns:
Boolean - TRUE, if successful, FALSE, if not

decrypt

public boolean decrypt(SPGameInterface game)
This method safely decrypts the message string and loads the results into the message body array using the global SPdecrypt function.

Returns:
result - Boolean: TRUE, if successful, FALSE, if not.