From 8a16641b47e9908d6362e07244cbad972c3a1730 Mon Sep 17 00:00:00 2001 From: tknall Date: Tue, 20 Oct 2009 09:57:33 +0000 Subject: Parsing of CreateXMLSignatureResponse improved (needed for SHA256 based signatures). git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@347 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../knowcenter/wag/egov/egiz/sig/connectors/mocca/MOCCAHelper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/mocca/MOCCAHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/mocca/MOCCAHelper.java index 7e32230..f13b5af 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/mocca/MOCCAHelper.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/mocca/MOCCAHelper.java @@ -74,9 +74,13 @@ public final class MOCCAHelper { // SignatureValue String sig_val = null; - Matcher signatureValueMatcher = Pattern.compile("<(\\w+:)?SignatureValue( Id=\"[\\w-]+\")?>\\s*(.*)\\s*").matcher(xmlResponse); + Pattern signatureValuePattern = Pattern.compile("<(\\w+:)?SignatureValue( Id=\"[\\w-]+\")?>\\s*(.*)\\s*", Pattern.DOTALL); + Matcher signatureValueMatcher = signatureValuePattern.matcher(xmlResponse); if (signatureValueMatcher.find()) { sig_val = signatureValueMatcher.group(3); + if (sig_val != null) { + sig_val = sig_val.replaceAll("\\s", ""); + } } log.debug("sig_val = " + sig_val); -- cgit v1.2.3