Package org.apache.cxf.ws.security.policy.model

Examples of org.apache.cxf.ws.security.policy.model.SupportingToken


        setResults(results);
        setSignedResults(signedResults);
        setEncryptedResults(encryptedResults);
       
        for (AssertionInfo ai : ais) {
            SupportingToken binding = (SupportingToken)ai.getAssertion();
            if (SPConstants.SupportTokenType.SUPPORTING_TOKEN_SUPPORTING != binding.getTokenType()) {
                continue;
            }
            ai.setAsserted(true);
           
            setSignedParts(binding.getSignedParts());
            setEncryptedParts(binding.getEncryptedParts());
            setSignedElements(binding.getSignedElements());
            setEncryptedElements(binding.getEncryptedElements());
           
            List<Token> tokens = binding.getTokens();
            for (Token token : tokens) {
                if (!isTokenRequired(token, message)) {
                    continue;
                }
               
View Full Code Here


     * true then the corresponding UsernameToken must have a password element.
     */
    private boolean isNonEndorsingSupportingToken(
        org.apache.cxf.ws.security.policy.model.UsernameToken usernameTokenPolicy
    ) {
        SupportingToken supportingToken = usernameTokenPolicy.getSupportingToken();
        if (supportingToken != null) {
            SPConstants.SupportTokenType type = supportingToken.getTokenType();
            if (type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SUPPORTING
                || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED
                || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENCRYPTED
                || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_ENCRYPTED) {
                return true;
View Full Code Here

        setResults(results);
        setSignedResults(signedResults);
        setEncryptedResults(encryptedResults);
       
        for (AssertionInfo ai : ais) {
            SupportingToken binding = (SupportingToken)ai.getAssertion();
            if (SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENDORSING_ENCRYPTED
                != binding.getTokenType()) {
                continue;
            }
            ai.setAsserted(true);
           
            setSignedParts(binding.getSignedParts());
            setEncryptedParts(binding.getEncryptedParts());
            setSignedElements(binding.getSignedElements());
            setEncryptedElements(binding.getEncryptedElements());

            List<Token> tokens = binding.getTokens();
            for (Token token : tokens) {
                if (!isTokenRequired(token, message)) {
                    continue;
                }
               
View Full Code Here

        setResults(results);
        setSignedResults(signedResults);
        setEncryptedResults(encryptedResults);

        for (AssertionInfo ai : ais) {
            SupportingToken binding = (SupportingToken)ai.getAssertion();
            if (SPConstants.SupportTokenType.SUPPORTING_TOKEN_ENCRYPTED != binding.getTokenType()) {
                continue;
            }
            ai.setAsserted(true);
           
            setSignedParts(binding.getSignedParts());
            setEncryptedParts(binding.getEncryptedParts());
            setSignedElements(binding.getSignedElements());
            setEncryptedElements(binding.getEncryptedElements());

            List<Token> tokens = binding.getTokens();
            for (Token token : tokens) {
                if (!isTokenRequired(token, message)) {
                    continue;
                }
               
View Full Code Here

        setResults(results);
        setSignedResults(signedResults);
        setEncryptedResults(encryptedResults);
       
        for (AssertionInfo ai : ais) {
            SupportingToken binding = (SupportingToken)ai.getAssertion();
            if (SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED != binding.getTokenType()) {
                continue;
            }
            ai.setAsserted(true);
           
            setSignedParts(binding.getSignedParts());
            setEncryptedParts(binding.getEncryptedParts());
            setSignedElements(binding.getSignedElements());
            setEncryptedElements(binding.getEncryptedElements());
           
            List<Token> tokens = binding.getTokens();
            for (Token token : tokens) {
                if (!isTokenRequired(token, message)) {
                    continue;
                }
               
View Full Code Here

     * true then the corresponding UsernameToken must have a password element.
     */
    private boolean isNonEndorsingSupportingToken(
        org.apache.cxf.ws.security.policy.model.UsernameToken usernameTokenPolicy
    ) {
        SupportingToken supportingToken = usernameTokenPolicy.getSupportingToken();
        if (supportingToken != null) {
            SPConstants.SupportTokenType type = supportingToken.getTokenType();
            if (type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SUPPORTING
                || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED
                || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENCRYPTED
                || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_ENCRYPTED) {
                return true;
View Full Code Here

    }
   
    public Assertion build(Element element, AssertionBuilderFactory factory)
        throws IllegalArgumentException {
        QName name = DOMUtils.getElementQName(element);
        SupportingToken supportingToken = null;

        if (SP11Constants.SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(SupportTokenType.SUPPORTING_TOKEN_SUPPORTING,
                                                  SP11Constants.INSTANCE,
                                                  builder);
        } else if (SP11Constants.SIGNED_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(SupportTokenType.SUPPORTING_TOKEN_SIGNED,
                                                  SP11Constants.INSTANCE,
                                                  builder);
        } else if (SP11Constants.ENDORSING_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(SupportTokenType.SUPPORTING_TOKEN_ENDORSING,
                                                  SP11Constants.INSTANCE,
                                                  builder);
        } else if (SP11Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENDORSING,
                                                  SP11Constants.INSTANCE,
                                                  builder);
        }

        Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
View Full Code Here

    }
   
   
    public Assertion build(Element element, AssertionBuilderFactory factory) {
        QName name = DOMUtils.getElementQName(element);
        SupportingToken supportingToken = null;

        if (SP12Constants.SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_SUPPORTING,
                    SP12Constants.INSTANCE,
                    builder);
        } else if (SP12Constants.SIGNED_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_SIGNED,
                    SP12Constants.INSTANCE,
                    builder);
        } else if (SP12Constants.ENDORSING_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_ENDORSING,
                    SP12Constants.INSTANCE,
                    builder);
        } else if (SP12Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENDORSING,
                    SP12Constants.INSTANCE,
                    builder);
        } else if (SP12Constants.ENCRYPTED_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_ENCRYPTED,
                    SP12Constants.INSTANCE,
                    builder);
        } else if (SP12Constants.SIGNED_ENCRYPTED_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENCRYPTED,
                    SP12Constants.INSTANCE,
                    builder);
        } else if (SP12Constants.ENDORSING_ENCRYPTED_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_ENDORSING_ENCRYPTED,
                    SP12Constants.INSTANCE,
                    builder);
        } else if (SP12Constants.SIGNED_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS.equals(name)) {
            supportingToken = new SupportingToken(
                    SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENDORSING_ENCRYPTED,
                    SP12Constants.INSTANCE,
                    builder);
        }
View Full Code Here

        Collection<AssertionInfo> ais;
       
        ais = aim.get(SP12Constants.SIGNED_SUPPORTING_TOKENS);
        if (ais != null) {
            for (AssertionInfo ai : ais) {
                SupportingToken sgndSuppTokens = (SupportingToken)ai.getAssertion();
                if (sgndSuppTokens != null) {
                    addSignedSupportingTokens(sgndSuppTokens);
                }
                ai.setAsserted(true);
            }
        }
       
        ais = aim.get(SP12Constants.SIGNED_ENCRYPTED_SUPPORTING_TOKENS);
        if (ais != null) {
            for (AssertionInfo ai : ais) {
                SupportingToken sgndSuppTokens = (SupportingToken)ai.getAssertion();
                if (sgndSuppTokens != null) {
                    addSignedSupportingTokens(sgndSuppTokens);
                }
                ai.setAsserted(true);
            }
        }
       
        ais = aim.get(SP12Constants.ENCRYPTED_SUPPORTING_TOKENS);
        if (ais != null) {
            for (AssertionInfo ai : ais) {
                SupportingToken encrSuppTokens = (SupportingToken)ai.getAssertion();
                if (encrSuppTokens != null) {
                    addSignedSupportingTokens(encrSuppTokens);
                }
                ai.setAsserted(true);
            }
        }
       
        ais = aim.get(SP12Constants.SUPPORTING_TOKENS);
        if (ais != null) {
            for (AssertionInfo ai : ais) {
                SupportingToken suppTokens = (SupportingToken)ai.getAssertion();
                if (suppTokens != null && suppTokens.getTokens() != null
                    && suppTokens.getTokens().size() > 0) {
                    handleSupportingTokens(suppTokens, false);
                }
                ai.setAsserted(true);
            }
        }
View Full Code Here

        Collection<AssertionInfo> ais;
        List<byte[]> signatureValues = new ArrayList<byte[]>();
       
        ais = aim.get(SP12Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS);
        if (ais != null) {
            SupportingToken sgndSuppTokens = null;
            for (AssertionInfo ai : ais) {
                sgndSuppTokens = (SupportingToken)ai.getAssertion();
                ai.setAsserted(true);
            }
            if (sgndSuppTokens != null) {
                for (Token token : sgndSuppTokens.getTokens()) {
                    handleEndorsingToken(token, sgndSuppTokens, signatureValues);
                }
            }
        }
       
        ais = aim.get(SP12Constants.ENDORSING_SUPPORTING_TOKENS);
        if (ais != null) {
            SupportingToken endSuppTokens = null;
            for (AssertionInfo ai : ais) {
                endSuppTokens = (SupportingToken)ai.getAssertion();
                ai.setAsserted(true);
            }
           
            if (endSuppTokens != null) {
                for (Token token : endSuppTokens.getTokens()) {
                    handleEndorsingToken(token, endSuppTokens, signatureValues);
                }
            }
        }
        ais = aim.get(SP12Constants.ENDORSING_ENCRYPTED_SUPPORTING_TOKENS);
        if (ais != null) {
            SupportingToken endSuppTokens = null;
            for (AssertionInfo ai : ais) {
                endSuppTokens = (SupportingToken)ai.getAssertion();
                ai.setAsserted(true);
            }
           
            if (endSuppTokens != null) {
                for (Token token : endSuppTokens.getTokens()) {
                    handleEndorsingToken(token, endSuppTokens, signatureValues);
                }
            }
        }
        ais = aim.get(SP12Constants.SIGNED_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS);
        if (ais != null) {
            SupportingToken endSuppTokens = null;
            for (AssertionInfo ai : ais) {
                endSuppTokens = (SupportingToken)ai.getAssertion();
                ai.setAsserted(true);
            }
           
            if (endSuppTokens != null) {
                for (Token token : endSuppTokens.getTokens()) {
                    handleEndorsingToken(token, endSuppTokens, signatureValues);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.security.policy.model.SupportingToken

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.