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 --- .../java/at/gv/egiz/pdfas/sigs/pades/PAdESConstants.java | 6 ++++++ .../main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java | 13 +++++-------- .../at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java | 8 +++----- .../java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java | 7 +++---- 4 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESConstants.java (limited to 'signature-standards/sigs-pades/src/main/java') diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESConstants.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESConstants.java new file mode 100644 index 00000000..c27d7467 --- /dev/null +++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESConstants.java @@ -0,0 +1,6 @@ +package at.gv.egiz.pdfas.sigs.pades; + +public interface PAdESConstants { + public static final String SUBFILTER_ETSI_CADES_DETACHED = "ETSI.CAdES.detached"; + public static final String FILTER_ADOBE_PPKLITE = "Adobe.PPKLite"; +} diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java index 07d3b66c..8a511c66 100644 --- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java +++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSigner.java @@ -24,19 +24,16 @@ package at.gv.egiz.pdfas.sigs.pades; import iaik.x509.X509Certificate; - -import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature; - import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.lib.api.sign.IPlainSigner; import at.gv.egiz.pdfas.lib.api.sign.SignParameter; import at.gv.egiz.pdfas.lib.impl.status.RequestedSignature; +import at.gv.egiz.sl.util.ISLConnector; import at.gv.egiz.sl.util.ISignatureConnector; import at.gv.egiz.sl.util.ISignatureConnectorSLWrapper; -import at.gv.egiz.sl.util.ISLConnector; - -public class PAdESSigner implements IPlainSigner { +public class PAdESSigner implements IPlainSigner, PAdESConstants { + private ISignatureConnector plainSigner; public PAdESSigner(ISLConnector connector) { @@ -57,11 +54,11 @@ public class PAdESSigner implements IPlainSigner { } public String getPDFSubFilter() { - return PDSignature.SUBFILTER_ETSI_CADES_DETACHED.getName(); + return SUBFILTER_ETSI_CADES_DETACHED; } public String getPDFFilter() { - return PDSignature.FILTER_ADOBE_PPKLITE.getName(); + return FILTER_ADOBE_PPKLITE; } } diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java index 002475eb..220cf6e2 100644 --- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java +++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java @@ -54,7 +54,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,9 +64,8 @@ import at.gv.egiz.pdfas.lib.api.sign.SignParameter; import at.gv.egiz.pdfas.lib.impl.status.RequestedSignature; import at.gv.egiz.pdfas.lib.util.CertificateUtils; -public class PAdESSignerKeystore implements IPlainSigner { +public class PAdESSignerKeystore implements IPlainSigner, PAdESConstants { - @SuppressWarnings("unused") private static final Logger logger = LoggerFactory .getLogger(PAdESSignerKeystore.class); @@ -257,11 +255,11 @@ public class PAdESSignerKeystore implements IPlainSigner { } public String getPDFSubFilter() { - return PDSignature.SUBFILTER_ETSI_CADES_DETACHED.getName(); + return SUBFILTER_ETSI_CADES_DETACHED; } public String getPDFFilter() { - return PDSignature.FILTER_ADOBE_PPKLITE.getName(); + return FILTER_ADOBE_PPKLITE; } } diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java index d1e185ab..a4ef703e 100644 --- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java +++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESVerifier.java @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,7 +39,7 @@ import at.gv.egiz.pdfas.lib.impl.verify.IVerifier; import at.gv.egiz.pdfas.lib.impl.verify.IVerifyFilter; import at.gv.egiz.pdfas.lib.impl.verify.VerifyResultImpl; -public class PAdESVerifier implements IVerifyFilter { +public class PAdESVerifier implements IVerifyFilter, PAdESConstants { private static final Logger logger = LoggerFactory .getLogger(PAdESVerifier.class); @@ -73,8 +72,8 @@ public class PAdESVerifier implements IVerifyFilter { public List getFiters() { List result = new ArrayList(); - result.add(new FilterEntry(PDSignature.FILTER_ADOBE_PPKLITE, - PDSignature.SUBFILTER_ETSI_CADES_DETACHED)); + result.add(new FilterEntry(FILTER_ADOBE_PPKLITE, + SUBFILTER_ETSI_CADES_DETACHED)); return result; } -- cgit v1.2.3