// 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) {