@Test public void indicationNotChangingQesSignatureLevel() { ValidationConclusion validationConclusion = getDefaultValidationConclusion(SignatureQualification.QES); ReportBuilderUtils.processSignatureIndications(validationConclusion, QES_POLICY); assertTotalPassed(validationConclusion); }
public static void processSignatureIndications(ValidationConclusion validationConclusion, String policyName) { if (QES_POLICY.equals(policyName)) { for (SignatureValidationData signature : validationConclusion.getSignatures()) { if (SignatureValidationData.Indication.TOTAL_PASSED.toString().equals(signature.getIndication())) { String signatureLevel = signature.getSignatureLevel(); if (SignatureQualification.ADESEAL_QC.name().equals(signatureLevel) || SignatureQualification.QES.name().equals(signatureLevel) || SignatureQualification.QESIG.name().equals(signatureLevel) || SignatureQualification.QESEAL.name().equals(signatureLevel)) { continue; } else if (SignatureQualification.ADESIG_QC.name().equals(signatureLevel)) { signature.getWarnings().add(getSignatureLevelWarning()); continue; } signature.setIndication(SignatureValidationData.Indication.TOTAL_FAILED); signature.getErrors().add(getSignatureLevelNotAcceptedError()); validationConclusion.setValidSignaturesCount(validationConclusion.getValidSignaturesCount() - 1); } } } }
ReportBuilderUtils { public static void processSignatureIndications(ValidationConclusion validationConclusion, String policyName) { if (QES_POLICY.equals(policyName)) { for (SignatureValidationData signature : validationConclusion.getSignatures()) { if (SignatureValidationData.Indication.TOTAL_PASSED.toString().equals(signature.getIndication())) { String signatureLevel = signature.getSignatureLevel(); if (SignatureQualification.ADESEAL_QC.name().equals(signatureLevel) || SignatureQualification.QES.name().equals(signatureLevel) || SignatureQualification.QESIG.name().equals(signatureLevel) || SignatureQualification.QESEAL.name().equals(signatureLevel)) { continue; } else if (SignatureQualification.ADESIG_QC.name().equals(signatureLevel)) { signature.getWarnings().add(getSignatureLevelWarning()); continue; } signature.setIndication(SignatureValidationData.Indication.TOTAL_FAILED); signature.getErrors().add(getSignatureLevelNotAcceptedError()); validationConclusion.setValidSignaturesCount(validationConclusion.getValidSignaturesCount() - 1); } } } } }
ReportBuilderUtils { public static void processSignatureIndications(ValidationConclusion validationConclusion, String policyName) { if (QES_POLICY.equals(policyName)) { for (SignatureValidationData signature : validationConclusion.getSignatures()) { if (SignatureValidationData.Indication.TOTAL_PASSED.toString().equals(signature.getIndication())) { String signatureLevel = signature.getSignatureLevel(); if (SignatureQualification.ADESEAL_QC.name().equals(signatureLevel) || SignatureQualification.QES.name().equals(signatureLevel) || SignatureQualification.QESIG.name().equals(signatureLevel) || SignatureQualification.QESEAL.name().equals(signatureLevel)) { continue; } else if (SignatureQualification.ADESIG_QC.name().equals(signatureLevel)) { signature.getWarnings().add(getSignatureLevelWarning()); continue; } signature.setIndication(SignatureValidationData.Indication.TOTAL_FAILED); signature.getErrors().add(getSignatureLevelNotAcceptedError()); validationConclusion.setValidSignaturesCount(validationConclusion.getValidSignaturesCount() - 1); } } } }  }
ReportBuilderUtils { public static void processSignatureIndications(ValidationConclusion validationConclusion, String policyName) { if (QES_POLICY.equals(policyName)) { for (SignatureValidationData signature : validationConclusion.getSignatures()) { if (SignatureValidationData.Indication.TOTAL_PASSED.toString().equals(signature.getIndication())) { String signatureLevel = signature.getSignatureLevel(); if (SignatureQualification.ADESEAL_QC.name().equals(signatureLevel) || SignatureQualification.QES.name().equals(signatureLevel) || SignatureQualification.QESIG.name().equals(signatureLevel) || SignatureQualification.QESEAL.name().equals(signatureLevel)) { continue; } else if (SignatureQualification.ADESIG_QC.name().equals(signatureLevel)) { signature.getWarnings().add(getSignatureLevelWarning()); continue; } signature.setIndication(SignatureValidationData.Indication.TOTAL_FAILED); signature.getErrors().add(getSignatureLevelNotAcceptedError()); validationConclusion.setValidSignaturesCount(validationConclusion.getValidSignaturesCount() - 1); } } } }  static String emptyWhenNull(String value); static String valueNotPresent(); static String valueNotKnown(); static SimpleDateFormat getDateFormatterWithGMTZone(); static Policy createReportPolicy(ValidationPolicy validationPolicy); static ValidatedDocument createValidatedDocument(boolean reportSignatureEnabled, String filename, byte[] document); static void processSignatureIndications(ValidationConclusion validationConclusion, String policyName); static String getValidationTime(); }
ReportBuilderUtils { public static void processSignatureIndications(ValidationConclusion validationConclusion, String policyName) { if (QES_POLICY.equals(policyName)) { for (SignatureValidationData signature : validationConclusion.getSignatures()) { if (SignatureValidationData.Indication.TOTAL_PASSED.toString().equals(signature.getIndication())) { String signatureLevel = signature.getSignatureLevel(); if (SignatureQualification.ADESEAL_QC.name().equals(signatureLevel) || SignatureQualification.QES.name().equals(signatureLevel) || SignatureQualification.QESIG.name().equals(signatureLevel) || SignatureQualification.QESEAL.name().equals(signatureLevel)) { continue; } else if (SignatureQualification.ADESIG_QC.name().equals(signatureLevel)) { signature.getWarnings().add(getSignatureLevelWarning()); continue; } signature.setIndication(SignatureValidationData.Indication.TOTAL_FAILED); signature.getErrors().add(getSignatureLevelNotAcceptedError()); validationConclusion.setValidSignaturesCount(validationConclusion.getValidSignaturesCount() - 1); } } } }  static String emptyWhenNull(String value); static String valueNotPresent(); static String valueNotKnown(); static SimpleDateFormat getDateFormatterWithGMTZone(); static Policy createReportPolicy(ValidationPolicy validationPolicy); static ValidatedDocument createValidatedDocument(boolean reportSignatureEnabled, String filename, byte[] document); static void processSignatureIndications(ValidationConclusion validationConclusion, String policyName); static String getValidationTime(); static final String FORMAT_NOT_FOUND; }