Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}