aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
diff options
context:
space:
mode:
authorpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-26 12:01:18 +0000
committerpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-11-26 12:01:18 +0000
commit1b337e50a9edb280aea49879f901613e1fe17b55 (patch)
tree8f0d6b59de02936320f2e4c180fde02a50c1fc7a /src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
parent7040bdb8ace897f0cfdd43bd0304f3487b27df22 (diff)
downloadpdf-as-3-1b337e50a9edb280aea49879f901613e1fe17b55.tar.gz
pdf-as-3-1b337e50a9edb280aea49879f901613e1fe17b55.tar.bz2
pdf-as-3-1b337e50a9edb280aea49879f901613e1fe17b55.zip
Changes for xmldsig reconstruction
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@612 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java87
1 files changed, 86 insertions, 1 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java b/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
index 7dd2f6d..fc4ebaf 100644
--- a/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
+++ b/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
@@ -16,6 +16,27 @@ import at.gv.egiz.pdfas.api.timestamp.TimeStamper;
*/
public class SignParameters
{
+// 23.11.2010 changed by exthex - added parameters for placeholder handling
+ /**
+ * Strict matching mode for placeholder extraction.<br/>
+ * If the placeholder with the given id is not found in the document, an exception will be thrown.
+ */
+ public static final int PLACEHOLDER_MATCH_MODE_STRICT = 0;
+
+ /**
+ * A moderate matching mode for placeholder extraction.<br/>
+ * If the placeholder with the given id is not found in the document, the first placeholder without an id will be taken.<br/>
+ * If there is no such placeholder, the signature will be placed as usual, according to the pos parameter of the signature profile used.
+ */
+ public static final int PLACEHOLDER_MATCH_MODE_MODERATE = 1;
+
+ /**
+ * A more lenient matching mode for placeholder extraction.<br/>
+ * If the placeholder with the given id is not found in the document, the first found placeholder will be taken, regardless if it has an id set, or not.<br/>
+ * If there is no placeholder at all, the signature will be placed as usual, according to the pos parameter of the signature profile used.
+ */
+ public static final int PLACEHOLDER_MATCH_MODE_LENIENT = 2;
+
/**
* The document to be signed.
*
@@ -99,8 +120,26 @@ public class SignParameters
protected DataSink output = null;
protected TimeStamper timeStamperImpl;
+
+ /**
+ *
+ */
+ protected boolean checkForPlaceholder;
+
+ /**
+ * The id of the placeholder which should be replaced.
+ */
+ protected String placeholderId;
+
+ /**
+ * The matching mode for placeholder extraction.<br/>
+ * If a {@link SignParameters#placeholderId} is set, the match mode determines what is to be done, if no matching placeholder is found in the document.
+ * <br/>
+ * Defaults to {@link SignParameters#PLACEHOLDER_MATCH_MODE_MODERATE}.
+ */
+ protected int placeholderMatchMode = PLACEHOLDER_MATCH_MODE_MODERATE;
-
+
/**
* {@link #setTimeStamperImpl(TimeStamper)}
* @return
@@ -236,5 +275,51 @@ public class SignParameters
this.signatureKeyIdentifier = signatureKeyIdentifier;
}
+ /**
+ *
+ * @return
+ */
+ public boolean isCheckForPlaceholder() {
+ return this.checkForPlaceholder;
+ }
+
+ /**
+ *
+ * @param check
+ */
+ public void setCheckForPlaceholder(boolean check) {
+ this.checkForPlaceholder = check;
+ }
+
+ /**
+ *
+ * @param placeholderId
+ */
+ public void setPlaceholderId(String placeholderId) {
+ this.placeholderId = placeholderId;
+ }
+
+ /**
+ *
+ * @return the placeholderId
+ */
+ public String getPlaceholderId() {
+ return placeholderId;
+ }
+
+ /**
+ *
+ * @param placeholderMatchMode
+ */
+ public void setPlaceholderMatchMode(int placeholderMatchMode) {
+ this.placeholderMatchMode = placeholderMatchMode;
+ }
+ /**
+ *
+ * @return the placeholderMatchMode
+ */
+ public int getPlaceholderMatchMode() {
+ return this.placeholderMatchMode;
+ }
}