FileDocCategorySizeDatePackage
AlgorithmSuite.javaAPI DocExample8362Thu Jul 19 02:00:08 BST 2007com.sun.xml.ws.security.impl.policy

AlgorithmSuite

public class AlgorithmSuite extends com.sun.xml.ws.policy.PolicyAssertion implements com.sun.xml.ws.security.policy.AlgorithmSuite, com.sun.xml.ws.security.policy.SecurityAssertionValidator
author
K.Venugopal@sun.com Abhijit.das@Sun.com

Fields Summary
private AssertionFitness
fitness
private com.sun.xml.ws.security.policy.AlgorithmSuiteValue
value
private HashSet
props
private boolean
populated
private boolean
isValid
Constructors Summary
public AlgorithmSuite()
Creates a new instance of AlgorithmSuite

               
      
    
public AlgorithmSuite(com.sun.xml.ws.policy.sourcemodel.AssertionData name, Collection nestedAssertions, com.sun.xml.ws.policy.AssertionSet nestedAlternative)

        super(name,nestedAssertions,nestedAlternative);
    
Methods Summary
public java.util.SetgetAdditionalProps()

        return props;
    
public java.lang.StringgetAsymmetricKeyAlgorithm()

        populate();
        return value.getAsymKWAlgorithm();
    
public java.lang.StringgetAsymmetricKeySignatureAlgorithm()

        return com.sun.xml.ws.security.policy.Constants.RSA_SHA1;
    
public java.lang.StringgetComputedKeyAlgorithm()

        return com.sun.xml.ws.security.policy.Constants.PSHA1;
    
public java.lang.StringgetDigestAlgorithm()

        populate();
        return value.getDigAlgorithm();
    
public java.lang.StringgetEncryptionAlgorithm()

        populate();
        return value.getEncAlgorithm();
    
public java.lang.StringgetEncryptionKDAlogrithm()

        populate();
        return value.getEncKDAlgorithm();
    
public intgetMaxAsymmetricKeyLength()

        return MAX_AKL;
    
public intgetMaxSymmetricKeyLength()

        return MAX_SKL;
    
public intgetMinAsymmetricKeyLength()

        return MIN_AKL;
    
public intgetMinSKLAlgorithm()

        populate();
        return value.getMinSKLAlgorithm();
    
public java.lang.StringgetSignatureKDAlogrithm()

        populate();
        return value.getSigKDAlgorithm();
    
public java.lang.StringgetSymmetricKeyAlgorithm()

        populate();
        return value.getSymKWAlgorithm();
    
public java.lang.StringgetSymmetricKeySignatureAlgorithm()

        return com.sun.xml.ws.security.policy.Constants.HMAC_SHA1;
    
public com.sun.xml.ws.security.policy.AlgorithmSuiteValuegetType()

        populate();
        return value;
    
private voidpopulate()

        populate(false);
    
private synchronized AssertionFitnesspopulate(boolean isServer)

        
        if(!populated){
            NestedPolicy policy = this.getNestedPolicy();
            if(policy == null){
                if(logger.isLoggable(Level.FINE)){
                    logger.log(Level.FINE,"NestedPolicy is null");
                }
                if(this.value == null){
                    this.value = AlgorithmSuiteValue.Basic128;
                }
                return fitness;
            }
            AssertionSet as = policy.getAssertionSet();
            
            Iterator<PolicyAssertion> ast = as.iterator();
            while(ast.hasNext()){
                PolicyAssertion assertion = ast.next();
                if(this.value == null){
                    AlgorithmSuiteValue av = PolicyUtil.isValidAlgorithmSuiteValue(assertion);
                    if(av != null){
                        this.value = av;
                        continue;
                    }
                }
                if(PolicyUtil.isInclusiveC14N(assertion)){
                    this.props.add(Constants.InclusiveC14N);
                }else if(PolicyUtil.isXPath(assertion)){
                    this.props.add(Constants.XPath);
                }else if(PolicyUtil.isXPathFilter20(assertion)){
                    this.props.add(Constants.XPathFilter20);
                }else if(PolicyUtil.isSTRTransform10(assertion)){
                    this.props.add(Constants.STRTransform10);
                }else if(PolicyUtil.isInclusiveC14NWithComments(assertion)){
                    if(PolicyUtil.isInclusiveC14NWithCommentsForTransforms(assertion)){
                        this.props.add(Constants.InclusiveC14NWithCommentsForTransforms);
                    }
                    if(PolicyUtil.isInclusiveC14NWithCommentsForCm(assertion)){
                        this.props.add(Constants.InclusiveC14NWithCommentsForCm);
                    }
                }else if(PolicyUtil.isExclusiveC14NWithComments(assertion)){
                    if(PolicyUtil.isExclusiveC14NWithCommentsForTransforms(assertion)){
                        this.props.add(Constants.ExclusiveC14NWithCommentsForTransforms);
                    } 
                    if(PolicyUtil.isExclusiveC14NWithCommentsForCm(assertion)){
                        this.props.add(Constants.ExclusiveC14NWithCommentsForCm);
                    }                    
                }else{
                    if(!assertion.isOptional()){
                        log_invalid_assertion(assertion, isServer,AlgorithmSuite);
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                    }
                }
            }
            if(this.value == null){
                this.value = AlgorithmSuiteValue.Basic128;
            }
            populated = true;
        }
        return fitness;
    
public voidsetAdditionalProps(java.util.Set properties)

    
public voidsetType(com.sun.xml.ws.security.policy.AlgorithmSuiteValue value)

        this.value = value;
        populated = true;
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);