diff options
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/pdf/AdobeSignatureHelper.java | 24 |
1 files changed, 13 insertions, 11 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 1ce0b6f..db5b082 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 @@ -3,13 +3,9 @@ package at.knowcenter.wag.egov.egiz.pdf; import java.util.HashMap;
import java.util.Iterator;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.XMLGregorianCalendar;
-
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import at.gv.egiz.pdfas.api.commons.Constants;
import at.gv.egiz.pdfas.exceptions.ErrorCode;
import at.gv.egiz.pdfas.framework.signator.SignatorInformation;
import at.gv.egiz.pdfas.utils.OgnlUtil;
@@ -20,7 +16,6 @@ import at.knowcenter.wag.egov.egiz.sig.SignatureObject; import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.AcroFields;
-import com.lowagie.text.pdf.PdfDate;
import com.lowagie.text.pdf.PdfDictionary;
import com.lowagie.text.pdf.PdfName;
import com.lowagie.text.pdf.PdfObject;
@@ -48,6 +43,8 @@ public class AdobeSignatureHelper { public static final String ADOBE_SIG_TEXT_KEY = "adobeSignText";
+ private static final String ADOBE_VERIFY_URL_KEY = "verifyURL";
+
/**
* Writes Adobe-pdf signature entry with itext
*
@@ -62,9 +59,10 @@ public class AdobeSignatureHelper { try {
logger.debug("Creating adobe signature field.");
- PdfSignatureAppearance sap = stamper.getSignatureAppearance();
+ PdfSignatureAppearance sap = stamper.getSignatureAppearance();
- String fieldName = getAdobeFieldName(so.getSignatureTypeDefinition().getType());
+ String profileId = so.getSignatureTypeDefinition().getType();
+ String fieldName = getAdobeFieldName(profileId);
// find field num
/*
int nexSigNum = 1;
@@ -106,16 +104,16 @@ public class AdobeSignatureHelper { subfilter = so.getKZ().toString();
} else if (si != null) {
subfilter = si.getSignSignatureObject().kz;
- }
+ }
PdfSignature sig = new PdfSignature(new PdfName(ADOBE_SIG_FILTER), new PdfName(subfilter));
// the following fields are not shown by the reader, because its is no
// Standard filter
// sig.setLocation("location is not visible");
// sig.setReason("reason is not visible");
- // sig.setContact("contact is not visible");
+ sig.setContact(getVerifyUrl(profileId));
// sig.setDate(new PdfDate());
- String reason = getAdobeReasonName(so.getSignatureTypeDefinition().getType());
+ String reason = getAdobeReasonName(profileId);
if (!StringUtils.isEmpty(reason)) {
sig.setReason(reason);
}
@@ -129,7 +127,7 @@ public class AdobeSignatureHelper { }
*/
- sig.setName(getAdobeSignText(so.getSignatureTypeDefinition().getType(), si));
+ sig.setName(getAdobeSignText(profileId, si));
sap.setCryptoDictionary(sig);
// content element is mandatory but empty
@@ -171,6 +169,10 @@ public class AdobeSignatureHelper { return getDefaultableConfigProperty(sigProfile, ADOBE_SIGN_REASONNAME_KEY, null);
}
+ private static String getVerifyUrl(String sigProfile) {
+ return getDefaultableConfigProperty(sigProfile, ADOBE_VERIFY_URL_KEY, "https://www.buergerkarte.at/signature-verification");
+ }
+
private static String getDefaultableConfigProperty(String sigProfile, String propName, String defaultValue) {
String confVal;
try {
|