"Expected Signature Element as per receiver requirements, found "+
localName));
context.isPrimaryPolicyViolation(true);
return 0;
}
DOMValidateContext validationContext = new DOMValidateContext(KeySelectorImpl.getInstance(), signElement);
XMLSignatureFactory signatureFactory = WSSPolicyConsumerImpl.getInstance().getSignatureFactory();
// unmarshal the XMLSignature
XMLSignature signature = signatureFactory.unmarshalXMLSignature(validationContext);
verifySignatureAlgorithm(signature);
//For SignatureConfirmation
List scList = (ArrayList)context.getExtraneousProperty("receivedSignValues");
if(scList != null){
scList.add(Base64.encode(signature.getSignatureValue().getValue()));
}
//End SignatureConfirmation specific code
validationContext.setURIDereferencer(DSigResolver.getInstance());
// Validate the XMLSignature (generated above)
validationContext.put(MessageConstants.WSS_PROCESSING_CONTEXT, context);
SignaturePolicy currentMessagePolicy = null;
if(context.getMode() == FilterProcessingContext.ADHOC ||
context.getMode() == FilterProcessingContext.POSTHOC){
currentMessagePolicy = new SignaturePolicy();
context.setInferredPolicy(currentMessagePolicy);