|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclient.MessageGenerator
final class MessageGenerator
Provides methods for generating messages (the mixes are capable of processing) from byte arrays.
Field Summary | |
---|---|
private static NetworkClockController |
clock
Reference on component NetworkClock . |
private Cryptography |
cryptography
Used to encrypt messages. |
private static InternalInformationPortController |
internalInformationPort
Reference on component InternalInformationPortController . |
private static java.util.logging.Logger |
LOGGER
Logger used to log and display information. |
private java.security.Key[] |
macKeys
Keys for message authentication codes (MACs). |
private int |
NUMBER_OF_MIXES_IN_CASCADE
Number of mixes in the cascade. |
Constructor Summary | |
---|---|
protected |
MessageGenerator(int numberOfMixesInCascade,
Cryptography cryptography)
Generates a new MessageGenerator for generating messages
(the mixes are capable of processing) from byte arrays. |
Method Summary | |
---|---|
protected byte[] |
generateChannelEstablishMessage(byte[] bytePayload)
Generates a message which consists of one or more (encrypted) layers, the cascade's mixes are capable of processing from the bypassed data (Type: ChannelEstablishMessage ). |
protected byte[] |
generateChannelMessage(byte[] bytePayload)
Generates a message which consists of one or more (encrypted) layers, the cascade's mixes are capable of processing from the bypassed data (Type: ChannelMessage ). |
private Message |
generatePlaintextChannelEstablishMessage(int positionOfMixInCascade,
Payload payload,
int messageID)
Generates a new (plaintext) ChannelEstablishMessage for the
specified mix. |
private Message |
generatePlaintextChannelMessage(int positionOfMixInCascade,
Payload payload,
int messageID)
Generates a new (plaintext) ChannelMessage for the
specified mix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static InternalInformationPortController internalInformationPort
InternalInformationPortController
.
Used to display and/or log data and read general settings.
private static final java.util.logging.Logger LOGGER
private static NetworkClockController clock
NetworkClock
.
private final int NUMBER_OF_MIXES_IN_CASCADE
private Cryptography cryptography
private java.security.Key[] macKeys
Constructor Detail |
---|
protected MessageGenerator(int numberOfMixesInCascade, Cryptography cryptography)
MessageGenerator
for generating messages
(the mixes are capable of processing) from byte arrays.
numberOfMixesInCascade
- Number of mixes in the cascade this
Client
shall use.cryptography
- Reference on Cryptography
object that shall be used to encrypt
messages.Method Detail |
---|
protected byte[] generateChannelEstablishMessage(byte[] bytePayload) throws MessageTooLongException
ChannelEstablishMessage
). A layer is added for each
mix in the cascade.
bytePayload
- Data to generate the mix message from.
ChannelEstablishMessage
as a byte array.
MessageTooLongException
- Thrown when the bypassed message is
larger than the maximum message
size.protected byte[] generateChannelMessage(byte[] bytePayload) throws MessageTooLongException
ChannelMessage
). A layer is added for each mix in
the cascade.
bytePayload
- Data to generate the mix message from.
ChannelMessage
as a byte
array.
MessageTooLongException
- Thrown when the bypassed message is
larger than the maximum message
size.private Message generatePlaintextChannelEstablishMessage(int positionOfMixInCascade, Payload payload, int messageID)
ChannelEstablishMessage
for the
specified mix. Generates message header and authentication information
as well.
positionOfMixInCascade
- The mix' position in the cascade, the
plaintext message shall be created for.payload
- Payload to be embedded.messageID
- Note: For testing only (MAKES MIX
INSECURE): An identifieing number,
which is the same for every envelope of
a mix message. Used to trace messages
for debugging.
private Message generatePlaintextChannelMessage(int positionOfMixInCascade, Payload payload, int messageID)
ChannelMessage
for the
specified mix. Generates message header and authentication information
as well.
positionOfMixInCascade
- The mix' position in the cascade, the
plaintext message shall be created for.payload
- Payload to be embedded.messageID
- Note: For testing only (MAKES MIX
INSECURE): An identifieing number,
which is the same for every envelope of
a mix message. Used to trace messages
for debugging.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |