public class SecurityProviderTestSupport extends Object
One major feature is the ability to check and load the Bouncy Castle security provider for tests which require advanced crypto capabilities, and unload it afterwards, if it wasn't loaded originally. The goal of this is to preserve the pre-test condition of whether BC was originally loaded or not, so we don't muck with the environment of JVM in which the tests are running. For example, the JVM may actually have been configured with BC deliberately, so we don't want to unload it by mistake.
| Modifier and Type | Field and Description |
|---|---|
static String |
BC_PROVIDER_NAME |
private boolean |
hadBCOriginally |
static String |
SUNEC_PROVIDER_NAME |
| Constructor and Description |
|---|
SecurityProviderTestSupport() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
haveBC()
Return whether the Bouncy Castle provider is currently available.
|
boolean |
haveSunEC()
Return whether the SunEC provider is currently available.
|
boolean |
isOpenJDK()
Determine if we're running on OpenJDK.
|
void |
loadBC()
Conditionally load the Bouncy Castle provider, if it isn't already loaded.
|
void |
unloadBC()
Conditionally unload the Bouncy Castle provider, if it wasn't loaded originally (outside of this class),
and if it is currently loaded.
|
public static final String BC_PROVIDER_NAME
public static final String SUNEC_PROVIDER_NAME
private boolean hadBCOriginally
public void loadBC()
public void unloadBC()
public boolean haveBC()
public boolean haveSunEC()
public boolean isOpenJDK()
Copyright © 1999–2020 Shibboleth Consortium. All rights reserved.