Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.net
Class TLSWrapper

    java.lang.Object
      org.jivesoftware.openfire.net.TLSWrapper

    public class TLSWrapper

extends Object

Creates and initializes the SSLContext instance to use to secure the plain connection. This class is also responsible for encoding and decoding the encrypted data and place it into the corresponding the `ByteBuffer`.

Author:
  Artur Hefczyc, Hao Chen

Constructor Summary
`TLSWrapper(Connection connection, boolean clientMode, boolean needClientAuth, String remoteServer)`

Method Summary
`void` | `close()` Signals that no more outbound application data will be sent on this TLSHandler.
`void` | `enableLogging(boolean logging)`
`int` | `getAppBuffSize()`
`int` | `getNetBuffSize()`
`TLSStatus` | `getStatus()` Returns the current status for this TLSHandler.
`protected SSLEngine` | `getTlsEngine()`
`boolean` | `isEngineClosed()` Returns whether unwrap(ByteBuffer, ByteBuffer) will accept any more inbound data messages and whether wrap(ByteBuffer, ByteBuffer) will produce any more outbound data messages.
`ByteBuffer` | `unwrap(ByteBuffer net, ByteBuffer app)` Attempts to decode SSL/TLS network data into a subsequence of plaintext application data buffers.
`void` | `wrap(ByteBuffer app, ByteBuffer net)` Attempts to encode a buffer of plaintext application data into TLS network data.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TLSWrapper

    public TLSWrapper(Connection connection,
                      boolean clientMode,
                      boolean needClientAuth,
                      String remoteServer)

Method Detail

### getNetBuffSize

    public int getNetBuffSize()

### getAppBuffSize

    public int getAppBuffSize()

### isEngineClosed

    public boolean isEngineClosed()

  Returns whether unwrap(ByteBuffer, ByteBuffer) will accept any more inbound data messages and whether wrap(ByteBuffer, ByteBuffer) will produce any more outbound data messages.

  Returns:
    true if the TLSHandler will not consume anymore network data and will not produce any anymore network data.

### enableLogging

    public void enableLogging(boolean logging)

### unwrap

    public ByteBuffer unwrap(ByteBuffer net,
                             ByteBuffer app)
                      throws SSLException

  Attempts to decode SSL/TLS network data into a subsequence of plaintext application data buffers. Depending on the state of the TLSWrapper, this method may consume network data without producing any application data (for example, it may consume handshake data.) If this TLSWrapper has not yet started its initial handshake, this method will automatically start the handshake.

  Parameters:
    `net` - a ByteBuffer containing inbound network data
    `app` - a ByteBuffer to hold inbound application data
  Returns:
    a ByteBuffer containing inbound application data
  Throws:
    `SSLException` - A problem was encountered while processing the data that caused the TLSHandler to abort.

### wrap

    public void wrap(ByteBuffer app,
                     ByteBuffer net)
              throws SSLException

  Attempts to encode a buffer of plaintext application data into TLS network data. Depending on the state of the TLSWrapper, this method may produce network data without consuming any application data (for example, it may generate handshake data). If this TLSWrapper has not yet started its initial handshake, this method will automatically start the handshake.

  Parameters:
    `app` - a ByteBuffer containing outbound application data
    `net` - a ByteBuffer to hold outbound network data
  Throws:
    `SSLException` - A problem was encountered while processing the data that caused the TLSWrapper to abort.

### close

    public void close()
               throws SSLException

  Signals that no more outbound application data will be sent on this TLSHandler.

  Throws:
    `SSLException`

### getStatus

    public TLSStatus getStatus()

  Returns the current status for this TLSHandler.

  Returns:
    the current TLSStatus

### getTlsEngine

    protected SSLEngine getTlsEngine()

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.