diff options
7 files changed, 53 insertions, 22 deletions
| diff --git a/spss.slinterface/WEB-INF/lib/xercesImpl-2.6.0ex24783.jar b/spss.slinterface/WEB-INF/lib/xercesImpl-2.6.0ex24783.jarBinary files differ new file mode 100644 index 000000000..02250b0af --- /dev/null +++ b/spss.slinterface/WEB-INF/lib/xercesImpl-2.6.0ex24783.jar diff --git a/spss.slinterface/WEB-INF/lib/xmlParserAPIs-2.6.0ex24783.jar b/spss.slinterface/WEB-INF/lib/xmlParserAPIs-2.6.0ex24783.jarBinary files differ new file mode 100644 index 000000000..2dd837714 --- /dev/null +++ b/spss.slinterface/WEB-INF/lib/xmlParserAPIs-2.6.0ex24783.jar diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/Constants.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/Constants.java index 1529317fa..8dd6a87ff 100644 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/Constants.java +++ b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/Constants.java @@ -23,6 +23,8 @@ public class Constants    public static final String IP_TEMP_DIR_ = "location.tempdir";    public static final String IP_SP_ENDPOINT_ = "service.sp.endpoint";    public static final String IP_SP_TRUSTPROFILEID_ = "service.sp.trustProfileId"; +  public static final String IP_RES_SHOWETSI_ = "result.showetsi"; +  public static final String IP_RES_SHOWSLMAN_ = "result.showslmanifest";    // Logging hierarchies diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java index 904640b71..94e3dac22 100644 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java +++ b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/beans/DataInfoBean.java @@ -72,12 +72,16 @@ public class DataInfoBean implements HttpSessionBindingListener    private static final String XPATH_SIG_ENV_CONTENT_ = "/" + Constants.NSPRE_MOA_12_ + ":VerifyXMLSignatureRequest/" +      Constants.NSPRE_MOA_12_ + ":VerifySignatureInfo/" + Constants.NSPRE_MOA_12_ + ":VerifySignatureEnvironment/*"; -   -      private static final String SLXHTML_TYPE_PREFIX_ = "http://www.buergerkarte.at/specifications/" +       "Security-Layer/20031113?Name=SignedImage&InstanceDocRef="; -    ServletContext context_; +  private static final String ETSI_TYPE_ = "http://uri.etsi.org/01903/v1.1.1#SignedProperties"; +  private static final String SLMANIFEST_TYPE_ =  +    "http://www.buergerkarte.at/specifications/Securitylayer/20020225#SignatureManifest"; +    +   +  ServletContext context_; +  Properties initProps_;    /**     * Contains objects of type {@link HashInputDataInfo}. @@ -92,6 +96,7 @@ public class DataInfoBean implements HttpSessionBindingListener      HttpSession session) throws Exception    {      context_ = context; +    initProps_ = (Properties) context_.getAttribute(Constants.WSCP_INIT_PROPS_);      hashInputDataInfos_ = new ArrayList();      int hashInputDataCount_ = 0; @@ -99,8 +104,7 @@ public class DataInfoBean implements HttpSessionBindingListener      Element moaResponseElem = moaResponseDoc.getDocumentElement();      List hidElems = DOMUtils.getChildElems(moaResponseElem, Constants.NSURI_MOA_12_, HID_ELEM_, false); -    Properties initProps = (Properties) context_.getAttribute(Constants.WSCP_INIT_PROPS_); -    String tempDir = initProps.getProperty(Constants.IP_TEMP_DIR_); +    String tempDir = initProps_.getProperty(Constants.IP_TEMP_DIR_);      if (tempDir == null)      {        String message = "Init property \"" + Constants.IP_TEMP_DIR_ + "\" not set."; @@ -305,9 +309,9 @@ public class DataInfoBean implements HttpSessionBindingListener        }      } -    // Change the src attributes of all img tags so that they refer to the temporary names      if (allImgsSigned)      { +      // Change the src attributes of all img tags so that they refer to the temporary names        for (int i = 0; i < imgTags.getLength(); i++)        {          Element currImgElem = (Element) imgTags.item(i); @@ -315,24 +319,21 @@ public class DataInfoBean implements HttpSessionBindingListener          HashInputDataInfo currHidi = (HashInputDataInfo) signedImages.get(uri);          Attr srcAttr = currImgElem.getAttributeNode(SRC_ATTR_); -        int slashPos = currHidi.filename_.lastIndexOf('/'); -        if (slashPos == -1) slashPos = 0; -        String newSrcAttrValue = currHidi.filename_.substring(slashPos + 1); +        int slashPos = currHidi.filename_.lastIndexOf('\\'); +        Properties initProps = (Properties) context_.getAttribute(Constants.WSCP_INIT_PROPS_); +        String tempDir = initProps.getProperty(Constants.IP_TEMP_DIR_); +        String newSrcAttrValue = "." + tempDir + currHidi.filename_.substring(slashPos + 1);          srcAttr.setNodeValue(newSrcAttrValue);        } -    } -     -    // Mark hid slxhtml document -    hid.isSLXHTMLDocument_ = true; -    // Serialize modified slxhtml document to temporary file location -    if (allImgsSigned) -    { +      // Mark hid as slxhtml document +      hid.isSLXHTMLDocument_ = true; + +      // Serialize modified slxhtml document to temporary file location        FileOutputStream slxhtmlFOS = new FileOutputStream(hid.filename_);        MOAInvoker.serializeDocument(slxhtmlDoc, slxhtmlFOS);        slxhtmlFOS.close();      } -    }    /* ---------------------------------------------------------------------------------------------------- */ @@ -366,6 +367,23 @@ public class DataInfoBean implements HttpSessionBindingListener        }      } +    // Check signature references if they refer to etsi attributes or to a SL manifest +    for (int i = 0; i < dsigRefs.getLength(); i++) +    { +      Element currRef = (Element) dsigRefs.item(i); +      String type = currRef.getAttribute(TYPE_ATTR_); +      if (type != null && type.equals(ETSI_TYPE_)) +      { +        HashInputDataInfo currHidi = (HashInputDataInfo)hashInputDataInfos.get(i); +        currHidi.doShow_ = new Boolean(initProps_.getProperty(Constants.IP_RES_SHOWETSI_).trim()).booleanValue(); +      } +      if (type != null && type.equals(SLMANIFEST_TYPE_)) +      { +        HashInputDataInfo currHidi = (HashInputDataInfo)hashInputDataInfos.get(i); +        currHidi.doShow_ = new Boolean(initProps_.getProperty(Constants.IP_RES_SHOWSLMAN_).trim()).booleanValue(); +      } +    } +          return imgHids;    } diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java index 3a78b07f4..f7cfb7e6c 100644 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java +++ b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java @@ -71,7 +71,7 @@ public class HashInputDataServlet extends HttpServlet      dataInfo.setHashInputDataCount(hidCount);      String hidFilename = dataInfo.getHashInputDataFilename(); -    // Set response headers +    // Set content type      boolean isSLXHTML = dataInfo.getIsSLXHTMLDocument();      String contenType = (isSLXHTML) ? "text/html" : "application/octet-stream";      response.setContentType(contenType); diff --git a/spss.slinterface/pages/resultOverview.jsp b/spss.slinterface/pages/resultOverview.jsp index deaa43709..cda562bbc 100644 --- a/spss.slinterface/pages/resultOverview.jsp +++ b/spss.slinterface/pages/resultOverview.jsp @@ -182,9 +182,17 @@          dataInfo.setHashInputDataCount(i);
          String hashDataInputURL = dataInfo.getHashInputDataURL();
          if (hashDataInputURL == null) break;
 -        if (i > 0) out.println("<br/>");
 -        out.print("<a href=\"" + response.encodeURL(request.getContextPath() + dataInfo.getHashInputDataURL()) + "\">");
 -        out.print("Datum Nr." + (i + 1) + "</a>");
 +        boolean doShow = dataInfo.getShowHashInputData();
 +        if (doShow)
 +        {
 +	        if (i > 0) out.println("<br/>");
 +	        out.print("<a href=\"" + response.encodeURL(request.getContextPath() + dataInfo.getHashInputDataURL()) + "\"");
 +	        boolean isSLXHTML = dataInfo.getIsSLXHTMLDocument();
 +	        if (isSLXHTML) out.write(" target=\"_blank\"");
 +	        out.print(">Datum Nr." + (i + 1));
 +	        if (isSLXHTML) out.print(" (SLXHTML Dokument)");
 +	        out.print("</a>");
 +	    }
          i++;
        }
        while (true);
 diff --git a/spss.slinterface/res/resources/properties/init.properties b/spss.slinterface/res/resources/properties/init.properties index 1f8f9b1ce..9025644c9 100644 --- a/spss.slinterface/res/resources/properties/init.properties +++ b/spss.slinterface/res/resources/properties/init.properties @@ -8,4 +8,7 @@ location.schema.slxhtml = /WEB-INF/classes/resources/schemas/slxhtml-1.0/slxhtml  location.tempdir = /workDir/temp/  service.sp.endpoint = http://localhost:8080/moa-spss/services/SignatureVerification -service.sp.trustProfileId = TrustProfile1
\ No newline at end of file +service.sp.trustProfileId = TrustProfile1 + +result.showetsi = true +result.showslmanifest = true
\ No newline at end of file | 
