FileDocCategorySizeDatePackage
SignatureTargetCreator.javaAPI DocExample5537Thu Jul 19 02:00:10 BST 2007com.sun.xml.ws.security.impl.policyconv

SignatureTargetCreator

public class SignatureTargetCreator extends Object
author
K.Venugopal@sun.com

Fields Summary
private boolean
enforce
private com.sun.xml.ws.security.policy.AlgorithmSuite
algorithmSuite
private boolean
contentOnly
Constructors Summary
public SignatureTargetCreator(boolean enforce, com.sun.xml.ws.security.policy.AlgorithmSuite algorithmSuite, boolean contentOnly)
Creates a new instance of SignatureTargetCreator

               
         
        this.enforce = enforce;
        this.algorithmSuite = algorithmSuite;
    
Methods Summary
public voidaddEXC14n(com.sun.xml.wss.impl.policy.mls.SignatureTarget target)

        SignatureTarget.Transform tr = target.newSignatureTransform();
        if(algorithmSuite != null && algorithmSuite.getAdditionalProps().contains(Constants.InclusiveC14N)){
            tr.setTransform(CanonicalizationMethod.INCLUSIVE);
        } else{
            tr.setTransform(CanonicalizationMethod.EXCLUSIVE);
        }
        
        if(algorithmSuite != null && 
                algorithmSuite.getAdditionalProps().contains(Constants.InclusiveC14NWithCommentsForTransforms)){
            tr.setTransform(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS);
        } else if(algorithmSuite != null && 
                algorithmSuite.getAdditionalProps().contains(Constants.ExclusiveC14NWithCommentsForTransforms)){
            tr.setTransform(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS);
        }
        
        target.addTransform(tr);
    
public voidaddSTRTransform(com.sun.xml.wss.impl.policy.mls.SignatureTarget target)

        SignatureTarget.Transform tr = target.newSignatureTransform();
        tr.setTransform(MessageConstants.STR_TRANSFORM_URI);
        target.addTransform(tr);
        tr.setAlgorithmParameters(new Parameter("CanonicalizationMethod",CanonicalizationMethod.EXCLUSIVE));
    
public com.sun.xml.wss.impl.policy.mls.SignatureTargetnewQNameSignatureTarget(javax.xml.namespace.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);
        addEXC14n(target);
        return target;
    
public com.sun.xml.wss.impl.policy.mls.SignatureTargetnewURISignatureTarget(java.lang.String uid)

        if ( uid != null ) {
            SignatureTarget target = new SignatureTarget();
            target.setType(SignatureTarget.TARGET_TYPE_VALUE_URI);
            target.setDigestAlgorithm(algorithmSuite.getDigestAlgorithm());
            target.setValue("#"+uid);
            addEXC14n(target);
            target.setEnforce(enforce);
            return target;
        }
        return null;
    
public com.sun.xml.wss.impl.policy.mls.SignatureTargetnewXpathSignatureTarget(java.lang.String xpathTarget)

        SignatureTarget target = new SignatureTarget();
        target.setType(SignatureTarget.TARGET_TYPE_VALUE_XPATH);
        target.setDigestAlgorithm(algorithmSuite.getDigestAlgorithm());
        addEXC14n(target);
        target.setValue(xpathTarget);
        target.setContentOnly(contentOnly);
        target.setEnforce(enforce);
        return target;