diff options
author | knowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-05-18 15:42:55 +0000 |
---|---|---|
committer | knowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-05-18 15:42:55 +0000 |
commit | 8f2a983cb8e9be9e71e3df04edd00a4bc0673862 (patch) | |
tree | 141e477bd1086e21f80dba750b6f93036827c280 /src/main/java/at/knowcenter/wag/egov/egiz/web/servlets | |
parent | dce5ed9e0a30ed7f03b21a8142029847a1194a2c (diff) | |
download | pdf-as-3-8f2a983cb8e9be9e71e3df04edd00a4bc0673862.tar.gz pdf-as-3-8f2a983cb8e9be9e71e3df04edd00a4bc0673862.tar.bz2 pdf-as-3-8f2a983cb8e9be9e71e3df04edd00a4bc0673862.zip |
detached connectors
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@92 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/web/servlets')
3 files changed, 16 insertions, 21 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 7d7220c..72f7c2d 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 @@ -25,7 +25,9 @@ import at.knowcenter.wag.egov.egiz.PdfASID; import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
import at.knowcenter.wag.egov.egiz.framework.Signator;
import at.knowcenter.wag.egov.egiz.framework.SignatorFactory;
+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.BKUPostConnection;
import at.knowcenter.wag.egov.egiz.sig.connectors.bku.EnvelopedBase64BKUConnector;
@@ -152,7 +154,7 @@ public class DataURLServlet extends HttpServlet if (si.sign_result == null)
{
- LocalConnector c = new LocRefDetachedBKUConnector(si.type, "loc ref content not needed here"); //$NON-NLS-1$
+ LocalConnector c = ConnectorChooser.chooseLocalConnectorForSign(si.connector, si.type, "loc ref content not needed here"); //$NON-NLS-1$
si.iui.signed_signature_object = c.analyzeSignResponse(si.response_properties[0]);
@@ -172,7 +174,12 @@ public class DataURLServlet extends HttpServlet for (int i = 0; i < si.response_properties.length; i++)
{
- LocalConnector c = new LocRefDetachedBKUConnector(si.type, "loc ref content not needed here"); //$NON-NLS-1$
+ SignatureHolder sh = (SignatureHolder) si.signature_holders.get(i);
+
+ PdfASID sig_kz = sh.getSignatureObject().getKZ();
+ String sig_id = sh.getSignatureObject().getSignationIds();
+
+ LocalConnector c = ConnectorChooser.chooseLocalConnectorForVerify(si.connector, sig_kz, sig_id, si.type, "loc ref content not needed here"); //$NON-NLS-1$
SignatureResponse sig_resp = c.analyzeVerifyResponse(si.response_properties[i]);
results.add(sig_resp);
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java index f2cbde8..a98fb79 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/web/servlets/SignServlet.java @@ -58,6 +58,7 @@ import at.knowcenter.wag.egov.egiz.sig.ConnectorFactory; import at.knowcenter.wag.egov.egiz.sig.SignatureData;
import at.knowcenter.wag.egov.egiz.sig.SignatureDataImpl;
import at.knowcenter.wag.egov.egiz.sig.connectors.Connector;
+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.DetachedBKUConnector;
import at.knowcenter.wag.egov.egiz.sig.connectors.bku.EnvelopedBase64BKUConnector;
@@ -430,7 +431,7 @@ public class SignServlet extends HttpServlet URL signature_data_URL = new URL(request.getScheme(), host, request.getServerPort(), request.getContextPath() + "/RetrieveSignatureData");
String signature_data_url = response.encodeURL(signature_data_URL.toString());
- Connector c = new DetachedLocRefMOAConnector(si.type, signature_data_url);
+ Connector c = ConnectorChooser.chooseWebConnectorForSign(si.connector, si.type, signature_data_url);
si.iui.signed_signature_object = c.doSign(si.iui.signature_data);
si.sign_result = signator.finishSign(si.iui);
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 ee20498..40ec9d9 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 @@ -22,7 +22,6 @@ import java.io.UnsupportedEncodingException; import java.net.URL;
import java.util.Iterator;
import java.util.List;
-import java.util.Properties;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
@@ -36,33 +35,17 @@ import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.log4j.Logger;
import at.knowcenter.wag.egov.egiz.PdfAS;
-import at.knowcenter.wag.egov.egiz.cfg.ConfigLogger;
import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
-import at.knowcenter.wag.egov.egiz.exceptions.ConnectorFactoryException;
-import at.knowcenter.wag.egov.egiz.exceptions.NormalizeException;
import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
-import at.knowcenter.wag.egov.egiz.exceptions.SignatureException;
-import at.knowcenter.wag.egov.egiz.exceptions.SignatureTypesException;
import at.knowcenter.wag.egov.egiz.framework.VerificationFilter;
-import at.knowcenter.wag.egov.egiz.pdf.SignatureHolder;
import at.knowcenter.wag.egov.egiz.sig.ConnectorFactory;
-import at.knowcenter.wag.egov.egiz.sig.SignatureData;
-import at.knowcenter.wag.egov.egiz.sig.SignatureDataImpl;
-import at.knowcenter.wag.egov.egiz.sig.SignatureObject;
-import at.knowcenter.wag.egov.egiz.sig.connectors.LocalConnector;
-import at.knowcenter.wag.egov.egiz.sig.connectors.bku.LocRefDetachedBKUConnector;
-import at.knowcenter.wag.egov.egiz.sig.connectors.bku.SignSignatureObject;
-import at.knowcenter.wag.egov.egiz.tools.CodingHelper;
import at.knowcenter.wag.egov.egiz.web.FormFields;
-import at.knowcenter.wag.egov.egiz.web.LocalRequest;
import at.knowcenter.wag.egov.egiz.web.LocalRequestHelper;
import at.knowcenter.wag.egov.egiz.web.SessionAttributes;
import at.knowcenter.wag.egov.egiz.web.SessionInformation;
-import at.knowcenter.wag.egov.egiz.web.servlets.SignServlet.UploadedData;
/**
* This method is the verify servlet for the pdf-as web application. It takes
@@ -144,7 +127,11 @@ public class VerifyServlet extends HttpServlet return;
}
- List results = PdfAS.verifySignatureHolders(signature_holders, si.connector);
+ String host = request.getServerName();
+ URL loc_ref_URL = new URL(request.getScheme(), host, request.getServerPort(), request.getContextPath() + "/RetrieveSignatureData");
+ String loc_ref_url = response.encodeURL(loc_ref_URL.toString());
+
+ List results = PdfAS.verifySignatureHoldersWeb(signature_holders, si.connector, loc_ref_url);
dispatchToResults(results, request, response);
}
|