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

Examples of org.apache.cxf.ws.security.policy.SPConstants


    }
   
    public Assertion build(Element element, AssertionBuilderFactory factory)
        throws IllegalArgumentException {

        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;

       
        AsymmetricBinding asymmetricBinding = new AsymmetricBinding(consts, builder);
View Full Code Here


        return KNOWN_ELEMENTS;
    }
    public Assertion build(Element element, AssertionBuilderFactory factory)
        throws IllegalArgumentException {

        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
       
        Wss10 wss10 = new Wss10(consts);
        processAlternative(element, wss10, consts);
        return wss10;
View Full Code Here

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

        SymmetricBinding symmetricBinding = new SymmetricBinding(consts, builder);

        Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
View Full Code Here

    public KeyValueTokenBuilder() {
    }
   
    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);
View Full Code Here

    }

    public Assertion build(Element element, AssertionBuilderFactory factory)
        throws IllegalArgumentException {
       
        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
        X509Token x509Token = new X509Token(consts);
        x509Token.setOptional(PolicyConstants.isOptional(element));
        x509Token.setIgnorable(PolicyConstants.isIgnorable(element));

        Element policyElement = DOMUtils.getFirstElement(element);

        // Process token inclusion
        String includeAttr = DOMUtils.getAttribute(element, consts.getIncludeToken());

        if (includeAttr != null) {
            SPConstants.IncludeTokenType inclusion
                = consts.getInclusionFromAttributeValue(includeAttr);
            x509Token.setInclusion(inclusion);
        }

        if (policyElement != null) {

            if (DOMUtils.getFirstChildWithName(policyElement, consts.getRequiredDerivedKeys()) != null) {
                x509Token.setDerivedKeys(true);
            } else if (DOMUtils.getFirstChildWithName(policyElement,
                                                      SP12Constants.REQUIRE_IMPLIED_DERIVED_KEYS) != null) {
                x509Token.setImpliedDerivedKeys(true);
            } else if (DOMUtils.getFirstChildWithName(policyElement,
View Full Code Here

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

        UsernameToken usernameToken = new UsernameToken(consts);
        usernameToken.setOptional(PolicyConstants.isOptional(element));
        usernameToken.setIgnorable(PolicyConstants.isIgnorable(element));

        String attribute = element.getAttributeNS(element.getNamespaceURI(), SPConstants.ATTR_INCLUDE_TOKEN);
        if (attribute != null) {
            usernameToken.setInclusion(consts.getInclusionFromAttributeValue(attribute));
        }

        Element polEl = PolicyConstants.findPolicyElement(element);
        if (polEl != null) {
            NodeList children = polEl.getChildNodes();
View Full Code Here

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

        SignedEncryptedElements signedEncryptedElements = new SignedEncryptedElements(false,
                                                                                      consts);

        String attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.XPATH_VERSION);
        if (attribute != null) {
            signedEncryptedElements.setXPathVersion(attribute);
        }

        Node nd = element.getFirstChild();
View Full Code Here

    }
    
    public Assertion build(Element element, AssertionBuilderFactory factory)
        throws IllegalArgumentException {
       
        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
   
        SignedEncryptedElements signedEncryptedElements = new SignedEncryptedElements(true,
                                                                                      consts);
   
        String attribute = element.getAttributeNS(consts.getNamespace(), SPConstants.XPATH_VERSION);
        if (attribute != null) {
            signedEncryptedElements.setXPathVersion(attribute);
        }
   
        Node nd = element.getFirstChild();
View Full Code Here

    }

   
    public Assertion build(Element element, AssertionBuilderFactory factory)
        throws IllegalArgumentException {
        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
        Wss11 wss11 = new Wss11(consts);
        processAlternative(element, wss11, consts);
        return wss11;
    }
View Full Code Here

    }

    public Assertion build(Element element, AssertionBuilderFactory factory)
        throws IllegalArgumentException {

        SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
            ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
       
       
        SecureConversationToken conversationToken = new SecureConversationToken(consts);
        conversationToken.setOptional(PolicyConstants.isOptional(element));
        conversationToken.setIgnorable(PolicyConstants.isIgnorable(element));

        String attribute = DOMUtils.getAttribute(element, consts.getIncludeToken());
        if (attribute == null) {
            throw new IllegalArgumentException("SecurityContextToken doesn't contain "
                                               + "any sp:IncludeToken attribute");
        }

        String inclusionValue = attribute.trim();

        conversationToken.setInclusion(consts.getInclusionFromAttributeValue(inclusionValue));

       
        Element elem = DOMUtils.getFirstElement(element);
        while (elem != null) {
            QName qn = DOMUtils.getElementQName(elem);
            if (Constants.isPolicyElement(qn)) {
                if (DOMUtils.getFirstChildWithName(elem,
                                                   consts.getNamespace(),
                                                   SPConstants.REQUIRE_DERIVED_KEYS) != null) {
                    conversationToken.setDerivedKeys(true);
                } else if (DOMUtils.getFirstChildWithName(elem,
                                                          SP12Constants
                                                              .REQUIRE_IMPLIED_DERIVED_KEYS)
                                                          != null) {
                    conversationToken.setImpliedDerivedKeys(true);
                } else if (DOMUtils.getFirstChildWithName(elem,
                                                          SP12Constants
                                                              .REQUIRE_EXPLICIT_DERIVED_KEYS)
                                                              != null) {
                    conversationToken.setExplicitDerivedKeys(true);
                }


                if (DOMUtils.getFirstChildWithName(elem,
                                                   consts.getNamespace(),
                                                   SPConstants.REQUIRE_EXTERNAL_URI_REFERENCE) != null) {
                    conversationToken.setRequireExternalUriRef(true);
                }

                if (DOMUtils.getFirstChildWithName(elem,
                                                   consts.getNamespace(),
                                                   SPConstants.SC10_SECURITY_CONTEXT_TOKEN) != null) {
                    conversationToken.setSc10SecurityContextToken(true);
                }

                Element bootstrapPolicyElement = DOMUtils.getFirstChildWithName(elem,
                                                                                consts.getNamespace(),
                                                                                SPConstants.BOOTSTRAP_POLICY);
                if (bootstrapPolicyElement != null) {
                    Policy policy = builder.getPolicy(DOMUtils.getFirstElement(bootstrapPolicyElement));
                    conversationToken.setBootstrapPolicy(policy);
                }

            } else if (consts.getNamespace().equals(qn.getNamespaceURI())
                && SPConstants.ISSUER.equals(qn.getLocalPart())) {
                conversationToken.setIssuerEpr(DOMUtils.getFirstElement(elem));               
            }
            elem = DOMUtils.getNextElement(elem);
        }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.security.policy.SPConstants

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.