FileDocCategorySizeDatePackage
RequestSecurityTokenTemplate.javaAPI DocExample8522Tue May 29 16:56:46 BST 2007com.sun.xml.ws.security.impl.policy

RequestSecurityTokenTemplate

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

Fields Summary
private boolean
populated
private AssertionFitness
fitness
String
tokenType
String
requestType
com.sun.xml.ws.security.policy.Lifetime
lifeTime
String
authenticationType
private String
keyType
private int
keySize
private String
sigAlgo
private String
encAlgo
private String
canonAlgo
private boolean
isProofEncRequired
private String
computedKeyAlgo
private boolean
isEncRequired
private String
signWith
private String
encryptWith
Constructors Summary
public RequestSecurityTokenTemplate()
Creates a new instance of RequestSecurityTokenTemplate

    
               
      
    
public RequestSecurityTokenTemplate(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.lang.StringgetAuthenticationType()

        populate();
        return authenticationType;
    
public java.lang.StringgetCanonicalizationAlgorithm()

        populate();
        return canonAlgo;
    
public java.lang.StringgetComputedKeyAlgorithm()

        populate();
        return computedKeyAlgo;
    
public java.lang.StringgetEncryptWith()

        populate();
        return encryptWith;
    
public java.lang.StringgetEncryptionAlgorithm()

        populate();
        return encAlgo;
    
public booleangetEncryptionRequired()

        populate();
        return isEncRequired;
    
public intgetKeySize()

        populate();
        return keySize;
    
public java.lang.StringgetKeyType()

        populate();
        return keyType;
    
public com.sun.xml.ws.security.policy.LifetimegetLifetime()

        populate();
        return lifeTime;
    
public booleangetProofEncryptionRequired()

        populate();
        return isProofEncRequired;
    
public java.lang.StringgetRequestType()

        populate();
        return this.requestType;
    
public java.lang.StringgetSignWith()

        populate();
        return signWith;
    
public java.lang.StringgetSignatureAlgorithm()

        populate();
        return sigAlgo;
    
public java.lang.StringgetTokenType()

        populate();
        return tokenType;
    
public java.lang.StringgetTrustVersion()

        throw new UnsupportedOperationException();
    
private voidpopulate()

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

        if(!populated){
            if ( this.hasNestedAssertions() ) {
                
                Iterator <PolicyAssertion> it =this.getNestedAssertionsIterator();
                while( it.hasNext() ) {
                    PolicyAssertion assertion = (PolicyAssertion) it.next();
                    //TODO: Support all RequestSecurityTokenTemplate elements
                    if ( PolicyUtil.isKeyType(assertion) ) {
                        this.keyType = assertion.getValue();
                    } else if ( PolicyUtil.isKeySize(assertion) ) {
                        this.keySize = Integer.valueOf(assertion.getValue());
                    }  else if ( PolicyUtil.isEncryption(assertion) ) {
                        this.isEncRequired = true;
                    } else if ( PolicyUtil.isProofEncryption(assertion) ) {
                        this.isProofEncRequired = true;
                    } else if ( PolicyUtil.isLifeTime(assertion) ) {
                        this.lifeTime = (Lifetime) assertion;
                    }else if(PolicyUtil.isSignWith(assertion)){
                        this.signWith = assertion.getValue();
                    }else if(PolicyUtil.isTrustTokenType(assertion)){
                        this.tokenType = assertion.getValue();
                    }else if(PolicyUtil.isRequestType(assertion)){
                        this.tokenType = assertion.getValue();
                    }else if(PolicyUtil.isAuthenticationType(assertion)){
                        this.tokenType = assertion.getValue();
                    }else if(PolicyUtil.isSignatureAlgorithm(assertion)){
                        this.tokenType = assertion.getValue();
                    }else if(PolicyUtil.isEncryptionAlgorithm(assertion)){
                        this.tokenType = assertion.getValue();
                    }else if(PolicyUtil.isCanonicalizationAlgorithm(assertion)){
                        this.tokenType = assertion.getValue();
                    }else if(PolicyUtil.isComputedKeyAlgorithm(assertion)){
                        this.tokenType = assertion.getValue();
                    }else if(PolicyUtil.isProofEncryption(assertion)){
                        isProofEncRequired = true;
                    }else if(PolicyUtil.isEncryption(assertion)){
                        isEncRequired = true;
                    }else if(PolicyUtil.isClaimsElement(assertion)) {
                        // Valid assertion.
                    }else if(PolicyUtil.isEntropyElement(assertion)){
                        // Valid assertion.
                    }else {
                        if(!assertion.isOptional()){
                            log_invalid_assertion(assertion, isServer,RequestSecurityTokenTemplate);
                            fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                        }
                    }
                    
                }
            }
            populated = true;
        }
        return fitness;
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);