/** * Returns the node set from input which was specified as the parameter of * {@link XMLSignatureInput} constructor * * @return the node set * @throws SAXException * @throws IOException * @throws ParserConfigurationException * @throws CanonicalizationException */ public Set<Node> getNodeSet() throws CanonicalizationException, ParserConfigurationException, IOException, SAXException { return getNodeSet(false); }
public Iterator iterator() { // If nodefilters are set, must execute them first to create node-set if (xi.getNodeFilters() != null) { return Collections.unmodifiableSet(getNodeSet(xi.getNodeFilters())).iterator(); } try { return Collections.unmodifiableSet(xi.getNodeSet()).iterator(); } catch (Exception e) { // should not occur throw new RuntimeException("unrecoverable error retrieving nodeset", e); } }
public Iterator<Node> iterator() { // If nodefilters are set, must execute them first to create node-set if (xi.getNodeFilters() != null && !xi.getNodeFilters().isEmpty()) { return Collections.unmodifiableSet (getNodeSet(xi.getNodeFilters())).iterator(); } try { return Collections.unmodifiableSet(xi.getNodeSet()).iterator(); } catch (Exception e) { // should not occur throw new RuntimeException ("unrecoverable error retrieving nodeset", e); } }
protected void circumventBugIfNeeded(XMLSignatureInput input) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException { if (!input.isNeedsToBeExpanded() || inclusiveNSSet.isEmpty() || inclusiveNSSet.isEmpty()) { return; } Document doc = null; if (input.getSubNode() != null) { doc = XMLUtils.getOwnerDocument(input.getSubNode()); } else { doc = XMLUtils.getOwnerDocument(input.getNodeSet()); } XMLUtils.circumventBug2650(doc); } }
private static Element obtainReferenceElement(XMLSignatureInput resource, boolean secureValidation) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException, KeyResolverException { Element e; if (resource.isElement()){ e = (Element) resource.getSubNode(); } else if (resource.isNodeSet()) { // Retrieved resource is a nodeSet e = getDocumentElement(resource.getNodeSet()); } else { // Retrieved resource is an inputStream byte inputBytes[] = resource.getBytes(); e = getDocFromBytes(inputBytes, secureValidation); // otherwise, we parse the resource, create an Element and delegate LOG.debug("we have to parse {} bytes", inputBytes.length); } return e; }
protected void circumventBugIfNeeded(XMLSignatureInput input) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException { if (!input.isNeedsToBeExpanded()) { return; } Document doc = null; if (input.getSubNode() != null) { doc = XMLUtils.getOwnerDocument(input.getSubNode()); } else { doc = XMLUtils.getOwnerDocument(input.getNodeSet()); } XMLUtils.circumventBug2650(doc); }
canon.canonicalizeXPathNodeSet(xmlSignatureInput.getNodeSet());
XMLSignatureInput signedManifestNodes = currentRef.dereferenceURIandPerformTransforms(null); Set<Node> nl = signedManifestNodes.getNodeSet(); Manifest referencedManifest = null; Iterator<Node> nlIterator = nl.iterator();
nodeSet = in.getNodeSet(); } else { return new OctetStreamData(new ByteArrayInputStream(
if (input.isNodeSet()) { try { final Set<Node> s = input.getNodeSet(); referenceData = new ReferenceNodeSetData() { public Iterator<Node> iterator() {
if (xsi.isNodeSet()) { try { final Set<Node> s = xsi.getNodeSet(); return new NodeSetData() { @Override
inputDoc = XMLUtils.getOwnerDocument(input.getSubNode()); } else { inputDoc = XMLUtils.getOwnerDocument(input.getNodeSet());
return engineCanonicalizeXPathNodeSetInternal(input.getSubNode()); } else { return engineCanonicalizeXPathNodeSet(input.getNodeSet());