aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/poifs
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2019-09-04 17:01:15 +0000
committerPJ Fanning <fanningpj@apache.org>2019-09-04 17:01:15 +0000
commitf31281f18f201841a2e963f26205d1fd3e170491 (patch)
tree3fbbe6558815e8952d5a94ce9bc5f58579b2c322 /src/ooxml/java/org/apache/poi/poifs
parentd51ca537ed0f4f945093669d71ac55ca69239111 (diff)
downloadpoi-f31281f18f201841a2e963f26205d1fd3e170491.tar.gz
poi-f31281f18f201841a2e963f26205d1fd3e170491.zip
remove debug code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1866406 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/poifs')
-rw-r--r--src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java
index d8da2e1f03..c8f04e8824 100644
--- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java
+++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java
@@ -70,7 +70,8 @@ import org.etsi.uri.x01903.v13.SignedSignaturePropertiesType;
import org.etsi.uri.x01903.v13.SignerRoleType;
import org.w3.x2000.x09.xmldsig.DigestMethodType;
import org.w3.x2000.x09.xmldsig.X509IssuerSerialType;
-import org.w3c.dom.*;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
/**
* XAdES Signature Facet. Implements XAdES v1.4.1 which is compatible with XAdES
@@ -223,32 +224,10 @@ public class XAdESSignatureFacet extends SignatureFacet {
private XMLObject addXadesObject(Document document, QualifyingPropertiesType qualifyingProperties) {
Node qualDocElSrc = qualifyingProperties.getDomNode();
Node qualDocEl = document.importNode(qualDocElSrc, true);
- markIds(qualDocEl);
List<XMLStructure> xadesObjectContent = Arrays.asList(new DOMStructure(qualDocEl));
return getSignatureFactory().newXMLObject(xadesObjectContent, null, null, null);
}
- private void markIds(Node node) {
- if (node instanceof Element) {
- markIds((Element)node);
- } else if (node instanceof Document) {
- markIds(((Document)node).getDocumentElement());
- }
- }
-
- private void markIds(Element element) {
- if (element != null) {
- Attr att = element.getAttributeNode("Id");
- if (att != null) {
- element.setIdAttributeNode(att, true);
- }
- NodeList nl = element.getChildNodes();
- for (int i = 0; i < nl.getLength(); i++) {
- markIds(nl.item(i));
- }
- }
- }
-
private Reference addXadesReference() throws XMLSignatureException {
List<Transform> transforms = singletonList(newTransform(CanonicalizationMethod.INCLUSIVE));
return newReference("#"+signatureConfig.getXadesSignatureId(), transforms, XADES_TYPE, null, null);