|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmessage.Message
message.ChannelEstablishMessage
public final class ChannelEstablishMessage
ExternalMessage used to establish a channel, which can transmit
ChannelMessages and Replyies. The parts this
message consists of are defined in the enumeration
ChannelEstablishMessagePart. A pair of set and get methods
is present for each defined part.
| Field Summary | |
|---|---|
static byte |
IDENTIFIER
Identifier for this type of message. |
private static InternalInformationPortController |
internalInformationPort
Reference on component InternalInformationPort. |
private static java.util.logging.Logger |
LOGGER
Logger used to log and display information. |
private int |
NUMBER_OF_FURTHER_HOPS
Number of further hops (= mixes), this message must pass to reach its destination. |
| Constructor Summary | |
|---|---|
ChannelEstablishMessage(byte[] byteMesssage,
int numberOfFurtherHops)
Message constructor used by client. |
|
ChannelEstablishMessage(byte[] byteMesssage,
User channel,
int numberOfFurtherHops)
Message constructor used by a mix. |
|
| Method Summary | |
|---|---|
byte[] |
getAsymmetricPart()
Returns the MessagePart ASYMMETRIC_PART = The
asymmetrically encrypted part of the message. |
byte |
getLeadingZero()
Returns the MessagePart LEADING_ZERO. |
byte[] |
getMAC()
Returns the MessagePart MAC = The Message
Authentication Code (MAC) of this message. |
javax.crypto.SecretKey |
getMACKey()
Returns the MessagePart MAC_KEY = Key used to
generate Message Authentication Code (MAC). |
int |
getMessageID()
Returns the MessagePart MESSAGE_ID = An
identifieing number, which is the same for every envelope of a mix
message. |
private byte[] |
getPart(ChannelEstablishMessagePart messagePart)
Returns a byte representation of a MessagePart. |
Payload |
getPayload()
Returns the MessagePart PAYLOAD. |
javax.crypto.spec.IvParameterSpec |
getSessionIV()
Returns the MessagePart SYMMETRIC_IV =
Initialization vector used to decrypt the symmetrically encryptet
message part. |
javax.crypto.spec.SecretKeySpec |
getSessionKey()
Returns the MessagePart SYMMETRIC_KEY = Key
used to decrypt the symmetrically encrypted message part. |
byte[] |
getSignedData()
Returns the MessagePart SIGNED_DATA. |
byte[] |
getSymmetricPart()
Returns the MessagePart SYMMETRIC_PART = The
symmetrically encrypted part of the message. |
long |
getTimestamp()
Returns the MessagePart TIMESTAMP = Point of
time, the message was created. |
void |
setAsymmetricPart(byte[] newAsymmetricPart)
Sets the MessagePart ASYMMETRIC_PART to the
bypassed value. |
void |
setLeadingZero()
Sets the MessagePart LEADING_ZERO to
01000000. |
void |
setMAC(byte[] mac)
Sets the MessagePart MAC to the
bypassed value. |
void |
setMACKey(javax.crypto.SecretKey key)
Sets the MessagePart MAC_KEY to the
bypassed value. |
void |
setMessageID(int newID)
Sets the MessagePart MESSAGE_ID to the
bypassed value. |
private void |
setPart(ChannelEstablishMessagePart messagePart,
byte[] data)
Saves a byte representation of a MessagePart. |
void |
setPayload(Payload newPayload)
Sets the MessagePart PAYLOAD to the
bypassed value. |
void |
setSessionIV(byte[] sessionIV)
Sets the MessagePart SYMMETRIC_IV to the
bypassed value. |
void |
setSessionKey(javax.crypto.SecretKey key)
Sets the MessagePart SYMMETRIC_KEY to the
bypassed value. |
void |
setSignedData(byte[] newSignedData)
Sets the MessagePart SIGNED_DATA to the
bypassed value. |
void |
setSymmetricPart(byte[] newSymmetricPart)
Sets the MessagePart SYMMETRIC_PART to the
bypassed value. |
void |
setTimestamp(long newTimestamp)
Sets the MessagePart TIMESTAMP to the
bypassed value. |
java.lang.String |
toString()
Returns a simple String representation of this class featuring several message parts. |
| Methods inherited from class message.Message |
|---|
compareTo, getByteMessage, getChannel, getChannelID, getNextMixChannelID, getTimeOfReceival, setByteMessage, setPayloadRange, setTimeOfReceival |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface message.BasicMessage |
|---|
getByteMessage, getChannel, getChannelID, getNextMixChannelID, getTimeOfReceival, setByteMessage, setPayloadRange, setTimeOfReceival |
| Field Detail |
|---|
private static InternalInformationPortController internalInformationPort
InternalInformationPort.
Used to display and/or log data and read general settings.
private static final java.util.logging.Logger LOGGER
public static final byte IDENTIFIER
instanceOf operator.
private final int NUMBER_OF_FURTHER_HOPS
MessagePart's position in the
byteMessage which has (a) dynamic start- and/or
end-position(s). Note: Message length isn't constant in a cascade.
Message.byteMessage,
ChannelEstablishMessagePart| Constructor Detail |
|---|
public ChannelEstablishMessage(byte[] byteMesssage,
User channel,
int numberOfFurtherHops)
Constructs a new ChannelEstablishMessage with the submitted
content (byteMesssage) for the specified user/channel.
byteMesssage - Byte representation of the message (as
received from the client/previous mix).channel - User/channel the message shall be created
for.numberOfFurtherHops - Number of further hops (= mixes), this
message must pass.
public ChannelEstablishMessage(byte[] byteMesssage,
int numberOfFurtherHops)
Constructs a new ChannelEstablishMessage with the submitted
content (byteMesssage).
byteMesssage - Byte representation of the message (can be
empty).numberOfFurtherHops - Number of mixes in the cascade.| Method Detail |
|---|
public byte getLeadingZero()
MessagePart LEADING_ZERO.
MessagePart LEADING_ZERO.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.LEADING_ZEROpublic void setLeadingZero()
MessagePart LEADING_ZERO to
01000000.
ChannelEstablishMessagePart,
ChannelEstablishMessagePart.LEADING_ZEROpublic byte[] getMAC()
MessagePart MAC = The Message
Authentication Code (MAC) of this message.
MessagePart MAC.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.MAC
public void setMAC(byte[] mac)
throws MessagePartHasWrongSizeException
MessagePart MAC to the
bypassed value.
mac - The Message Authentication Code (MAC) of this message.
MessagePartHasWrongSizeExceptionChannelEstablishMessagePart,
ChannelEstablishMessagePart.MACpublic int getMessageID()
MessagePart MESSAGE_ID = An
identifieing number, which is the same for every envelope of a mix
message. Used to trace messages for debugging. Can only be read
correctly, when current envelope is decrypted! Note: For testing only
(MAKES MIX INSECURE)!
getMessageID in interface BasicMessagegetMessageID in class MessageMessagePart MESSAGE_ID.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.MESSAGE_IDpublic void setMessageID(int newID)
MessagePart MESSAGE_ID to the
bypassed value.
setMessageID in interface BasicMessagesetMessageID in class MessagenewID - An identifieing number, which is the same for every
envelope of a mix message. Used to trace messages for
debugging. Can only be set correctly, when current envelope
is decrypted! Note: For testing only (MAKES MIX INSECURE)!ChannelEstablishMessagePart,
ChannelEstablishMessagePart.MESSAGE_IDpublic javax.crypto.SecretKey getMACKey()
MessagePart MAC_KEY = Key used to
generate Message Authentication Code (MAC).
MessagePart MAC_KEY.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.MAC_KEYpublic void setMACKey(javax.crypto.SecretKey key)
MessagePart MAC_KEY to the
bypassed value.
key - Key used to generate Message Authentication Code (MAC).ChannelEstablishMessagePart,
ChannelEstablishMessagePart.MAC_KEYpublic javax.crypto.spec.SecretKeySpec getSessionKey()
MessagePart SYMMETRIC_KEY = Key
used to decrypt the symmetrically encrypted message part.
MessagePart SYMMETRIC_KEY.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.SESSION_KEYpublic void setSessionKey(javax.crypto.SecretKey key)
MessagePart SYMMETRIC_KEY to the
bypassed value.
key - Key used to decrypt the symmetrically encrypted message
part.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.SESSION_KEYpublic javax.crypto.spec.IvParameterSpec getSessionIV()
MessagePart SYMMETRIC_IV =
Initialization vector used to decrypt the symmetrically encryptet
message part.
MessagePart SYMMETRIC_IV.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.SESSION_IVpublic void setSessionIV(byte[] sessionIV)
MessagePart SYMMETRIC_IV to the
bypassed value.
sessionIV - Initialization vector used to decrypt the symmetrically
encryptet message part.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.SESSION_IVpublic long getTimestamp()
MessagePart TIMESTAMP = Point of
time, the message was created.
MessagePart TIMESTAMP.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.TIMESTAMPpublic void setTimestamp(long newTimestamp)
MessagePart TIMESTAMP to the
bypassed value.
newTimestamp - Point of time, the message was created.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.TIMESTAMPpublic Payload getPayload()
MessagePart PAYLOAD.
MessagePart PAYLOAD.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.PAYLOAD
public void setPayload(Payload newPayload)
throws MessagePartHasWrongSizeException
MessagePart PAYLOAD to the
bypassed value.
newPayload - Payload to be set.
MessagePartHasWrongSizeExceptionChannelEstablishMessagePart,
ChannelEstablishMessagePart.PAYLOADpublic byte[] getSignedData()
MessagePart SIGNED_DATA.
MessagePart SIGNED_DATA.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.SIGNED_DATA
public void setSignedData(byte[] newSignedData)
throws MessagePartHasWrongSizeException
MessagePart SIGNED_DATA to the
bypassed value.
newSignedData - The signed data to be set.
MessagePartHasWrongSizeExceptionChannelEstablishMessagePart,
ChannelEstablishMessagePart.SIGNED_DATApublic byte[] getAsymmetricPart()
MessagePart ASYMMETRIC_PART = The
asymmetrically encrypted part of the message.
MessagePart ASYMMETRIC_PART.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.ASYMMETRIC_PART
public void setAsymmetricPart(byte[] newAsymmetricPart)
throws MessagePartHasWrongSizeException
MessagePart ASYMMETRIC_PART to the
bypassed value.
newAsymmetricPart - The asymmetric part of the message to be set.
MessagePartHasWrongSizeExceptionChannelEstablishMessagePart,
ChannelEstablishMessagePart.ASYMMETRIC_PARTpublic byte[] getSymmetricPart()
MessagePart SYMMETRIC_PART = The
symmetrically encrypted part of the message.
MessagePart SYMMETRIC_PART.ChannelEstablishMessagePart,
ChannelEstablishMessagePart.SYMMETRIC_PART
public void setSymmetricPart(byte[] newSymmetricPart)
throws MessagePartHasWrongSizeException
MessagePart SYMMETRIC_PART to the
bypassed value.
newSymmetricPart - The symmetric part of the message to be set.
MessagePartHasWrongSizeExceptionChannelEstablishMessagePart,
ChannelEstablishMessagePart.SYMMETRIC_PARTprivate byte[] getPart(ChannelEstablishMessagePart messagePart)
MessagePart. Example of
usage:
getPart(ChannelEstablishMessagePart.NAME_OF_ENUM_CONSTANT);
messagePart - Enum constant who's byte representation shall be
retrieved (= "type" of the part).
MessagePart
suiting the bypassed enum constant.ChannelEstablishMessagePart
private void setPart(ChannelEstablishMessagePart messagePart,
byte[] data)
throws MessagePartHasWrongSizeException
MessagePart. Example of
usage:
setPart(ChannelEstablishMessagePart.NAME_OF_ENUM_CONSTANT, data);
messagePart - Enum constant who's byte representation shall be
saved.data - Byte representation of the MessagePart
to be saved.
MessagePartHasWrongSizeException - Thrown when a
MessagePart that shall be assigned is of
wrong size.ChannelEstablishMessagePartpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||