diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-04-15 17:11:43 +0200 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-04-15 17:11:43 +0200 |
commit | d7d12cd83d1610b118a336024b260e11b7c83d98 (patch) | |
tree | 963d2b790b64247679f3fb92928cf34dc61785fe | |
parent | 7be260ac248ee9f461f0e1384a5ba527f28cfd6d (diff) | |
download | pdf-as-4-d7d12cd83d1610b118a336024b260e11b7c83d98.tar.gz pdf-as-4-d7d12cd83d1610b118a336024b260e11b7c83d98.tar.bz2 pdf-as-4-d7d12cd83d1610b118a336024b260e11b7c83d98.zip |
pass empty map if no map is supplied
2 files changed, 8 insertions, 4 deletions
diff --git a/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturBlockParameterTest.java b/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturBlockParameterTest.java index 4bce7b05..db11f451 100644 --- a/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturBlockParameterTest.java +++ b/pdf-as-cli/src/test/java/at/gv/egiz/pdfas/cli/test/SignaturBlockParameterTest.java @@ -147,9 +147,10 @@ public class SignaturBlockParameterTest { result = pdfas.sign(signParameter); fos.close(); name = getName(outFile, "PDF-AS Signatur1"); - Assert.assertEquals("{sbp.subject} test {sbp.foo} 123 {subject.T != null ? (subject.T + \" a \"+sbp.subject) : " + - "\"c \"+sbp.subject+\" \"}Andreas Fitzek ECC", name); -//TODO gewünscht? + Assert.assertEquals("null test null 123 c null Andreas Fitzek ECC", name); +// Assert.assertEquals("{sbp.subject} test {sbp.foo} 123 {subject.T != null ? (subject.T + \" a \"+sbp.subject) : " + +// "\"c \"+sbp.subject+\" \"}Andreas Fitzek ECC", name); +//TODO was ist gewünscht? outFile = getPath("out") + "/" + profile + "-4.pdf"; diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateAndRequestParameterResolver.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateAndRequestParameterResolver.java index 024f377f..c53a9a4f 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateAndRequestParameterResolver.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateAndRequestParameterResolver.java @@ -62,7 +62,10 @@ public class CertificateAndRequestParameterResolver implements IResolver { this.ctx = new OgnlContext(null, null, memberAccess); this.ctx = new OgnlContext(null, null, memberAccess); - this.ctx.put(IProfileConstants.SIGNATURE_BLOCK_PARAMETER, operationStatus.getSignParamter().getDynamicSignatureBlockArguments()); + Map<String, String> map = operationStatus.getSignParamter().getDynamicSignatureBlockArguments(); + if(map == null) + map = new HashMap<>(); + this.ctx.put(IProfileConstants.SIGNATURE_BLOCK_PARAMETER, map); this.ctx.put("sn", this.certificate.getSerialNumber().toString()); |