Class OpenSSLLifecycleListener

  • All Implemented Interfaces:
    LifecycleListener

    public class OpenSSLLifecycleListener
    extends java.lang.Object
    implements LifecycleListener
    Implementation of LifecycleListener that will do the global initialization of OpenSSL according to specified configuration parameters. Using the listener is completely optional, but is needed for configuration and full cleanup of a few native memory allocations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.Object lock
      Lock object for OpenSSL initialization.
      protected static StringManager sm
      The string manager for this package.
    • Constructor Summary

      Constructors 
      Constructor Description
      OpenSSLLifecycleListener()
      Constructs an OpenSSLLifecycleListener.
    • Field Detail

      • sm

        protected static final StringManager sm
        The string manager for this package.
      • lock

        protected static final java.lang.Object lock
        Lock object for OpenSSL initialization.
    • Constructor Detail

      • OpenSSLLifecycleListener

        public OpenSSLLifecycleListener()
        Constructs an OpenSSLLifecycleListener.
    • Method Detail

      • isAvailable

        public static boolean isAvailable()
        Checks if OpenSSL is available.
        Returns:
        true if OpenSSL is available
      • getInstalledOpenSslVersion

        public static java.lang.String getInstalledOpenSslVersion()
        Get the installed OpenSSL version string (via FFM), if available.
        Returns:
        the OpenSSL version string (e.g., "OpenSSL 3.2.6 30 Sep 2025"), or null if not available
      • lifecycleEvent

        public void lifecycleEvent​(LifecycleEvent event)
        Primary entry point for startup and shutdown events.
        Specified by:
        lifecycleEvent in interface LifecycleListener
        Parameters:
        event - The event that has occurred
      • getSSLEngine

        public java.lang.String getSSLEngine()
        Returns the SSL engine information.
        Returns:
        The SSL engine string, or null if not available
      • setSSLEngine

        public void setSSLEngine​(java.lang.String SSLEngine)
        Sets the SSL engine.
        Parameters:
        SSLEngine - The SSL engine to use
      • getSSLRandomSeed

        public java.lang.String getSSLRandomSeed()
        Returns the SSL random seed.
        Returns:
        The SSL random seed, or null if not available
      • setSSLRandomSeed

        public void setSSLRandomSeed​(java.lang.String SSLRandomSeed)
        Sets the SSL random seed.
        Parameters:
        SSLRandomSeed - The SSL random seed
      • getFIPSMode

        public java.lang.String getFIPSMode()
        Returns the FIPS mode status.
        Returns:
        The FIPS mode, or null if not available
      • setFIPSMode

        public void setFIPSMode​(java.lang.String FIPSMode)
        Sets the FIPS mode.
        Parameters:
        FIPSMode - The FIPS mode setting
      • isFIPSModeActive

        public boolean isFIPSModeActive()
        Checks if FIPS mode is active.
        Returns:
        true if FIPS mode is active
      • setUseOpenSSL

        public void setUseOpenSSL​(boolean useOpenSSL)
        Sets whether to use OpenSSL.
        Parameters:
        useOpenSSL - true to use OpenSSL
      • getUseOpenSSL

        public static boolean getUseOpenSSL()
        Returns whether OpenSSL should be used.
        Returns:
        true if OpenSSL should be used