aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-04-10 18:14:01 +0200
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-04-10 18:14:01 +0200
commit7824a4d85cfe855ddeb330c6ff753a2e60f8009b (patch)
treedf82e7826a647f41b60f005d13b2bd6237162e4a /pdf-as-lib/src/main/java/at/gv/egiz/pdfas
parent263eaef58922b74bd31012f2732de8f25eb9ac0b (diff)
downloadpdf-as-4-7824a4d85cfe855ddeb330c6ff753a2e60f8009b.tar.gz
pdf-as-4-7824a4d85cfe855ddeb330c6ff753a2e60f8009b.tar.bz2
pdf-as-4-7824a4d85cfe855ddeb330c6ff753a2e60f8009b.zip
pass parameters to resolver(s)
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsParameter.java8
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java7
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsParameterImpl.java5
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java6
4 files changed, 18 insertions, 8 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsParameter.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsParameter.java
index 11a1941b..6303c0a0 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsParameter.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsParameter.java
@@ -82,10 +82,16 @@ public interface PdfAsParameter {
public void setPreprocessorArguments(Map<String, String> map);
/**
- * Sets the dynamic signatur block values.
+ * Sets the dynamic signature-block values.
*
* @param map the map
*/
public void setDynamicSignatureBlockArguments(Map<String, String> map);
+ /**
+ * Gets the dynamic signature-block values.
+ *
+ * @return the dynamic signature-block values
+ */
+ public Map<String, String> getDynamicSignatureBlockArguments();
}
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
index 324712cb..55891bb2 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
@@ -23,6 +23,7 @@
******************************************************************************/
package at.gv.egiz.pdfas.lib.impl;
+import at.gv.egiz.pdfas.lib.impl.status.PDFObject;
import iaik.x509.X509Certificate;
import java.awt.Image;
@@ -144,7 +145,11 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants,
IPdfSigner signer = backend.getPdfSigner();
- status.setPdfObject(signer.buildPDFObject(status));
+
+ PDFObject pdfObject = signer.buildPDFObject(status);
+ //TODO verify map???
+ pdfObject.getStatus().getRequestParameters().putAll(status.getSignParamter().getDynamicSignatureBlockArguments());
+ status.setPdfObject(pdfObject);
// set Original PDF Document Data
status.getPdfObject()
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsParameterImpl.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsParameterImpl.java
index f3e1c301..d6161f2c 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsParameterImpl.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsParameterImpl.java
@@ -82,4 +82,9 @@ protected Configuration configuration;
public void setDynamicSignatureBlockArguments(Map<String, String> map) {
this.dynamicSignatureBlockArgumentsMap = map;
}
+
+ @Override
+ public Map<String, String> getDynamicSignatureBlockArguments() {
+ return this.dynamicSignatureBlockArgumentsMap;
+ }
}
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java
index 2481c77b..ab118857 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java
@@ -63,12 +63,6 @@ public class ValueResolver implements IProfileConstants, IResolver {
private IResolver internalResolver;
public ValueResolver(ICertificateProvider certProvider, OperationStatus operationStatus) {
-// Map<String, String> test = new HashMap<>();
-// test.put("schoolNameRand", RandomStringUtils.randomAlphabetic(5));
-// test.put("schoolName", "EGIZ testschule");
-//
-// test.put("subject","bbBbb");
-// internalRequestParameterResolver = new RequestParameterResolver(test);
internalResolver = new CertificateAndRequestParameterResolver(certProvider.getCertificate(),
operationStatus);
}