Class ThreadLocalX509CredentialContext


  • public final class ThreadLocalX509CredentialContext
    extends Object
    Class which holds and makes available an instance of X509Credential via ThreadLocal storage, typically used for client TLS authentication via ThreadLocalX509CredentialKeyManager.
    • Field Detail

      • currentCredential

        private static ThreadLocal<org.opensaml.security.x509.X509Credential> currentCredential
        ThreadLocal storage for credential.
    • Constructor Detail

      • ThreadLocalX509CredentialContext

        private ThreadLocalX509CredentialContext()
        Constructor.
    • Method Detail

      • loadCurrent

        public static void loadCurrent​(@Nonnull
                                       org.opensaml.security.x509.X509Credential credential)
        Load the thread-local storage with the current credential.
        Parameters:
        credential - the current X509Credential
      • 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 a non-null value.
        Returns:
        true if thread-local has a value, false otherwise
      • getCredential

        @Nullable
        public static org.opensaml.security.x509.X509Credential getCredential()
        Return the current thread-local X509Credential.
        Returns:
        the current response