aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common/src/main/java/at/gv
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-06-25 13:10:41 +0200
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-06-28 14:22:51 +0200
commit759f2277f9b6cf339d8fcc5631ea547855ab9e56 (patch)
treef88357ef218dd1b0037909b61d76c350730c1f69 /pdf-as-common/src/main/java/at/gv
parent897664089ed6b3082d3dcca946533c83268a79bb (diff)
downloadpdf-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')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/DefaultSignatureProfileSettings.java3
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/CheckSignatureBlockParameters.java15
2 files changed, 14 insertions, 4 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/DefaultSignatureProfileSettings.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/DefaultSignatureProfileSettings.java
index ff9c6d0f..6e288a27 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/DefaultSignatureProfileSettings.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/settings/DefaultSignatureProfileSettings.java
@@ -68,8 +68,7 @@ public class DefaultSignatureProfileSettings {
public static final String SIG_BLOCK_PARAMETER_DEFAULT_KEY_REGEX = "^([A-za-z]){1,20}$";
// public static final String SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX = "^([\\p{Print}-ß_'\\+\\!\u00e4\u00f6\u00fc" +
// "\u00c4\u00d6\u00dc]){1,100}$";
-public static final String SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX = "^([\\p{Print}ߧ€\u00e4\u00f6\u00fc\u00c4\u00d6" +
- "\u00dc]){1,100}$";
+public static final String SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX = "^([\\p{Print}\u00df\u00A7\u20AC\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc]){1,100}$";
static {
profileSettings.put(KEY_SIG_SUBJECT, new SignatureProfileEntry(KEY_SIG_SUBJECT, KEY_SIG_SUBJECT_DEFAULT, VALUE_SIG_SUBJECT_DEFAULT) );
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;