aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib/src')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/OutputConstants.java2
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java4
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java2
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/AdESResultUtils.java28
4 files changed, 24 insertions, 12 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/OutputConstants.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/OutputConstants.java
index 83519d2..c264475 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/OutputConstants.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/OutputConstants.java
@@ -2,7 +2,7 @@ package at.gv.egovernment.moa.spss;
import java.lang.reflect.Field;
-import iaik.server.modules.ResultCode;
+import iaik.server.modules.resultcodes.ResultCode;
public class OutputConstants {
public static void main(String[] argv) throws IllegalArgumentException, IllegalAccessException {
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
index d618bab..34d6a22 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java
@@ -288,8 +288,6 @@ public class CMSSignatureVerificationInvoker {
Logger.info("Extended Validation Info: " + result.getInfo());
extCheckResult = AdESResultUtils.getExtendedResult(result.getResultCode());
- } catch (ConfigurationException e) {
- Logger.warn("Cannot generate Extendend Result. Check SVA Configuration!", e);
} catch (NullPointerException e) {
Logger.info("No extendend validation result available.");
}
@@ -357,8 +355,6 @@ public class CMSSignatureVerificationInvoker {
Logger.info("Extended Validation Info: " + result.getInfo());
extCheckResult = AdESResultUtils.getExtendedResult(result.getResultCode());
- } catch (ConfigurationException e) {
- Logger.warn("Cannot generate Extendend Result. Check SVA Configuration!", e);
} catch (NullPointerException e) {
Logger.info("No extendend validation result available.");
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java
index 827728c..e68092f 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java
@@ -260,8 +260,6 @@ public class XMLSignatureVerificationInvoker {
extCheckResult = AdESResultUtils.getExtendedResult(result.getResultCode());
responseBuilder.setExtendedCertificateCheckResult(extCheckResult);
- } catch (ConfigurationException e) {
- Logger.warn("Cannot generate Extendend Result. Check SVA Configuration!", e);
} catch (NullPointerException e) {
Logger.info("No extendend validation result available.");
}
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 b6bba93..b1fee06 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
@@ -12,19 +12,24 @@ import at.gv.egovernment.moaspss.logging.Logger;
import iaik.esi.sva.validation.ValidationReport;
import iaik.server.ConfigurationException;
import iaik.server.modules.AdESVerificationResult;
-import iaik.server.modules.ResultCode;
-import iaik.server.modules.ResultCodeInvalid;
-import iaik.server.modules.ResultCodeValid;
import iaik.server.modules.SignatureVerificationProfile;
import iaik.server.modules.SignatureVerificationResult;
+import iaik.server.modules.resultcodes.ResultCode;
+import iaik.server.modules.resultcodes.ResultCodeError;
+import iaik.server.modules.resultcodes.ResultCodeInvalid;
+import iaik.server.modules.resultcodes.ResultCodeSkipped;
+import iaik.server.modules.resultcodes.ResultCodeValid;
public class AdESResultUtils {
+ private static final int MAJORRESULTCODESKIPPED = new Integer(3);
+ private static final int MAJORRESULTCODEERROR = new Integer(4);
+
public static Integer getResultCode(Integer adesCode) {
return adesCode;
}
- public static ExtendedCertificateCheckResult getExtendedResult(iaik.server.modules.ResultCode resultCode) {
+ public static ExtendedCertificateCheckResult getExtendedResult(iaik.server.modules.resultcodes.ResultCode resultCode) {
ExtendedCertificateCheckResult check = null;
int majorCode = -1;
@@ -37,9 +42,19 @@ public class AdESResultUtils {
if (resultCode instanceof ResultCodeValid) {
majorCode = SignatureVerificationResult.VALID;
majorInfo = "VALID";
+
} else if (resultCode instanceof ResultCodeInvalid) {
majorCode = SignatureVerificationResult.INVALID;
majorInfo = "INVALID";
+
+ } else if (resultCode instanceof ResultCodeSkipped) {
+ majorCode = MAJORRESULTCODESKIPPED;
+ majorInfo = "SKIPPED";
+
+ } else if (resultCode instanceof ResultCodeError) {
+ majorCode = MAJORRESULTCODEERROR;
+ majorInfo = "ERROR";
+
} else {
majorCode = SignatureVerificationResult.INDETERMINATE;
majorInfo = "INDETERMINATE";
@@ -93,7 +108,10 @@ public class AdESResultUtils {
minorInfo = "UNKNOWN_COMMITMENT_TYPE";
} else if (resultCode.getCode().equals(ResultCode.SUCCESS)) {
minorInfo = "SUCCESS";
+ } else if (resultCode.getCode().equals(ResultCode.UNKNOWN_SUBFILTER)) {
+ minorInfo = "UNKNOWN_SUBFILTER";
}
+
}
check = new ExtendedCertificateCheckResultImpl(majorCode, majorInfo, minorCode,
@@ -198,7 +216,7 @@ public class AdESResultUtils {
try {
AdESFormResultsImpl adESFormResultsImpl = new AdESFormResultsImpl();
- ResultCode resultCode = subResult.getResultCode();
+ iaik.server.modules.resultcodes.ResultCode resultCode = subResult.getResultCode();
if (resultCode instanceof ResultCodeValid) {
adESFormResultsImpl.setCode(SignatureVerificationResult.VALID);// .getResultCode().getCode()));
} else if (resultCode instanceof ResultCodeInvalid) {