summaryrefslogtreecommitdiff
path: root/pdf-over-signator
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-signator')
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java30
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java9
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java17
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java6
4 files changed, 57 insertions, 5 deletions
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java
new file mode 100644
index 00000000..bd908b1d
--- /dev/null
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/BkuSlConnector.java
@@ -0,0 +1,30 @@
+/*
+ * 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.signator;
+
+// Imports
+
+/**
+ *
+ */
+public interface BkuSlConnector {
+ /**
+ * @param request
+ * @return SL Response
+ * @throws SignatureException
+ */
+ public SLResponse handleSLRequest(SLRequest request) throws SignatureException;
+}
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java
index 15f31771..9edd0a02 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SLRequest.java
@@ -114,4 +114,13 @@ public class SLRequest {
{
return this.signatureData;
}
+
+ /**
+ * Gets the request String
+ *
+ * @return the request
+ */
+ public String getRequest() {
+ return this.request;
+ }
}
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
index c55a7555..31cf18be 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
@@ -36,9 +36,13 @@ public class Signator {
*/
public enum Signers {
/**
- * PDF-AS
+ * PDF-AS 3
*/
- PDFAS
+ PDFAS,
+ /**
+ * PDF-AS 4
+ */
+ PDFAS4
};
private static Map<Signers, SignerFactory> factoryMap;
@@ -47,9 +51,12 @@ public class Signator {
factoryMap = new EnumMap<Signers, SignerFactory>(Signers.class);
try {
- Class<?> pdfAsClass = Class.forName("at.asit.pdfover.signer.pdfas.PDFASSignerFactory");
- SignerFactory factory = (SignerFactory)pdfAsClass.newInstance();
- registerSigner(Signers.PDFAS, factory);
+// Class<?> pdfAsClass = Class.forName("at.asit.pdfover.signer.pdfas.PDFASSignerFactory");
+// SignerFactory factory = (SignerFactory)pdfAsClass.newInstance();
+// registerSigner(Signers.PDFAS, factory);
+ Class<?> pdfAs4Class = Class.forName("at.asit.pdfover.signer.pdfas.PdfAs4SignerFactory");
+ SignerFactory factory = (SignerFactory)pdfAs4Class.newInstance();
+ registerSigner(Signers.PDFAS4, factory);
} catch (ClassNotFoundException e) {
log.error("PDF Signer Factory not found", e);
throw new RuntimeException("PDF Signer Factory not found", e);
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java
index 93facb86..b86e356c 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SigningState.java
@@ -37,4 +37,10 @@ public interface SigningState {
* @return true if a SLResponse is set
*/
public boolean hasSignatureResponse();
+
+ /**
+ * Set the BKU connector
+ * @param connector the BKU connector
+ */
+ public void setBKUConnector(BkuSlConnector connector);
}