From 9868b02903f950566206ee736bf5e9edbeeac5f3 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 7 Feb 2019 12:47:00 +0100 Subject: add additional PAdES verification information and some more small updates --- .../invoke/VerifyCMSSignatureResponseBuilder.java | 49 ++++++++++++++-------- 1 file changed, 31 insertions(+), 18 deletions(-) (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java') diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java index 22bae71..2b2e2cf 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java @@ -132,23 +132,27 @@ public class VerifyCMSSignatureResponseBuilder { certificateCheck, adesResults, extendedCertificateCheckResult, - sigAlgName); + sigAlgName, + null, + null); responseElements.add(responseElement); } - /** - * Add a verification result to the response. - * - * @param result The result to add. - * @param trustprofile The actual trustprofile - * @param checkQCFromTSL true, if the TSL check verifies the - * certificate as qualified, otherwise false. - * @param checkSSCD true, if the TSL check verifies the - * signature based on a SSDC, otherwise false. - * @param sscdSourceTSL true, if the SSCD information comes from the TSL, - * otherwise false. - * @throws MOAException - */ +/** + * + * @param result + * @param trustProfile + * @param checkQC + * @param qcSourceTSL + * @param checkSSCD + * @param sscdSourceTSL + * @param issuerCountryCode + * @param adesResults + * @param extendedCertificateCheckResult + * @param tslInfos + * @param extendedVerification + * @throws MOAException + */ public void addResult(PDFSignatureVerificationResult result, TrustProfile trustProfile, boolean checkQC, boolean qcSourceTSL, boolean checkSSCD, boolean sscdSourceTSL, String issuerCountryCode, List adesResults, ExtendedCertificateCheckResult extendedCertificateCheckResult, TslInfos tslInfos, boolean extendedVerification) throws MOAException { @@ -167,10 +171,17 @@ public class VerifyCMSSignatureResponseBuilder { //add signature algorithm name in case of extended validation String sigAlgName = null; - if (extendedVerification) - sigAlgName = result.getSignatureAlgorithmName(); - + Boolean coversFullDoc = null; + int[] sigByteRange = null; + if (extendedVerification) { + sigAlgName = result.getSignatureAlgorithmName(); + coversFullDoc = result.byteRangeCoversWholeDocument(); + sigByteRange = result.getByteRange(); + + } + + //set code 99 if not certcheckresult exists int certificateCheckCode = 99; if (certResult != null) { @@ -205,7 +216,9 @@ public class VerifyCMSSignatureResponseBuilder { certificateCheck, adesResults, extendedCertificateCheckResult, - sigAlgName); + sigAlgName, + coversFullDoc, + sigByteRange); responseElements.add(responseElement); } -- cgit v1.2.3