aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/pdf
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-01-11 10:58:48 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-01-11 10:58:48 +0000
commit4ce2fbc415f2fae57842b2e13a0817bb63594434 (patch)
tree709565a905002f7d02f474d46ce7bf548b3e6fc8 /src/main/java/at/knowcenter/wag/egov/egiz/pdf
parent511fcf7604d754475860a85834af43eecc44d61f (diff)
downloadpdf-as-3-4ce2fbc415f2fae57842b2e13a0817bb63594434.tar.gz
pdf-as-3-4ce2fbc415f2fae57842b2e13a0817bb63594434.tar.bz2
pdf-as-3-4ce2fbc415f2fae57842b2e13a0817bb63594434.zip
- check implemented: responses are validated upon valid SL content (ErrorResponse, Create|VerifyXMLSignatureResponse) (ErrorCode 340)
- new errorcode added (340: unable to receive suitable response) - default signature validation links changed (-> http://www.signaturpruefung.gv.at) - recognition of non-textual objects: static switch implemented allowing to configure behaviour (at compile time) in case of signatures (default behaviour: skip detection of all signatures as non-textual objects) - minor bug fixed: invalid evaluation of response charset resulting in invalid warn debug message - configuration updated - Default configuration updated git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@542 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/pdf')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java13
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/ObjectExtractor.java17
2 files changed, 24 insertions, 6 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java
index db5b082..1db1de0 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java
@@ -110,7 +110,14 @@ public class AdobeSignatureHelper {
// Standard filter
// sig.setLocation("location is not visible");
// sig.setReason("reason is not visible");
- sig.setContact(getVerifyUrl(profileId));
+
+ // contact field is used to embed signature verification url for adobe handler
+ String verifyURL = getVerifyUrl(profileId);
+ if (!StringUtils.isEmpty(verifyURL)) {
+ sig.setContact(getVerifyUrl(profileId));
+ } else {
+ logger.debug("No verify URL set -> verify URL is not embedded.");
+ }
// sig.setDate(new PdfDate());
String reason = getAdobeReasonName(profileId);
@@ -166,11 +173,11 @@ public class AdobeSignatureHelper {
}
private static String getAdobeReasonName(String sigProfile) {
- return getDefaultableConfigProperty(sigProfile, ADOBE_SIGN_REASONNAME_KEY, null);
+ return getDefaultableConfigProperty(sigProfile, ADOBE_SIGN_REASONNAME_KEY, "Informationen zur Prüfung finden Sie unter http://www.signaturpruefung.gv.at");
}
private static String getVerifyUrl(String sigProfile) {
- return getDefaultableConfigProperty(sigProfile, ADOBE_VERIFY_URL_KEY, "https://www.buergerkarte.at/signature-verification");
+ return getDefaultableConfigProperty(sigProfile, ADOBE_VERIFY_URL_KEY, "http://www.signaturpruefung.gv.at");
}
private static String getDefaultableConfigProperty(String sigProfile, String propName, String defaultValue) {
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/ObjectExtractor.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/ObjectExtractor.java
index cd6d449..4516b6b 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/ObjectExtractor.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/ObjectExtractor.java
@@ -26,6 +26,12 @@ import at.gv.egiz.pdfas.framework.input.PdfDataSource;
*/
public class ObjectExtractor {
private static Logger log = Logger.getLogger(ObjectExtractor.class);
+
+ /*
+ * If set <code>true</code> signature annotations are not extracted otherwise
+ * all signatures except PDF-AS signatures are extracted.
+ */
+ private final static boolean SKIP_SIGNATURES = true;
/**
* Find annotation objects in pdf documents
@@ -50,10 +56,15 @@ public class ObjectExtractor {
}
String ft = anno.getDictionary().getNameAsString("FT");
if (ft != null && ft.equals("Sig")) { // skip signature widgets
- COSDictionary sigDict = (COSDictionary) anno.getDictionary().getDictionaryObject("V");
- if (sigDict != null && AdobeSignatureHelper.ADOBE_SIG_FILTER.equals(sigDict.getNameAsString("Filter"))) {
- log.debug("found PDF-AS signature widged, skip further extraction");
+ if (SKIP_SIGNATURES) {
+ log.debug("found signature widged, skip extraction");
continue;
+ } else {
+ COSDictionary sigDict = (COSDictionary) anno.getDictionary().getDictionaryObject("V");
+ if (sigDict != null && AdobeSignatureHelper.ADOBE_SIG_FILTER.equals(sigDict.getNameAsString("Filter"))) {
+ log.debug("found PDF-AS signature widged, skip extraction");
+ continue;
+ }
}
}
NonTextObjectInfo objInfo = new NonTextObjectInfo();