Class ThreadLocalX509TrustEngineContext


  • public final class ThreadLocalX509TrustEngineContext
    extends Object
    Class which holds and makes available instances of TrustEngine<? super X509Credential> and CriteriaSet via ThreadLocal storage, typically used for server TLS authentication via ThreadLocalX509TrustManager.
    • Constructor Detail

      • ThreadLocalX509TrustEngineContext

        private ThreadLocalX509TrustEngineContext()
        Constructor.
    • Method Detail

      • loadCurrent

        public static void loadCurrent​(@Nonnull
                                       org.opensaml.security.trust.TrustEngine<? super org.opensaml.security.x509.X509Credential> trustEngine,
                                       @Nonnull
                                       net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria,
                                       @Nullable
                                       Boolean fatal)
        Load the thread-local storage with the current credential.
        Parameters:
        trustEngine - the current trust engine
        criteria - the current criteria
        fatal - whether trust engine evaluation failure should be treated as fatal. Defaults to true.
      • clearCurrent

        public static void clearCurrent()
        Clear the current thread-local credential.
      • haveCurrent

        public static boolean haveCurrent()
        Get whether the current thread-local is populated with non-null data.
        Returns:
        true if thread-local has non-null data, false otherwise
      • getTrustEngine

        @Nullable
        public static org.opensaml.security.trust.TrustEngine<? super org.opensaml.security.x509.X509Credential> getTrustEngine()
        Return the current thread-local trust engine instance.
        Returns:
        the current trust engine
      • getCriteria

        @Nullable
        public static net.shibboleth.utilities.java.support.resolver.CriteriaSet getCriteria()
        Return the current thread-local criteria instance.
        Returns:
        the current criteria
      • isFailureFatal

        @Nonnull
        public static Boolean isFailureFatal()
        Return whether failure of server TLS is to be treated as fatal.
        Returns:
        true if fatal, false if not
      • getTrusted

        @Nullable
        public static Boolean getTrusted()
        Return the current thread-local trust evaluation data.
        Returns:
        the current trust evaluation data
      • setTrusted

        public static void setTrusted​(@Nullable
                                      Boolean trusted)
        Set the current thread-local trust evaluation data.
        Parameters:
        trusted - the current trust evaluation data