// Need to wrap the uri in an Attribute node so that we can
// Pass to the resource resolvers
Attr uriAttr = cr.getURIAsAttr();
XMLSignatureInput input = null;
try {
ResourceResolver resolver =
ResourceResolver.getInstance(uriAttr, null);
input = resolver.resolve(uriAttr, null);
} catch (ResourceResolverException ex) {
throw new XMLEncryptionException("empty", ex);
}
if (input != null) {
logger.debug("Managed to resolve URI \"" + cr.getURI() + "\"");
}
else {
logger.debug("Failed to resolve URI \"" + cr.getURI() + "\"");
}
// Lets see if there are any transforms
Transforms transforms = cr.getTransforms();
if (transforms != null) {
logger.debug ("Have transforms in cipher reference");
try {
org.apache.xml.security.transforms.Transforms dsTransforms =
transforms.getDSTransforms();
input = dsTransforms.performTransforms(input);
} catch (TransformationException ex) {
throw new XMLEncryptionException("empty", ex);
}
}
try {
return input.getBytes();
}
catch (IOException ex) {
throw new XMLEncryptionException("empty", ex);
} catch (CanonicalizationException ex) {
throw new XMLEncryptionException("empty", ex);