client
Class Client

java.lang.Object
  extended by client.Client
All Implemented Interfaces:
ClientInterface

public final class Client
extends java.lang.Object
implements ClientInterface

The Client used to anonymize data (e. g. from a user's application) via a cascade of mixes. Follows the "everything is a stream" concept. See architectureInterfaces.ClientInterface. From a user perspective, this Client behaves quite equal to a socket (java.net.Socket) and therefore abstracts from the underlying technique.

Author:
Karl-Peter Fuchs

Constructor Summary
Client()
          Creates a new Client which receives the keys (to encrypt messages) from the cascade's mixes automatically.
Client(java.security.Key[] publicKeysOfMixes)
          Creates a new Client which uses the bypassed keys to encrypt messages.
 
Method Summary
 void connect()
          Connects client to the mix cascade, specified in property file.
 void disconnect()
          Disconnects client from mix cascade.
 client.ClientInputStream getInputStream()
          Returns an InputStream that can be used to receive data anonymously.
 client.ClientOutputStream getOutputStream()
          Returns an OutputStream that can be used to send data anonymously.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Client

public Client(java.security.Key[] publicKeysOfMixes)
Creates a new Client which uses the bypassed keys to encrypt messages.

Parameters:
publicKeysOfMixes - Public keys of the cascade's mixes (used to encrypt messages).

Client

public Client()
Creates a new Client which receives the keys (to encrypt messages) from the cascade's mixes automatically.

Method Detail

getInputStream

public client.ClientInputStream getInputStream()
Returns an InputStream that can be used to receive data anonymously.

Specified by:
getInputStream in interface ClientInterface
Returns:
InputStream that can be used to receive data anonymously.
Throws:
java.io.IOException - I/O problem occurred.

getOutputStream

public client.ClientOutputStream getOutputStream()
Returns an OutputStream that can be used to send data anonymously.

Specified by:
getOutputStream in interface ClientInterface
Returns:
OutputStream that can be used to send data anonymously.
Throws:
java.io.IOException - I/O problem occurred.

connect

public void connect()
             throws java.io.IOException
Connects client to the mix cascade, specified in property file.

Specified by:
connect in interface ClientInterface
Throws:
java.io.IOException - I/O problem occurred.

disconnect

public void disconnect()
                throws java.io.IOException
Disconnects client from mix cascade.

Specified by:
disconnect in interface ClientInterface
Throws:
java.io.IOException - I/O problem occurred.