public class ThreadLocalCrypto<CryptoFunction> extends Object
ThreadLocal to cache calls to ThreadLocalCrypto.Factory.getInstance().| Modifier and Type | Class and Description |
|---|---|
static interface |
ThreadLocalCrypto.Factory<CryptoFunction>
Factory to create instances of crypto functions.
|
| Constructor and Description |
|---|
ThreadLocalCrypto(ThreadLocalCrypto.Factory<CryptoFunction> factory)
Create thread local crypto function.
|
| Modifier and Type | Method and Description |
|---|---|
CryptoFunction |
current()
Get "thread local" instance of crypto function.
|
CryptoFunction |
currentWithCause()
Get "thread local" instance of crypto function.
|
GeneralSecurityException |
getCause()
Get the failure of the initial try to instantiate the crypto function for
the provided factory.
|
boolean |
isSupported()
Check, if crypto function is supported by the java-vm.
|
public ThreadLocalCrypto(ThreadLocalCrypto.Factory<CryptoFunction> factory)
getCause(). Use isSupported() to
check, if the java-vm supports the crypto function.factory - factory to create instances of the crypto function.ThreadLocalCipher,
ThreadLocalMac,
ThreadLocalMessageDigestpublic CryptoFunction current()
null, if crypto function
is not supported by the java-vm.public CryptoFunction currentWithCause() throws GeneralSecurityException
GeneralSecurityException - if crypto function is not supported by
the java-vm.public final boolean isSupported()
true, if crypto function is supported by the java-vm.public final GeneralSecurityException getCause()
null, if no failure occurred.Copyright © 2023 Eclipse Foundation. All rights reserved.