summaryrefslogtreecommitdiff
path: root/pdf-over-gui
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-09-30 13:56:31 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-09-30 13:56:31 +0200
commitf5d1de1e0bd56b2c61953b1688e53b6efe249ddb (patch)
tree8353507673e1f3a82e993dcfb7232802aab7a930 /pdf-over-gui
parent529e08cd21115834dc9887305a8d199ea83638d2 (diff)
downloadpdf-over-f5d1de1e0bd56b2c61953b1688e53b6efe249ddb.tar.gz
pdf-over-f5d1de1e0bd56b2c61953b1688e53b6efe249ddb.tar.bz2
pdf-over-f5d1de1e0bd56b2c61953b1688e53b6efe249ddb.zip
remove SLResponse outright
since it's just a glorified string now
Diffstat (limited to 'pdf-over-gui')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java8
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java5
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java11
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java4
4 files changed, 10 insertions, 18 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java
index f91924ad..2993ea55 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java
@@ -34,7 +34,6 @@ import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.gui.utils.FileUploadSource;
import at.asit.pdfover.signator.BkuSlConnector;
import at.asit.pdfover.signator.SLRequest;
-import at.asit.pdfover.signator.SLResponse;
import at.asit.pdfover.signator.SignatureException;
/**
@@ -65,7 +64,7 @@ public class LocalBKUConnector implements BkuSlConnector {
* @see at.asit.pdfover.signator.BkuSlConnector#handleSLRequest(java.lang.String)
*/
@Override
- public SLResponse handleSLRequest(SLRequest request) throws SignatureException {
+ public String handleSLRequest(SLRequest request) throws SignatureException {
try {
HttpClient client = BKUHelper.getHttpClient();
PostMethod method = new PostMethod(Constants.LOCAL_BKU_URL);
@@ -94,10 +93,7 @@ public class LocalBKUConnector implements BkuSlConnector {
method.getResponseBodyAsString());
}
- String response = method.getResponseBodyAsString();
- log.debug("SL Response: " + response);
- SLResponse slResponse = new SLResponse(response);
- return slResponse;
+ return method.getResponseBodyAsString();
} catch (HttpException e) {
log.error("LocalBKUConnector: ", e);
throw new SignatureException(e);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
index a56b5ce7..0ee258f3 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
@@ -25,7 +25,6 @@ import at.asit.pdfover.gui.bku.mobile.ATrustStatus;
import at.asit.pdfover.gui.workflow.states.MobileBKUState;
import at.asit.pdfover.signator.BkuSlConnector;
import at.asit.pdfover.signator.SLRequest;
-import at.asit.pdfover.signator.SLResponse;
import at.asit.pdfover.signator.SignatureException;
import at.asit.pdfover.signer.pdfas.PdfAs4SigningState;
@@ -52,7 +51,7 @@ public class MobileBKUConnector implements BkuSlConnector {
* @see at.asit.pdfover.signator.BkuSlConnector#handleSLRequest(java.lang.String)
*/
@Override
- public SLResponse handleSLRequest(SLRequest request) throws SignatureException {
+ public String handleSLRequest(SLRequest request) throws SignatureException {
PdfAs4SigningState signingState = this.state.getSigningState();
signingState.signatureRequest = request;
@@ -111,7 +110,7 @@ public class MobileBKUConnector implements BkuSlConnector {
// Check if response is already available
if (signingState.signatureResponse != null) {
- SLResponse response = signingState.signatureResponse;
+ String response = signingState.signatureResponse;
signingState.signatureResponse = null;
return response;
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
index 867bdfd6..abcc1e19 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
@@ -61,7 +61,6 @@ import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.states.LocalBKUState;
import at.asit.pdfover.gui.workflow.states.MobileBKUState;
import at.asit.pdfover.signator.SLRequest;
-import at.asit.pdfover.signator.SLResponse;
import at.asit.pdfover.signer.pdfas.PdfAs4SigningState;
/**
@@ -512,13 +511,13 @@ public class ATrustHandler {
// credentials ok! InfoboxReadResponse
state.rememberCredentialsIfNecessary();
log.debug("Credentials accepted - Response given");
- getSigningState().signatureResponse = new SLResponse(responseData);
+ getSigningState().signatureResponse = responseData;
return;
} else if (responseData.contains("undecided.aspx?sid=")) {
// skip intermediate page
log.debug("Page Undecided");
- getSigningState().signatureResponse = new SLResponse(responseData);
- status.errorMessage = "waiting...";
+ getSigningState().signatureResponse = responseData;
+ status.errorMessage = "waiting..."; // TODO: this looks incorrect...?
return;
}else {
// error page
@@ -591,7 +590,7 @@ public class ATrustHandler {
responseData.contains("sl:CreateCMSSignatureResponse xmlns:sl")) {
// success !!
- getSigningState().signatureResponse = new SLResponse(responseData);
+ getSigningState().signatureResponse = responseData;
} else {
try {
String tries = MobileBKUHelper.extractSubstring(
@@ -701,7 +700,7 @@ public class ATrustHandler {
responseData.contains("sl:CreateCMSSignatureResponse xmlns:sl")) {
// success !!
- getSigningState().signatureResponse = new SLResponse(responseData);
+ getSigningState().signatureResponse = responseData;
return true;
}
return false;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java
index 59274567..f1bfa5b9 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java
@@ -35,7 +35,6 @@ import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.gui.workflow.StateMachine;
import at.asit.pdfover.gui.workflow.Status;
-import at.asit.pdfover.signator.SLResponse;
import at.asit.pdfover.signer.pdfas.PdfAs4SigningState;
/**
@@ -120,8 +119,7 @@ public class LocalBKUState extends State {
if ((server != null) && (server.contains("trustDeskbasic") || server.contains("asignSecurityLayer")))
LocalBKUState.this.useBase64Request = true;
- String response = method.getResponseBodyAsString();
- this.signingState.signatureResponse = new SLResponse(response);
+ this.signingState.signatureResponse = method.getResponseBodyAsString();
this.signingState.useBase64Request = LocalBKUState.this.useBase64Request;
}
} catch (Exception e) {