From f5d1de1e0bd56b2c61953b1688e53b6efe249ddb Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Fri, 30 Sep 2022 13:56:31 +0200 Subject: remove SLResponse outright since it's just a glorified string now --- .../main/java/at/asit/pdfover/gui/bku/LocalBKUConnector.java | 8 ++------ .../main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java | 5 ++--- .../java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java | 11 +++++------ .../at/asit/pdfover/gui/workflow/states/LocalBKUState.java | 4 +--- 4 files changed, 10 insertions(+), 18 deletions(-) (limited to 'pdf-over-gui') 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) { -- cgit v1.2.3