Package io.github.rhusar.securenio.channels


package io.github.rhusar.securenio.channels
Secure NIO channel decorators that transparently add TLS and DTLS encryption to standard 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