aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2017-02-27 13:59:51 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2017-02-27 13:59:51 +0100
commit0defe2a024c95922610549f8475c614dec0eadb4 (patch)
tree148c4dfa3cd1fbf3620d342ee1c041cdb2e255e7 /moaSig/moa-sig-lib/src
parentc462ee197210016dc7f3ae84683b826201806685 (diff)
downloadmoa-sig-0defe2a024c95922610549f8475c614dec0eadb4.tar.gz
moa-sig-0defe2a024c95922610549f8475c614dec0eadb4.tar.bz2
moa-sig-0defe2a024c95922610549f8475c614dec0eadb4.zip
change form-validation result in WebService response
Diffstat (limited to 'moaSig/moa-sig-lib/src')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java34
1 files changed, 26 insertions, 8 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java
index 4903391..41d363d 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import at.gv.egovernment.moa.sig.tsl.utils.MiscUtil;
import at.gv.egovernment.moa.spss.api.common.ExtendedCertificateCheckResult;
import at.gv.egovernment.moa.spss.api.impl.AdESFormResultsImpl;
import at.gv.egovernment.moa.spss.api.impl.ExtendedCertificateCheckResultImpl;
@@ -110,14 +111,31 @@ public class AdESResultUtils {
List adesList = new ArrayList();
- checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_LTA),
- SignatureVerificationProfile.LEVEL_LTA, adesList);
- checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_LT),
- SignatureVerificationProfile.LEVEL_LT, adesList);
- checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_T),
- SignatureVerificationProfile.LEVEL_T, adesList);
- checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_B),
- SignatureVerificationProfile.LEVEL_B, adesList);
+ //add only the completed form result to response
+ String completedForm = adesFormVerification.getCompleteForm();
+ if (MiscUtil.isNotEmpty(completedForm)) {
+ Logger.info("Form-validation found completed form: " + completedForm);
+ AdESVerificationResult subResult = adesFormVerification.getSubResult(completedForm);
+ checkSubResult(subResult, completedForm, adesList);
+ if (Logger.isDebugEnabled())
+ Logger.debug("Detailed Result: \n" + subResult.getInfo());
+
+ } else
+ Logger.info("Form-valdition found NO completed form.");
+
+ if (Logger.isDebugEnabled())
+ Logger.debug("Full form-validation result: \n" + adesFormVerification.getInfo());
+
+
+ //add results for all form types to response
+// checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_LTA),
+// SignatureVerificationProfile.LEVEL_LTA, adesList);
+// checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_LT),
+// SignatureVerificationProfile.LEVEL_LT, adesList);
+// checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_T),
+// SignatureVerificationProfile.LEVEL_T, adesList);
+// checkSubResult(adesFormVerification.getSubResult(SignatureVerificationProfile.LEVEL_B),
+// SignatureVerificationProfile.LEVEL_B, adesList);
return adesList;
}