Package com.sun.xml.wss.core

Examples of com.sun.xml.wss.core.SignatureConfirmationHeaderBlock


            List scList = null;
            if(temp != null && temp instanceof ArrayList)
                scList = (ArrayList)temp;
            if(scList != null){
           
                SignatureConfirmationHeaderBlock signConfirm = null;
                SOAPElement sc = null;
                try{
                    SOAPFactory factory = SOAPFactory.newInstance();
                    Name name = factory.createName(
                            MessageConstants.SIGNATURE_CONFIRMATION_LNAME,
                            MessageConstants.WSSE11_PREFIX,
                            MessageConstants.WSSE11_NS);
                    Iterator i = secHeader.getChildElements(name);
                    if(!i.hasNext()){
                        log.log(Level.SEVERE, LogStringsMessages.WSS_1428_SIGNATURE_CONFIRMATION_ERROR());
                        throw new XWSSecurityException("Message does not confirm to Security Policy:" +
                                "wss11:SignatureConfirmation Element not found");
                    }
                    while(i.hasNext()){
                        sc = (SOAPElement)i.next();
                        try{
                            signConfirm = new SignatureConfirmationHeaderBlock(sc);
                        } catch( XWSSecurityException xwsse){
                            log.log(Level.SEVERE, LogStringsMessages.WSS_1435_SIGNATURE_CONFIRMATION_VALIDATION_FAILURE(), xwsse);
                            throw SecurableSoapMessage.newSOAPFaultException(
                                MessageConstants.WSSE_INVALID_SECURITY,
                                "Failure in SignatureConfirmation validation\n" +
                                "Message is: " + xwsse.getMessage(),
                                xwsse );
                        }
                        String signValue = signConfirm.getSignatureValue();

                        //Case when there was no Signature in sent message, the received message should have one
                        //SignatureConfirmation with no Value attribute
                        if(signValue == null){
                            if(i.hasNext() || !scList.isEmpty()){                           
View Full Code Here


                SecurityHeader secHeader = secureMessage.findOrCreateSecurityHeader();

                if(!it.hasNext()){
                    // Insert a SignatureConfirmation element with no Value attribute
                    String id = secureMessage.generateId();
                    SignatureConfirmationHeaderBlock signConfirm = new SignatureConfirmationHeaderBlock(id);
                    secHeader.insertHeaderBlock(signConfirm);
                    context.getSignatureConfirmationIds().add(id);
                }

                while(it.hasNext()){

                    String signValue = (String)it.next();    
                    String id = secureMessage.generateId();
                    SignatureConfirmationHeaderBlock signConfirm = new SignatureConfirmationHeaderBlock(id);
                    signConfirm.setSignatureValue(signValue);
                    secHeader.insertHeaderBlock(signConfirm);
                    context.getSignatureConfirmationIds().add(id);
                }        
            }
        }
View Full Code Here

TOP

Related Classes of com.sun.xml.wss.core.SignatureConfirmationHeaderBlock

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.