From 63784f692a50606f34702706761edac052fdac60 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 16 Oct 2014 12:45:01 +0200 Subject: Introduced PDF-AS Backends, removed all pdfbox specific code to pdfbox backend --- .../gv/egiz/pdfas/common/exceptions/ErrorConstants.java | 1 + .../at/gv/egiz/pdfas/common/exceptions/PDFASError.java | 2 +- .../java/at/gv/egiz/pdfas/common/utils/PDFUtils.java | 16 ---------------- 3 files changed, 2 insertions(+), 17 deletions(-) (limited to 'pdf-as-common/src/main/java/at/gv/egiz/pdfas/common') diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java index 04314c6c..6ad65d42 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java @@ -5,6 +5,7 @@ public interface ErrorConstants { public static final long ERROR_GENERIC = 10000; public static final long ERROR_NO_INPUT = 10001; + public static final long ERROR_NO_BACKEND = 10002; // Signature Errors public static final long ERROR_SIG_INVALID_STATUS = 11004; diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFASError.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFASError.java index 8a6d7379..bcd3375b 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFASError.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFASError.java @@ -5,7 +5,7 @@ import at.gv.egiz.pdfas.common.messages.ErrorCodeResolver; /** * The Class PDFASError. */ -public class PDFASError extends Exception { +public class PDFASError extends Exception implements ErrorConstants { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1233586898708485346L; diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/PDFUtils.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/PDFUtils.java index 68cfd80a..d88f514c 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/PDFUtils.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/PDFUtils.java @@ -27,13 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.apache.pdfbox.pdmodel.PDDocument; -import org.apache.pdfbox.pdmodel.encryption.AccessPermission; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.gv.egiz.pdfas.common.exceptions.PDFIOException; -import at.gv.egiz.pdfas.common.exceptions.PdfAsValidationException; public class PDFUtils { @@ -187,17 +184,4 @@ public class PDFUtils { } return null; } - - public static void checkPDFPermissions(PDDocument doc) throws PdfAsValidationException { - - AccessPermission accessPermission = doc.getCurrentAccessPermission(); - if (doc.isEncrypted()) { - throw new PdfAsValidationException("error.pdf.sig.12", null); - } - - if (!accessPermission.isOwnerPermission()) { - throw new PdfAsValidationException("error.pdf.sig.12", null); - } - - } } -- cgit v1.2.3