summaryrefslogtreecommitdiff
path: root/trunk/pdf-over-signer/pdf-over-sigpdfas/src
diff options
context:
space:
mode:
authortkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459>2012-08-24 17:04:57 +0000
committertkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459>2012-08-24 17:04:57 +0000
commite1bc934f1948043fa4bfa44963337c2ef554d99d (patch)
tree5790c073e9eb1f80accc1d3020509466e5a3454e /trunk/pdf-over-signer/pdf-over-sigpdfas/src
parent969617f6557c559b173a8cc267c7cd37c6e2e088 (diff)
downloadpdf-over-e1bc934f1948043fa4bfa44963337c2ef554d99d.tar.gz
pdf-over-e1bc934f1948043fa4bfa44963337c2ef554d99d.tar.bz2
pdf-over-e1bc934f1948043fa4bfa44963337c2ef554d99d.zip
Changed SLRequest interface
git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12392 3a0b52a2-8410-0410-bc02-ff6273a87459
Diffstat (limited to 'trunk/pdf-over-signer/pdf-over-sigpdfas/src')
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java35
-rw-r--r--trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java1
2 files changed, 9 insertions, 27 deletions
diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
index 49cb1522..7267db85 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
+++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSLRequest.java
@@ -26,45 +26,28 @@ import at.asit.pdfover.signator.SLRequest;
/**
* PDF - AS Security Layer Request implementation
*/
-public class PDFASSLRequest implements SLRequest {
+public class PDFASSLRequest extends SLRequest {
/**
* SFL4J Logger instance
**/
- @SuppressWarnings("unused")
private static final Logger log = LoggerFactory.getLogger(PDFASSLRequest.class);
-
- private String request;
-
- private ByteArrayDocumentSource source;
-
+
/**
* Default constructor
* @param slRequest
* @param signData
*/
public PDFASSLRequest(String slRequest, byte[] signData) {
- // Modifing SL Request ...
- this.request = slRequest.replace(PDFASSigner.LOC_REF, SLRequest.DATAOBJECT_STRING);
-
- if(!this.request.contains(DATAOBJECT_STRING)) {
+ if(!slRequest.contains(PDFASSigner.LOC_REF)) {
// TODO: throw Exception (Failed to prepare SL Request)
+ log.error("PDF-AS SL request doesn't contain " + PDFASSigner.LOC_REF);
+ log.debug("Request: " + slRequest);
}
-
- this.source = new ByteArrayDocumentSource(signData);
- }
-
- @Override
- public DocumentSource getSignatureData() {
- return this.source;
- }
- /* (non-Javadoc)
- * @see at.asit.pdfover.signator.SLRequest#getRequest()
- */
- @Override
- public String getRequest() {
- return this.request;
- }
+ // Modifing SL Request ...
+ setRequest(slRequest.replace(PDFASSigner.LOC_REF, SLRequest.DATAOBJECT_STRING));
+ setSignatureData(new ByteArrayDocumentSource(signData));
+ }
}
diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java
index d1336d91..a2f34e9a 100644
--- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java
+++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java
@@ -12,7 +12,6 @@ import at.asit.pdfover.signator.SigningState;
import at.gv.egiz.pdfas.api.PdfAs;
import at.gv.egiz.pdfas.api.sign.SignParameters;
import at.gv.egiz.pdfas.api.sign.SignatureDetailInformation;
-import at.gv.egiz.pdfas.framework.input.DataSource;
import at.gv.egiz.pdfas.io.ByteArrayDataSink;
import at.gv.egiz.pdfas.api.commons.Constants;
import at.gv.egiz.pdfas.api.exceptions.PdfAsException;