key = publicKey;
} else {
key = KeyUtils.prepareSecretKey(signatureMethod, secretKey);
}
XMLValidateContext context = new DOMValidateContext(key, elem);
context.setProperty("javax.xml.crypto.dsig.cacheReference", Boolean.TRUE);
context.setProperty("org.apache.jcp.xml.dsig.secureValidation", Boolean.TRUE);
context.setProperty("org.jcp.xml.dsig.secureValidation", Boolean.TRUE);
context.setProperty(STRTransform.TRANSFORM_WS_DOC_INFO, wsDocInfo);
context.setProperty(AttachmentContentSignatureTransform.ATTACHMENT_CALLBACKHANDLER,
data.getAttachmentCallbackHandler());
try {
XMLSignature xmlSignature = signatureFactory.unmarshalXMLSignature(context);
checkBSPCompliance(xmlSignature, data.getBSPEnforcer());