Package org.apache.neethi

Examples of org.apache.neethi.Assertion


    private void processAlternative(List assertions, SupportingToken supportingToken) {
       
        for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {

            Assertion primitive = (Assertion) iterator.next();
            QName qname = primitive.getName();

            if (SP12Constants.ALGORITHM_SUITE.equals(qname)) {
                supportingToken.setAlgorithmSuite((AlgorithmSuite) primitive);

            } else if (SP12Constants.SIGNED_PARTS.equals(qname)) {
View Full Code Here


        }
        return x509Token;
    }

    private void processAlternative(List assertions, X509Token parent) {
                Assertion assertion;
        QName name;

        for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
            assertion = (Assertion) iterator.next();
            name = assertion.getName();

            if (SP11Constants.REQUIRE_KEY_IDENTIFIRE_REFERENCE.equals(name)) {
                parent.setRequireKeyIdentifierReference(true);

            } else if (SP11Constants.REQUIRE_ISSUER_SERIAL_REFERENCE.equals(name)) {
View Full Code Here

    }

    private void processAlternative(List assertions, UsernameToken parent) {
               
        for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
            Assertion assertion = (Assertion) iterator.next();
            QName qname = assertion.getName();
           
            if (SP11Constants.WSS_USERNAME_TOKEN10.equals(qname)) {
                parent.setUseUTProfile10(true);
               
            } else if (SP11Constants.WSS_USERNAME_TOKEN11.equals(qname)) {
View Full Code Here

        }
        return x509Token;
    }

    private void processAlternative(List assertions, X509Token parent) {
                Assertion assertion;
        QName name;

        for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
            assertion = (Assertion) iterator.next();
            name = assertion.getName();

            if (SP12Constants.REQUIRE_KEY_IDENTIFIRE_REFERENCE.equals(name)) {
                parent.setRequireKeyIdentifierReference(true);

            } else if (SP12Constants.REQUIRE_ISSUER_SERIAL_REFERENCE.equals(name)) {
View Full Code Here

        return compatible;
    }
   
    private Assertion findCompatibleAssertion(Assertion assertion, Collection<Assertion> alt) {
        for (Assertion a : alt) {
            Assertion compatible = intersect(assertion, a);
            if (null != compatible) {
                return compatible;
            }
        }
        return null;
View Full Code Here

        if (! iterator.hasNext()) {
            throw new SandeshaException("No Policy Alternative found");
        }

        List assertionList = (List) iterator.next();
        Assertion assertion = null;
       
        boolean found = false;
       
        for (Iterator assertions = assertionList.iterator(); assertions.hasNext();) {
            assertion = (Assertion) assertions.next();
View Full Code Here

        if (! iterator.hasNext()) {
            throw new SandeshaException("No Policy Alternative found");
        }

        List assertionList = (List) iterator.next();
        Assertion assertion = null;
       
        boolean found = false;
       
        for (Iterator assertions = assertionList.iterator(); assertions.hasNext();) {
            assertion = (Assertion) assertions.next();
View Full Code Here

        return WSS4JUtils.getTokenStore(message);
    }
   
    static Assertion getAddressingPolicy(AssertionInfoMap aim, boolean optional) {
        Collection<AssertionInfo> lst = aim.get(MetadataConstants.USING_ADDRESSING_2004_QNAME);
        Assertion assertion = null;
        if (null != lst && !lst.isEmpty()) {
            assertion = lst.iterator().next().getAssertion();
        }
        if (assertion == null) {
            lst = aim.get(MetadataConstants.USING_ADDRESSING_2005_QNAME);
            if (null != lst && !lst.isEmpty()) {
                assertion = lst.iterator().next().getAssertion();
            }
        }
        if (assertion == null) {
            lst = aim.get(MetadataConstants.USING_ADDRESSING_2006_QNAME);
            if (null != lst && !lst.isEmpty()) {
                assertion = lst.iterator().next().getAssertion();
            }
        }
        if (assertion == null) {
            return new PrimitiveAssertion(MetadataConstants.USING_ADDRESSING_2006_QNAME,
                                          optional);
        } else if (optional) {
            return new PrimitiveAssertion(assertion.getName(),
                                          optional);           
        }
        return assertion;
    }
View Full Code Here

                    //Cancel and Renew just sign with the token
                    Policy p = new Policy();
                    ExactlyOne ea = new ExactlyOne();
                    p.addPolicyComponent(ea);
                    All all = new All();
                    Assertion ass = NegotiationUtils.getAddressingPolicy(aim, false);
                    all.addPolicyComponent(ass);
                    ea.addPolicyComponent(all);
                   
                    final SecureConversationToken secureConversationToken =
                        new SecureConversationToken(
                            SPConstants.SPVersion.SP12,
                            SPConstants.IncludeTokenType.INCLUDE_TOKEN_NEVER,
                            null,
                            null,
                            null,
                            new Policy()
                        );
                   
                    Policy sctPolicy = new Policy();
                    ExactlyOne sctPolicyEa = new ExactlyOne();
                    sctPolicy.addPolicyComponent(sctPolicyEa);
                    All sctPolicyAll = new All();
                    sctPolicyAll.addPolicyComponent(secureConversationToken);
                    sctPolicyEa.addPolicyComponent(sctPolicyAll);
                   
                    Policy bindingPolicy = new Policy();
                    ExactlyOne bindingPolicyEa = new ExactlyOne();
                    bindingPolicy.addPolicyComponent(bindingPolicyEa);
                    All bindingPolicyAll = new All();
                   
                    AbstractBinding origBinding = getBinding(aim);
                    bindingPolicyAll.addPolicyComponent(origBinding.getAlgorithmSuite());
                    bindingPolicyAll.addPolicyComponent(new ProtectionToken(SPConstants.SPVersion.SP12, sctPolicy));
                    bindingPolicyAll.addAssertion(
                        new PrimitiveAssertion(SP12Constants.INCLUDE_TIMESTAMP));
                    bindingPolicyAll.addAssertion(
                        new PrimitiveAssertion(SP12Constants.ONLY_SIGN_ENTIRE_HEADERS_AND_BODY));
                    bindingPolicyEa.addPolicyComponent(bindingPolicyAll);
                   
                    DefaultSymmetricBinding binding =
                        new DefaultSymmetricBinding(SPConstants.SPVersion.SP12, bindingPolicy);
                    binding.setOnlySignEntireHeadersAndBody(true);
                    binding.setProtectTokens(false);
                   
                    all.addPolicyComponent(binding);
                   
                    SignedParts signedParts = getSignedParts(aim, addNs);
                    all.addPolicyComponent(signedParts);
                    pol = p;
                    message.getInterceptorChain().add(SecureConversationTokenFinderInterceptor.INSTANCE);
                } else {
                    Policy p = new Policy();
                    ExactlyOne ea = new ExactlyOne();
                    p.addPolicyComponent(ea);
                    All all = new All();
                    Assertion ass = NegotiationUtils.getAddressingPolicy(aim, false);
                    all.addPolicyComponent(ass);
                    ea.addPolicyComponent(all);
                    pol = p.merge(pol);
                }
               
View Full Code Here

                Policy p = new Policy();
                ExactlyOne ea = new ExactlyOne();
                p.addPolicyComponent(ea);
                All all = new All();
                Assertion ass = NegotiationUtils.getAddressingPolicy(aim, false);
                all.addPolicyComponent(ass);
                ea.addPolicyComponent(all);
               
                //setup endpoint and forward to it.
                unmapSecurityProps(message);
View Full Code Here

TOP

Related Classes of org.apache.neethi.Assertion

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.