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

Examples of com.sun.xml.wss.impl.policy.mls.SignatureTarget$Transform


        }
        return null;
    }

    public SignatureTarget newXpathSignatureTarget(String xpathTarget){
        SignatureTarget target = new SignatureTarget();
        target.setType(SignatureTarget.TARGET_TYPE_VALUE_XPATH);
        target.setDigestAlgorithm(algorithmSuite.getDigestAlgorithm());
        target.setValue(xpathTarget);
        target.setContentOnly(contentOnly);
        target.setEnforce(enforce);
        return target;
    }
View Full Code Here


        target.setEnforce(enforce);
        return target;
    }

    public SignatureTarget newQNameSignatureTarget(QName name){
        SignatureTarget target = new SignatureTarget();
        target.setType(SignatureTarget.TARGET_TYPE_VALUE_QNAME);
        target.setDigestAlgorithm(algorithmSuite.getDigestAlgorithm());
        target.setContentOnly(contentOnly);
        target.setEnforce(enforce);
        target.setQName(name);
        return target;
    }
View Full Code Here

    //a new one for SingedSupportingTokens where we don't add transform by default
    //a decision on using STR-TX is pending and hence we delay adding the transform
    public SignatureTarget newURISignatureTargetForSSToken(String uid) {
          if ( uid != null ) {
            SignatureTarget target = new SignatureTarget();
            target.setType(SignatureTarget.TARGET_TYPE_VALUE_URI);
            target.setDigestAlgorithm(algorithmSuite.getDigestAlgorithm());
            target.setValue("#"+uid);
            target.setEnforce(enforce);
            return target;
        }
        return null;
    }
