JSSESupport (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.tomcat.util.net.jsse, class: JSSESupport

# Class JSSESupport

java.lang.Object
org.apache.tomcat.util.net.jsse.JSSESupport

All Implemented Interfaces:
  `SSLSessionManager, SSLSupport`

public class JSSESupport extends Object implements SSLSupport, SSLSessionManager
JSSESupport. Concrete implementation class for JSSE Support classes.

- ## Field Summary

  ### Fields inherited from interface SSLSupport

  `CERTIFICATE_KEY, CIPHER_SUITE_KEY, KEY_SIZE_KEY, PROTOCOL_VERSION_KEY, REQUESTED_CIPHERS_KEY, REQUESTED_PROTOCOL_VERSIONS_KEY, SECURE_PROTOCOL_KEY, SESSION_ID_KEY, SESSION_MGR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JSSESupport(SSLSession session, Map<String, List<String>> additionalAttributes)`
  Constructs an instance for the given SSL session.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getCipherSuite()`
  The cipher suite being used on this connection.
  `Integer`
  `getKeySize()`
  Get the key size.
  `X509Certificate[]`
  `getLocalCertificateChain()`
  The server certificate chain (if any) that were sent to the peer.
  `X509Certificate[]`
  `getPeerCertificateChain()`
  The client certificate chain (if any).
  `String`
  `getProtocol()`
  Returns the protocol string indicating how the SSL socket was created e.g.
  `String`
  `getRequestedCiphers()`
  Returns the list of SSL/TLS ciphers requested by the client.
  `String`
  `getRequestedProtocols()`
  Returns the list of SSL/TLS protocol versions requested by the client.
  `String`
  `getSessionId()`
  The current session Id.
  `void`
  `invalidateSession()`
  Invalidate the session this support object is associated with.
  `void`
  `setSession(SSLSession session)`
  Sets the SSL session for this support object.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### JSSESupport

    public JSSESupport(SSLSession session, Map<String, List<String>> additionalAttributes)
    Constructs an instance for the given SSL session.
    Parameters:
      `session` - The SSL session
      `additionalAttributes` - Additional SSL attributes

- ## Method Details

  - ### getCipherSuite

    public String getCipherSuite() throws IOException
    Description copied from interface: `SSLSupport`
    The cipher suite being used on this connection.
    Specified by:
      `getCipherSuite` in interface `SSLSupport`
    Returns:
      The name of the cipher suite as returned by the SSL/TLS implementation
    Throws:
      `IOException` - If an error occurs trying to obtain the cipher suite

  - ### getLocalCertificateChain

    public X509Certificate[] getLocalCertificateChain()
    Description copied from interface: `SSLSupport`
    The server certificate chain (if any) that were sent to the peer.
    Specified by:
      `getLocalCertificateChain` in interface `SSLSupport`
    Returns:
      The certificate chain sent with the server certificate first, followed by those of any certificate authorities

  - ### getPeerCertificateChain

    public X509Certificate[] getPeerCertificateChain() throws IOException
    Description copied from interface: `SSLSupport`
    The client certificate chain (if any).
    Specified by:
      `getPeerCertificateChain` in interface `SSLSupport`
    Returns:
      The certificate chain presented by the client with the peer's certificate first, followed by those of any certificate authorities
    Throws:
      `IOException` - If an error occurs trying to obtain the certificate chain

  - ### getKeySize

    public Integer getKeySize() throws IOException
    Get the key size. What we're supposed to put here is ill-defined by the Servlet spec (S 4.7 again). There are at least 4 potential values that might go here: (a) The size of the encryption key (b) The size of the MAC key (c) The size of the key-exchange key (d) The size of the signature key used by the server Unfortunately, all of these values are nonsensical.

    This returns the effective bits for the current cipher suite.

    Specified by:
      `getKeySize` in interface `SSLSupport`
    Returns:
      The effective key size for the current cipher suite
    Throws:
      `IOException` - If an error occurs trying to obtain the key size

  - ### getSessionId

    public String getSessionId() throws IOException
    Description copied from interface: `SSLSupport`
    The current session Id.
    Specified by:
      `getSessionId` in interface `SSLSupport`
    Returns:
      The current SSL/TLS session ID
    Throws:
      `IOException` - If an error occurs trying to obtain the session ID

  - ### setSession

    public void setSession(SSLSession session)
    Sets the SSL session for this support object.
    Parameters:
      `session` - The SSL session

  - ### invalidateSession

    public void invalidateSession()
    Invalidate the session this support object is associated with.
    Specified by:
      `invalidateSession` in interface `SSLSessionManager`

  - ### getProtocol

    public String getProtocol() throws IOException
    Description copied from interface: `SSLSupport`
    Returns the protocol string indicating how the SSL socket was created e.g. TLSv1 or TLSv1.2 etc.
    Specified by:
      `getProtocol` in interface `SSLSupport`
    Returns:
      the protocol string
    Throws:
      `IOException` - If an error occurs trying to obtain the protocol information from the socket

  - ### getRequestedProtocols

    public String getRequestedProtocols() throws IOException
    Description copied from interface: `SSLSupport`
    Returns the list of SSL/TLS protocol versions requested by the client.
    Specified by:
      `getRequestedProtocols` in interface `SSLSupport`
    Returns:
      the list of requested protocols
    Throws:
      `IOException` - If an error occurs trying to obtain the client requested protocol information from the socket

  - ### getRequestedCiphers

    public String getRequestedCiphers() throws IOException
    Description copied from interface: `SSLSupport`
    Returns the list of SSL/TLS ciphers requested by the client.
    Specified by:
      `getRequestedCiphers` in interface `SSLSupport`
    Returns:
      the list of requested ciphers
    Throws:
      `IOException` - If an error occurs trying to obtain the client request cipher information from the socket