Java Code Examples for com.sun.security.sasl.util.PolicyUtils

Following code examples demonstrate how to use com.sun.security.sasl.util.PolicyUtilsfrom 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 com.sun.security.sasl.util.PolicyUtilsand various code implementation of this class.

    }

    public SaslServer createSaslServer(String mech,
        String protocol,
        String serverName,
        Map<String,?> props,
        CallbackHandler cbh) throws SaslException {

        if (mech.equals(myMechs[CRAMMD5])
            && PolicyUtils.checkPolicy(mechPolicies[CRAMMD5], props)) {

            if (cbh == null) {
                throw new SaslException(
            "Callback handler with support for AuthorizeCallback required");
            }
            return new CramMD5Server(protocol, serverName, props, cbh);
        }
        return null;
    }; 


Advertisement
Javadoc
Static class that contains utilities for dealing with Java SASL security policy-related properties.

@author Rosanna Lee

Read More
Advertisement