
public class ClearTextCipher extends Object implements SocketCipher
| Constructor and Description |
|---|
ClearTextCipher() |
| Modifier and Type | Method and Description |
|---|---|
SocketCipher |
acceptedSocket(Socket sock)
Used to set the socket, specially to add the accepted socket.
|
Socket |
createClientSocket(InetAddress host,
int port)
Create and connect a
Socket. |
ServerSocket |
createServerSocket(int port,
int backlog,
InetAddress ifAddress)
Create a
ServerSocket. |
Message |
readMessage()
Read the next message in the socket.
|
boolean |
sendMessage(Message m)
Marshalls, ciphers and sends the message.
|
boolean |
setup(Properties props)
Set up the Cipher with the properties.
|
public boolean setup(Properties props)
setup in interface SocketCipherpublic ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException
ServerSocket.createServerSocket in interface SocketCipherport - the port to listen to.backlog - the number of allowed pending connections.ifAddress - the address to which to bind.IOExceptionServerSocketFactory.createServerSocket(int, int, InetAddress)public SocketCipher acceptedSocket(Socket sock)
acceptedSocket in interface SocketCipherpublic Socket createClientSocket(InetAddress host, int port) throws IOException
Socket. Automatically
sets the Socket.createClientSocket in interface SocketCipherhost - The address of the server.port - The port of the server.IOExceptionSocketFactory.createSocket(InetAddress, int)public boolean sendMessage(Message m) throws org.bouncycastle.crypto.CryptoException, IOException
sendMessage in interface SocketCipherm - message to be sent.org.bouncycastle.crypto.CryptoExceptionEOFException - This means the underlying socket is closed.IOExceptionpublic Message readMessage() throws org.bouncycastle.crypto.CryptoException, IOException
readMessage in interface SocketCipherorg.bouncycastle.crypto.CryptoExceptionEOFException - This means the underlying socket is closed.IOExceptionCopyright © 2018 universAAL Consortium. All rights reserved.