@Override public Data dereference(final URIReference uriReference, final XMLCryptoContext context) throws URIReferenceException { String uri = uriReference.getURI(); // TODO: Following the test case: XAdESTest003 test: testTDetached() the URI can be like: should we accept this URI and what about the baseURI ? // <ds:Reference Id="Reference0" URI="./TARGET_BBB.bin"> // The following rule was added to comply this functionality: // BEGIN: if (uri.startsWith("./")) { uri = uri.substring(2); } // :END if (!uri.equals(documentURI)) { final URIDereferencer uriDereferencer = factory.getURIDereferencer(); final Data data = uriDereferencer.dereference(uriReference, context); if (LOG.isInfoEnabled()) { LOG.info("--> Reference dereferenced: " + uriReference.getURI() + "=" + (data != null) + " | Reference type: " + uriReference.getType()); } return data; } if(document==null) { return null; } final InputStream octetStream = document.openStream(); return new OctetStreamData(octetStream); } }