SSLContext (Apache Tomcat 9.0.121 API Documentation)
Description: declaration: package: org.apache.tomcat.util.net, interface: SSLContext

# Interface SSLContext

All Known Implementing Classes:
  `OpenSSLContext`

public interface SSLContext
This interface is needed to override the default SSLContext class to allow SSL implementation pluggability without having to use JCE. With regular JSSE it will do nothing but delegate to the SSLContext.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SSLEngine`
  `createSSLEngine()`
  Creates a new SSL engine.
  `void`
  `destroy()`
  Destroys this SSL context and releases any associated resources.
  `X509Certificate[]`
  `getAcceptedIssuers()`
  Returns the accepted issuers.
  `X509Certificate[]`
  `getCertificateChain(String alias)`
  Returns the certificate chain for the given alias.
  `SSLSessionContext`
  `getServerSessionContext()`
  Returns the server session context.
  `SSLServerSocketFactory`
  `getServerSocketFactory()`
  Returns the server socket factory.
  `SSLParameters`
  `getSupportedSSLParameters()`
  Returns the supported SSL parameters.
  `void`
  `init(KeyManager[] kms, TrustManager[] tms, SecureRandom sr)`
  Initializes the SSL context with the given key managers, trust managers, and random number generator.

- ## Method Details

  - ### init

    void init(KeyManager[] kms, TrustManager[] tms, SecureRandom sr) throws KeyManagementException
    Initializes the SSL context with the given key managers, trust managers, and random number generator.
    Parameters:
      `kms` - The key managers
      `tms` - The trust managers
      `sr` - The secure random number generator
    Throws:
      `KeyManagementException` - if initialization fails

  - ### destroy

    void destroy()
    Destroys this SSL context and releases any associated resources.

  - ### getServerSessionContext

    SSLSessionContext getServerSessionContext()
    Returns the server session context.
    Returns:
      The server session context

  - ### createSSLEngine

    SSLEngine createSSLEngine()
    Creates a new SSL engine.
    Returns:
      The new SSL engine

  - ### getServerSocketFactory

    SSLServerSocketFactory getServerSocketFactory()
    Returns the server socket factory.
    Returns:
      The server socket factory

  - ### getSupportedSSLParameters

    SSLParameters getSupportedSSLParameters()
    Returns the supported SSL parameters.
    Returns:
      The supported SSL parameters

  - ### getCertificateChain

    X509Certificate[] getCertificateChain(String alias)
    Returns the certificate chain for the given alias.
    Parameters:
      `alias` - The alias
    Returns:
      The certificate chain

  - ### getAcceptedIssuers

    X509Certificate[] getAcceptedIssuers()
    Returns the accepted issuers.
    Returns:
      The accepted issuers