messageProcessor
Class MessageProcessorController

java.lang.Object
  extended by messageProcessor.MessageProcessorController

public class MessageProcessorController
extends java.lang.Object

Controller class of component MessageProcessor.

Takes messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypasses them to component OutputStrategy.

Can handle Requests and Replies in parallel.

The functions mentioned above can be performed in parallel as well, except for detecting replays (for security reasons).

Author:
Karl-Peter Fuchs

Constructor Summary
MessageProcessorController()
          Generates a new MessageProcessor component, which takes messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypasses them to the OutputStrategy component.
 
Method Summary
 byte[] decrypt(byte[] data, java.lang.String transformation)
          Decrypts the bypassed data using the internal asymmetric cipher (and private key) and the specified transformation.
 void initialize(java.security.KeyPair keyPair)
          Initialization method for this component.
 void initialize(java.security.KeyPair keyPair, InputOutputHandlerController inputOutputHandler, AccessControlController accessControl, OutputStrategyController outputStrategy)
          Initialization method for this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageProcessorController

public MessageProcessorController()
Generates a new MessageProcessor component, which takes messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypasses them to the OutputStrategy component.

Can handle Requests and Replies in parallel.

The functions mentioned above can be performed in parallel as well, except for detecting replays (for security reasons).

Component can't be used before calling initialize().

See Also:
initialize(KeyPair), initialize( KeyPair, InputOutputHandlerController, AccessControlController, OutputStrategyController )
Method Detail

initialize

public void initialize(java.security.KeyPair keyPair,
                       InputOutputHandlerController inputOutputHandler,
                       AccessControlController accessControl,
                       OutputStrategyController outputStrategy)
Initialization method for this component. Makes this component process messages (= take messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypass them to the OutputStrategy component.

Parameters:
keyPair - Reference on this mix' KeyPair. Used for asymmetric cryptography.
inputOutputHandler - Reference on component InputOutputHandler (used to get unprocessed messages from).
accessControl - Reference on component AccessControl (used to check if messages have integrity).
outputStrategy - Reference on component OutputStrategy (used to hand over processed messages).
See Also:
initialize(KeyPair)

initialize

public void initialize(java.security.KeyPair keyPair)
Initialization method for this component. Should be called, when component shall solely be used to decrypt data and not process messages (see initialize(KeyPair, InternalInformationPortController, InputOutputHandlerController, AccessControlController, OutputStrategyController) for an initializer causing this component to process messages, too).

Parameters:
keyPair - Reference on this mix' KeyPair. Used to decrypt data.
See Also:
initialize( KeyPair, InputOutputHandlerController, AccessControlController, OutputStrategyController)

decrypt

public byte[] decrypt(byte[] data,
                      java.lang.String transformation)
               throws java.lang.Exception
Decrypts the bypassed data using the internal asymmetric cipher (and private key) and the specified transformation.

Parameters:
data - Data to be decrypted.
transformation - Transformation that shall be used for decryption.
Returns:
Decrypted data.
Throws:
java.lang.Exception - Any type of error preventing the data from being decrypted.