Class ThreadLocalX509CredentialContext
- java.lang.Object
-
- org.opensaml.security.x509.tls.impl.ThreadLocalX509CredentialContext
-
public final class ThreadLocalX509CredentialContext extends Object
Class which holds and makes available an instance ofX509Credentialvia ThreadLocal storage, typically used for client TLS authentication viaThreadLocalX509CredentialKeyManager.
-
-
Field Summary
Fields Modifier and Type Field Description private static ThreadLocal<X509Credential>currentCredentialThreadLocal storage for credential.
-
Constructor Summary
Constructors Modifier Constructor Description privateThreadLocalX509CredentialContext()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearCurrent()Clear the current thread-local credential.static X509CredentialgetCredential()Return the current thread-localX509Credential.static booleanhaveCurrent()Get 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 Detail
-
currentCredential
private static ThreadLocal<X509Credential> currentCredential
ThreadLocal storage for credential.
-
-
Method Detail
-
loadCurrent
public static void loadCurrent(@Nonnull X509Credential credential)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
@Nullable public static X509Credential getCredential()
Return the current thread-localX509Credential.- Returns:
- the current response
-
-