Package tigase.io

## Class JcaTLSWrapper

- java.lang.Object
- - tigase.io.JcaTLSWrapper

- All Implemented Interfaces:
    `TLSWrapper`

      public class JcaTLSWrapper
      extends java.lang.Object
      implements TLSWrapper

  Describe class TLSWrapper here.
  Created: Sat Mar 5 09:13:29 2005
  Author:
    Artur Hefczyc

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JcaTLSWrapper​(javax.net.ssl.SSLContext sslc, TLSEventHandler eventHandler, java.lang.String hostname, int port, boolean clientMode, boolean wantClientAuth)` |
    `JcaTLSWrapper​(javax.net.ssl.SSLContext sslc, TLSEventHandler eventHandler, java.lang.String hostname, int port, boolean clientMode, boolean wantClientAuth, boolean needClientAuth)` | Creates a new `TLSWrapper` instance.
    `JcaTLSWrapper​(javax.net.ssl.SSLContext sslc, TLSEventHandler eventHandler, java.lang.String remote_hostname, int port, boolean clientMode, boolean wantClientAuth, boolean needClientAuth, java.lang.String[] enabledCiphers, java.lang.String[] enabledProtocols)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `bytesConsumed()` |
    `void` | `close()` |
    `int` | `getAppBuffSize()` |
    `CertCheckResult` | `getCertificateStatus​(boolean revocationEnabled, SSLContextContainerIfc sslContextContainer)` |
    `javax.net.ssl.SSLEngineResult.HandshakeStatus` | `getHandshakeStatus()` |
    `java.security.cert.Certificate[]` | `getLocalCertificates()` |
    `int` | `getNetBuffSize()` |
    `int` | `getPacketBuffSize()` |
    `java.security.cert.Certificate[]` | `getPeerCertificates()` |
    `TLSStatus` | `getStatus()` |
    `byte[]` | `getTlsUniqueBindingData()` |
    `boolean` | `isClientMode()` |
    `boolean` | `isNeedClientAuth()` |
    `void` | `notifyIfHandshakeFinished()` |
    `void` | `setDebugId​(java.lang.String id)` |
    `protected void` | `tlsEngineHandshakeCompleted()` |
    `java.lang.String` | `toString()` |
    `java.nio.ByteBuffer` | `unwrap​(java.nio.ByteBuffer net, java.nio.ByteBuffer app)` |
    `boolean` | `wantClientAuth()` |
    `void` | `wrap​(java.nio.ByteBuffer app, java.nio.ByteBuffer net)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JcaTLSWrapper

          public JcaTLSWrapper​(javax.net.ssl.SSLContext sslc,
                               TLSEventHandler eventHandler,
                               java.lang.String hostname,
                               int port,
                               boolean clientMode,
                               boolean wantClientAuth)

    - #### JcaTLSWrapper

          public JcaTLSWrapper​(javax.net.ssl.SSLContext sslc,
                               TLSEventHandler eventHandler,
                               java.lang.String hostname,
                               int port,
                               boolean clientMode,
                               boolean wantClientAuth,
                               boolean needClientAuth)

      Creates a new `TLSWrapper` instance.

    - #### JcaTLSWrapper

          public JcaTLSWrapper​(javax.net.ssl.SSLContext sslc,
                               TLSEventHandler eventHandler,
                               java.lang.String remote_hostname,
                               int port,
                               boolean clientMode,
                               boolean wantClientAuth,
                               boolean needClientAuth,
                               java.lang.String[] enabledCiphers,
                               java.lang.String[] enabledProtocols)

  - ### Method Detail

    - #### tlsEngineHandshakeCompleted

          protected void tlsEngineHandshakeCompleted()

    - #### notifyIfHandshakeFinished

          public void notifyIfHandshakeFinished()

      Specified by:
        `notifyIfHandshakeFinished` in interface `TLSWrapper`

    - #### bytesConsumed

          public int bytesConsumed()

      Specified by:
        `bytesConsumed` in interface `TLSWrapper`

    - #### close

          public void close()
                     throws javax.net.ssl.SSLException

      Specified by:
        `close` in interface `TLSWrapper`
      Throws:
        `javax.net.ssl.SSLException`

    - #### getAppBuffSize

          public int getAppBuffSize()

      Specified by:
        `getAppBuffSize` in interface `TLSWrapper`

    - #### getCertificateStatus

          public CertCheckResult getCertificateStatus​(boolean revocationEnabled,
                                                      SSLContextContainerIfc sslContextContainer)

      Specified by:
        `getCertificateStatus` in interface `TLSWrapper`

    - #### getHandshakeStatus

          public javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus()

      Specified by:
        `getHandshakeStatus` in interface `TLSWrapper`

    - #### getLocalCertificates

          public java.security.cert.Certificate[] getLocalCertificates()

      Specified by:
        `getLocalCertificates` in interface `TLSWrapper`

    - #### getNetBuffSize

          public int getNetBuffSize()

      Specified by:
        `getNetBuffSize` in interface `TLSWrapper`

    - #### getPacketBuffSize

          public int getPacketBuffSize()

      Specified by:
        `getPacketBuffSize` in interface `TLSWrapper`

    - #### getPeerCertificates

          public java.security.cert.Certificate[] getPeerCertificates()
                                                               throws javax.net.ssl.SSLPeerUnverifiedException

      Specified by:
        `getPeerCertificates` in interface `TLSWrapper`
      Throws:
        `javax.net.ssl.SSLPeerUnverifiedException`

    - #### getStatus

          public TLSStatus getStatus()

      Specified by:
        `getStatus` in interface `TLSWrapper`

    - #### getTlsUniqueBindingData

          public byte[] getTlsUniqueBindingData()

      Specified by:
        `getTlsUniqueBindingData` in interface `TLSWrapper`

    - #### isClientMode

          public boolean isClientMode()

      Specified by:
        `isClientMode` in interface `TLSWrapper`

    - #### isNeedClientAuth

          public boolean isNeedClientAuth()

      Specified by:
        `isNeedClientAuth` in interface `TLSWrapper`

    - #### setDebugId

          public void setDebugId​(java.lang.String id)

      Specified by:
        `setDebugId` in interface `TLSWrapper`

    - #### unwrap

          public java.nio.ByteBuffer unwrap​(java.nio.ByteBuffer net,
                                            java.nio.ByteBuffer app)
                                     throws javax.net.ssl.SSLException

      Specified by:
        `unwrap` in interface `TLSWrapper`
      Throws:
        `javax.net.ssl.SSLException`

    - #### wantClientAuth

          public boolean wantClientAuth()

      Specified by:
        `wantClientAuth` in interface `TLSWrapper`

    - #### wrap

          public void wrap​(java.nio.ByteBuffer app,
                           java.nio.ByteBuffer net)
                    throws javax.net.ssl.SSLException

      Specified by:
        `wrap` in interface `TLSWrapper`
      Throws:
        `javax.net.ssl.SSLException`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`