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 SocketCipher
public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException
ServerSocket
.createServerSocket
in interface SocketCipher
port
- the port to listen to.backlog
- the number of allowed pending connections.ifAddress
- the address to which to bind.IOException
ServerSocketFactory.createServerSocket(int, int, InetAddress)
public SocketCipher acceptedSocket(Socket sock)
acceptedSocket
in interface SocketCipher
public Socket createClientSocket(InetAddress host, int port) throws IOException
Socket
. Automatically
sets the Socket
.createClientSocket
in interface SocketCipher
host
- The address of the server.port
- The port of the server.IOException
SocketFactory.createSocket(InetAddress, int)
public boolean sendMessage(Message m) throws org.bouncycastle.crypto.CryptoException, IOException
sendMessage
in interface SocketCipher
m
- message to be sent.org.bouncycastle.crypto.CryptoException
EOFException
- This means the underlying socket is closed.IOException
public Message readMessage() throws org.bouncycastle.crypto.CryptoException, IOException
readMessage
in interface SocketCipher
org.bouncycastle.crypto.CryptoException
EOFException
- This means the underlying socket is closed.IOException
Copyright © 2018 universAAL Consortium. All rights reserved.