AbstractTlsPeer (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.crypto.tls

## Class AbstractTlsPeer

- java.lang.Object
- - org.bouncycastle.crypto.tls.AbstractTlsPeer

- All Implemented Interfaces:
    TlsPeer
  Direct Known Subclasses:
    AbstractTlsClient, AbstractTlsServer

      public abstract class AbstractTlsPeer
      extends java.lang.Object
      implements TlsPeer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTlsPeer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `notifyAlertRaised(short alertLevel, short alertDescription, java.lang.String message, java.lang.Throwable cause)` This method will be called when an alert is raised by the protocol.
    `void` | `notifyAlertReceived(short alertLevel, short alertDescription)` This method will be called when an alert is received from the remote peer.
    `void` | `notifyHandshakeComplete()` Notifies the peer that the handshake has been successfully completed.
    `void` | `notifySecureRenegotiation(boolean secureRenegotiation)`
    `boolean` | `shouldUseGMTUnixTime()` draft-mathewson-no-gmtunixtime-00 2.

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

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

    - ### Methods inherited from interface org.bouncycastle.crypto.tls.TlsPeer

      `getCipher, getCompression`

- - ### Constructor Detail

    - #### AbstractTlsPeer

          public AbstractTlsPeer()

  - ### Method Detail

    - #### shouldUseGMTUnixTime

          public boolean shouldUseGMTUnixTime()

      Description copied from interface: `TlsPeer`
      draft-mathewson-no-gmtunixtime-00 2. "If existing users of a TLS implementation may rely on gmt_unix_time containing the current time, we recommend that implementors MAY provide the ability to set gmt_unix_time as an option only, off by default."
      Specified by:
        `shouldUseGMTUnixTime` in interface `TlsPeer`
      Returns:
        `true` if the current time should be used in the gmt_unix_time field of Random, or `false` if gmt_unix_time should contain a cryptographically random value.

    - #### notifySecureRenegotiation

          public void notifySecureRenegotiation(boolean secureRenegotiation)
                                         throws java.io.IOException

      Specified by:
        `notifySecureRenegotiation` in interface `TlsPeer`
      Throws:
        `java.io.IOException`

    - #### notifyAlertRaised

          public void notifyAlertRaised(short alertLevel,
                               short alertDescription,
                               java.lang.String message,
                               java.lang.Throwable cause)

      Description copied from interface: `TlsPeer`
      This method will be called when an alert is raised by the protocol.
      Specified by:
        `notifyAlertRaised` in interface `TlsPeer`
      Parameters:
        `alertLevel` - `AlertLevel`
        `alertDescription` - `AlertDescription`
        `message` - A human-readable message explaining what caused this alert. May be null.
        `cause` - The `Throwable` that caused this alert to be raised. May be null.

    - #### notifyAlertReceived

          public void notifyAlertReceived(short alertLevel,
                                 short alertDescription)

      Description copied from interface: `TlsPeer`
      This method will be called when an alert is received from the remote peer.
      Specified by:
        `notifyAlertReceived` in interface `TlsPeer`
      Parameters:
        `alertLevel` - `AlertLevel`
        `alertDescription` - `AlertDescription`

    - #### notifyHandshakeComplete

          public void notifyHandshakeComplete()
                                       throws java.io.IOException

      Description copied from interface: `TlsPeer`
      Notifies the peer that the handshake has been successfully completed.
      Specified by:
        `notifyHandshakeComplete` in interface `TlsPeer`
      Throws:
        `java.io.IOException`