aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-asic
diff options
context:
space:
mode:
authortlenz <thomas.lenz@egiz.gv.at>2017-06-27 10:38:31 +0200
committertlenz <thomas.lenz@egiz.gv.at>2017-06-27 10:38:31 +0200
commitd69e3b6fb1dec68c0142eda193d1302f5a1ea383 (patch)
treefaa7d6422210f3320503ddf3d3b24152e049e80c /moaSig/moa-asic
parent997b70350b176d8e01ede2653785346555b6aca0 (diff)
parent25f28669519773054184d6695114f38c5da4e177 (diff)
downloadmoa-sig-d69e3b6fb1dec68c0142eda193d1302f5a1ea383.tar.gz
moa-sig-d69e3b6fb1dec68c0142eda193d1302f5a1ea383.tar.bz2
moa-sig-d69e3b6fb1dec68c0142eda193d1302f5a1ea383.zip
lokal merge
Merge branch 'nightlybuild' of https://gitlab.iaik.tugraz.at/egiz/moa-sig into nightlybuild
Diffstat (limited to 'moaSig/moa-asic')
-rw-r--r--moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedXAdESVerifier.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedXAdESVerifier.java b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedXAdESVerifier.java
index 58f0185..c07efd9 100644
--- a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedXAdESVerifier.java
+++ b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedXAdESVerifier.java
@@ -7,6 +7,7 @@ import at.gv.egiz.asic.api.ASiC;
import at.gv.egiz.asic.api.ASiCEntry;
import at.gv.egiz.asic.api.ASiCFormat;
import at.gv.egiz.asic.api.ASiCVerificationResult;
+import at.gv.egovernment.moa.spss.MOAApplicationException;
import at.gv.egovernment.moa.spss.MOAException;
import at.gv.egovernment.moa.spss.MOARuntimeException;
import at.gv.egovernment.moa.spss.MOASystemException;
@@ -85,6 +86,15 @@ public class ExtendedXAdESVerifier extends XAdESVerifier {
"XAdESSignatures".equals(rootElement.getLocalName())) {
XAdESSignaturesType xAdESSignaturesType = JAXB.unmarshal(xadesSignature.getContents(), XAdESSignaturesType.class);
xmlSignatures = xAdESSignaturesType.getSignature();
+
+ //TODO: maybe add additional XAdES version
+ } else if ("http://uri.etsi.org/02918/v1.1.1#".equals(rootElement.getNamespaceURI()) &&
+ "XAdESSignatures".equals(rootElement.getLocalName())) {
+
+ logger.warn("ASiC v1.1.1 is not supported any more. MOA-SP only supports v1.2.1 (http://uri.etsi.org/02918/v1.2.1#)");
+ //XAdESSignaturesType xAdESSignaturesType = JAXB.unmarshal(xadesSignature.getContents(), XAdESSignaturesType.class);
+ //xmlSignatures = xAdESSignaturesType.getSignature();
+
} else {
NodeList childrenNodes = rootElement.getChildNodes();
for(int i = 0; i < childrenNodes.getLength(); i++) {
@@ -108,6 +118,12 @@ public class ExtendedXAdESVerifier extends XAdESVerifier {
//namespaces.put("asic", "http://uri.etsi.org/02918/v1.2.1#");
namespaces.put("ds", "http://www.w3.org/2000/09/xmldsig#");
+ if (xmlSignatures == null || xmlSignatures.size() == 0) {
+ logger.info("ASiC container does not include a signature or signature format is not supported");
+ throw new MOAApplicationException("asic.0016", null);
+
+ }
+
for (int i = 0; i < xmlSignatures.size(); i++) {
//NodeList nodes = (NodeList) result;