|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclient.Client
public final class Client
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.
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. |
ClientInputStream |
getInputStream()
Returns an InputStream that can be used to receive data
anonymously. |
ClientOutputStream |
getOutputStream()
Returns an OutputStream that can be used to send data
anonymously. |
protected void |
putInSendBuffer(byte[] data)
Adds the bypassed data to the sendBuffer (from where it
gets transmitted to the mix cascade by CascadeInputOutputHandler
). |
protected byte[] |
receiveDataFromCascade(int amoutOfDataNeeded)
Tries to read amoutOfDataNeeded bytes from the mix cascade. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Client(java.security.Key[] publicKeysOfMixes)
Client
which uses the bypassed keys to
encrypt messages.
publicKeysOfMixes
- Public keys of the cascade's mixes
(used to encrypt messages).public Client()
Client
which receives the keys (to encrypt
messages) from the cascade's mixes automatically.
Method Detail |
---|
public ClientInputStream getInputStream()
InputStream
that can be used to receive data
anonymously.
getInputStream
in interface ClientInterface
InputStream
that can be used to receive data
anonymously.
java.io.IOException
- I/O problem occurred.public ClientOutputStream getOutputStream()
OutputStream
that can be used to send data
anonymously.
getOutputStream
in interface ClientInterface
OutputStream
that can be used to send data
anonymously.
java.io.IOException
- I/O problem occurred.public void connect() throws java.io.IOException
connect
in interface ClientInterface
java.io.IOException
- I/O problem occurred.public void disconnect() throws java.io.IOException
disconnect
in interface ClientInterface
java.io.IOException
- I/O problem occurred.protected void putInSendBuffer(byte[] data)
sendBuffer
(from where it
gets transmitted to the mix cascade by CascadeInputOutputHandler
). Blocks until all data is written (if data doesn't fit in
buffer).
data
- Data to be put in sendBuffer
.protected byte[] receiveDataFromCascade(int amoutOfDataNeeded)
amoutOfDataNeeded
bytes from the mix cascade.
Blocks until amoutOfDataNeeded
bytes are available, or
no further data can be expected from the corresponding communication
partner.
amoutOfDataNeeded
- Number of bytes that shall be read.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |