diff options
Diffstat (limited to 'pdf-as-lib')
-rw-r--r-- | pdf-as-lib/build.gradle | 49 | ||||
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/CertificateResolver.java | 17 | ||||
-rw-r--r-- | pdf-as-lib/src/main/resources/config/config.zip | bin | 1277320 -> 1277320 bytes |
3 files changed, 41 insertions, 25 deletions
diff --git a/pdf-as-lib/build.gradle b/pdf-as-lib/build.gradle index 1ddc1f9a..c7506a26 100644 --- a/pdf-as-lib/build.gradle +++ b/pdf-as-lib/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'java' +apply plugin: 'java-library' apply plugin: 'eclipse' apply plugin: 'java-library-distribution' @@ -13,7 +13,7 @@ buildscript { mavenLocal() mavenCentral() } - dependencies { classpath("commons-io:commons-io:2.4") } + dependencies { classpath("commons-io:commons-io:2.8.0") } } sourceSets { @@ -41,6 +41,7 @@ project.ext { task createConf(type: Zip, dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) { from 'src/configuration' + //archiveBaseName 'config' archiveName 'config.zip' destinationDir new File(projectDir, 'src/main/resources/config') } @@ -54,29 +55,29 @@ repositories { } dependencies { - compile project (':pdf-as-common') - compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.12' - compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.12' - compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.65' - compile group: 'javax.activation', name: 'activation', version: '1.1.1' - compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' - compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6' - compile group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.7.0' - compile group: 'commons-io', name: 'commons-io', version: '2.6' - compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.3' - compile 'org.apache.commons:commons-collections4:4.4' - compile group: 'ognl', name: 'ognl', version: '3.0.8' - compile files('libs/iaik_eccelerate_cms.jar') - compile files('libs/iaik_eccelerate.jar') - compile files('libs/iaik_jce_full.jar') - compile files('libs/iaik_cms.jar') - compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion - compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion + api project (':pdf-as-common') + api group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + api group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.13' + api group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13' + api group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.68' + api group: 'javax.activation', name: 'activation', version: '1.1.1' + api group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' + api group: 'com.google.code.gson', name: 'gson', version: '2.8.6' + api group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.7.6' + api group: 'commons-io', name: 'commons-io', version: '2.8' + api group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.3' + api 'org.apache.commons:commons-collections4:4.4' + api group: 'ognl', name: 'ognl', version: '3.2.19' + api files('libs/iaik_eccelerate_cms.jar') + api files('libs/iaik_eccelerate.jar') + api files('libs/iaik_jce_full.jar') + api files('libs/iaik_cms.jar') + api group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion + api group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion - compile group: 'com.google.zxing', name: 'core', version: '3.2.0' - compile group: 'com.google.zxing', name: 'javase', version: '3.2.0' - testCompile group: 'junit', name: 'junit', version: '4.+' + api group: 'com.google.zxing', name: 'core', version: '3.4.1' + api group: 'com.google.zxing', name: 'javase', version: '3.4.1' + testImplementation group: 'junit', name: 'junit', version: '4.+' ws group: 'org.apache.cxf', name: 'cxf-tools', version: cxfVersion ws group: 'org.apache.cxf', name: 'cxf-tools-wsdlto-databinding-jaxb', version: cxfVersion ws group: 'org.apache.cxf', name: 'cxf-tools-wsdlto-frontend-jaxws', version: cxfVersion 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()); diff --git a/pdf-as-lib/src/main/resources/config/config.zip b/pdf-as-lib/src/main/resources/config/config.zip Binary files differindex 0c4be90c..38cc4f34 100644 --- a/pdf-as-lib/src/main/resources/config/config.zip +++ b/pdf-as-lib/src/main/resources/config/config.zip |