sun.security.jgss.krb5.Krb5MechFactory Java Examples

The following examples show how to use sun.security.jgss.krb5.Krb5MechFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SunProvider.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object newInstance(Object ctrParamObj)
    throws NoSuchAlgorithmException {
    String type = getType();
    if (ctrParamObj != null) {
        throw new InvalidParameterException
            ("constructorParameter not used with " + type +
             " engines");
    }
    String algo = getAlgorithm();
    try {
        if (type.equals("GssApiMechanism")) {
            if (algo.equals("1.2.840.113554.1.2.2")) {
                return new Krb5MechFactory();
            } else if (algo.equals("1.3.6.1.5.5.2")) {
                return new SpNegoMechFactory();
            }
        }
    } catch (Exception ex) {
        throw new NoSuchAlgorithmException
            ("Error constructing " + type + " for " +
            algo + " using SunJGSS", ex);
    }
    throw new ProviderException("No impl for " + algo +
        " " + type);
}