Yes, this is highly desirable, but unfortunately we haven't time to do it for
J2SE 1.4. This, or something like it, will be considered for a future release.
-- mr@eng 2001/8/23
This is definately on the radar for tiger.
In JSSE 1.0.x and JSSE in JDK 1.4.x, the SSLContext class is
responsible for generating communication sockets that transparently use
SSL/TLS as a secure/reliable data transport mechanism. Application
data written to a SSLSocket is encrypted and integrity protected before
being sent over an unsecured channel.
We update this model by creating a javax.net.ssl.SSLEngine class. The
primary distinction of an SSLEngine is that the SSLEngine removes all
I/O handling and simply operates on the inbound and outbound byte
streams. The SSLEngine user is responsible for arranging reliable
I/O transport. By separating the SSL/TLS abstraction from the I/O
method, the SSLEngine can be used for a variety of I/O types:
non-blocking I/O (polling), selectable non-blocking I/O,
Sockets-Input/OutputStream's, local ByteBuffers/byte arrays, etc.
If developers feel they have a better I/O heuristic for an
SSLSocket implementation (say using SocketChannels and a pool of worker
threads), they are free to create their own SSLSocket/SSLSocketFactory
implementations and register it with the JSSE framework.