esig / dss-demonstrations

Examples of DSS integration
GNU Lesser General Public License v2.1
92 stars 70 forks source link

DSS Demo WebApp SOAP interface is unable to validate XAdES with multi documents #21

Closed ak91hu closed 2 years ago

ak91hu commented 3 years ago

I use DSS Demo WebApp v5.7 to sign documents with SOAP webservice. I signed a document with XAdES_BASELINE_LTA level, detached packaging and ASiC_S container type. I see following in getDataToSign response:

<ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></ds:SignatureMethod>
<ds:Reference Id="r-id-2d34b1394fb5942a843b9d2a7393c29c-1" URI="package.zip"><ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>

After signing process the signed file is container-signed-xades-baseline-lta.scs, which contains a package.zip named file. I am not sure, why it is present in container instead of 2 standalone files. When I try to validate signed file with DSS Demo following error is shown:

Oops... An error occurred! Unable to close entry In log:

2020-12-04 11:20:42,146 WARN | http-nio-8080-exec-4 | eu.europa.esig.dss.asic.c
ommon.ASiCUtils | ZIP container contains a malformed, corrupted or not accessible entry! The entry is skipped. Reason: [Unexpected end of ZLIB input stream]
2020-12-04 11:20:42,206 ERROR | http-nio-8080-exec-4 | e.europa.esig.dss.web.con
troller.GlobalExceptionHandler | Unhandled exception occurred : Unable to close
entry eu.europa.esig.dss.model.DSSException: Unable to close entry
bsanchezb commented 2 years ago

Hello,

Please see the specification for ASiC container. In short: when using ASiC-S all files are combined within a single archive "package.zip" which is actually signed, while when using ASiC-E profile, the files are stored within a created container as it is and signed directly.

So, if you expect to have multiple files within your ASiC, you need to use ASiC-E profile.

Best regards, Aleksandr.