diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2009-04-27 08:16:42 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2009-04-27 08:16:42 +0000 |
commit | c4efec1daeb50b30d363bb9fb83aec5435dbf2ad (patch) | |
tree | e64dabcd20551714fb5f342d504927995e8c648a /src/main/java/at/knowcenter/wag/egov/egiz/web/servlets | |
parent | a8c39b215939a0ddd01f4c110fbc9070fbb8d9ca (diff) | |
download | pdf-as-3-c4efec1daeb50b30d363bb9fb83aec5435dbf2ad.tar.gz pdf-as-3-c4efec1daeb50b30d363bb9fb83aec5435dbf2ad.tar.bz2 pdf-as-3-c4efec1daeb50b30d363bb9fb83aec5435dbf2ad.zip |
New signature layout for new MOCCA bku integrated (etsi-moc-1.1).
New architecture implemented that allows different signature layouts for single types of BKUs.
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@337 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/web/servlets')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/DataURLServlet.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/DataURLServlet.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/DataURLServlet.java index 7947d90..7cf762e 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/DataURLServlet.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/DataURLServlet.java @@ -42,13 +42,17 @@ import at.knowcenter.wag.egov.egiz.PdfASID; import at.knowcenter.wag.egov.egiz.exceptions.ConnectorException;
import at.knowcenter.wag.egov.egiz.exceptions.InvalidIDException;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
+import at.knowcenter.wag.egov.egiz.exceptions.SettingsException;
import at.knowcenter.wag.egov.egiz.exceptions.SignatorFactoryException;
import at.knowcenter.wag.egov.egiz.exceptions.SignatureException;
import at.knowcenter.wag.egov.egiz.pdf.SignatureHolder;
import at.knowcenter.wag.egov.egiz.sig.SignatureResponse;
import at.knowcenter.wag.egov.egiz.sig.connectors.ConnectorChooser;
import at.knowcenter.wag.egov.egiz.sig.connectors.LocalConnector;
+import at.knowcenter.wag.egov.egiz.sig.connectors.bku.BKUHelper;
import at.knowcenter.wag.egov.egiz.sig.connectors.bku.BKUPostConnection;
+import at.knowcenter.wag.egov.egiz.sig.signaturelayout.SignatureLayoutHandler;
+import at.knowcenter.wag.egov.egiz.sig.signaturelayout.SignatureLayoutHandlerFactory;
import at.knowcenter.wag.egov.egiz.web.FormFields;
import at.knowcenter.wag.egov.egiz.web.LocalRequest;
import at.knowcenter.wag.egov.egiz.web.LocalRequestHelper;
@@ -200,7 +204,17 @@ public class DataURLServlet extends HttpServlet log.trace("processSign");
String xml_response = retrieveXMLResponse(request);
+ Properties response_properties = BKUHelper.getBKUProperties(request);
+ String bkuIdentifier = BKUHelper.getBKUIdentifier(response_properties);
+ log.debug("BKU identifier: \"" + bkuIdentifier + "\"");
+
+ try {
+ SignatureLayoutHandlerFactory.verifyBKUSupport(bkuIdentifier);
+ } catch (SettingsException e) {
+ throw new ConnectorException(e.getErrorCode(), e.getMessage());
+ }
+
if (isNullResponse(xml_response))
{
log.debug("Received a NullOperationResponse -> answering with the first request."); //$NON-NLS-1$
@@ -210,12 +224,6 @@ public class DataURLServlet extends HttpServlet log.debug("There are still requests to be performed -> answering with request."); //$NON-NLS-1$
- // TODO[tknall] Parse user agent's cce type and version in order to prevent unsupported cces from signing pdfs
- // http://www.buergerkarte.at/konzept/securitylayer/spezifikation/aktuell/bindings/bindings.html#http.kodierung.response.dataurl
- log.debug("BKU response header \"user-agent\" header: " + request.getHeader("User-Agent"));
- // http://www.buergerkarte.at/konzept/securitylayer/spezifikation/aktuell/bindings/bindings.html#http.kodierung.response.browser
- log.debug("BKU response header \"server\" header: " + request.getHeader("Server"));
-
LocalRequest local_request = si.localRequest;
String request_string = local_request.getRequestString();
@@ -229,16 +237,8 @@ public class DataURLServlet extends HttpServlet {
log.debug("Received a normal response -> storing the response."); //$NON-NLS-1$
- Properties response_properties = new Properties();
response_properties.setProperty(BKUPostConnection.RESPONSE_STRING_KEY, xml_response);
- String userAgent = request.getHeader("User-Agent");
- if (userAgent != null) {
- response_properties.setProperty(BKUPostConnection.BKU_USER_AGENT_HEADER_KEY, userAgent);
- } else {
- log.warn("BKU request/response header \"User-Agent\" is empty.");
- }
-
si.response_properties = response_properties;
log.debug("All requests have been processed -> processing the responses."); //$NON-NLS-1$
|