Package io.github.rhusar.securenio.channels
java.nio.channels types.
The package provides drop-in replacements for the plain NIO channels:
SecureSocketChannel wraps a
SocketChannel with TLS,
SecureServerSocketChannel wraps a
ServerSocketChannel and accepts TLS-secured connections, and
SecureDatagramChannel wraps a
DatagramChannel with DTLS. All cryptographic operations are driven by a
SSLEngine internally; application code reads and writes plaintext through the
familiar channel API while encrypted records flow over the underlying raw channel.
The secure channels support non-blocking mode only and are designed to be driven by a
Selector. Since a secure channel cannot itself be registered with a
selector, the underlying raw channel is registered instead, with the secure channel attached to the
resulting SelectionKey; alternatively, the
io.github.rhusar.securenio.channels.spi package provides a selector that accepts secure
channel registrations directly and performs this delegation automatically.
- Author:
- Radoslav Husar
-
ClassesClassDescriptionA
DatagramChanneldecorator that transparently wraps a raw channel with DTLS encryption and decryption.AServerSocketChanneldecorator that wraps a raw server socket channel, producingSecureSocketChannelinstances for each accepted connection.ASocketChanneldecorator that transparently wraps a raw channel with TLS/SSL encryption and decryption.