Package com.sun.xml.wss.impl.policy.mls

Examples of com.sun.xml.wss.impl.policy.mls.Target


    // replace uri target types with qname target types
    @SuppressWarnings("unchecked")
    private void modifyTargets(ArrayList targets) {
        for (int i = 0; i < targets.size(); i++) {
            Target target = (Target) targets.get(i);
            if (Target.TARGET_TYPE_VALUE_URI.equals(target.getType())) {
                findAndReplaceTargets(target);
            }
        }
    }
View Full Code Here


            TransformsType transforms= new Transforms();
            transforms.setTransform(tList);
            rt.setTransforms((Transforms) transforms);
           
            // policy creation
            Target target = new Target(Target.TARGET_TYPE_VALUE_URI, uri);
            SignatureTarget signTarget = new SignatureTarget(target);
            signTarget.setDigestAlgorithm(dm);
            for(int i = 0; tList != null &&  i < tList.size(); i++){
                Transform tr = (Transform) tList.get(i);
                SignatureTarget.Transform sTr = new SignatureTarget.Transform(tr.getAlgorithm());
View Full Code Here

            TransformsType transforms= new Transforms();
            transforms.setTransform(tList);
            rt.setTransforms((Transforms) transforms);
           
            // policy creation
            Target target = new Target(Target.TARGET_TYPE_VALUE_URI, uri);
            SignatureTarget signTarget = new SignatureTarget(target);
            signTarget.setDigestAlgorithm(dm);
            for(int i = 0; tList != null &&  i < tList.size(); i++){
                Transform tr = (Transform) tList.get(i);
                SignatureTarget.Transform sTr = new SignatureTarget.Transform(tr.getAlgorithm());
View Full Code Here

                            refList.add(uri.substring(1));
                        }else{
                            refList.add(uri);
                        }
                        // for policy creation
                        Target target = new Target(Target.TARGET_TYPE_VALUE_URI, uri);
                        EncryptionTarget encTarget = new EncryptionTarget(target);
                        fb.addTargetBinding(encTarget);
                    }
                }
                if(_exit(reader)){
View Full Code Here

        Element eachSubElement = getFirstChildElement(optionalTargetSettings);
        while (eachSubElement != null) {
            QName subElementQName = getQName(eachSubElement);
           
            if (TARGET_QNAME.equals(subElementQName)) {
                Target t = new Target();
                t.setEnforce(false);
                Target t1 = readTargetSettings(eachSubElement, t);
                targets.add(t1);
            } else {
                log.log(Level.SEVERE,
                        "WSS0513.illegal.configuration.element",
                        subElementQName.toString());
View Full Code Here

                (EncryptionPolicy.FeatureBinding)policy.getFeatureBinding();
        boolean targetsEmpty = (featureBinding.getTargetBindings().size() == 0);
        if (!dp && targetsEmpty) {
            // this much will automatically set the SOAPBody as target and
            // contentOnly as TRUE.
            Target t = new EncryptionTarget();
            featureBinding.addTargetBinding(t);
        }
        if (policy.getKeyBinding() == null) {
            AuthenticationTokenPolicy.X509CertificateBinding x509Policy =
                    (AuthenticationTokenPolicy.X509CertificateBinding)policy.newX509CertificateKeyBinding();
View Full Code Here

                (EncryptionPolicy.FeatureBinding)policy.getFeatureBinding();
        boolean targetsEmpty = (featureBinding.getTargetBindings().size() == 0);
        if (!dp && targetsEmpty) {
            // this much will automatically set the SOAPBody as target and
            // contentOnly as TRUE.
            Target t = new EncryptionTarget();
            featureBinding.addTargetBinding(t);
        }
       
        // if bsp is true the filters will actually have code to verify that the
        // incoming algorithms (for key and data enc are BSP defined ones)
View Full Code Here

               (EncryptionPolicy.FeatureBinding)policy.getFeatureBinding();
           int numTargets = fb.getTargetBindings().size();
           if (numTargets != 1)
               return false;
           Iterator it1 = fb.getTargetBindings().iterator();
           Target target = (Target)it1.next();
           if (target.getType() == Target.TARGET_TYPE_VALUE_URI) {
               //get the URI fragment
               return uriIsUsernameToken(mPolicy, target.getValue());
           } else {
               int idx = target.getValue().indexOf(USERNAMETOKEN);
               if (idx > -1) {
                   return true;
               }
           }
           return false;
View Full Code Here

       private boolean hasEncryptUsernamePolicy(EncryptionPolicy policy, MessagePolicy mPolicy) {
           EncryptionPolicy.FeatureBinding fb =
               (EncryptionPolicy.FeatureBinding)policy.getFeatureBinding();
           Iterator it = fb.getTargetBindings().iterator();
           while (it.hasNext()) {
               Target target = (Target)it.next();
               if (target.getType() == Target.TARGET_TYPE_VALUE_URI) {
                   //get the URI fragment
                   return uriIsUsernameToken(mPolicy, target.getValue());
               }else {
                   int idx = target.getValue().indexOf(USERNAMETOKEN);
                   if (idx > -1) {
                       return true;
                   }
               }
           }
View Full Code Here

           return ret;
       }
       //Assuming single username target
       //TODO: This logic fails if we have more than 2 targets in the ArrayList
       private boolean hasUsernameFollowedByBody(ArrayList targets) {
           Target t = (Target)targets.get(0);
           int idx = t.getValue().indexOf(USERNAMETOKEN);
           if (idx == -1) {
               return false;
           }
           return true;
       }
View Full Code Here

TOP

Related Classes of com.sun.xml.wss.impl.policy.mls.Target

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.