public class InMemoSharkMessage extends java.lang.Object implements SharkMessage
ANONYMOUS, ANY_RECEIVER, ENCRYPTED_MASK, SIGNED_MASK
Modifier and Type | Method and Description |
---|---|
boolean |
couldBeDecrypted()
Can this message be decrypted?
|
boolean |
encrypted()
Not part of the transferred message - just a flag that indicates if this message is encrypted.
|
java.util.List<ASAPHop> |
getASAPHopsList()
A message can be received directly from a sender or it was routed.
|
byte[] |
getContent()
Content - can be encrypted and signed
|
java.sql.Timestamp |
getCreationTime()
Creation date is produced when an object is serialized.
|
java.util.Set<java.lang.CharSequence> |
getRecipients()
Recipients are always visible - the only recipient is in the unencrypted head if message
is encrypted - maybe we change this in a later version.
|
java.lang.CharSequence |
getSender()
Sender - can be encrypted and signed
|
boolean |
isAnonymousSender(java.lang.CharSequence peerID) |
boolean |
isAnyRecipient(java.lang.CharSequence peerID) |
boolean |
isLaterThan(SharkMessage message)
Compare two message what creation date is earlier.
|
static InMemoSharkMessage |
parseMessage(byte[] message,
java.util.List<ASAPHop> hopsList) |
static InMemoSharkMessage |
parseMessage(byte[] message,
java.util.List<ASAPHop> hopsList,
ASAPKeyStore ASAPKeyStore) |
static byte[] |
serializeMessage(byte[] content,
java.lang.CharSequence sender,
java.lang.CharSequence recipient) |
static byte[] |
serializeMessage(byte[] content,
java.lang.CharSequence sender,
java.lang.CharSequence recipient,
boolean sign,
boolean encrypt,
ASAPKeyStore ASAPKeyStore) |
static byte[] |
serializeMessage(byte[] content,
java.lang.CharSequence sender,
java.util.Set<java.lang.CharSequence> recipients) |
static byte[] |
serializeMessage(byte[] content,
java.lang.CharSequence sender,
java.util.Set<java.lang.CharSequence> receiver,
boolean sign,
boolean encrypt,
ASAPKeyStore asapKeyStore) |
boolean |
verified()
Not part of the transferred message - just a flag that indicates if this message could now
be verified.
|
public static byte[] serializeMessage(byte[] content, java.lang.CharSequence sender, java.lang.CharSequence recipient) throws java.io.IOException, ASAPException
java.io.IOException
ASAPException
public static byte[] serializeMessage(byte[] content, java.lang.CharSequence sender, java.util.Set<java.lang.CharSequence> recipients) throws java.io.IOException, ASAPException
java.io.IOException
ASAPException
public static byte[] serializeMessage(byte[] content, java.lang.CharSequence sender, java.lang.CharSequence recipient, boolean sign, boolean encrypt, ASAPKeyStore ASAPKeyStore) throws java.io.IOException, ASAPException
java.io.IOException
ASAPException
public static byte[] serializeMessage(byte[] content, java.lang.CharSequence sender, java.util.Set<java.lang.CharSequence> receiver, boolean sign, boolean encrypt, ASAPKeyStore asapKeyStore) throws java.io.IOException, ASAPException
java.io.IOException
ASAPException
public byte[] getContent() throws ASAPSecurityException
SharkMessage
getContent
in interface SharkMessage
ASAPSecurityException
- if message could not be encryptedpublic java.lang.CharSequence getSender() throws ASAPSecurityException
SharkMessage
getSender
in interface SharkMessage
ASAPSecurityException
- if message could not be encryptedpublic java.util.Set<java.lang.CharSequence> getRecipients()
SharkMessage
getRecipients
in interface SharkMessage
public boolean verified() throws ASAPSecurityException
SharkMessage
verified
in interface SharkMessage
ASAPSecurityException
- if message could not be encryptedpublic boolean encrypted()
SharkMessage
encrypted
in interface SharkMessage
public boolean couldBeDecrypted()
SharkMessage
couldBeDecrypted
in interface SharkMessage
public java.sql.Timestamp getCreationTime() throws ASAPSecurityException
SharkMessage
getCreationTime
in interface SharkMessage
ASAPSecurityException
- if message could not be encryptedpublic boolean isLaterThan(SharkMessage message) throws ASAPException, java.io.IOException
SharkMessage
isLaterThan
in interface SharkMessage
ASAPException
java.io.IOException
public java.util.List<ASAPHop> getASAPHopsList()
SharkMessage
getASAPHopsList
in interface SharkMessage
public static InMemoSharkMessage parseMessage(byte[] message, java.util.List<ASAPHop> hopsList) throws java.io.IOException, ASAPException
java.io.IOException
ASAPException
public static InMemoSharkMessage parseMessage(byte[] message, java.util.List<ASAPHop> hopsList, ASAPKeyStore ASAPKeyStore) throws java.io.IOException, ASAPException
java.io.IOException
ASAPException
public boolean isAnonymousSender(java.lang.CharSequence peerID)
public boolean isAnyRecipient(java.lang.CharSequence peerID)