From edd5756535f4a3cf9897837510dc12168715bdd5 Mon Sep 17 00:00:00 2001 From: tknall Date: Wed, 2 Dec 2009 18:11:11 +0000 Subject: Non-textual objects may be extracted during the analysis phase of the signature verification process git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@485 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../at/gv/egiz/pdfas/api/analyze/AnalyzeParameters.java | 16 ++++++++++++++++ .../java/at/gv/egiz/pdfas/api/analyze/AnalyzeResult.java | 14 ++++++++++++++ .../at/gv/egiz/pdfas/api/verify/VerifyParameters.java | 12 ++++++------ .../java/at/gv/egiz/pdfas/api/verify/VerifyResults.java | 10 ++++++++-- 4 files changed, 44 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/gv/egiz/pdfas/api') diff --git a/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeParameters.java b/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeParameters.java index 0ab854c..b0ad28b 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeParameters.java +++ b/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeParameters.java @@ -33,6 +33,8 @@ public class AnalyzeParameters */ protected String verifyMode = Constants.VERIFY_MODE_FULL_CONSERVATIVE; + protected boolean returnNonTextualObjects = false; + /** * @return the document */ @@ -65,5 +67,19 @@ public class AnalyzeParameters this.verifyMode = verifyMode; } + public boolean isReturnNonTextualObjects() { + return this.returnNonTextualObjects; + } + + /** + * Tells if non text object of the signed pdf should be extracted and returned. + * One should show this to the user, especially in case of textual signature. + * Defaults to false + * + * @param returnNonTextualObjects + */ + public void setReturnNonTextualObjects(boolean returnNonTextualObjects) { + this.returnNonTextualObjects = returnNonTextualObjects; + } } diff --git a/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeResult.java b/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeResult.java index d063b76..c9dde9e 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeResult.java +++ b/src/main/java/at/gv/egiz/pdfas/api/analyze/AnalyzeResult.java @@ -29,4 +29,18 @@ public interface AnalyzeResult public List getSignatures() throws PdfAsException; public List getNoSignatures(); + + /** + * Returns non textual data from pdf provided that {@link AnalyzeParameters#setReturnNonTextualObjects(boolean)} + * has been set {@code true}. + * @return List of {@link NonTextObjectInfo} + */ + public List getNonTextualObjects(); + + /** + * Returns true if non textual objects have been found, false if not. + * @return true if non textual objects have been found, false if not. + */ + public boolean hasNonTextualObjects(); + } diff --git a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java index 4f60bea..793764b 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java +++ b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java @@ -78,7 +78,7 @@ public class VerifyParameters */ protected boolean returnHashInputData = false; - protected boolean returnNonTextObjects = false; + protected boolean returnNonTextualObjects = false; /** * @return the document @@ -182,8 +182,8 @@ public class VerifyParameters this.returnHashInputData = returnHashInputData; } - public boolean isReturnNonTextObjects() { - return this.returnNonTextObjects; + public boolean isReturnNonTextualObjects() { + return this.returnNonTextualObjects; } /** @@ -191,10 +191,10 @@ public class VerifyParameters * One should show this to the user, especially in case of textual signature. * Defaults to false * - * @param returnNonTextObjects + * @param returnNonTextualObjects */ - public void setReturnNonTextObjects(boolean returnNonTextObjects) { - this.returnNonTextObjects = returnNonTextObjects; + public void setReturnNonTextualObjects(boolean returnNonTextualObjects) { + this.returnNonTextualObjects = returnNonTextualObjects; } diff --git a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java index b30c451..ef06880 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java +++ b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java @@ -28,11 +28,17 @@ public interface VerifyResults public List getResults(); /** - * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document. + * Returns a list<{@link NonTextObjectInfo}> of non textual objects in the pdf document. * Only available for textual signatures. Show this to the user who signed the textual content only! * @return List<{@link NonTextObjectInfo} or null of not available (binary signature) */ public List getNonTextualObjects(); - public void setNonTextualObjects(List nonTextObjects); + + /** + * Returns true if non textual objects have been found, false if not. + * @return true if non textual objects have been found, false if not. + */ + public boolean hasNonTextualObjects(); + } -- cgit v1.2.3