aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2018-07-23 08:42:27 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2018-07-23 08:42:27 +0200
commit5d90a82062472d9c87eacc90963529309abecb18 (patch)
treee32a9f6538a8aa7c4a8cd953c7ff32fabef6bd7a /pdf-as-web/src
parent55d708efe16aa409665537dfc3647e9fe4bb669e (diff)
parent21c932574c86031da3bed44b94bf3f54a930070d (diff)
downloadpdf-as-4-5d90a82062472d9c87eacc90963529309abecb18.tar.gz
pdf-as-4-5d90a82062472d9c87eacc90963529309abecb18.tar.bz2
pdf-as-4-5d90a82062472d9c87eacc90963529309abecb18.zip
Merge branch 'SL20_development' of gitlab.iaik.tugraz.at:egiz/pdf-as-4 into SL20_development
Diffstat (limited to 'pdf-as-web/src')
-rw-r--r--pdf-as-web/src/main/configuration/pdf-as-web.properties15
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java25
2 files changed, 15 insertions, 25 deletions
diff --git a/pdf-as-web/src/main/configuration/pdf-as-web.properties b/pdf-as-web/src/main/configuration/pdf-as-web.properties
index 10ef26a1..59d76607 100644
--- a/pdf-as-web/src/main/configuration/pdf-as-web.properties
+++ b/pdf-as-web/src/main/configuration/pdf-as-web.properties
@@ -70,3 +70,18 @@ request.store=at.gv.egiz.pdfas.web.store.InMemoryRequestStore
#hibernate.props.hibernate.show_sql=true
#hibernate.props.hibernate.hbm2ddl.auto=update
+#Security layer 2.0 config
+
+#sl20.sign.enabled=true
+#sl20.mobile.url=http://localhost:7080/vda/services/getCertificate
+sl20.keystore.file=
+sl20.keystore.pass=
+sl20.keystore.sign.key.alias=
+sl20.keystore.sign.key.pass=
+sl20.keystore.enc.key.alias=
+sl20.keystore.enc.key.pass=
+sl20.debug.validation.disable=true
+sl20.debug.signed.result.enabled=false
+sl20.debug.signed.result.required=false
+sl20.debug.encryption.enabled=false
+sl20.debug.encryption.required=false
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java
index 4d3d1872..bc773ec8 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFData.java
@@ -95,31 +95,6 @@ public class PDFData extends HttpServlet {
if (signedData != null) {
- /*if (WebConfiguration.isPdfProtected()) {
- File tempFile = new File(System.getProperty("java.io.tmpdir"),"protect.pdf");
- FileUtils.writeByteArrayToFile(tempFile, signedData);
- Path tempPath = tempFile.toPath();
- SecureRandom random = new SecureRandom();
- byte seed[] = random.generateSeed(50);
- String ownerPassword = new String(seed, StandardCharsets.UTF_8);
- PDDocument document = PDDocument.load(tempFile);
- AccessPermission accessPermission = new AccessPermission();
- accessPermission.setCanExtractContent(false);
- accessPermission.setCanExtractForAccessibility(true);
- StandardProtectionPolicy spp = new StandardProtectionPolicy(ownerPassword, "", accessPermission);
- spp.setEncryptionKeyLength(128);
- spp.setPermissions(accessPermission);
- document.protect(spp);
- document.save(tempFile);
- document.close();
- //accessPermission.setCanModify(false);
- signedData = Files.readAllBytes(tempPath);
- logger.info("Added Protection Parameters");
- if (tempFile.exists()) {
- tempFile.delete();
- }
- }*/
-
if(WebConfiguration.isKeepSignedDocument()) {
if(PdfAsHelper.isSignedDataExpired(request, response)) {
logger.info("Destroying expired signed data in session");