aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java b/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java
index 4b9a566..36d3764 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java
@@ -43,8 +43,10 @@ import at.gv.egiz.pdfas.utils.OgnlUtil;
import at.knowcenter.wag.egov.egiz.PdfAS;
import at.knowcenter.wag.egov.egiz.PdfASID;
import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
+import at.knowcenter.wag.egov.egiz.exceptions.NormalizeException;
import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
+import at.knowcenter.wag.egov.egiz.exceptions.SignatureException;
import at.knowcenter.wag.egov.egiz.framework.SignatorFactory;
import at.knowcenter.wag.egov.egiz.pdf.BinarySignature;
import at.knowcenter.wag.egov.egiz.pdf.IncrementalUpdateInformation;
@@ -58,6 +60,7 @@ import at.knowcenter.wag.egov.egiz.sig.SignatureFieldDefinition;
import at.knowcenter.wag.egov.egiz.sig.SignatureObject;
import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
import at.knowcenter.wag.egov.egiz.sig.signatureobject.SignatureObjectHelper;
+import at.knowcenter.wag.egov.egiz.tools.Normalizer;
import at.knowcenter.wag.exactparser.ByteArrayUtils;
import com.lowagie.text.pdf.PdfPTable;
@@ -94,6 +97,8 @@ public class BinarySignator_1_0_0 implements Signator
*/
public static final PdfASID MY_ID = new PdfASID(SignatorFactory.VENDOR, SignatorFactory.TYPE_BINARY, SignatorFactory.VERSION_1_0_0);
+ private Normalizer normalizer;
+
/**
* @see at.knowcenter.wag.egov.egiz.framework.Signator#getMyId()
*/
@@ -107,7 +112,15 @@ public class BinarySignator_1_0_0 implements Signator
*/
public BinarySignator_1_0_0()
{
- // Default constructor.
+ try
+ {
+ this.normalizer = new Normalizer();
+ }
+ catch (NormalizeException e)
+ {
+ String msg = "Normalizer can not be initialized";
+ throw new RuntimeException(msg, new SignatureException(400, msg, e));
+ }
}
/**
@@ -320,8 +333,9 @@ public class BinarySignator_1_0_0 implements Signator
// dferbas
if (ognl.containsExpression(ri.sfd.value)) {
// evaluate expression
- String res = ognl.compileMessage(ri.sfd.value);
- ri.value = res;
+ String res = ognl.compileMessage(ri.sfd.value);
+
+ ri.value = this.normalizer.normalize(res);
} else {
ri.value = iui.signed_signature_object.retrieveStringValue(ri.sfd.field_name);