summaryrefslogtreecommitdiff
path: root/pdf-over-signer/src/main
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-02 14:18:37 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-02 14:18:37 +0200
commit62a3115ce4d55a7a3b3fbf202bac0fff85dc412b (patch)
tree21259582d60491447e06e941682df7ada3437c46 /pdf-over-signer/src/main
parent2513de9079b48864c89d7a633a0a4fa43d2f313f (diff)
downloadpdf-over-62a3115ce4d55a7a3b3fbf202bac0fff85dc412b.tar.gz
pdf-over-62a3115ce4d55a7a3b3fbf202bac0fff85dc412b.tar.bz2
pdf-over-62a3115ce4d55a7a3b3fbf202bac0fff85dc412b.zip
YAGNI: PDF signer factory pattern
Diffstat (limited to 'pdf-over-signer/src/main')
-rw-r--r--pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java15
-rw-r--r--pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignerFactory.java31
2 files changed, 4 insertions, 42 deletions
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
index 9943ec0e..bc5d4263 100644
--- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
+++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java
@@ -12,7 +12,6 @@ import at.asit.pdfover.signator.SignResultImpl;
import at.asit.pdfover.signator.SignatureException;
import at.asit.pdfover.signator.SignatureParameter;
import at.asit.pdfover.signator.SignaturePosition;
-import at.asit.pdfover.signator.Signer;
import at.asit.pdfover.signator.SigningState;
import at.gv.egiz.pdfas.common.exceptions.PDFASError;
import at.gv.egiz.pdfas.common.exceptions.PdfAsException;
@@ -30,10 +29,7 @@ import at.knowcenter.wag.egov.egiz.pdf.TablePos;
/**
* PDF AS Signer Implementation
*/
-public class PdfAs4Signer implements Signer {
-
-
-
+public class PdfAs4Signer {
/**
* The template URL
@@ -46,8 +42,7 @@ public class PdfAs4Signer implements Signer {
protected static final String LOC_REF = "<sl:LocRefContent>" + URL_TEMPLATE
+ "</sl:LocRefContent>";
- @Override
- public SigningState prepare(SignatureParameter parameter)
+ public static SigningState prepare(SignatureParameter parameter)
throws SignatureException {
PdfAs4SignatureParameter sign_para = null;
@@ -97,8 +92,7 @@ public class PdfAs4Signer implements Signer {
return state;
}
- @Override
- public SignResult sign(SigningState state) throws SignatureException {
+ public static SignResult sign(SigningState state) throws SignatureException {
try {
PdfAs4SigningState sstate = null;
@@ -157,8 +151,7 @@ public class PdfAs4Signer implements Signer {
}
}
- @Override
- public SignatureParameter newParameter() {
+ public static SignatureParameter newParameter() {
return new PdfAs4SignatureParameter();
}
}
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignerFactory.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignerFactory.java
deleted file mode 100644
index 3fa7ce16..00000000
--- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignerFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://joinup.ec.europa.eu/software/page/eupl
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- */
-package at.asit.pdfover.signer.pdfas;
-
-//Imports
-import at.asit.pdfover.signator.Signer;
-import at.asit.pdfover.signator.SignerFactory;
-
-/**
- * Factory class for PDF-AS Signer
- */
-public class PdfAs4SignerFactory extends SignerFactory {
-
- @Override
- public Signer createSigner() {
- return new PdfAs4Signer();
- }
-}