externalInformationPort
Class ExternalInformationPortController

java.lang.Object
  extended by externalInformationPort.ExternalInformationPortController
All Implemented Interfaces:
ExternalInformationPortInterface

public class ExternalInformationPortController
extends java.lang.Object
implements ExternalInformationPortInterface

Controller class of component ExternalInformationPort. Implements the architecture interface ExternalInformationPortInterface.

Used for Information (for example a public key) exchange with "external" communication partners (for example other mixes or clients). This component doesn't affect the sending of mix messages directly (That's done by the InputOutputHandler: see architectureInterface.InputOutputHandlerInterface).

Each exchangeable type of information is specified in the enumeration Information.

Author:
Karl-Peter Fuchs

Constructor Summary
ExternalInformationPortController()
          Generates a new ExternalInformationPort component.
 
Method Summary
 void acceptRequests()
          Make component start listening for requests (on communication channel).
 java.lang.Object getInformation(java.net.InetAddress informationProviderAddress, int informationProviderPort, Information informationOfInterest)
          Generic method to receive some Information from a specified ExternalInformationPort component.
 java.lang.Object getInformation(java.net.InetAddress informationProviderAddress, int informationProviderPort, Information informationOfInterest, byte[] data)
          Generic method to receive some Information from a specified ExternalInformationPort component, sending the bypassed data.
 java.lang.Object[] getInformationFromAll(java.net.InetAddress informationProviderAddress, int informationProviderPort, Information informationOfInterest)
          Generic method to receive some Information from several ExternalInformationPort components.
 java.lang.Object[] getInformationFromAll(java.net.InetAddress informationProviderAddress, int informationProviderPort, Information informationOfInterest, byte[] data)
          Generic method to receive some Information from several ExternalInformationPort components, sending the bypassed data.
 void initialize()
          Initialization method for this component.
 void initialize(java.security.PublicKey publicKey, MessageProcessorController messageProcessor)
          Initialization method for this component.
 void setInterMixIVWithPreviousMix(javax.crypto.spec.IvParameterSpec interMixIV)
          Makes the bypassed initialization vector available via InformationProvider.
 void setInterMixKeyWithPreviousMix(javax.crypto.SecretKey interMixKey)
          Makes the bypassed key available via InformationProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalInformationPortController

public ExternalInformationPortController()
Generates a new ExternalInformationPort component.

Used for Information (for example a public key) exchange with "external" communication partners (for example other mixes or clients). This component doesn't affect the sending of mix messages directly (That's done by the InputOutputHandler: see architectureInterface.InputOutputHandlerInterface).

Each exchangeable type of information is specified in the enumeration Information.

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

See Also:
initialize(), initialize(PublicKey, MessageProcessorController)
Method Detail

initialize

public void initialize(java.security.PublicKey publicKey,
                       MessageProcessorController messageProcessor)
Initialization method for this component. Makes this component capable of receiving AND providing Information (see initialize() for receival only). Must be called before using an instance of this class for anything but dispensing references on the instance itself.

Parameters:
publicKey - The mix' public key, this object belongs to (will be made available via InformationProvider).
messageProcessor - Used to encrypt certain kinds of Information.
See Also:
initialize()

initialize

public void initialize()
Initialization method for this component. Makes this component capable of receiving BUT NOT providing Information from a communication partner's ExternalInformationPort (see initialize(PublicKey, MessageProcessorController) for providing Information, too). Must be called before using an instance of this class for anything but dispensing references on the instance itself.

See Also:
initialize(PublicKey, MessageProcessorController)

setInterMixKeyWithPreviousMix

public void setInterMixKeyWithPreviousMix(javax.crypto.SecretKey interMixKey)
Makes the bypassed key available via InformationProvider. This key is used to encrypt data between mixes.

Parameters:
interMixKey - Key used to encrypt data between mixes.

setInterMixIVWithPreviousMix

