Hi Folks,
I'm currently working on implementing a Java service within webMethods Integration Server that performs XML digital signatures using the XAdES standard. To achieve this, I chose to use the Digital Signature Services (DSS) libraries, developed and maintained by the European Commission (https://github.com/esig/dss)
So far, I've integrated the DSS JARs and set up the service to:
-Load a document (XML or binary)
-Use a PKCS#12 keystore to access the signing certificate
-Configure XAdESSignatureParameters (level, digest, packaging, etc.)
Sign the document and save the output
However, when invoking the service, I get the following error:
Unable to instantiate default RevocationDataVerifier. Reason : SECURITY : unable to set attribute(s)! [http://javax.xml.XMLConstants/property/accessExternalDTD: org.xml.sax.SAXNotRecognizedException: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.;
http://javax.xml.XMLConstants/property/accessExternalSchema: org.xml.sax.SAXNotRecognizedException: Property 'http://javax.xml.XMLConstants/property/accessExternalSchema' is not recognized.]
From my investigation, this seems to be related to an incompatibility between the XML parser (SAXParserFactory) used by Integration Server (specifically, Apache Xerces) and the security properties being set by the DSS library when initializing the RevocationDataVerifier.
Solutions I've attempted
-Basic XML security properties configuration:
javaSystem.setProperty("javax.xml.accessExternalDTD", "all");
System.setProperty("javax.xml.accessExternalSchema", "all");
-Configuring the certificate verifier:
javaCommonCertificateVerifier verifier = new CommonCertificateVerifier();
verifier.setAlertOnMissingRevocationData(null);
verifier.setAlertOnRevokedCertificate(null);
verifier.setCheckRevocationForUntrustedChains(false);
-Attempting to disable revocation checking:
javaverifier.setOcspSource(null);
verifier.setCrlSource(null);
-Setting additional JVM properties:
javaSystem.setProperty("jdk.xml.transform.enableExtensionFunctions", "true");
System.setProperty("jdk.xml.xpathExprGrpLimit", "0");
System.setProperty("jdk.xml.xpathExprOpLimit", "0");
System.setProperty("jdk.xml.xpathTotalOpLimit", "0");
None of these approaches have resolved the issue.
Has anyone successfully implemented XML signatures using DSS libraries (or any others) in WebMethods ? Any suggestions on how to resolver these XML
security property issues ?
Thanks in advance for your help !
------------------------------
Thibaut Volpoet
------------------------------