aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2017-01-25 11:54:29 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2017-01-25 11:54:29 +0100
commit2972ec31c2bd59434be9ac12872baa30141325df (patch)
treeae6bae01a2573fad4f5685987c13ff44f6eeb7bc /moaSig/moa-sig-lib/src/main/java/at/gv/egovernment
parentb0d77d439a8df6b09648e19b1ec93f24eadfbe7b (diff)
downloadmoa-sig-2972ec31c2bd59434be9ac12872baa30141325df.tar.gz
moa-sig-2972ec31c2bd59434be9ac12872baa30141325df.tar.bz2
moa-sig-2972ec31c2bd59434be9ac12872baa30141325df.zip
update QC evaluation from TSL --> if TSL support is enabled for the requested TrustProfile than ONLY QC information from TSL is used
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/CertificateUtils.java71
1 files changed, 41 insertions, 30 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/CertificateUtils.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/CertificateUtils.java
index ad64052..ce78580 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/CertificateUtils.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/util/CertificateUtils.java
@@ -259,26 +259,33 @@ public class CertificateUtils {
}
}
- //evaluate QC statement according previous selected information
- if (qcSourceTSL)
- Logger.debug("Certificate is QC (Source: TSL)");
-
- else {
- // if TSL return no service-type identifier us information from certificate
- if (tslServiceTypeIdentifier == null ||
- MiscUtil.isEmpty(tslServiceTypeIdentifier.toString())) {
- // try certificate extensions QCP and QcEuCompliance
- Logger.debug("QC check via TSL returned false - checking certificate extensions");
- boolean checkQCP = CertificateUtils.checkQCP(chain[0]);
- boolean checkQcEuCompliance = CertificateUtils.checkQcEuCompliance(chain[0]);
-
- if ((checkQCP || checkQcEuCompliance) && !qcDisallowedFromTSL) {
- Logger.debug("Certificate is QC (Source: Certificate)");
- qc = true;
-
- }
- }
- }
+ /*
+ * This block is removes with MOA-SP 3.1 because if TSL support is enabled for the requested TrustProfile
+ * QC evaluation is ONLY allowed from TSL information!!! Because with eIDAS regulation and July 01. 2016
+ * the Trust-Status List is constitutive.
+ */
+// //evaluate QC statement according previous selected information
+// if (qcSourceTSL)
+// Logger.debug("Certificate is QC (Source: TSL)");
+//
+// else {
+//
+//
+// // if TSL return no service-type identifier us information from certificate
+// if (tslServiceTypeIdentifier == null ||
+// MiscUtil.isEmpty(tslServiceTypeIdentifier.toString())) {
+// // try certificate extensions QCP and QcEuCompliance
+// Logger.debug("QC check via TSL returned false - checking certificate extensions");
+// boolean checkQCP = CertificateUtils.checkQCP(chain[0]);
+// boolean checkQcEuCompliance = CertificateUtils.checkQcEuCompliance(chain[0]);
+//
+// if ((checkQCP || checkQcEuCompliance) && !qcDisallowedFromTSL) {
+// Logger.debug("Certificate is QC (Source: Certificate)");
+// qc = true;
+//
+// }
+// }
+// }
//evaluate SSCD/QSCD results according previous selected information
@@ -313,13 +320,14 @@ public class CertificateUtils {
return result;
} else {
- Logger.debug("Qualifier check via TSL return null - checking certificate extensions");
- return parseInfosFromCertificate(chain);
+ Logger.debug("Qualifier check via TSL return null - checking certificate extensions without QC evaluation");
+ return parseInfosFromCertificate(chain, false);
}
} else
- return parseInfosFromCertificate(chain);
+ Logger.info("TSL support is not enabled - checking certificate extensions with QC evaluation ");
+ return parseInfosFromCertificate(chain, true);
}
catch (TslException e) {
MessageProvider msg = MessageProvider.getInstance();
@@ -330,19 +338,22 @@ public class CertificateUtils {
}
- private static QCSSCDResult parseInfosFromCertificate(X509Certificate[] chain) {
+ private static QCSSCDResult parseInfosFromCertificate(X509Certificate[] chain, boolean performQCEvaluation) {
boolean qc = false;
boolean sscd = false;
// Trustprofile is not TSL enabled - use certificate extensions only
- // perform QC check
- // try certificate extensions QCP and QcEuCompliance
- boolean checkQCP = CertificateUtils.checkQCP(chain[0]);
- boolean checkQcEuCompliance = CertificateUtils.checkQcEuCompliance(chain[0]);
+ if (performQCEvaluation) {
+ // perform QC check
+ // try certificate extensions QCP and QcEuCompliance
+ boolean checkQCP = CertificateUtils.checkQCP(chain[0]);
+ boolean checkQcEuCompliance = CertificateUtils.checkQcEuCompliance(chain[0]);
- if (checkQCP || checkQcEuCompliance)
- qc = true;
+ if (checkQCP || checkQcEuCompliance)
+ qc = true;
+
+ }
// perform SSCD check
// try certificate extensions QCP+ and QcEuSSCD