From 669e2b7db13e42315b6b638cbbe2f03ef9ed0fa5 Mon Sep 17 00:00:00 2001 From: tknall Date: Thu, 24 May 2007 16:19:16 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@104 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java | 2 +- .../knowcenter/wag/egov/egiz/framework/VerificationFilter.java | 9 +++++++-- .../wag/egov/egiz/framework/signators/TextualSignator_1_0_0.java | 4 ++++ .../java/at/knowcenter/wag/egov/egiz/sig/SignatureObject.java | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java b/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java index 5b516f2..e4107eb 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java @@ -822,7 +822,7 @@ public abstract class PdfAS throw new SignatureException(312, "Document can not be verified because no signature object are set."); } - // added by tknall + // fixed by tknall if (so_to_be_verified.getX509Cert() == null) { throw new SignatureException(313, "Document certificate is not defined."); } diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java index be375ec..95a738c 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java @@ -101,6 +101,11 @@ public class VerificationFilter * @throws PresentableException */ public List extractSignaturesFromPdf(final byte[] pdf) throws PresentableException + { + return extractSignaturesFromPdf(pdf, false); + } + + public List extractSignaturesFromPdf(final byte[] pdf, boolean ignorePostSignModificationsRestriction) throws PresentableException { // tzefferer: get allow_post_sign_modifications property from property file @@ -219,9 +224,9 @@ public class VerificationFilter } // tzefferer: check if illegal modifications have been performed on the document after performing a signation - if(allow_post_sign_mods.equals("false")) + if (!("true".equalsIgnoreCase(allow_post_sign_mods)) && !ignorePostSignModificationsRestriction) { - if((signature_block_detected == true) && (current_block_contains_signature == false)) + if (signature_block_detected && !current_block_contains_signature) { throw new PDFDocumentException(316, "Das Dokument wurde nach erfolgter Signierung verändert."); } diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/TextualSignator_1_0_0.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/TextualSignator_1_0_0.java index 0af80d9..f250b0d 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/TextualSignator_1_0_0.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/TextualSignator_1_0_0.java @@ -120,6 +120,10 @@ public class TextualSignator_1_0_0 implements Signator so.setSignationValue(iui.signed_signature_object.getSignatureValue()); so.setSignationIDs(iui.signed_signature_object.getSigID()); so.setKZ(getMyId()); + + // fixed by tknall + so.setSignationName(iui.signed_signature_object.getName()); + PdfPTable pdf_table = PdfAS.createPdfPTableFromSignatureObject(so); PositioningInstruction pi = PdfAS.determineTablePositioning(iui.pos, iui.signature_type, iui.original_document, pdf_table); diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureObject.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureObject.java index b95f61b..62944e4 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureObject.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/SignatureObject.java @@ -482,6 +482,7 @@ public class SignatureObject implements Serializable */ private String getSigCaption(String key) { + String caption = null; if (sigEntries_.containsKey(key)) { -- cgit v1.2.3