aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java5
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/OldMOAIdFormatter.java2
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java35
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java1
-rw-r--r--webapp/jsp/local_connection_page.jsp3
-rw-r--r--webapp/jsp/null_request_page.jsp43
-rw-r--r--webapp/jsp/results.jsp6
7 files changed, 86 insertions, 9 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java
index 318f215..aedb7e3 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java
@@ -3,6 +3,11 @@
*/
package at.knowcenter.wag.egov.egiz.sig.connectors.moa;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
import java.security.cert.X509Certificate;
import java.util.Properties;
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/OldMOAIdFormatter.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/OldMOAIdFormatter.java
index ab322d9..bf1bd48 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/OldMOAIdFormatter.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/OldMOAIdFormatter.java
@@ -15,7 +15,7 @@ public class OldMOAIdFormatter implements IdFormatter
*/
public String formatIds(String[] ids)
{
- return "etsi-bka-moa-1.0";
+ return null;//"etsi-bka-moa-1.0";
}
}
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java
index e8443d7..82aad9a 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/LocalRequestHelper.java
@@ -18,6 +18,7 @@
package at.knowcenter.wag.egov.egiz.web;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.Properties;
@@ -25,6 +26,9 @@ import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import at.knowcenter.wag.egov.egiz.exceptions.ConnectorFactoryException;
import at.knowcenter.wag.egov.egiz.exceptions.NormalizeException;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
@@ -38,6 +42,7 @@ import at.knowcenter.wag.egov.egiz.sig.connectors.LocalConnector;
import at.knowcenter.wag.egov.egiz.sig.connectors.bku.SignSignatureObject;
import at.knowcenter.wag.egov.egiz.sig.signatureobject.SignatureObjectHelper;
import at.knowcenter.wag.egov.egiz.tools.CodingHelper;
+import at.knowcenter.wag.egov.egiz.web.servlets.SignServlet;
/**
* Contains commonly used helper functions for the local request procedure.
@@ -60,6 +65,8 @@ public abstract class LocalRequestHelper
* The resource of the redirect refresh page jsp.
*/
public static final String REDIRECT_REFRESH_PAGE_JSP = "/jsp/redirect_refresh_page.jsp";
+
+ private static Log log = LogFactory.getLog(LocalRequestHelper.class);
/**
* Sets up the local sign procedure.
@@ -77,7 +84,7 @@ public abstract class LocalRequestHelper
String host = request.getServerName(); // "129.27.153.77"
URL loc_ref_URL = new URL(request.getScheme(), host, request.getServerPort(), request.getContextPath() + "/RetrieveSignatureData");
String loc_ref_url = response.encodeURL(loc_ref_URL.toString());
-
+
LocalConnector c = ConnectorChooser.chooseLocalConnectorForSign(si.connector, si.type, loc_ref_url);
String sign_request = c.prepareSignRequest(si.iui.signature_data);
@@ -94,6 +101,11 @@ public abstract class LocalRequestHelper
request.setAttribute("local_request_url", local_request_url);
request.setAttribute("data_url", data_url);
+
+ URL local_server = new URL(request.getScheme(), host, request.getServerPort(),null);
+ String loc_server = response.encodeURL(local_server.toString());
+
+ request.setAttribute("loc_server", loc_server);
return NULL_REQUEST_PAGE_JSP;
@@ -203,9 +215,13 @@ public abstract class LocalRequestHelper
URL data_URL = new URL(request.getScheme(), host, request.getServerPort(), request.getContextPath() + "/DataURL");
String data_url = response.encodeURL(data_URL.toString());
-
+
+ //URL local_server_url = new URL(request.getScheme(), host, request.getServerPort(), "/");
+ //String loc_server_url = response.encodeURL(local_server_url.toString());
+
request.setAttribute("local_request_url", local_request_url);
request.setAttribute("data_url", data_url);
+ //request.setAttribute("loc_server_url", loc_server_url);
return NULL_REQUEST_PAGE_JSP;
@@ -326,4 +342,19 @@ public abstract class LocalRequestHelper
output = output.replaceAll(">", ">");
return output;
}
+
+ public static String getLocalServerAddress(HttpServletRequest request, HttpServletResponse response)
+ {
+ String host = request.getServerName();
+ URL local_server = null;
+ try {
+ local_server = new URL(request.getScheme(), host, request.getServerPort(), "/");
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ String loc_server = response.encodeURL(local_server.toString());
+
+ return loc_server;
+ }
}
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java
index 3ae5d1b..b53a9a1 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/VerifyServlet.java
@@ -123,6 +123,7 @@ public class VerifyServlet extends HttpServlet
if (ConnectorFactory.isConnectorLocal(si.connector))
{
String dispatch_to = LocalRequestHelper.processLocalVerify(si, si.signature_holders, request, response);
+
dispatch(request, response, dispatch_to);
return;
}
diff --git a/webapp/jsp/local_connection_page.jsp b/webapp/jsp/local_connection_page.jsp
index 91ba403..16c7ea1 100644
--- a/webapp/jsp/local_connection_page.jsp
+++ b/webapp/jsp/local_connection_page.jsp
@@ -14,7 +14,6 @@
</head>
<body onload="document.submitform.submit()">
-
<div class="maindiv">
<h1>PDF-AS Amtssignaturen</h1>
@@ -44,7 +43,7 @@
</div>
-<a class="big" href="/pdf-as/">zurück</a>
+<a class="big" href="/pdf-as/">zur&uuml;ck</a>
</div>
</body>
</html>
diff --git a/webapp/jsp/null_request_page.jsp b/webapp/jsp/null_request_page.jsp
index 60e35a9..7bb3541 100644
--- a/webapp/jsp/null_request_page.jsp
+++ b/webapp/jsp/null_request_page.jsp
@@ -9,6 +9,45 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>PDF-AS Amtssignaturen Lokale Verbindung</title>
<link rel="stylesheet" type="text/css" href="/pdf-as/css/styles.css" />
+
+<script type="text/javascript">
+
+var req;
+
+function init() {
+
+ if (window.XMLHttpRequest) { req = new XMLHttpRequest(); }
+ else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
+
+ var url = "<%= local_request_url %>";
+ var formdata = "XMLRequest=<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>";
+ formdata += "&DataURL=<%= data_url %>";
+
+ req.open("post", url, true);
+ req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
+ req.onreadystatechange = processXMLResponse;
+ req.send(formdata);
+}
+
+function processXMLResponse() {
+ try
+ {
+ //readyState of 4 or 'complete' represents
+ //that data has been returned
+ if (xmlHttp.readyState == 4 ||
+ xmlHttp.readyState == 'complete')
+ {
+ var response = req.responseText;
+ alert(response);
+ }
+ else
+ alert("not ok");
+ }
+ catch(e){}
+}
+
+</script>
+
</head>
<body onload="document.submitform.submit()">
@@ -41,7 +80,7 @@
</div>
-<a class="big" href="/pdf-as/">zurück</a>
+<a class="big" href="/pdf-as/">zur&uuml;ck</a>
</div>
</body>
-</html>
+</html> \ No newline at end of file
diff --git a/webapp/jsp/results.jsp b/webapp/jsp/results.jsp
index 833c35a..02e084f 100644
--- a/webapp/jsp/results.jsp
+++ b/webapp/jsp/results.jsp
@@ -2,6 +2,8 @@
<%@ page import="java.util.List" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="at.knowcenter.wag.egov.egiz.sig.SignatureResponse" %>
+<%@ page import="at.knowcenter.wag.egov.egiz.web.LocalRequestHelper" %>
+
<%
List results = (List) request.getAttribute("results");
Object bb = request.getAttribute("backbutton");
@@ -16,7 +18,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>PDF-AS Amtssignaturen Resultat</title>
- <link rel="stylesheet" type="text/css" href="/pdf-as/css/styles.css" />
+ <link rel="stylesheet" type="text/css" href="<%=LocalRequestHelper.getLocalServerAddress(request,response)%>pdf-as/css/styles.css" />
</head>
<body>
<div class="maindiv">
@@ -83,7 +85,7 @@
if (backbutton)
{
%>
-<a class="big" href="/pdf-as/">zur&uuml;ck</a>
+<a class="big" href="<%=LocalRequestHelper.getLocalServerAddress(request,response)%>pdf-as/">zur&uuml;ck</a>
<%
}
%>