diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2017-11-27 09:19:33 +0100 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2017-11-27 09:19:33 +0100 |
commit | 95ce1a4f7e2b0be1d359e815fe7e631609c44844 (patch) | |
tree | 4d992c2813a109aa6b56d7125df37a63fb466a1f /moaSig | |
parent | 887d2444a1e75b0ff5f1d63127f71570c24f921d (diff) | |
download | moa-sig-95ce1a4f7e2b0be1d359e815fe7e631609c44844.tar.gz moa-sig-95ce1a4f7e2b0be1d359e815fe7e631609c44844.tar.bz2 moa-sig-95ce1a4f7e2b0be1d359e815fe7e631609c44844.zip |
change some log levels
Diffstat (limited to 'moaSig')
4 files changed, 33 insertions, 75 deletions
diff --git a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/api/ASiCFactory.java b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/api/ASiCFactory.java index 6b067f7..661e418 100644 --- a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/api/ASiCFactory.java +++ b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/api/ASiCFactory.java @@ -78,7 +78,7 @@ public class ASiCFactory { String fileComment = commentReaderStream.getFileComment(); ASiCFormat fileCommentFormat = null; if (fileComment != null) { - logger.info("Found file comment in ASiC {}", fileComment); + logger.debug("Found file comment in ASiC {}", fileComment); if(fileComment.startsWith("mimetype=")) { String fileCommentMimeType = fileComment.substring("mimetype=".length()); if(fileCommentMimeType.startsWith(MIMETYPE_FORMAT_E)) { @@ -94,7 +94,7 @@ public class ASiCFactory { ASiCFormat mimeTypeFileFormat = null; if (mimeTypeFile != null) { - logger.info("Found mimetype file in ASiC {}", mimeTypeFile); + logger.debug("Found mimetype file in ASiC {}", mimeTypeFile); if(MIMETYPE_FORMAT_E.equalsIgnoreCase(mimeTypeFile)) { mimeTypeFileFormat = ASiCFormat.ASiCE; } else if(MIMETYPE_FORMAT_S.equalsIgnoreCase(mimeTypeFile)) { diff --git a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/BaseVerifier.java b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/BaseVerifier.java index a0bc516..cc2d363 100644 --- a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/BaseVerifier.java +++ b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/BaseVerifier.java @@ -34,7 +34,7 @@ public abstract class BaseVerifier implements Verifier { String referenceHex = Hex.encodeHexString(reference); String calculatedHex = Hex.encodeHexString(calculated); if(Arrays.equals(reference, calculated)) { - logger.info("Digest from manifest do match for {}", refName); + logger.debug("Digest from manifest do match for {}", refName); return true; } else { logger.info("Digest from manifest do not match for {}", refName); diff --git a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedCAdESVerifier.java b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedCAdESVerifier.java index e71f263..9f16035 100644 --- a/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedCAdESVerifier.java +++ b/moaSig/moa-asic/src/main/java/at/gv/egiz/asic/impl/verifier/ExtendedCAdESVerifier.java @@ -120,7 +120,7 @@ public class ExtendedCAdESVerifier extends CAdESVerifier { dis.close(); String fullDigest = Hex.encodeHexString(md.digest()); - logger.info("CMS Input data {}", fullDigest); + logger.debug("CMS Input data {}", fullDigest); if (!allReferencesValid) { logger.warn("ASiCManifest {} References do not match data files!", 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 188e8e2..42d34fc 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 @@ -147,7 +147,7 @@ public class CMSSignatureVerificationInvoker { // build the profile if (request.isPDF()) { PDFSignatureVerificationProfile profile = profileFactory.createPDFProfile(); - Logger.info("Sending PDFSignatureVerificationProfile to IAIK-MOA"); + Logger.debug("Sending PDFSignatureVerificationProfile to IAIK-MOA"); PDFSignatureVerificationModule module = iaik.server.modules.pdfverify.PDFSignatureVerificationModuleFactory .getInstance(); @@ -174,7 +174,7 @@ public class CMSSignatureVerificationInvoker { // get the signed content signedContent = getSignedContent(request); CMSSignatureVerificationProfile profile = profileFactory.createProfile(); - Logger.info("Sending CMSSignatureVerificationProfile to IAIK-MOA"); + Logger.debug("Sending CMSSignatureVerificationProfile to IAIK-MOA"); // verify the signature CMSSignatureVerificationModule module = CMSSignatureVerificationModuleFactory.getInstance(); @@ -276,24 +276,28 @@ public class CMSSignatureVerificationInvoker { adesResults = AdESResultUtils.getAdESResult(result.getFormVerificationResult()); - if (adesResults != null) { + if (Logger.isDebugEnabled() && adesResults != null) { Iterator adesIterator = adesResults.iterator(); - while (adesIterator.hasNext()) { - Logger.info("ADES Formresults: " + adesIterator.next().toString()); - } + while (adesIterator.hasNext()) + Logger.debug("ADES Formresults: " + adesIterator.next().toString()); + } + try { //Logger.info("Extended Validation Report: " + result.getName()); - Logger.info("Extended Validation Code: " + result.getResultCode().toString()); - Logger.info("Extended Validation Info: " + result.getInfo()); + Logger.debug("Extended Validation Code: " + result.getResultCode().toString()); + Logger.debug("Extended Validation Info: " + result.getInfo()); extCheckResult = AdESResultUtils.getExtendedResult(result.getResultCode()); + } catch (NullPointerException e) { Logger.info("No extendend validation result available."); + } } else { - Logger.info("Got CMSSignatureVerificationResult"); + Logger.debug("Got CMSSignatureVerificationResult"); cmsResult = (CMSSignatureVerificationResult) resultObject; + } String issuerCountryCode = null; @@ -342,29 +346,34 @@ public class CMSSignatureVerificationInvoker { cmsResult = result.getPDFSignatureVerificationResult(); adesResults = AdESResultUtils.getAdESResult(result.getFormVerificationResult()); - if (adesResults != null) { + if (Logger.isDebugEnabled() && adesResults != null) { Iterator adesIterator = adesResults.iterator(); - while (adesIterator.hasNext()) { - Logger.info("ADES Formresults: " + adesIterator.next().toString()); - } + while (adesIterator.hasNext()) + Logger.debug("ADES Formresults: " + adesIterator.next().toString()); + } + cmsResult = result.getPDFSignatureVerificationResult(); + try { - //Logger.info("Extended Validation Report: " + result.getName()); - Logger.info("Extended Validation Code: " + result.getResultCode().toString()); + Logger.debug("Extended Validation Code: " + result.getResultCode().toString()); + if (result.getDetailedExtendedReport() != null) - Logger.info("Extended Validation Info: " + result.getDetailedExtendedReport().getMessage()); + Logger.debug("Extended Validation Info: " + result.getDetailedExtendedReport().getMessage()); else - Logger.info("Extended Validation Info: " + result.getInfo()); + Logger.debug("Extended Validation Info: " + result.getInfo()); - Logger.debug("Full extended Validation Infos: " + result.getInfo()); - + + Logger.debug("Full extended Validation Infos: " + result.getInfo()); extCheckResult = AdESResultUtils.getExtendedResult(result.getResultCode()); + } catch (NullPointerException e) { Logger.info("No extendend validation result available."); + } + } else { - Logger.info("Got PDFSignatureVerificationResult"); + Logger.debug("Got PDFSignatureVerificationResult"); cmsResult = (PDFSignatureVerificationResult) resultObject; } @@ -505,55 +514,4 @@ public class CMSSignatureVerificationInvoker { } } - - private List getAdESResult(ExtendedCMSSignatureVerificationResult adesFormVerification) throws ConfigurationException { - if (adesFormVerification == null) { - // no form information - return null; - } - - List adesList = new ArrayList(); - Logger.info("Checking AdES Results:"); - - //AdESResultUtils.buildResult(adesFormVerification.getDetailedExtendedReport(), adesList); - - //AdESResultUtils.checkSubResult(adesFormVerification.getSubResult(AdESConstants.LONG_TERM_VALIDATION), - // SignatureVerificationProfile.LEVEL_LTA, adesList); - AdESResultUtils.checkSubResult(adesFormVerification.getSubResult(AdESConstants.LONG_TERM_VALIDATION), - SignatureVerificationProfile.LEVEL_LT, adesList); - AdESResultUtils.checkSubResult(adesFormVerification.getSubResult(AdESConstants.ADES_T_VALIDATION), - SignatureVerificationProfile.LEVEL_T, adesList); - AdESResultUtils.checkSubResult(adesFormVerification.getSubResult("basic report"), - SignatureVerificationProfile.LEVEL_B, adesList); - - return adesList; - } - - private List getAdESResult(ExtendedPDFSignatureVerificationResult adesFormVerification) throws ConfigurationException { - if (adesFormVerification == null) { - // no form information - return null; - } - - 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); - */ - - AdESResultUtils.checkSubResult(adesFormVerification.getSubResult(AdESConstants.LONG_TERM_VALIDATION), - SignatureVerificationProfile.LEVEL_LT, adesList); - AdESResultUtils.checkSubResult(adesFormVerification.getSubResult(AdESConstants.ADES_T_VALIDATION), - SignatureVerificationProfile.LEVEL_T, adesList); - AdESResultUtils.checkSubResult(adesFormVerification.getSubResult("basic report"), - SignatureVerificationProfile.LEVEL_B, adesList); - - return adesList; - } } |