aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-lib/src')
-rw-r--r--pdf-as-lib/src/configuration/cfg/advancedconfig.properties6
-rw-r--r--pdf-as-lib/src/configuration/cfg/config.properties3
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java12
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java8
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/GlobalConfiguration.java18
5 files changed, 41 insertions, 6 deletions
diff --git a/pdf-as-lib/src/configuration/cfg/advancedconfig.properties b/pdf-as-lib/src/configuration/cfg/advancedconfig.properties
index 5fd8b5cb..726deba8 100644
--- a/pdf-as-lib/src/configuration/cfg/advancedconfig.properties
+++ b/pdf-as-lib/src/configuration/cfg/advancedconfig.properties
@@ -87,12 +87,10 @@
#default.adobeSignReasonValue=Informationen zur Pr\u00FCfung finden Sie unter http://www.signaturpruefung.gv.at
-
# Standard Prueflink fuer die Adobe Signaturkennzeichnung (nur relevant falls Adobe Plugin fuer Pruefung verwendet wird)
#default.verifyURL=http://www.signaturpruefung.gv.at
-
# Standard Alternativer Text fuer den Signaturblock (WAI) (globale Einstellung)
#default.sigLogoAltText=Abgebildet ist eine Standard-Signaturbildmarke.
@@ -108,3 +106,7 @@ default.verifier.01=at.gv.egiz.pdfas.sigs.pades.PAdESVerifier
#sigblock.placement.debug.file=/home/user/temp/debugImg.png
#runtime.backend=PDFBOX_2_BACKEND
+##################
+# Protect PDF files from copying and extractiong content
+# Set values to be true|false|unchanged
+
diff --git a/pdf-as-lib/src/configuration/cfg/config.properties b/pdf-as-lib/src/configuration/cfg/config.properties
index f9eaeb98..fe2385a8 100644
--- a/pdf-as-lib/src/configuration/cfg/config.properties
+++ b/pdf-as-lib/src/configuration/cfg/config.properties
@@ -102,3 +102,6 @@ include.01 = profiles/*.properties
# Legt das Standard-Signaturprofil fest
sig_obj.type.default=SIGNATURBLOCK_SMALL_DE_NOTE
+##################
+# Protect PDF files from copying and extractiong content
+# Set values to be true|false|unchanged
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
index f8f71f2f..713948ba 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
@@ -108,12 +108,18 @@ public interface IConfigurationConstants {
public static final String BG_COLOR_DETECTION = "sigblock.placement.bgcolor.detection.enabled";
public static final String SIG_PLACEMENT_DEBUG_OUTPUT = "sigblock.placement.debug.file";
-
-
-
/**
* PADES Constants
*/
public static final String SIG_PADES_FORCE_FLAG= SIG_OBJECT + SEPERATOR+"PAdESCompatibility";
public static final String SIG_PADES_INTELL_FLAG = SIG_OBJECT + SEPERATOR+"CheckPAdESCompatibility";
+
+
+ /**
+ * Protect PDF file from copying content and extracting
+ */
+
+ public static final String DEFAULT_CONFIG_PROTECT_COPY_PDF = DEFAULT_CONFIG_PROTECT_PDF + SEPERATOR + "accessCopy";
+ public static final String DEFAULT_CONFIG_PROTECT_EXTRACT_PDF = DEFAULT_CONFIG_PROTECT_PDF + SEPERATOR + "canModify";
+
}
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
index 72d182ed..c3c2b6fd 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
@@ -61,6 +61,11 @@ import at.gv.egiz.pdfas.lib.impl.SignParameterImpl;
import at.gv.egiz.pdfas.lib.impl.VerifyParameterImpl;
import at.gv.egiz.pdfas.lib.impl.configuration.ConfigValidatorLoader;
+
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
public class PdfAsFactory implements IConfigurationConstants {
private static final Logger logger = LoggerFactory
@@ -118,6 +123,9 @@ public class PdfAsFactory implements IConfigurationConstants {
// TODO: register ECCelerate in second position when TLS issue is
// fixed
registerProvider(new ECCelerate(), -1);
+
+ registerProvider( new BouncyCastleProvider(), -2);
+
} else {
logger.info("Skipping Security Provider registration!");
}
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/GlobalConfiguration.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/GlobalConfiguration.java
index d04f6878..a40c336d 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/GlobalConfiguration.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/GlobalConfiguration.java
@@ -21,6 +21,7 @@
* The "NOTICE" text file is part of the distribution. Any derivative works
* that you distribute must include a readable copy of the "NOTICE" text file.
******************************************************************************/
+
package at.gv.egiz.pdfas.lib.impl.configuration;
import at.gv.egiz.pdfas.common.settings.ISettings;
@@ -46,5 +47,20 @@ public class GlobalConfiguration extends SpecificBaseConfiguration
}
return null;
}
-
+
+ public String getDefaultCopyProtection() {
+ if(this.configuration.hasValue(DEFAULT_CONFIG_PROTECT_COPY_PDF)) {
+ return this.configuration.getValue(DEFAULT_CONFIG_PROTECT_COPY_PDF);
+ }
+ return null;
+ }
+
+ public String getDefaultExtractProtection() {
+ if(this.configuration.hasValue(DEFAULT_CONFIG_PROTECT_EXTRACT_PDF)) {
+ return this.configuration.getValue(DEFAULT_CONFIG_PROTECT_EXTRACT_PDF);
+ }
+ return null;
+ }
+
+
}