From e7e98e908d4b71e875e9ff6d31dea052e5c9f3b8 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Tue, 7 Aug 2018 16:18:08 +0200 Subject: pdf-over support for fingerprint and faceid implemented --- .../asit/pdfover/gui/bku/MobileBKUConnector.java | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java') 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 1a5c822b..b9f77a45 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 @@ -15,6 +15,8 @@ */ package at.asit.pdfover.gui.bku; +import java.io.IOException; + // Imports import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -88,8 +90,6 @@ public class MobileBKUConnector implements BkuSlConnector { try { String responseData = handler.postCredentials(); - //TODO check the response data to determine authentication method - // Now we have received some data lets check it: log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$ @@ -136,8 +136,38 @@ public class MobileBKUConnector implements BkuSlConnector { enterTAN = false; } } + if (enterTAN) { + try { + this.state.showFingerPrintInformation(); + if (this.state.getStatus().getErrorMessage() != null && + this.state.getStatus().getErrorMessage().equals("cancel")) //$NON-NLS-1$ + throw new SignatureException(new IllegalStateException()); + } catch (Exception ex) { + log.error("Error in PostCredentialsThread", ex); //$NON-NLS-1$ + this.state.setThreadException(ex); + this.state.displayError(ex); + throw new SignatureException(ex); + } + + 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$ + this.state.setThreadException(e); + this.state.displayError(e); + throw new SignatureException(e); + } + } + else { + enterTAN = false; + } + } } - if (enterTAN) { + + if (enterTAN || this.state.getSMSStatus()) { // Get TAN this.state.checkTAN(); -- cgit v1.2.3