From 510fca957d9cf00260efe7ed78a663d46c69adb7 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Fri, 26 Mar 2021 09:54:41 +0100 Subject: update gradle build-process to wrapper 6.8.3 --- .../pdfas/lib/impl/stamping/CertificateResolver.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas') diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java index edb87eb2..d7d83b34 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java @@ -28,11 +28,17 @@ import at.gv.egiz.pdfas.common.utils.DNUtils; import at.gv.egiz.pdfas.common.utils.OgnlUtils; 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; @@ -45,7 +51,16 @@ public class CertificateResolver implements IResolver { public CertificateResolver(X509Certificate certificate, OperationStatus operationStatus) { this.certificate = certificate; - this.ctx = new OgnlContext(); + + MemberAccess memberAccess = new AbstractMemberAccess() { + @Override + public boolean isAccessible(Map context, Object target, Member member, String propertyName) { + int modifiers = member.getModifiers(); + return Modifier.isPublic(modifiers); + } + }; + + this.ctx = new OgnlContext(null, null, memberAccess); this.ctx.put("sn", this.certificate.getSerialNumber().toString()); -- cgit v1.2.3