Package com.sun.xml.wss.impl.policy.mls

Examples of com.sun.xml.wss.impl.policy.mls.EncryptionTarget


                (EncryptionPolicy.FeatureBinding)policy.getFeatureBinding();
        boolean targetsEmpty = (featureBinding.getTargetBindings().size() == 0);
        if (!dp && targetsEmpty) {
            // this much will automatically set the SOAPBody as target and
            // contentOnly as TRUE.
            Target t = new EncryptionTarget();
            featureBinding.addTargetBinding(t);
        }
       
        // if bsp is true the filters will actually have code to verify that the
        // incoming algorithms (for key and data enc are BSP defined ones)
View Full Code Here


                if(isServer && isIncoming){
                    EncryptionPolicy optionalPolicy =
                            new EncryptionPolicy();
                    EncryptionPolicy.FeatureBinding  fb = (EncryptionPolicy.FeatureBinding) optionalPolicy.getFeatureBinding();
                    optionalPolicy.newX509CertificateKeyBinding();
                    EncryptionTarget target = new EncryptionTarget();
                    target.setQName(new QName(MessageConstants.SAML_v1_1_NS,MessageConstants.SAML_ASSERTION_LNAME));
                    target.setEnforce(false);
                    fb.addTargetBinding(target);
                    /*
                    try {
                        bmp.prepend(optionalPolicy);
                    } catch (PolicyGenerationException ex) {
View Full Code Here

            edKeyInfo = tokenInfo.getKeyInfo();
        }
       
        boolean refAdded = false;
        while (targetItr.hasNext()) {
            EncryptionTarget target = (EncryptionTarget)targetItr.next();
            boolean contentOnly = target.getContentOnly();
            //target.getDataEncryptionAlgorithm();
            //target.getCipherReferenceTransforms();//TODO support this
           
            List edList = edBuilder.buildEDList( (EncryptionPolicy)wssPolicy,target ,context, dataEncKey,edKeyInfo);
            for(int i =0;i< edList.size();i++){
View Full Code Here

                        EncryptionPolicy encPolicy = (EncryptionPolicy) primaryPolicy;
                        EncryptionPolicy.FeatureBinding featureBinding = (EncryptionPolicy.FeatureBinding) encPolicy.getFeatureBinding();
                        ArrayList targetList = featureBinding.getTargetBindings();
                        ListIterator iterator = targetList.listIterator();
                        while (iterator.hasNext()) {
                            EncryptionTarget encryptionTarget = (EncryptionTarget) iterator.next();
                            String targetURI = encryptionTarget.getValue();
                            if (targetURI.equals(issuedTokenPolicyId)) {
                                if (ctx != null) {
                                    GenericToken issuedToken = (GenericToken) ctx.getSecurityToken();
                                    encryptionTarget.setValue(issuedToken.getId());
                                    sph.setMessagePolicy(policy);
                                    p.getOutMessagePolicyMap().put(operation, sph);
                                    breakOuterLoop = true;
                                    break;
                                }
View Full Code Here

       
        Iterator i = targets.iterator();
        //TODO : remove all  the three while loops and
        //convert to a 2 loop - Venu
        while (i.hasNext()) {
            EncryptionTarget target = (EncryptionTarget)i.next();
            boolean contentOnly = target.getContentOnly();
            Boolean cOnly = Boolean.valueOf(contentOnly);
            if(MessageConstants.PROCESS_ALL_ATTACHMENTS.equals(target.getValue())){
                Iterator itr = secureMsg.getAttachments();
                while(itr.hasNext()){
                    AttachmentPart ap = (AttachmentPart)itr.next();
                    Object[] s = new Object[2];
                    s[0] = ap;
                    s[1] = cOnly;
                    _aparts.add(s);
                }
                continue;
            }
            Object mgpart = secureMsg.getMessageParts(target);
            //Change this to context.
            //TODO :: Venu
            ArrayList transforms = target.getCipherReferenceTransforms();
            if(mgpart == null){
                continue;
            } else if (mgpart instanceof AttachmentPart) {
                Object[] s = new Object[2];
                s[0] = mgpart;
View Full Code Here

                    WSSPolicy wp = (WSSPolicy) mp.get(i);
                    if (PolicyTypeUtil.encryptionPolicy(wp)) {
                        EncryptionPolicy ep = (EncryptionPolicy) wp;
                        ArrayList list = ((EncryptionPolicy.FeatureBinding) ep.getFeatureBinding()).getTargetBindings();
                        for (int ei = 0; ei < list.size(); ei++) {
                            EncryptionTarget et = (EncryptionTarget) list.get(ei);
                            if (et.getValue().equals(Target.BODY)) {
                                securedBody = true;
                            }
                        }
                    } else if (PolicyTypeUtil.signaturePolicy(wp)) {
                        SignaturePolicy sp = (SignaturePolicy) wp;
View Full Code Here

        if(PolicyUtil.isUsernameToken((PolicyAssertion) token, spVersion) &&
                ((UserNameToken)token).hasPassword() &&
                !((UserNameToken)token).useHashPassword()){
            if ( binding != null && token.getTokenId()!= null ) {
                EncryptionPolicy.FeatureBinding fb =(EncryptionPolicy.FeatureBinding) encryptionPolicy.getFeatureBinding();
                EncryptionTarget et = etc.newURIEncryptionTarget(token.getTokenId());
                fb.addTargetBinding(et);
            }
        }
    }
View Full Code Here

    }
   
    protected void encryptToken(Token token, SecurityPolicyVersion spVersion)throws PolicyException{   
        if ( token.getTokenId()!= null ) {
            EncryptionPolicy.FeatureBinding fb =(EncryptionPolicy.FeatureBinding) encryptionPolicy.getFeatureBinding();
            EncryptionTarget et = etc.newURIEncryptionTarget(token.getTokenId());
            fb.addTargetBinding(et);
           
            if(PolicyUtil.isIssuedToken((PolicyAssertion) token, spVersion)){
                isIssuedTokenAsEncryptedSupportingToken = true;
            }
View Full Code Here

    }
   
    protected void encryptToken(Token token, SecurityPolicyVersion spVersion)throws PolicyException{   
        if ( token.getTokenId()!= null ) {
            EncryptionPolicy.FeatureBinding fb =(EncryptionPolicy.FeatureBinding) encryptionPolicy.getFeatureBinding();
            EncryptionTarget et = etc.newURIEncryptionTarget(token.getTokenId());
            fb.addTargetBinding(et);
           
            if(PolicyUtil.isIssuedToken((PolicyAssertion) token, spVersion)){
                isIssuedTokenAsEncryptedSupportingToken = true;
            }
View Full Code Here

    }
   
    protected void encryptToken(Token token, SecurityPolicyVersion spVersion)throws PolicyException{   
         if (encryptionPolicy != null && token.getTokenId()!= null ) {
            EncryptionPolicy.FeatureBinding fb =(EncryptionPolicy.FeatureBinding) encryptionPolicy.getFeatureBinding();
            EncryptionTarget et = etc.newURIEncryptionTarget(token.getTokenId());
            fb.addTargetBinding(et);
           
            if(PolicyUtil.isIssuedToken((PolicyAssertion) token, spVersion)){
                isIssuedTokenAsEncryptedSupportingToken = true;
            }
View Full Code Here

TOP

Related Classes of com.sun.xml.wss.impl.policy.mls.EncryptionTarget

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.