}
if (se == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK);
}
WSDataRef ref = new WSDataRef();
ref.setWsuId(uri);
ref.setProtectedElement(se);
ref.setAlgorithm(signedInfo.getSignatureMethod().getAlgorithm());
ref.setDigestAlgorithm(siRef.getDigestMethod().getAlgorithm());
ref.setAttachment(attachment);
// Set the Transform algorithms as well
@SuppressWarnings("unchecked")
List<Transform> transforms = (List<Transform>)siRef.getTransforms();
List<String> transformAlgorithms = new ArrayList<String>(transforms.size());
for (Transform transform : transforms) {
transformAlgorithms.add(transform.getAlgorithm());
}
ref.setTransformAlgorithms(transformAlgorithms);
ref.setXpath(ReferenceListProcessor.getXPath(se));
protectedRefs.add(ref);
}
}
return protectedRefs;
}