if(next instanceof SignedMessageHeader){
targets.add((SignedMessageHeader)next);
} else if(next instanceof SecurityHeaderElement){
SecurityHeaderElement she = (SecurityHeaderElement)next;
SignedMessageHeader smh = new SignedMessageHeader(she);
secMessage.replaceHeader(she, smh);
targets.add(smh);
} else if(next instanceof Header){
Header header = (Header)next;
SignedMessageHeader smh = toSignedMessageHeader(header, fpContext);
secMessage.replaceHeader(header, smh);