Java Code Examples for sun.security.jgss.spnego.SpNegoMechFactory

Following code examples demonstrate how to use sun.security.jgss.spnego.SpNegoMechFactoryfrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use sun.security.jgss.spnego.SpNegoMechFactoryand various code implementation of this class.

        @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);
        } 


Advertisement
Javadoc
SpNego Mechanism plug in for JGSS This is the properties object required by the JGSS framework. All

mechanism specific information is defined here. @author Seema Malkani @since 1.6

Read More
Advertisement