Package com.sun.xml.ws.security.opt.crypto.dsig

Examples of com.sun.xml.ws.security.opt.crypto.dsig.SignedInfo


            // One or more reference element must be present in Signature
            if(!referencesFound){
                logger.log(Level.SEVERE, LogStringsMessages.WSS_1725_REFERENCE_ELEMENT_NOTFOUND());
                throw new XWSSecurityException(LogStringsMessages.WSS_1725_REFERENCE_ELEMENT_NOTFOUND());
            }
            SignedInfo si = new SignedInfo();
            SignatureMethod sm =new SignatureMethod();
            sm.setAlgorithm(signatureMethod);
            si.setSignatureMethod(sm);
            si.setReference(getReferenceList());
            XMLStreamReader siReader = siBuffer.readAsXMLStreamReader();
            while(siReader.hasNext() ){
                if(siReader.getEventType() == siReader.START_ELEMENT){
                    if(siReader.getLocalName() == "SignedInfo".intern()){
                        break;
                    }                  
                }
                 siReader.next();
            }
            int counter =1;
            while(siReader.hasNext()){ 
                StreamUtil.writeCurrentEvent(siReader,exc14nFinal);
                if(counter == 0){
                    break;
                }
                siReader.next();
                if(siReader.getEventType() == siReader.END_ELEMENT){
                    counter --;                   
                }else if(siReader.getEventType() == siReader.START_ELEMENT){
                    counter++;
                }               
            }
            si.setCanonicalizedSI(canonInfo.toByteArray());
            if(logger.isLoggable(Level.FINEST)){
                logger.log(Level.FINEST, "Canonicalized Signed Info:" + new String(canonInfo.toByteArray()));
            }
            return si;
        } catch (XMLStreamException ex) {
View Full Code Here


            // One or more reference element must be present in Signature
            if(!referencesFound){
                logger.log(Level.SEVERE, LogStringsMessages.WSS_1725_REFERENCE_ELEMENT_NOTFOUND());
                throw new XWSSecurityException(LogStringsMessages.WSS_1725_REFERENCE_ELEMENT_NOTFOUND());
            }
            SignedInfo si = new SignedInfo();
            SignatureMethod sm =new SignatureMethod();
            sm.setAlgorithm(signatureMethod);
            si.setSignatureMethod(sm);
            si.setReference(getReferenceList());
            XMLStreamReader siReader = siBuffer.readAsXMLStreamReader();
            while(siReader.hasNext() ){
                if(siReader.getEventType() == siReader.START_ELEMENT){
                    if(siReader.getLocalName() == "SignedInfo".intern()){
                        break;
                    }                  
                }
                 siReader.next();
            }
            int counter =1;
            while(siReader.hasNext()){ 
                StreamUtil.writeCurrentEvent(siReader,exc14nFinal);
                if(counter == 0){
                    break;
                }
                siReader.next();
                if(siReader.getEventType() == siReader.END_ELEMENT){
                    counter --;                   
                }else if(siReader.getEventType() == siReader.START_ELEMENT){
                    counter++;
                }               
            }
            si.setCanonicalizedSI(canonInfo.toByteArray());
            if(logger.isLoggable(Level.FINEST)){
                logger.log(Level.FINEST, "Canonicalized Signed Info:" + new String(canonInfo.toByteArray()));
            }
            return si;
        } catch (XMLStreamException ex) {
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.security.opt.crypto.dsig.SignedInfo

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.