* be a subclass of <code>java.security.Provider</code>
*
* @return Returns the actual name of the provider that was loaded
*/
public static String appendJceProvider(String name, String className) {
Provider currentProvider = Security.getProvider(name);
if (currentProvider == null) {
try {
Class<? extends Provider> clazz = Loader.loadClass(className, false, Provider.class);
Provider provider = clazz.newInstance();
int ret = Security.addProvider(provider);
if (LOG.isDebugEnabled()) {
LOG.debug(
"The provider " + provider.getName()
+ " was added at position: " + ret
);
}
return provider.getName();
} catch (Throwable t) {
if (LOG.isDebugEnabled()) {
LOG.debug("The provider " + name + " could not be added: " + t.getMessage(), t);
}
return null;