Package org.apache.ws.secpolicy.model

Examples of org.apache.ws.secpolicy.model.SignedEncryptedParts


import org.apache.ws.secpolicy.model.SignedEncryptedParts;

public class SignedPartsBuilder implements AssertionBuilder {
       
    public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
        SignedEncryptedParts signedEncryptedParts = new SignedEncryptedParts(true, SPConstants.SP_V12);
       
        for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
            processElement((OMElement) iterator.next(), signedEncryptedParts);
        }
       
        OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
    if (isOptional != null) {
      signedEncryptedParts.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
          .booleanValue());
    }

        //presense of <sp:SignedParts/> enforces the requirement for sign body and all the header blocks
        if(!element.getChildren().hasNext()){
            signedEncryptedParts.setBody(true);
            signedEncryptedParts.setSignAllHeaders(true);
        }
       
        return signedEncryptedParts;
    }
View Full Code Here


import org.apache.ws.secpolicy.model.SignedEncryptedParts;

public class SignedPartsBuilder implements AssertionBuilder {
       
    public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
        SignedEncryptedParts signedEncryptedParts = new SignedEncryptedParts(true, SPConstants.SP_V11);
        OMAttribute isOptional = element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
    if (isOptional != null) {
      signedEncryptedParts.setOptional(Boolean.valueOf(isOptional.getAttributeValue())
          .booleanValue());
    }
        for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
            processElement((OMElement) iterator.next(), signedEncryptedParts);
        }

        // Presense of <sp:SignedParts/> enforces the requirement for sign body and all the header blocks
        if(!element.getChildren().hasNext()){
            signedEncryptedParts.setBody(true);
            signedEncryptedParts.setSignAllHeaders(true);
        }

        return signedEncryptedParts;
    }
View Full Code Here

                    sgndEndSuppTokens.getTokens().size() > 0) {

                log.debug("Processing endorsing signed supporting tokens");

                ArrayList tokens = sgndEndSuppTokens.getTokens();
                SignedEncryptedParts signdParts = sgndEndSuppTokens.getSignedParts();
                for (Object objectToken : tokens) {
                    Token token = (Token) objectToken;
                    if (token instanceof IssuedToken && rmd.isInitiator()) {
                        signatureValues.add(doIssuedTokenSignature(rmd, token, signdParts));
                    } else if (token instanceof X509Token) {
                        signatureValues.add(doX509TokenSignature(rmd, token, signdParts));
                    }
                }
            }
   
            SupportingToken endSupptokens = rpd.getEndorsingSupportingTokens();
            if(endSupptokens != null && endSupptokens.getTokens() != null &&
                    endSupptokens.getTokens().size() > 0) {
                log.debug("Processing endorsing supporting tokens");
                ArrayList tokens = endSupptokens.getTokens();
                SignedEncryptedParts signdParts = endSupptokens.getSignedParts();
                for (Object objectToken : tokens) {
                    Token token = (Token) objectToken;
                    if (token instanceof IssuedToken && rmd.isInitiator()) {
                        signatureValues.add(doIssuedTokenSignature(rmd, token, signdParts));
                    } else if (token instanceof X509Token) {
View Full Code Here

    public static final QName NAME = new QName("Name");
    public static final QName NAMESPACE = new QName("Namespace");
    public static final QName BODY = new QName(Constants.SP_NS, "Body");
       
    public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
        SignedEncryptedParts signedEncryptedParts = new SignedEncryptedParts(true);
       
        for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
            processElement((OMElement) iterator.next(), signedEncryptedParts);
        }
       
View Full Code Here

    public static final QName NAMESPACE = new QName(Constants.SP_NS, "Namespace");
    public static final QName BODY = new QName(Constants.SP_NS, "Body");
       
    public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
       
        SignedEncryptedParts signedEncryptedParts = new SignedEncryptedParts(false);
       
        for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
            processElement((OMElement) iterator.next(), signedEncryptedParts);
        }
       
View Full Code Here

    public static final QName NAMESPACE = new QName(Constants.SP_NS, "Namespace");
    public static final QName BODY = new QName(Constants.SP_NS, "Body");
       
    public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
       
        SignedEncryptedParts signedEncryptedParts = new SignedEncryptedParts(false);
       
        for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
            processElement((OMElement) iterator.next(), signedEncryptedParts);
        }
       
View Full Code Here

    public static final QName NAME = new QName("Name");
    public static final QName NAMESPACE = new QName("Namespace");
    public static final QName BODY = new QName(Constants.SP_NS, "Body");
       
    public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
        SignedEncryptedParts signedEncryptedParts = new SignedEncryptedParts(true);
       
        for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
            processElement((OMElement) iterator.next(), signedEncryptedParts);
        }
       
View Full Code Here

       
        if(!rmd.isInitiator()) {
            //Just an indicator for EndorsingSupportingToken signature
            SupportingToken endSupportingToken = rpd.getEndorsingSupportingTokens();
            if(endSupportingToken !=  null) {
                SignedEncryptedParts endSignedParts = endSupportingToken.getSignedParts();
                if(endSignedParts != null &&
                        (endSignedParts.isBody() ||
                                endSignedParts.getHeaders().size() > 0)) {
                    signatureParts.add(
                            new WSEncryptionPart("EndorsingSupportingTokens"));
                }
            }
            //Just an indicator for SignedEndorsingSupportingToken signature
            SupportingToken sgndEndSupportingToken = rpd.getSignedEndorsingSupportingTokens();
            if(sgndEndSupportingToken != null) {
                SignedEncryptedParts sgndEndSignedParts = sgndEndSupportingToken.getSignedParts();
                if(sgndEndSignedParts != null &&
                        (sgndEndSignedParts.isBody() ||
                                sgndEndSignedParts.getHeaders().size() > 0)) {
                    signatureParts.add(
                            new WSEncryptionPart("SignedEndorsingSupportingTokens"));
                }
            }
        }
View Full Code Here

                    sgndEndSuppTokens.getTokens().size() > 0) {
               
                log.debug("Processing endorsing signed supporting tokens");
               
                ArrayList tokens = sgndEndSuppTokens.getTokens();
                SignedEncryptedParts signdParts = sgndEndSuppTokens.getSignedParts();
                for (Iterator iter = tokens.iterator(); iter.hasNext();) {
                    Token token = (Token) iter.next();
                    if(token instanceof IssuedToken && rmd.isInitiator()) {
                        signatureValues.add(doIssuedTokenSignature(rmd, token, signdParts));
                    } else if(token instanceof X509Token) {
                        signatureValues.add(doX509TokenSignature(rmd, token, signdParts));
                    }
                }
            }
   
            SupportingToken endSupptokens = rpd.getEndorsingSupportingTokens();
            if(endSupptokens != null && endSupptokens.getTokens() != null &&
                    endSupptokens.getTokens().size() > 0) {
                log.debug("Processing endorsing supporting tokens");
                ArrayList tokens = endSupptokens.getTokens();
                SignedEncryptedParts signdParts = endSupptokens.getSignedParts();
                for (Iterator iter = tokens.iterator(); iter.hasNext();) {
                    Token token = (Token) iter.next();
                    if(token instanceof IssuedToken && rmd.isInitiator()){
                        signatureValues.add(doIssuedTokenSignature(rmd, token, signdParts));
                    } else if(token instanceof X509Token) {
View Full Code Here

TOP

Related Classes of org.apache.ws.secpolicy.model.SignedEncryptedParts

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.