APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.jca

public Class Providers

extends Object
Class Inheritance
Imports
java.security.Provider, sun.security.x509.AlgorithmId

Collection of methods to get and set provider list. Also includes special code for the provider list during JAR verification.
Author
Andreas Sterbenz
Since
1.5

Field Summary

Modifier and TypeField and Description
private static final String[]
private static volatile ProviderList
private static final ThreadLocal<ProviderList>
private static volatile int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static synchronized ProviderList
beginThreadProviderList(ProviderList list)

Methods to manipulate the thread local provider list.

private static void
private static void
clearCachedValues()

Clears the cached provider-list-specific values.

public static synchronized void
public static ProviderList
getFullProviderList()

Get the full provider list with invalid providers (those that could not be loaded) removed.

public static ProviderList
getProviderList()

Return the current ProviderList.

public static Provider
private static ProviderList
public static ProviderList
public static void
setProviderList(ProviderList newList)

Set the current ProviderList.

private static void
public static Object
startJarVerification()

Start JAR verification.

public static void
stopJarVerification(Object obj)

Stop JAR verification.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jarVerificationProvidersback to summary
private static final String[] jarVerificationProviders
providerListback to summary
private static volatile ProviderList providerList
threadListsback to summary
private static final ThreadLocal<ProviderList> threadLists
threadListsUsedback to summary
private static volatile int threadListsUsed

Constructor Detail

Providersback to summary
private Providers()

Method Detail

beginThreadProviderListback to summary
public static synchronized ProviderList beginThreadProviderList(ProviderList list)

Methods to manipulate the thread local provider list. It is for use by JAR verification (see above). It should be used as follows: ProviderList list = ...; ProviderList oldList = Providers.beginThreadProviderList(list); try { // code that needs thread local provider list } finally { Providers.endThreadProviderList(oldList); }

changeThreadProviderListback to summary
private static void changeThreadProviderList(ProviderList list)
clearCachedValuesback to summary
private static void clearCachedValues()

Clears the cached provider-list-specific values. These values need to be re-generated whenever provider list is changed. The logic for generating them is in the respective classes.

endThreadProviderListback to summary
public static synchronized void endThreadProviderList(ProviderList list)
getFullProviderListback to summary
public static ProviderList getFullProviderList()

Get the full provider list with invalid providers (those that could not be loaded) removed. This is the list we need to present to applications.

getProviderListback to summary
public static ProviderList getProviderList()

Return the current ProviderList. If the thread-local list is set, it is returned. Otherwise, the system-wide list is returned.

getSunProviderback to summary
public static Provider getSunProvider()
getSystemProviderListback to summary
private static ProviderList getSystemProviderList()
getThreadProviderListback to summary
public static ProviderList getThreadProviderList()
setProviderListback to summary
public static void setProviderList(ProviderList newList)

Set the current ProviderList. Affects the thread-local list if set, otherwise the system-wide list.

setSystemProviderListback to summary
private static void setSystemProviderList(ProviderList list)
startJarVerificationback to summary
public static Object startJarVerification()

Start JAR verification. This sets a special provider list for the current thread. You MUST save the return value from this method, and you MUST call stopJarVerification() with that object once you are done.

stopJarVerificationback to summary
public static void stopJarVerification(Object obj)

Stop JAR verification. Call once you have completed JAR verification.