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();
                    Assertion ass = NegotiationUtils.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

            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.ws.secpolicy.model.SecureConversationToken

                                (!RampartUtil.isTokenValid(rmd, secConvTokenId) && !cancelReqResp))) {
               
                    log.debug("No SecureConversationToken found, " +
                            "requesting a new token");
                   
                    SecureConversationToken secConvTok =
                                        (SecureConversationToken) sigTok;
                   
                    try {

                        String id = RampartUtil.getSecConvToken(rmd, secConvTok);
View Full Code Here

Examples of org.apache.ws.secpolicy.model.SecureConversationToken

                    || (secConvTokenId != null &&
                        (!RampartUtil.isTokenValid(rmd, secConvTokenId) && !cancelReqResp))) {

                    log.debug("No SecureConversationToken found, requesting a new token");

                    SecureConversationToken secConvTok =
                                        (SecureConversationToken) sigTok;
                   
                    try {

                        String id = RampartUtil.getSecConvToken(rmd, secConvTok);
View Full Code Here

Examples of org.apache.ws.secpolicy.model.SecureConversationToken

          return null;
        }
        List it = (List) servicePolicy.getAlternatives().next();
        RampartPolicyData rpd = RampartPolicyBuilder.build(it);

        SecureConversationToken secConvTok = null;

        org.apache.ws.secpolicy.model.Token encrtok = rpd
            .getEncryptionToken();
        secConvTok = (encrtok != null && encrtok instanceof SecureConversationToken) ? (SecureConversationToken) encrtok
            : null;

        if (secConvTok == null) {
          org.apache.ws.secpolicy.model.Token sigtok = rpd
              .getSignatureToken();
          secConvTok = (sigtok != null && sigtok instanceof SecureConversationToken) ? (SecureConversationToken) sigtok
              : null;
        }

        if (secConvTok != null) {

          Policy issuerPolicy = secConvTok.getBootstrapPolicy();
          issuerPolicy.addAssertion(rpd.getRampartConfig());

          STSClient client = new STSClient(message
              .getConfigurationContext());
          Options op = new Options();
View Full Code Here

Examples of org.apache.ws.secpolicy.model.SecureConversationToken

                        || (secConvTokenId != null && (!RampartUtil.isTokenValid(rmd,
                                secConvTokenId) && !cancelReqResp))) {

                    log.debug("No SecureConversationToken found, requesting a new token");

                    SecureConversationToken secConvTok = (SecureConversationToken) sigTok;

                    try {

                        String id = RampartUtil.getSecConvToken(rmd, secConvTok);
                        rmd.setSecConvTokenId(id);
View Full Code Here

Examples of org.apache.ws.secpolicy.model.SecureConversationToken

                                (!RampartUtil.isTokenValid(rmd, secConvTokenId) && !cancelReqResp))) {
               
                    log.debug("No SecureConversationToken found, " +
                            "requesting a new token");
                   
                    SecureConversationToken secConvTok =
                                        (SecureConversationToken) sigTok;
                   
                    try {

                        String id = RampartUtil.getSecConvToken(rmd, secConvTok);
View Full Code Here

Examples of org.apache.wss4j.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().getPolicy();
                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 = 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,
View Full Code Here

Examples of org.apache.wss4j.policy.model.SecureConversationToken

                    NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.SECURE_CONVERSATION_TOKEN);
                if (ais.isEmpty()) {
                    return;
                }
                for (AssertionInfo inf : ais) {
                    SecureConversationToken token = (SecureConversationToken)inf.getAssertion();
                    IncludeTokenType inclusion = token.getIncludeTokenType();
                    if (foundSCT || token.isOptional()
                        || (!foundSCT && inclusion == IncludeTokenType.INCLUDE_TOKEN_NEVER)) {
                        inf.setAsserted(true);
                    } else {
                        inf.setNotAsserted("No SecureConversation token found in message.");
                    }
View Full Code Here

Examples of org.apache.wss4j.policy.model.SecureConversationToken

                NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.SECURE_CONVERSATION_TOKEN);
            if (ais.isEmpty()) {
                return;
            }
           
            SecureConversationToken tok = (SecureConversationToken)ais.iterator()
                .next().getAssertion();
            doCancel(message, aim, tok);

        }
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.