aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java15
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;