Class ThreadLocalX509CredentialContext
java.lang.Object
org.opensaml.security.x509.tls.impl.ThreadLocalX509CredentialContext
Class which holds and makes available an instance of
X509Credential via ThreadLocal storage,
typically used for client TLS authentication via ThreadLocalX509CredentialKeyManager.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ThreadLocal<X509Credential>ThreadLocal storage for credential. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear the current thread-local credential.static X509CredentialReturn the current thread-localX509Credential.static booleanGet whether the current thread-local is populated with a non-null value.static voidloadCurrent(X509Credential credential) Load the thread-local storage with the current credential.
-
Field Details
-
currentCredential
ThreadLocal storage for credential.
-
-
Constructor Details
-
ThreadLocalX509CredentialContext
private ThreadLocalX509CredentialContext()Constructor.
-
-
Method Details
-
loadCurrent
Load the thread-local storage with the current credential.- Parameters:
credential- the currentX509Credential
-
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
Return the current thread-localX509Credential.- Returns:
- the current response
-