summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-06 12:33:33 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-07-06 12:33:33 +0200
commite4767bccc7324d4b61a334bf6c0558d0080045e2 (patch)
tree728a5df44f02ca10f760b979873c990cd4c0d265 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
parent3422e5eb2819f5de304f25dc622f5284813bb9b4 (diff)
downloadpdf-over-e4767bccc7324d4b61a334bf6c0558d0080045e2.tar.gz
pdf-over-e4767bccc7324d4b61a334bf6c0558d0080045e2.tar.bz2
pdf-over-e4767bccc7324d4b61a334bf6c0558d0080045e2.zip
remove NON-NLS comments, cleanup whitespace
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java74
1 files changed, 37 insertions, 37 deletions
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 2e278f5e..3d3f6012 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
@@ -31,7 +31,7 @@ import at.asit.pdfover.signator.SignatureException;
import at.asit.pdfover.signer.pdfas.PdfAs4SigningState;
/**
- *
+ *
*/
public class MobileBKUConnector implements BkuSlConnector {
/**
@@ -43,8 +43,8 @@ public class MobileBKUConnector implements BkuSlConnector {
private MobileBKUState state;
/**
- *
- * @param state
+ *
+ * @param state
*/
public MobileBKUConnector(MobileBKUState state) {
this.state = state;
@@ -64,31 +64,31 @@ public class MobileBKUConnector implements BkuSlConnector {
// Post SL Request
try {
String responseData = handler.postSLRequest(this.state.getURL(), request);
-
+
// Now we have received some data lets check it:
- log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$
-
+ log.trace("Response from mobile BKU: " + responseData); //
+
handler.handleSLRequestResponse(responseData);
} catch (Exception ex) {
- log.error("Error in PostSLRequestThread", ex); //$NON-NLS-1$
+ log.error("Error in PostSLRequestThread", ex); //
this.state.threadException = ex;
this.state.displayError(ex);
throw new SignatureException(ex);
}
-
+
do {
// Check if credentials are available, get them from user if not
this.state.checkCredentials();
if (this.state.status.errorMessage != null &&
- this.state.status.errorMessage.equals("cancel")) //$NON-NLS-1$
+ this.state.status.errorMessage.equals("cancel")) //
throw new SignatureException(new IllegalStateException());
// Post credentials
try {
String responseData = handler.postCredentials();
- if (responseData.contains("undecided.aspx?sid=")) { //$NON-NLS-1$
+ if (responseData.contains("undecided.aspx?sid=")) { //
// handle polling
this.state.showOpenAppMessageWithSMSandCancel();
@@ -98,28 +98,28 @@ public class MobileBKUConnector implements BkuSlConnector {
aHandler.handleCredentialsResponse(response);
} else if (consumeCancelError()) {
throw new SignatureException(new IllegalStateException());
- }
+ }
} else {
// Now we have received some data lets check it:
- log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$
+ log.trace("Response from mobile BKU: " + responseData); //
handler.handleCredentialsResponse(responseData);
}
} catch (Exception ex) {
- log.error("Error in PostCredentialsThread", ex); //$NON-NLS-1$
+ log.error("Error in PostCredentialsThread", ex); //
this.state.threadException = new IllegalStateException();
throw new SignatureException(new IllegalStateException());
}
} while(this.state.status.errorMessage != null);
-
+
// Check if response is already available
if (signingState.hasSignatureResponse()) {
SLResponse response = signingState.getSignatureResponse();
signingState.setSignatureResponse(null);
return response;
}
-
+
do {
MobileBKUStatus status = this.state.status;
boolean enterTAN = true;
@@ -130,72 +130,72 @@ public class MobileBKUConnector implements BkuSlConnector {
if (aStatus.qrCodeURL != null) {
this.state.showQR();
if (this.state.status.errorMessage != null &&
- this.state.status.errorMessage.equals("cancel")) //$NON-NLS-1$
+ this.state.status.errorMessage.equals("cancel")) //
throw new SignatureException(new IllegalStateException());
if (aStatus.qrCodeURL == null) {
try {
String response = aHandler.postSMSRequest();
- log.trace("Response from mobile BKU: " + response); //$NON-NLS-1$
+ log.trace("Response from mobile BKU: " + response); //
handler.handleCredentialsResponse(response);
} catch (Exception ex) {
- log.error("Error in PostCredentialsThread", ex); //$NON-NLS-1$
+ log.error("Error in PostCredentialsThread", ex); //
this.state.threadException = new IllegalStateException();
throw new SignatureException(new IllegalStateException());
}
} else {
enterTAN = false;
}
- }
+ }
if (enterTAN && !aStatus.tanField) {
try {
-
+
this.state.showFingerPrintInformation();
if (this.state.status.errorMessage != null &&
- this.state.status.errorMessage.equals("cancel")) //$NON-NLS-1$
+ this.state.status.errorMessage.equals("cancel")) //
throw new SignatureException(new IllegalStateException());
} catch (Exception ex) {
- log.error("Error in PostCredentialsThread", ex); //$NON-NLS-1$
+ log.error("Error in PostCredentialsThread", ex); //
this.state.threadException = new IllegalStateException();
//this.state.displayError(ex);
throw new SignatureException(new IllegalStateException());
}
-
+
if (this.state.getSMSStatus()) {
String response;
try {
response = aHandler.postSMSRequest();
handler.handleCredentialsResponse(response);
} catch (Exception e) {
- log.error("Error in PostCredentialsThread", e); //$NON-NLS-1$
+ log.error("Error in PostCredentialsThread", e); //
this.state.threadException = e;
this.state.displayError(e);
throw new SignatureException(e);
}
}
else {
- enterTAN = false;
+ enterTAN = false;
}
}
}
-
+
if (enterTAN) {
// Get TAN
this.state.checkTAN();
-
+
if (this.state.status.errorMessage != null &&
- this.state.status.errorMessage.equals("cancel")) //$NON-NLS-1$
+ this.state.status.errorMessage.equals("cancel")) //
throw new SignatureException(new IllegalStateException());
// Post TAN
try {
responseData = handler.postTAN();
- log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$
+ log.trace("Response from mobile BKU: " + responseData); //
// Now we have received some data lets check it:
handler.handleTANResponse(responseData);
} catch (Exception ex) {
- log.error("Error in PostTanThread", ex); //$NON-NLS-1$
+ log.error("Error in PostTanThread", ex); //
this.state.threadException = ex;
this.state.displayError(ex);
throw new SignatureException(ex);
@@ -207,18 +207,18 @@ public class MobileBKUConnector implements BkuSlConnector {
} while (this.state.status.tanTries == -2);
return signingState.getSignatureResponse();
- }
-
+ }
+
private boolean consumeCancelError() {
-
+
if (this.state.status instanceof ATrustStatus) {
- if (this.state.status.errorMessage != null &&
- this.state.status.errorMessage.equals("cancel")) { //$NON-NLS-1$
+ if (this.state.status.errorMessage != null &&
+ this.state.status.errorMessage.equals("cancel")) { //
this.state.status.errorMessage = null;
return true;
}
}
- return false;
+ return false;
}
-
+
}