Examples of SecureConversationToken


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

            if (s != null
                && s.contains("/RST/SCT")
                && (s.startsWith(STSUtils.WST_NS_05_02)
                    || s.startsWith(STSUtils.WST_NS_05_12))) {

                SecureConversationToken tok = (SecureConversationToken)ais.iterator()
                    .next().getAssertion();
                Policy pol = tok.getBootstrapPolicy();
                if (s.endsWith("Cancel") || s.endsWith("/Renew")) {
                    //Cancel and Renew just sign with the token
                    Policy p = new Policy();
                    ExactlyOne ea = new ExactlyOne();
                    p.addPolicyComponent(ea);
                    All all = new All();
                    PolicyAssertion ass = SecureConversationTokenInterceptorProvider
                        .getAddressingPolicy(aim, false);
                    all.addPolicyComponent(ass);
                    ea.addPolicyComponent(all);
                    SymmetricBinding binding = new SymmetricBinding(SP12Constants.INSTANCE);
                    binding.setIncludeTimestamp(true);
                    ProtectionToken token = new ProtectionToken(SP12Constants.INSTANCE);
                    token.setToken(new SecureConversationToken(SP12Constants.INSTANCE));
                    binding.setProtectionToken(token);
                    binding.setEntireHeadersAndBodySignatures(true);
                   
                    Binding origBinding = getBinding(aim);
                    binding.setAlgorithmSuite(origBinding.getAlgorithmSuite());
View Full Code Here

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

            binding.setIncludeTimestamp(true);
            binding.setEntireHeadersAndBodySignatures(true);
            binding.setTokenProtection(false);
            AlgorithmSuite suite = new AlgorithmSuite();
            binding.setAlgorithmSuite(suite);
            SecureConversationToken sct = new SecureConversationToken();
            sct.setOptional(true);
            ptoken.setToken(sct);
           
            SignedEncryptedParts parts = new SignedEncryptedParts(true);
            parts.setOptional(true);
            parts.setBody(true);
View Full Code Here

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

            binding.setIncludeTimestamp(true);
            binding.setEntireHeadersAndBodySignatures(true);
            binding.setTokenProtection(false);
            AlgorithmSuite suite = new AlgorithmSuite();
            binding.setAlgorithmSuite(suite);
            SecureConversationToken sct = new SecureConversationToken();
            sct.setOptional(true);
            ptoken.setToken(sct);
           
            SignedEncryptedParts parts = new SignedEncryptedParts(true);
            parts.setOptional(true);
            parts.setBody(true);
View Full Code Here

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

            binding.setIncludeTimestamp(true);
            binding.setEntireHeadersAndBodySignatures(true);
            binding.setTokenProtection(false);
            AlgorithmSuite suite = new AlgorithmSuite();
            binding.setAlgorithmSuite(suite);
            SecureConversationToken sct = new SecureConversationToken();
            sct.setOptional(true);
            ptoken.setToken(sct);
           
            SignedEncryptedParts parts = new SignedEncryptedParts(true);
            parts.setOptional(true);
            parts.setBody(true);
View Full Code Here

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

            if (s != null
                && s.contains("/RST/SCT")
                && (s.startsWith(STSUtils.WST_NS_05_02)
                    || s.startsWith(STSUtils.WST_NS_05_12))) {

                SecureConversationToken tok = (SecureConversationToken)ais.iterator()
                    .next().getAssertion();
                Policy pol = tok.getBootstrapPolicy();
                if (s.endsWith("Cancel") || s.endsWith("/Renew")) {
                    //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 = SecureConversationTokenInterceptorProvider
                        .getAddressingPolicy(aim, false);
                    all.addPolicyComponent(ass);
                    ea.addPolicyComponent(all);
                    PolicyBuilder pbuilder = message.getExchange().getBus()
                        .getExtension(PolicyBuilder.class);
                    SymmetricBinding binding = new SymmetricBinding(SP12Constants.INSTANCE, pbuilder);
                    binding.setIncludeTimestamp(true);
                    ProtectionToken token = new ProtectionToken(SP12Constants.INSTANCE, pbuilder);
                    token.setToken(new SecureConversationToken(SP12Constants.INSTANCE));
                    binding.setProtectionToken(token);
                    binding.setEntireHeadersAndBodySignatures(true);
                   
                    Binding origBinding = getBinding(aim);
                    binding.setAlgorithmSuite(origBinding.getAlgorithmSuite());
View Full Code Here

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

            Collection<AssertionInfo> ais = aim.get(SP12Constants.SECURE_CONVERSATION_TOKEN);
            if (ais == null || ais.isEmpty()) {
                return;
            }
            if (isRequestor(message)) {
                SecureConversationToken itok = (SecureConversationToken)ais.iterator()
                    .next().getAssertion();
               
                SecurityToken tok = (SecurityToken)message.getContextualProperty(SecurityConstants.TOKEN);
                if (tok == null) {
                    String tokId = (String)message.getContextualProperty(SecurityConstants.TOKEN_ID);
View Full Code Here

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

            Collection<AssertionInfo> ais = aim.get(SP12Constants.SECURE_CONVERSATION_TOKEN);
            if (ais == null || ais.isEmpty()) {
                return;
            }
           
            SecureConversationToken tok = (SecureConversationToken)ais.iterator()
                .next().getAssertion();
            doCancel(message, aim, tok);

        }
View Full Code Here

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

        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("SecureConversationToken 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);
                }
               
                if (DOMUtils.getFirstChildWithName(elem,
                        consts.getNamespace(),
                        SPConstants.SC13_SECURITY_CONTEXT_TOKEN) != null) {
                    conversationToken.setSc13SecurityContextToken(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);
        }
       
        return conversationToken;
View Full Code Here

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

            binding.setIncludeTimestamp(true);
            binding.setEntireHeadersAndBodySignatures(true);
            binding.setTokenProtection(false);
            AlgorithmSuite suite = new AlgorithmSuite();
            binding.setAlgorithmSuite(suite);
            SecureConversationToken sct = new SecureConversationToken();
            sct.setOptional(true);
            ptoken.setToken(sct);
           
            SignedEncryptedParts parts = new SignedEncryptedParts(true);
            parts.setOptional(true);
            parts.setBody(true);
View Full Code Here

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

            binding.setIncludeTimestamp(true);
            binding.setEntireHeadersAndBodySignatures(true);
            binding.setTokenProtection(false);
            AlgorithmSuite suite = new AlgorithmSuite();
            binding.setAlgorithmSuite(suite);
            SecureConversationToken sct = new SecureConversationToken();
            sct.setOptional(true);
            ptoken.setToken(sct);
           
            SignedEncryptedParts parts = new SignedEncryptedParts(true);
            parts.setOptional(true);
            parts.setBody(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.