public interface SocketCipher
setup(Properties)
to set it up. Then one of
createClientSocket(InetAddress, int)
or
createServerSocket(int, int, InetAddress)
. Followed by
any number of calls for sendMessage(Message)
or
readMessage()
.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.
|
boolean setup(Properties props)
props
- ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException
ServerSocket
.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)
SocketCipher acceptedSocket(Socket sock)
sock
- Socket createClientSocket(InetAddress host, int port) throws IOException
Socket
. Automatically
sets the Socket
.host
- The address of the server.port
- The port of the server.IOException
SocketFactory.createSocket(InetAddress, int)
boolean sendMessage(Message m) throws org.bouncycastle.crypto.CryptoException, IOException
m
- message to be sent.org.bouncycastle.crypto.CryptoException
EOFException
- This means the underlying socket is closed.IOException
Message readMessage() throws org.bouncycastle.crypto.CryptoException, IOException
org.bouncycastle.crypto.CryptoException
EOFException
- This means the underlying socket is closed.IOException
Copyright © 2018 universAAL Consortium. All rights reserved.