diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-04-10 17:35:31 +0200 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2021-04-10 17:35:31 +0200 |
commit | 263eaef58922b74bd31012f2732de8f25eb9ac0b (patch) | |
tree | dd317b0ff1f4c95e6f14d370b1c039f946577337 /pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateAndRequestParameterResolver.java | |
parent | bd1def86093d9bb539603cc1eca4e843a37e67e5 (diff) | |
download | pdf-as-4-263eaef58922b74bd31012f2732de8f25eb9ac0b.tar.gz pdf-as-4-263eaef58922b74bd31012f2732de8f25eb9ac0b.tar.bz2 pdf-as-4-263eaef58922b74bd31012f2732de8f25eb9ac0b.zip |
one resolver for certificate and request atrtributes
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateAndRequestParameterResolver.java')
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateAndRequestParameterResolver.java | 12 |
1 files changed, 7 insertions, 5 deletions
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 d7d83b34..3fe8298b 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 @@ -23,6 +23,7 @@ ******************************************************************************/ package at.gv.egiz.pdfas.lib.impl.stamping; +import at.gv.egiz.pdfas.common.settings.IProfileConstants; import at.gv.egiz.pdfas.common.settings.SignatureProfileSettings; import at.gv.egiz.pdfas.common.utils.DNUtils; import at.gv.egiz.pdfas.common.utils.OgnlUtils; @@ -30,26 +31,24 @@ import at.gv.egiz.pdfas.lib.impl.status.OperationStatus; import iaik.x509.X509Certificate; import ognl.AbstractMemberAccess; import ognl.MemberAccess; -import ognl.Ognl; import ognl.OgnlContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.naming.InvalidNameException; - import java.lang.reflect.Member; import java.lang.reflect.Modifier; import java.util.HashMap; import java.util.Map; -public class CertificateResolver implements IResolver { +public class CertificateAndRequestParameterResolver implements IResolver { - private static final Logger logger = LoggerFactory.getLogger(CertificateResolver.class); + private static final Logger logger = LoggerFactory.getLogger(CertificateAndRequestParameterResolver.class); private OgnlContext ctx; private X509Certificate certificate; - public CertificateResolver(X509Certificate certificate, OperationStatus operationStatus) { + public CertificateAndRequestParameterResolver(X509Certificate certificate, OperationStatus operationStatus) { this.certificate = certificate; MemberAccess memberAccess = new AbstractMemberAccess() { @@ -62,6 +61,9 @@ public class CertificateResolver implements IResolver { this.ctx = new OgnlContext(null, null, memberAccess); + this.ctx = new OgnlContext(null, null, memberAccess); + this.ctx.put(IProfileConstants.DYNAMIC_REQUEST_PARAMETERS, operationStatus.getRequestParameters()); + this.ctx.put("sn", this.certificate.getSerialNumber().toString()); try { |