Package org.apache.cxf.ws.security.policy.model

Examples of org.apache.cxf.ws.security.policy.model.KeyValueToken


    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = MS_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        KeyValueToken token = new KeyValueToken(consts);
        token.setOptional(PolicyConstants.isOptional(element));
        token.setIgnorable(PolicyConstants.isIgnorable(element));
       
        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(SP11Constants.INSTANCE.getNamespace(),
                                               SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (!StringUtils.isEmpty(attribute)) {
            token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }

        Element polEl = PolicyConstants.findPolicyElement(element);
        if (polEl != null) {
            Element child = DOMUtils.getFirstElement(polEl);
            if (child != null) {
                QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
                if ("RsaKeyValue".equals(qname.getLocalPart())) {
                    token.setForceRsaKeyValue(true);
                }
            }
        }
        return token;
    }
View Full Code Here


    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = MS_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        KeyValueToken token = new KeyValueToken(consts);
        token.setOptional(PolicyConstants.isOptional(element));
        token.setIgnorable(PolicyConstants.isIgnorable(element));
       
        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(SP11Constants.INSTANCE.getNamespace(),
                                               SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (!StringUtils.isEmpty(attribute)) {
            token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }

        Element polEl = PolicyConstants.findPolicyElement(element);
        if (polEl == null) {
            LOG.warning("sp:KeyValueToken/wsp:Policy should have a value!");
        } else {
            token.setPolicy(polEl);
            Element child = DOMUtils.getFirstElement(polEl);
            if (child != null) {
                QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
                if ("RsaKeyValue".equals(qname.getLocalPart())) {
                    token.setForceRsaKeyValue(true);
                }
            }
        }

        return token;
View Full Code Here

    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = MS_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        KeyValueToken token = new KeyValueToken(consts);
        token.setOptional(PolicyConstants.isOptional(element));
        token.setIgnorable(PolicyConstants.isIgnorable(element));
       
        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(SP11Constants.INSTANCE.getNamespace(),
                                               SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (!StringUtils.isEmpty(attribute)) {
            token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }

        Element polEl = PolicyConstants.findPolicyElement(element);
        if (polEl != null) {
            Element child = DOMUtils.getFirstElement(polEl);
            if (child != null) {
                QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
                if ("RsaKeyValue".equals(qname.getLocalPart())) {
                    token.setForceRsaKeyValue(true);
                }
            }
        }
        return token;
    }
View Full Code Here

    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = MS_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        KeyValueToken token = new KeyValueToken(consts);
        token.setOptional(PolicyConstants.isOptional(element));
        token.setIgnorable(PolicyConstants.isIgnorable(element));
       
        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(SP11Constants.INSTANCE.getNamespace(),
                                               SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (!StringUtils.isEmpty(attribute)) {
            token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }

        Element polEl = PolicyConstants.findPolicyElement(element);
        if (polEl == null) {
            throw new IllegalArgumentException(
                "sp:KeyValueToken/wsp:Policy must have a value"
            );
        }
       
        token.setPolicy(polEl);
        Element child = DOMUtils.getFirstElement(polEl);
        if (child != null) {
            QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
            if ("RsaKeyValue".equals(qname.getLocalPart())) {
                token.setForceRsaKeyValue(true);
            }
        }
        return token;
    }
View Full Code Here

    public PolicyAssertion build(Element element) {
       
        SPConstants consts = MS_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        KeyValueToken token = new KeyValueToken(consts);
        token.setOptional(PolicyConstants.isOptional(element));
       
        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(SP11Constants.INSTANCE.getNamespace(),
                                               SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (!StringUtils.isEmpty(attribute)) {
            token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }

        Element polEl = PolicyConstants.findPolicyElement(element);
        if (polEl != null) {
            Element child = DOMUtils.getFirstElement(polEl);
            if (child != null) {
                QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
                if ("RsaKeyValue".equals(qname.getLocalPart())) {
                    token.setForceRsaKeyValue(true);
                }
            }
        }
        return token;
    }
View Full Code Here

    public Assertion build(Element element, AssertionBuilderFactory factory) {
       
        SPConstants consts = MS_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

        KeyValueToken token = new KeyValueToken(consts);
        token.setOptional(PolicyConstants.isOptional(element));
        token.setIgnorable(PolicyConstants.isIgnorable(element));
       
        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (StringUtils.isEmpty(attribute)) {
            attribute = element.getAttributeNS(SP11Constants.INSTANCE.getNamespace(),
                                               SPConstants.ATTR_INCLUDE_TOKEN);
        }
        if (!StringUtils.isEmpty(attribute)) {
            token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }

        Element polEl = PolicyConstants.findPolicyElement(element);
        if (polEl == null) {
            throw new IllegalArgumentException(
                "sp:KeyValueToken/wsp:Policy must have a value"
            );
        }
        Element child = DOMUtils.getFirstElement(polEl);
        if (child != null) {
            QName qname = new QName(child.getNamespaceURI(), child.getLocalName());
            if ("RsaKeyValue".equals(qname.getLocalPart())) {
                token.setForceRsaKeyValue(true);
            }
        }
        return token;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.security.policy.model.KeyValueToken

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.