View Full Code Here

        }
    }

    private boolean containsSTRTransform(Target actualTarget, List<Target> inferredTargets) {
        for (Target inferredTarget : inferredTargets) {
            SignatureTarget st = (SignatureTarget) inferredTarget;
            ArrayList ar = st.getTransforms();
            Iterator it = ar.iterator();
            while (it.hasNext()) {
                SignatureTarget.Transform str = (Transform) it.next();
                if (str.getTransform().equals(MessageConstants.STR_TRANSFORM_URI)) {
                    //if(actualTarget.getValue().equals(st.getValue())){
View Full Code Here

    @SuppressWarnings("unchecked")
    private int countSTRTransforms(List<Target> targets, boolean isActualTarget) {
        int strTransformCount = 0;
        for (Target target : targets) {
            if (target instanceof SignatureTarget) {
                SignatureTarget st = (SignatureTarget) target;
                ArrayList ar = st.getTransforms();
                Iterator it = ar.iterator();
                while (it.hasNext()) {
                    SignatureTarget.Transform str = (Transform) it.next();
                    if (str.getTransform().equals(MessageConstants.STR_TRANSFORM_URI)) {
                        strTransformCount++;
                        if(isActualTarget){
                            String localPart = (st.getPolicyQName() != null)?st.getPolicyQName().getLocalPart():"";
                            tokenList.append(localPart);tokenList.append(", ");
                        }
                    }
                }
            }
View Full Code Here

                    WSSPolicy pol = (WSSPolicy)securityPolicy.get(i);
                    if(PolicyTypeUtil.isPrimaryPolicy(pol) && PolicyTypeUtil.signaturePolicy(pol)){
                        SignaturePolicy signPol = (SignaturePolicy)pol;
                        SignaturePolicy.FeatureBinding fb = (SignaturePolicy.FeatureBinding)signPol.getFeatureBinding();
                        for (int no_of_sig_targets=0; no_of_sig_targets < fb.getTargetBindings().size(); no_of_sig_targets++){
                            SignatureTarget target = (SignatureTarget)fb.getTargetBindings().get(no_of_sig_targets);
                            if("{http://www.w3.org/2000/09/xmldsig#}Signature".equals(target.getValue()))
                                return pol;
                        }
                    }
                }
            }
View Full Code Here

                            (SignaturePolicy.FeatureBinding)sigPol.getFeatureBinding();
                    ArrayList targets = featureBinding.getTargetBindings();
                    buffer.append("\tCanonicalizationAlgorithm" + featureBinding.getCanonicalizationAlgorithm() + "\n");
                    buffer.append("\t Targets\n");
                    for(int j = 0; j < targets.size(); j++){
                        SignatureTarget target = (SignatureTarget)targets.get(j);
                        buffer.append("\t " + j + ":Type:" + target.getType() + "\n");
                        buffer.append("\t  Value:" + target.getValue() + "\n");
                        buffer.append("\t  DigestAlgorithm:" + target.getDigestAlgorithm() + "\n");
                        ArrayList transforms = target.getTransforms();
                       
                        if(transforms != null){
                            buffer.append("\t  " + "Transforms::\n");
                            for(int k = 0; k < transforms.size(); k++){
                                buffer.append("\t " + "   " + ((SignatureTarget.Transform)transforms.get(k)).getTransform() + "\n");
                            }
                        }
                    }
                    MLSPolicy keyBinding = sigPol.getKeyBinding();
                    if(keyBinding != null){
                        buffer.append("\tKeyBinding\n");
                        printKeyBinding(keyBinding, buffer);
                    }
                } else if(PolicyTypeUtil.encryptionPolicy(pol)){
                    buffer.append("Encryption Policy\n");
                    EncryptionPolicy encPol = (EncryptionPolicy)pol;
                    EncryptionPolicy.FeatureBinding featureBinding =
                            (EncryptionPolicy.FeatureBinding)encPol.getFeatureBinding();
                    ArrayList targets = featureBinding.getTargetBindings();
                    buffer.append("\t Targets\n");
                    for(int j = 0; j < targets.size(); j++){
                        EncryptionTarget target = (EncryptionTarget)targets.get(j);
                        buffer.append("\t " + j + ":"+ "Type:" + target.getType() + "\n");
                        buffer.append("\t  Value:" + target.getValue() + "\n");
                        buffer.append("\t  ContentOnly:" + target.getContentOnly() + "\n");
                        buffer.append("\t  DataEncryptionAlgorithm:" + target.getDataEncryptionAlgorithm() + "\n");
                    }
                    MLSPolicy keyBinding = encPol.getKeyBinding();
                    if(keyBinding != null){
                        buffer.append("\tKeyBinding\n");
                        printKeyBinding(keyBinding, buffer);
View Full Code Here

            sp.setUUID(pid.generateID());
            tokenProcessor.addKeyBinding(binding,sp,token,false);
            // container.insert(sp.getKeyBinding());
           
            if(tp != null ){
                SignatureTarget target = iAP.getTargetCreator().newURISignatureTarget(tp.getUUID());
                iAP.getTargetCreator().addTransform(target);
                SecurityPolicyUtil.setName(target, tp);
                // there is no primary signature in Transport Binding
                //spFB.isEndorsingSignature(true);
                spFB.addTargetBinding(target);                               
View Full Code Here

            tokenProcessor.addKeyBinding( binding,sp,token,false);

            //protect primary signature
           
            if(tp != null){
                SignatureTarget target = iAP.getTargetCreator().newURISignatureTarget(tp.getUUID());
                iAP.getTargetCreator().addTransform(target);
                SecurityPolicyUtil.setName(target, tp);
                //SignaturePolicy.FeatureBinding spFB = (SignaturePolicy.FeatureBinding)sp.getFeatureBinding();
                //spFB.isEndorsingSignature(true);
                spFB.addTargetBinding(target);
View Full Code Here

        }
    }

    protected void protectTimestamp(TimestampPolicy tp) {
        if (primarySP != null) {
            SignatureTarget target = iAP.getTargetCreator().newURISignatureTarget(tp.getUUID());
            iAP.getTargetCreator().addTransform(target);
            SecurityPolicyUtil.setName(target, tp);
            SignaturePolicy.FeatureBinding spFB = (SignaturePolicy.FeatureBinding) primarySP.getFeatureBinding();
            spFB.addTargetBinding(target);
        }
View Full Code Here

TOP

Related Classes of com.sun.xml.wss.impl.policy.mls.SignatureTarget$Transform

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.