public void setInterMixIVWithPreviousMix(javax.crypto.spec.IvParameterSpec interMixIV)
Makes the bypassed initialization vector available via InformationProvider. This initialization vector is used to encrypt data between mixes.

Parameters:
interMixIV - Initialization vector used to encrypt data between mixes.

getInformation

public java.lang.Object getInformation(java.net.InetAddress informationProviderAddress,
                                       int informationProviderPort,
                                       Information informationOfInterest)
                                throws InformationRetrieveException
Generic method to receive some Information from a specified ExternalInformationPort component.

If communication channel isn't safe, but transmitted data is sensitive, cryptographic measures (like authentication and encryption) should be applied.

Specified by:
getInformation in interface ExternalInformationPortInterface
Parameters:
informationProviderAddress - Address of the ExternalInformationPort component to receive data from.
informationProviderPort - Port the ExternalInformationPort component to receive data from runs on.
informationOfInterest - Type of Information, that shall be received.
Returns:
The requested Information .
Throws:
InformationRetrieveException - Thrown, when requested Information not available.

getInformation

public java.lang.Object getInformation(java.net.InetAddress informationProviderAddress,
                                       int informationProviderPort,
                                       Information informationOfInterest,
                                       byte[] data)
                                throws InformationRetrieveException
Generic method to receive some Information from a specified ExternalInformationPort component, sending the bypassed data.

If communication channel isn't safe, but transmitted data is sensitive, cryptographic measures (like authentication and encryption) should be applied.

Specified by:
getInformation in interface ExternalInformationPortInterface
Parameters:
informationProviderAddress - Address of the ExternalInformationPort component to receive data from.
informationProviderPort - Port the ExternalInformationPort component to receive data from runs on.
informationOfInterest - Type of Information, that shall be received.
data - Data to be transmitted.
Returns:
The requested Information .
Throws:
InformationRetrieveException - Thrown, when requested Information not available.

getInformationFromAll

public java.lang.Object[] getInformationFromAll(java.net.InetAddress informationProviderAddress,
                                                int informationProviderPort,
                                                Information informationOfInterest)
                                         throws InformationRetrieveException
Generic method to receive some Information from several ExternalInformationPort components. The first component's address and port number must be specified. The other components addresses are received by their predecessor (= telescope implementation).

If communication channel isn't safe, but transmitted data is sensitive, cryptographic measures (like authentication and encryption) should be applied.

Specified by:
getInformationFromAll in interface ExternalInformationPortInterface
Parameters:
informationProviderAddress - Address of the InformationProvider -component to receive data from.
informationProviderPort - Port the InformationProvider -component to receive data from runs on.
informationOfInterest - Type of Information, that shall be received.
Returns:
The requested Information s.
Throws:
InformationRetrieveException - Thrown, when requested Information not available.

getInformationFromAll

public java.lang.Object[] getInformationFromAll(java.net.InetAddress informationProviderAddress,
                                                int informationProviderPort,
                                                Information informationOfInterest,
                                                byte[] data)
                                         throws InformationRetrieveException
Generic method to receive some Information from several ExternalInformationPort components, sending the bypassed data. The first component's address and port number must be specified. The other components' addresses are received by their predecessor (= telescope implementation).

If communication channel isn't safe, but transmitted data is sensitive, cryptographic measures (like authentication and encryption) should be applied.

Specified by:
getInformationFromAll in interface ExternalInformationPortInterface
Parameters:
informationProviderAddress - Address of the InformationProvider component to receive data from.
informationProviderPort - Port the InformationProvider component to receive data from runs on.
informationOfInterest - Type of Information, that shall be received.
data - Data to be transmitted.
Returns:
The requested Information s.
Throws:
InformationRetrieveException - Thrown, when requested Information not available.

acceptRequests

public void acceptRequests()
Make component start listening for requests (on communication channel).

Specified by:
acceptRequests in interface ExternalInformationPortInterface