Package com.sun.xml.ws.security.policy

Examples of com.sun.xml.ws.security.policy.Token


        ArrayList<PolicyAssertion> tokenList = new ArrayList<PolicyAssertion>();
        for(AssertionSet assertionSet : policy){
            for(PolicyAssertion assertion:assertionSet){
                if(PolicyUtil.isAsymmetricBinding(assertion, spVersion)){
                    AsymmetricBinding sb =  (AsymmetricBinding)assertion;
                    Token iToken = sb.getInitiatorToken();
                        if (iToken != null){
                            addToken(iToken, tokenList);
                        }else{
                            addToken(sb.getInitiatorSignatureToken(), tokenList);
                            addToken(sb.getInitiatorEncryptionToken(), tokenList);
                        }

                        Token rToken = sb.getRecipientToken();
                        if (rToken != null){
                            addToken(rToken, tokenList);
                        }else{
                            addToken(sb.getRecipientSignatureToken(), tokenList);
                            addToken(sb.getRecipientEncryptionToken(), tokenList);
                        }
                }else if(PolicyUtil.isSymmetricBinding(assertion, spVersion)){
                    SymmetricBinding sb = (SymmetricBinding)assertion;
                    Token token = sb.getProtectionToken();
                    if(token != null){
                        addToken(token,tokenList);
                    }else{
                        addToken(sb.getEncryptionToken(),tokenList);
                        addToken(sb.getSignatureToken(),tokenList);
View Full Code Here


    protected MessagePolicy getOutgoingXWSSecurityPolicy(
            Packet packet, boolean isSCMessage) {
       
       
        if (isSCMessage) {
            Token scToken = (Token)packet.invocationProperties.get(SC_ASSERTION);
            return getOutgoingXWSBootstrapPolicy(scToken);
        }
        Message message = packet.getMessage();
        WSDLBoundOperation operation = null;
        if(isTrustMessage(packet)){
View Full Code Here

    }
   
    public void processSupportingTokens(SupportingTokens tokens) throws PolicyException{
        Iterator itr = tokens.getTokens();
        while(itr.hasNext()){
            Token token = (Token) itr.next();
            WSSPolicy policy = tokenProcessor.getWSSToken(token);
            if (policy instanceof IssuedTokenKeyBinding){
                ((IssuedTokenKeyBinding)policy).setSTRID(null);
            }else if (policy instanceof AuthenticationTokenPolicy.SAMLAssertionBinding){
                ((AuthenticationTokenPolicy.SAMLAssertionBinding)policy).setSTRID(null);
View Full Code Here

    }
   
    public void processSupportingTokens(SignedSupportingTokens sst) throws PolicyException{
        Iterator itr = sst.getTokens();
        while(itr.hasNext()){
            Token token = (Token) itr.next();
            WSSPolicy policy = tokenProcessor.getWSSToken(token);
            if (policy instanceof IssuedTokenKeyBinding){
                ((IssuedTokenKeyBinding)policy).setSTRID(null);
            }else if (policy instanceof AuthenticationTokenPolicy.SAMLAssertionBinding){
                ((AuthenticationTokenPolicy.SAMLAssertionBinding)policy).setSTRID(null);
View Full Code Here

        Iterator itr = est.getTokens();       
        if(est.getSignedElements().hasNext() || est.getSignedParts().hasNext()){
            buildSP = true;
        }
        while(itr.hasNext()){
            Token token = (Token) itr.next();
            SignaturePolicy sp = new SignaturePolicy();           
            SignaturePolicy.FeatureBinding spFB = (com.sun.xml.wss.impl.policy.mls.SignaturePolicy.FeatureBinding)sp.getFeatureBinding();
            //spFB.setCanonicalizationAlgorithm(CanonicalizationMethod.EXCLUSIVE);
            SecurityPolicyUtil.setCanonicalizationMethod(spFB, binding.getAlgorithmSuite());
            sp.setUUID(pid.generateID());
View Full Code Here

    }
   
    public void processSupportingTokens(SignedEndorsingSupportingTokens set) throws PolicyException{
        Iterator itr = set.getTokens();
        while(itr.hasNext()){
            Token token = (Token) itr.next();
            SignaturePolicy sp = new SignaturePolicy();
            sp.setUUID(pid.generateID());
            SignaturePolicy.FeatureBinding spFB = (com.sun.xml.wss.impl.policy.mls.SignaturePolicy.FeatureBinding)sp.getFeatureBinding();
            //spFB.setCanonicalizationAlgorithm(CanonicalizationMethod.EXCLUSIVE);
            SecurityPolicyUtil.setCanonicalizationMethod(spFB, binding.getAlgorithmSuite());
View Full Code Here

    }
   
    public void processSupportingTokens(SignedEncryptedSupportingTokens sest) throws PolicyException{
        Iterator itr = sest.getTokens();
        while(itr.hasNext()){
            Token token = (Token) itr.next();
            WSSPolicy policy = tokenProcessor.getWSSToken(token);
            if (policy instanceof IssuedTokenKeyBinding){
                ((IssuedTokenKeyBinding)policy).setSTRID(null);
            }else if (policy instanceof AuthenticationTokenPolicy.SAMLAssertionBinding){
                ((AuthenticationTokenPolicy.SAMLAssertionBinding)policy).setSTRID(null);
View Full Code Here

       
    }
   
   
    public void process()throws PolicyException{
        Token st = getSignatureToken();
        Token et = getEncryptionToken();
        if(st != null){
            primarySP = new SignaturePolicy();
            primarySP.setUUID(pid.generateID());
            if(logger.isLoggable(Level.FINEST)){
                logger.log(Level.FINEST,"ID of Primary signature policy is "+primarySP.getUUID());
View Full Code Here

       
    }
   
    protected Token getEncryptionToken(){
        if(isServer^isIncoming){
              Token token = binding.getInitiatorToken();
             if (token == null){
                token = binding.getRecipientEncryptionToken();
            }
            return token;
        }else{
            Token token= binding.getRecipientToken();
            if (token == null){
                token = binding.getInitiatorEncryptionToken();
            }

            return token;
View Full Code Here

        }
    }
   
    protected Token getSignatureToken(){
        if(isServer^isIncoming){
            Token token = binding.getRecipientToken();
            if (token == null){
                 token = binding.getRecipientSignatureToken();
            }

            return token;
        }else{
            Token token= binding.getInitiatorToken();
            if (token == null){
                token = binding.getInitiatorSignatureToken();
            }

            return token;
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.security.policy.Token

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.