Java tutorial
//package com.java2s; //License from project: GNU General Public License import java.security.*; public class Main { protected static boolean initProvider(String providerName, String className) { try { Provider provider = Security.getProvider(providerName); if (provider == null) { @SuppressWarnings("rawtypes") Class clazz = Class.forName(className); provider = (Provider) clazz.newInstance(); Security.addProvider(provider); } return true; } catch (Throwable ignored) { } return false; } }