diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-06-25 13:10:41 +0200 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-06-28 14:22:51 +0200 |
commit | 759f2277f9b6cf339d8fcc5631ea547855ab9e56 (patch) | |
tree | f88357ef218dd1b0037909b61d76c350730c1f69 /pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils | |
parent | 897664089ed6b3082d3dcca946533c83268a79bb (diff) | |
download | pdf-as-4-759f2277f9b6cf339d8fcc5631ea547855ab9e56.tar.gz pdf-as-4-759f2277f9b6cf339d8fcc5631ea547855ab9e56.tar.bz2 pdf-as-4-759f2277f9b6cf339d8fcc5631ea547855ab9e56.zip |
seems to work on most systems ..
Diffstat (limited to 'pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils')
-rw-r--r-- | pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java index c2e6b81d..756a240c 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java @@ -1,24 +1,35 @@ package at.gv.egiz.pdfas.common.utils; import at.gv.egiz.pdfas.common.settings.DefaultSignatureProfileSettings; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Map; public class CheckSignatureBlockParameters { + private static final Logger logger = LoggerFactory + .getLogger(CheckSignatureBlockParameters.class); public static boolean checkSignatureBlockParameterMapIsValid(Map<String, String> map, String keyRegex, String valueRegex) { + + logger.trace("regex1:"+keyRegex+", regex1:"+valueRegex); if(keyRegex == null || keyRegex.length() == 0) { keyRegex = DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_KEY_REGEX; } if(valueRegex == null || valueRegex.length() == 0) { valueRegex = DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX; } + logger.trace("regex2:"+keyRegex+", regex2:"+valueRegex); for(String key : map.keySet()){ - if(isValid(key, keyRegex) == false) + if(isValid(key, keyRegex) == false) { + logger.error("Invalid key:"+key+", regex:"+keyRegex); return false; - if(isValid(map.get(key), valueRegex) == false) + } + if(isValid(map.get(key), valueRegex) == false) { + logger.error("Invalid value:"+map.get(key)+", regex:"+valueRegex); return false; + } } return true; |