From 49de61fea3ad3fc7811a537bf8bbffc4cbf618c7 Mon Sep 17 00:00:00 2001 From: knowcenter Date: Mon, 23 Jul 2007 13:40:18 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@139 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java b/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java index cdc0aa8..6ea0a5b 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java @@ -65,6 +65,7 @@ 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.tools.Normalizer; +import at.knowcenter.wag.egov.egiz.web.SessionInformation; import at.knowcenter.wag.exactparser.ParseDocument; import at.knowcenter.wag.exactparser.parsing.PDFUtils; import at.knowcenter.wag.exactparser.parsing.results.HeaderParseResult; @@ -774,16 +775,25 @@ public abstract class PdfAS // TODO the choosing algorithm should be extracted into a visitor or factory design pattern. public static List verifySignatureHoldersWeb(List signature_holders, - String connector, String loc_ref) throws PDFDocumentException, NormalizeException, SignatureException + // String connector, String loc_ref) throws PDFDocumentException, NormalizeException, SignatureException + SessionInformation sessionInfo, String loc_ref) throws PDFDocumentException, NormalizeException, SignatureException { List results = new ArrayList(); + for (int i = 0; i < signature_holders.size(); i++) { SignatureHolder holder = (SignatureHolder) signature_holders.get(i); - - SignatureResponse result = verifyWeb(holder, connector, loc_ref); + SignatureResponse result = verifyWeb(holder, sessionInfo.connector, loc_ref); results.add(result); + + // increment current_operation to be sure that every signature holder is verified + // if not incremented, the first document is always verified correctly but other not + // because the first document is everytime sent to MOA. + // FIXXME: running too slow + + sessionInfo.current_operation++; } + return results; } @@ -905,6 +915,7 @@ public abstract class PdfAS SignSignatureObject so = SignatureObjectHelper.convertSignatureObjectToSignSignatureObject(so_to_be_verified); String profile = so_to_be_verified.getSignatureTypeDefinition().getType(); + Connector c = ConnectorChooser.chooseWebConnectorForVerify(connector, so_to_be_verified.getKZ(), so.id, profile, loc_ref); return c.doVerify(sd, so); -- cgit v1.2.3