|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--core.Message | +--core.MessageT
This method represents a Message which is tagged
Field Summary |
Fields inherited from class core.Message |
|
Constructor Summary | |
MessageT()
|
|
MessageT(Agent agent)
|
|
MessageT(INonce nonce)
|
|
MessageT(Message m1,
Message m2)
|
Method Summary | |
void |
decrypt(java.lang.String algo,
java.security.Key key)
Decrypt the message with a given key, using the given algorithm. |
void |
encrypt(java.lang.String algo,
java.security.Key key)
Encrypts the message with the given key, using the given algorithm, and put the result in Base64 format |
IMessage[] |
getAllFields()
Returns an array containing the different parts of a message, ie the different messages that have been concatenated in order to build this message |
private java.lang.String |
getOneTag()
|
Tag |
getTag()
|
static Tag |
getTag(Message m)
Returns the tag of this Message |
java.lang.String |
getText()
|
void |
hash()
This method hashes the Message |
void |
removeTags()
|
void |
setString(java.lang.String str)
Change the value of the private member string into the given string It is advised to only use Base64 string in the message to avoid any issue |
Methods inherited from class core.Message |
addMessage, clone, equals, getString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MessageT()
public MessageT(Agent agent)
public MessageT(INonce nonce)
public MessageT(Message m1, Message m2)
Method Detail |
public static Tag getTag(Message m) throws java.lang.Exception
java.lang.Exception
- if the message does not contain a valid tagpublic Tag getTag() throws java.lang.Exception
java.lang.Exception
private java.lang.String getOneTag() throws java.lang.Exception
java.lang.Exception
public java.lang.String getText() throws java.lang.Exception
java.lang.Exception
public void decrypt(java.lang.String algo, java.security.Key key) throws java.lang.Exception
Message
decrypt
in interface IMessage
decrypt
in class Message
algo
- algorithm to use for decryptionkey
- key to use for decryption
java.lang.Exception
public void encrypt(java.lang.String algo, java.security.Key key) throws java.lang.Exception
Message
encrypt
in interface IMessage
encrypt
in class Message
algo
- algorithm to use for encryptionkey
- key to use for encryption
java.lang.Exception
public void hash() throws java.security.NoSuchAlgorithmException
Message
hash
in interface IMessage
hash
in class Message
java.security.NoSuchAlgorithmException
public void setString(java.lang.String str)
Message
setString
in interface IMessage
setString
in class Message
str
- new value for the content of the messagepublic IMessage[] getAllFields()
Message
getAllFields
in interface IMessage
getAllFields
in class Message
public void removeTags() throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |