diff options
9 files changed, 2172 insertions, 2005 deletions
diff --git a/pdf-over-gui/.classpath b/pdf-over-gui/.classpath index a72a5bd8..8308daea 100644 --- a/pdf-over-gui/.classpath +++ b/pdf-over-gui/.classpath @@ -1,31 +1,32 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> - <attributes> - <attribute name="maven.pomderived" value="true"/> - </attributes> - </classpathentry> - <classpathentry kind="src" output="target/classes" path="src/main/java"> - <attributes> - <attribute name="optional" value="true"/> - <attribute name="maven.pomderived" value="true"/> - </attributes> - </classpathentry> - <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> - <attributes> - <attribute name="maven.pomderived" value="true"/> - </attributes> - </classpathentry> - <classpathentry kind="src" output="target/test-classes" path="src/test/java"> - <attributes> - <attribute name="optional" value="true"/> - <attribute name="maven.pomderived" value="true"/> - </attributes> - </classpathentry> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> - <attributes> - <attribute name="maven.pomderived" value="true"/> - </attributes> - </classpathentry> - <classpathentry kind="output" path="target/classes"/> -</classpath> +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" output="target/classes" path="src/main/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
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();
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 5e65f81e..eaa0327a 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 @@ -1,427 +1,442 @@ -/* - * Copyright 2012 by A-SIT, Secure Information Technology Center Austria - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://joinup.ec.europa.eu/software/page/eupl - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - */ -package at.asit.pdfover.gui.bku.mobile; - -// Imports -import java.awt.Desktop; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.lang3.StringEscapeUtils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import at.asit.pdfover.gui.controls.Dialog; -import at.asit.pdfover.gui.controls.Dialog.BUTTONS; -import at.asit.pdfover.gui.controls.Dialog.ICON; -import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.states.MobileBKUState; -import at.asit.pdfover.signator.SLResponse; -import at.asit.pdfover.signator.SignatureException; - -/** - * A-Trust mobile BKU handler - */ -public class ATrustHandler extends MobileBKUHandler { - Shell shell; - - /** - * @param state - * @param shell - * @param useBase64 - */ - public ATrustHandler(MobileBKUState state, Shell shell, boolean useBase64) { - super(state); - this.shell = shell; - this.useBase64 = useBase64; - } - - /** - * SLF4J Logger instance - **/ - static final Logger log = LoggerFactory - .getLogger(ATrustHandler.class); - - private static boolean expiryNoticeDisplayed = false; - - private static final String ACTIVATION_URL = "https://www.handy-signatur.at/"; //$NON-NLS-1$ - - private boolean useBase64 = false; - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#handleSLRequestResponse(java.lang.String) - */ - @Override - public void handleSLRequestResponse(String responseData) throws Exception { - ATrustStatus status = getStatus(); - - if (responseData.contains("<sl:ErrorResponse")) { //$NON-NLS-1$ - String errorCode = MobileBKUHelper.extractSubstring(responseData, - "<sl:ErrorCode>", "</sl:ErrorCode>"); //$NON-NLS-1$ //$NON-NLS-2$ - String errorMsg = MobileBKUHelper.extractSubstring(responseData, - "<sl:Info>", "</sl:Info>"); //$NON-NLS-1$ //$NON-NLS-2$ - throw new Exception("Error from mobile BKU: " + //$NON-NLS-1$ - errorCode + " - " + errorMsg); //$NON-NLS-1$ - } - - // Extract infos: - String sessionID = MobileBKUHelper.extractSubstring(responseData, - "identification.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - - String viewState = MobileBKUHelper.extractValueFromTagWithParam( - responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - String eventValidation = MobileBKUHelper.extractValueFromTagWithParam( - responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - log.info("sessionID: " + sessionID); //$NON-NLS-1$ - log.info("viewState: " + viewState); //$NON-NLS-1$ - log.info("eventValidation: " + eventValidation); //$NON-NLS-1$ - - status.setSessionID(sessionID); - - status.setViewstate(viewState); - - status.setEventvalidation(eventValidation); - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#postCredentials() - */ - @Override - public String postCredentials() throws Exception { - ATrustStatus status = getStatus(); - - MobileBKUHelper.registerTrustedSocketFactory(); - HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); - - PostMethod post = new PostMethod(status.getBaseURL() + "/identification.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ - post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ - post.addParameter("__VIEWSTATE", status.getViewstate()); //$NON-NLS-1$ - post.addParameter("__EVENTVALIDATION", status.getEventvalidation()); //$NON-NLS-1$ - post.addParameter("handynummer", status.getPhoneNumber()); //$NON-NLS-1$ - post.addParameter("signaturpasswort", status.getMobilePassword()); //$NON-NLS-1$ - post.addParameter("Button_Identification", "Identifizieren"); //$NON-NLS-1$ //$NON-NLS-2$ - - return executePost(client, post); - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#handleCredentialsResponse(java.lang.String) - */ - @Override - public void handleCredentialsResponse(String responseData) throws Exception { - ATrustStatus status = getStatus(); - String viewState = status.getViewstate(); - String eventValidation = status.getEventvalidation(); - String sessionID = status.getSessionID(); - String refVal = null; - String signatureDataURL = null; - String qrCode = null; - - status.setErrorMessage(null); - - if (responseData.contains("ExpiresInfo.aspx?sid=")) { //$NON-NLS-1$ - // Certificate expiration interstitial - skip - String notice = Messages.getString("mobileBKU.notice") + " " + //$NON-NLS-1$ //$NON-NLS-2$ - StringEscapeUtils.unescapeHtml4(MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "id", "Label2")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - .replaceAll("\\<.*?\\>", ""); //$NON-NLS-1$ //$NON-NLS-2$ - log.info(notice); - - if (!expiryNoticeDisplayed) { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - Dialog d = new Dialog(ATrustHandler.this.shell, Messages.getString("common.info"), Messages.getString("mobileBKU.certExpiresSoon"), BUTTONS.YES_NO, ICON.WARNING); //$NON-NLS-1$ //$NON-NLS-2$ - if (d.open() == SWT.YES) { - log.debug("Trying to open " + ACTIVATION_URL); //$NON-NLS-1$ - if (Desktop.isDesktopSupported()) { - try { - Desktop.getDesktop().browse(new URI(ACTIVATION_URL)); - return; - } catch (Exception e) { - log.debug("Error opening URL", e); //$NON-NLS-1$ - } - } - log.info("SWT Desktop is not supported on this platform"); //$NON-NLS-1$ - Program.launch(ACTIVATION_URL); - } - } - }); - expiryNoticeDisplayed = true; - } - - String t_sessionID = MobileBKUHelper.extractSubstring(responseData, "ExpiresInfo.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - String t_viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - String t_eventValidation = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - // Post again to skip - MobileBKUHelper.registerTrustedSocketFactory(); - HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); - - PostMethod post = new PostMethod(status.getBaseURL() + "/ExpiresInfo.aspx?sid=" + t_sessionID); //$NON-NLS-1$ - post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ - post.addParameter("__VIEWSTATE", t_viewState); //$NON-NLS-1$ - post.addParameter("__EVENTVALIDATION", t_eventValidation); //$NON-NLS-1$ - post.addParameter("Button_Next", "Weiter"); //$NON-NLS-1$ //$NON-NLS-2$ - - responseData = executePost(client, post); - log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$ - } else if (responseData.contains("tanAppInfo.aspx?sid=")) { //$NON-NLS-1$ - // App info interstitial - skip - log.info("Skipping tan app interstitial"); //$NON-NLS-1$ - - String t_sessionID = MobileBKUHelper.extractSubstring(responseData, "tanAppInfo.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - String t_viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - String t_eventValidation = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - // Post again to skip - MobileBKUHelper.registerTrustedSocketFactory(); - HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); - - PostMethod post = new PostMethod(status.getBaseURL() + "/tanAppInfo.aspx?sid=" + t_sessionID); //$NON-NLS-1$ - post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ - post.addParameter("__VIEWSTATE", t_viewState); //$NON-NLS-1$ - post.addParameter("__EVENTVALIDATION", t_eventValidation); //$NON-NLS-1$ - post.addParameter("NextBtn", "Weiter"); //$NON-NLS-1$ //$NON-NLS-2$ - - responseData = executePost(client, post); - log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$ - } - - if (responseData.contains("signature.aspx?sid=")) { //$NON-NLS-1$ - // credentials ok! TAN entry - log.debug("Credentials accepted - TAN required"); //$NON-NLS-1$ - sessionID = MobileBKUHelper.extractSubstring(responseData, "signature.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - eventValidation = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - refVal = MobileBKUHelper.extractSubstring(responseData, "id='vergleichswert'><b>Vergleichswert:</b>", "</div>"); //$NON-NLS-1$ //$NON-NLS-2$ - signatureDataURL = status.getBaseURL() + "/ShowSigobj.aspx" + //$NON-NLS-1$ - MobileBKUHelper.extractSubstring(responseData, "ShowSigobj.aspx", "'"); //$NON-NLS-1$ //$NON-NLS-2$ - try { - qrCode = MobileBKUHelper.extractValueFromTagWithParam(responseData, "img", "class", "qrcode", "src"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - log.debug("QR Code found: " + qrCode); //$NON-NLS-1$ - status.setQRCode(qrCode); - } catch (Exception e) { - log.debug("No QR Code found"); //$NON-NLS-1$ - } - } else if (responseData.contains("sl:InfoboxReadResponse")) { //$NON-NLS-1$ - // credentials ok! InfoboxReadResponse - log.debug("Credentials accepted - Response given"); //$NON-NLS-1$ - getSigningState().setSignatureResponse( - new SLResponse(responseData, getStatus().getServer(), null, null)); - return; - } else { - // error page - // extract error text! - try { - String errorMessage = MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "class", "ErrorClass"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - status.setErrorMessage(errorMessage); - } catch (Exception e) { - throw new SignatureException(MobileBKUHelper.extractSubstring(responseData, "<sl:ErrorCode>", "</sl:ErrorCode>") + ": " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - MobileBKUHelper.extractSubstring(responseData, "<sl:Info>", "</sl:Info>")); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // force UI again! - status.setMobilePassword(null); - } - - log.info("sessionID: " + sessionID); //$NON-NLS-1$ - log.info("Vergleichswert: " + refVal); //$NON-NLS-1$ - log.info("viewState: " + viewState); //$NON-NLS-1$ - log.info("eventValidation: " + eventValidation); //$NON-NLS-1$ - log.info("signatureDataURL: " + signatureDataURL); //$NON-NLS-1$ - - status.setSessionID(sessionID); - status.setRefVal(refVal); - status.setViewstate(viewState); - status.setEventvalidation(eventValidation); - status.setSignatureDataURL(signatureDataURL); - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#postTAN() - */ - @Override - public String postTAN() throws IOException { - ATrustStatus status = getStatus(); - - MobileBKUHelper.registerTrustedSocketFactory(); - HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); - - PostMethod post = new PostMethod(status.getBaseURL() - + "/signature.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ - post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ - post.addParameter("__VIEWSTATE", status.getViewstate()); //$NON-NLS-1$ - post.addParameter( - "__EVENTVALIDATION", status.getEventvalidation()); //$NON-NLS-1$ - post.addParameter("input_tan", status.getTan()); //$NON-NLS-1$ - post.addParameter("SignButton", "Signieren"); //$NON-NLS-1$ //$NON-NLS-2$ - post.addParameter("Button1", "Identifizieren"); //$NON-NLS-1$ //$NON-NLS-2$ - - return executePost(client, post); - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#handleTANResponse(java.lang.String) - */ - @Override - public void handleTANResponse(String responseData) { - getStatus().setErrorMessage(null); - if (responseData.contains("sl:CreateXMLSignatureResponse xmlns:sl") || //$NON-NLS-1$ - responseData.contains("sl:CreateCMSSignatureResponse xmlns:sl")) { //$NON-NLS-1$ - // success !! - - getSigningState().setSignatureResponse( - new SLResponse(responseData, getStatus().getServer(), null, null)); - } else { - try { - String tries = MobileBKUHelper.extractSubstring( - responseData, "Sie haben noch", "Versuch"); //$NON-NLS-1$ //$NON-NLS-2$ - getStatus().setTanTries(Integer.parseInt(tries.trim())); - getStatus().setErrorMessage("mobileBKU.wrong_tan"); //$NON-NLS-1$ - } catch (Exception e) { - getStatus().setTanTries(getStatus().getTanTries() - 1); - log.debug("Error parsing TAN response", e); //$NON-NLS-1$ - } - - if (getStatus().getTanTries() <= 0) { - getStatus().setErrorMessage(null); - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - Dialog dialog = new Dialog(ATrustHandler.this.shell, Messages.getString("common.warning"), //$NON-NLS-1$ - Messages.getString("mobileBKU.tan_tries_exceeded"), //$NON-NLS-1$ - BUTTONS.OK_CANCEL, ICON.QUESTION); - if (dialog.open() == SWT.CANCEL) { - // Go back to BKU Selection - getStatus().setTanTries(-1); - } else { - // Start signature process over - getStatus().setTanTries(-2); - } - } - }); - } - } - } - - /** - * Cancel QR process, request SMS TAN - * @return the response - * @throws IOException Error during posting - */ - public String postSMSRequest() throws IOException { - ATrustStatus status = getStatus(); - - MobileBKUHelper.registerTrustedSocketFactory(); - HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); - - GetMethod get = new GetMethod(status.getBaseURL() - + "/sendsms.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ - get.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ - - return executeGet(client, get); - } - - /** - * Get the QR code image - * @return the QR code image as a String - */ - public InputStream getQRCode() { - //TODO: Update HTTPClient here - - ATrustStatus status = getStatus(); - - MobileBKUHelper.registerTrustedSocketFactory(); - HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); - - GetMethod get = new GetMethod(status.getBaseURL() + "/" + //$NON-NLS-1$ - status.getQRCode()); - - try { - log.debug("Getting " + get.getURI()); //$NON-NLS-1$ - int returnCode = client.executeMethod(get); - - if (returnCode != HttpStatus.SC_OK) { - log.error("Error getting QR code"); //$NON-NLS-1$ - return null; - } - - return get.getResponseBodyAsStream(); - } catch (Exception e) { - log.error("Error getting QR code", e); //$NON-NLS-1$ - return null; - } - } - - /** - * Get Signature page after scanning QR code - * @return the response - * @throws IOException Error during get - */ - public String getSignaturePage() throws IOException { - ATrustStatus status = getStatus(); - - MobileBKUHelper.registerTrustedSocketFactory(); - HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); - - GetMethod get = new GetMethod(status.getBaseURL() - + "/signature.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ - - return executeGet(client, get); - } - - /** - * Parse QR code response - * @param responseData - * @return whether a SL response was received - */ - public boolean handleQRResponse(String responseData) { - getStatus().setErrorMessage(null); - if (responseData.contains("sl:CreateXMLSignatureResponse xmlns:sl") || //$NON-NLS-1$ - responseData.contains("sl:CreateCMSSignatureResponse xmlns:sl")) { //$NON-NLS-1$ - // success !! - - getSigningState().setSignatureResponse( - new SLResponse(responseData, getStatus().getServer(), null, null)); - return true; - } - return false; - } - - @Override - public ATrustStatus getStatus() { - return (ATrustStatus) getState().getStatus(); - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.bku.mobile.MobileBKUHandler#useBase64Request() - */ - @Override - public boolean useBase64Request() { - return this.useBase64; - } -} +/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
+package at.asit.pdfover.gui.bku.mobile;
+
+// Imports
+import java.awt.Desktop;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import at.asit.pdfover.gui.controls.Dialog;
+import at.asit.pdfover.gui.controls.Dialog.BUTTONS;
+import at.asit.pdfover.gui.controls.Dialog.ICON;
+import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.gui.workflow.states.MobileBKUState;
+import at.asit.pdfover.signator.SLResponse;
+import at.asit.pdfover.signator.SignatureException;
+
+/**
+ * A-Trust mobile BKU handler
+ */
+public class ATrustHandler extends MobileBKUHandler {
+ Shell shell;
+
+ /**
+ * @param state
+ * @param shell
+ * @param useBase64
+ */
+ public ATrustHandler(MobileBKUState state, Shell shell, boolean useBase64) {
+ super(state);
+ this.shell = shell;
+ this.useBase64 = useBase64;
+ }
+
+ /**
+ * SLF4J Logger instance
+ **/
+ static final Logger log = LoggerFactory
+ .getLogger(ATrustHandler.class);
+
+ private static boolean expiryNoticeDisplayed = false;
+
+ private static final String ACTIVATION_URL = "https://www.handy-signatur.at/"; //$NON-NLS-1$
+
+ private boolean useBase64 = false;
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#handleSLRequestResponse(java.lang.String)
+ */
+ @Override
+ public void handleSLRequestResponse(String responseData) throws Exception {
+ ATrustStatus status = getStatus();
+
+ if (responseData.contains("<sl:ErrorResponse")) { //$NON-NLS-1$
+ String errorCode = MobileBKUHelper.extractSubstring(responseData,
+ "<sl:ErrorCode>", "</sl:ErrorCode>"); //$NON-NLS-1$ //$NON-NLS-2$
+ String errorMsg = MobileBKUHelper.extractSubstring(responseData,
+ "<sl:Info>", "</sl:Info>"); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new Exception("Error from mobile BKU: " + //$NON-NLS-1$
+ errorCode + " - " + errorMsg); //$NON-NLS-1$
+ }
+
+ // Extract infos:
+ String sessionID = MobileBKUHelper.extractSubstring(responseData,
+ "identification.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$
+
+ String viewState = MobileBKUHelper.extractValueFromTagWithParam(
+ responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ String eventValidation = MobileBKUHelper.extractValueFromTagWithParam(
+ responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ log.info("sessionID: " + sessionID); //$NON-NLS-1$
+ log.info("viewState: " + viewState); //$NON-NLS-1$
+ log.info("eventValidation: " + eventValidation); //$NON-NLS-1$
+
+ status.setSessionID(sessionID);
+
+ status.setViewstate(viewState);
+
+ status.setEventvalidation(eventValidation);
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#postCredentials()
+ */
+ @Override
+ public String postCredentials() throws Exception {
+ ATrustStatus status = getStatus();
+
+ MobileBKUHelper.registerTrustedSocketFactory();
+ HttpClient client = MobileBKUHelper.getHttpClient(getStatus());
+
+ PostMethod post = new PostMethod(status.getBaseURL() + "/identification.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$
+ post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$
+ post.addParameter("__VIEWSTATE", status.getViewstate()); //$NON-NLS-1$
+ post.addParameter("__EVENTVALIDATION", status.getEventvalidation()); //$NON-NLS-1$
+ post.addParameter("handynummer", status.getPhoneNumber()); //$NON-NLS-1$
+ post.addParameter("signaturpasswort", status.getMobilePassword()); //$NON-NLS-1$
+ post.addParameter("Button_Identification", "Identifizieren"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ return executePost(client, post);
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#handleCredentialsResponse(java.lang.String)
+ */
+ @Override
+ public void handleCredentialsResponse(String responseData) throws Exception {
+ ATrustStatus status = getStatus();
+ String viewState = status.getViewstate();
+ String eventValidation = status.getEventvalidation();
+ String sessionID = status.getSessionID();
+ String refVal = null;
+ String signatureDataURL = null;
+ String qrCode = null;
+ String tanField = null;
+ String tanTextTan = null;
+
+ status.setErrorMessage(null);
+
+ if (responseData.contains("ExpiresInfo.aspx?sid=")) { //$NON-NLS-1$
+ // Certificate expiration interstitial - skip
+ String notice = Messages.getString("mobileBKU.notice") + " " + //$NON-NLS-1$ //$NON-NLS-2$
+ StringEscapeUtils.unescapeHtml4(MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "id", "Label2")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ .replaceAll("\\<.*?\\>", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ log.info(notice);
+
+ if (!expiryNoticeDisplayed) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ Dialog d = new Dialog(ATrustHandler.this.shell, Messages.getString("common.info"), Messages.getString("mobileBKU.certExpiresSoon"), BUTTONS.YES_NO, ICON.WARNING); //$NON-NLS-1$ //$NON-NLS-2$
+ if (d.open() == SWT.YES) {
+ log.debug("Trying to open " + ACTIVATION_URL); //$NON-NLS-1$
+ if (Desktop.isDesktopSupported()) {
+ try {
+ Desktop.getDesktop().browse(new URI(ACTIVATION_URL));
+ return;
+ } catch (Exception e) {
+ log.debug("Error opening URL", e); //$NON-NLS-1$
+ }
+ }
+ log.info("SWT Desktop is not supported on this platform"); //$NON-NLS-1$
+ Program.launch(ACTIVATION_URL);
+ }
+ }
+ });
+ expiryNoticeDisplayed = true;
+ }
+
+ String t_sessionID = MobileBKUHelper.extractSubstring(responseData, "ExpiresInfo.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ String t_viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ String t_eventValidation = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ // Post again to skip
+ MobileBKUHelper.registerTrustedSocketFactory();
+ HttpClient client = MobileBKUHelper.getHttpClient(getStatus());
+
+ PostMethod post = new PostMethod(status.getBaseURL() + "/ExpiresInfo.aspx?sid=" + t_sessionID); //$NON-NLS-1$
+ post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$
+ post.addParameter("__VIEWSTATE", t_viewState); //$NON-NLS-1$
+ post.addParameter("__EVENTVALIDATION", t_eventValidation); //$NON-NLS-1$
+ post.addParameter("Button_Next", "Weiter"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ responseData = executePost(client, post);
+ log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$
+ } else if (responseData.contains("tanAppInfo.aspx?sid=")) { //$NON-NLS-1$
+ // App info interstitial - skip
+ log.info("Skipping tan app interstitial"); //$NON-NLS-1$
+
+ String t_sessionID = MobileBKUHelper.extractSubstring(responseData, "tanAppInfo.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ String t_viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ String t_eventValidation = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ // Post again to skip
+ MobileBKUHelper.registerTrustedSocketFactory();
+ HttpClient client = MobileBKUHelper.getHttpClient(getStatus());
+
+ PostMethod post = new PostMethod(status.getBaseURL() + "/tanAppInfo.aspx?sid=" + t_sessionID); //$NON-NLS-1$
+ post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$
+ post.addParameter("__VIEWSTATE", t_viewState); //$NON-NLS-1$
+ post.addParameter("__EVENTVALIDATION", t_eventValidation); //$NON-NLS-1$
+ post.addParameter("NextBtn", "Weiter"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ responseData = executePost(client, post);
+ log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$
+ }
+
+ if (responseData.contains("signature.aspx?sid=")) { //$NON-NLS-1$
+ // credentials ok! TAN entry
+ log.debug("Credentials accepted - TAN required"); //$NON-NLS-1$
+ sessionID = MobileBKUHelper.extractSubstring(responseData, "signature.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ eventValidation = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ refVal = MobileBKUHelper.extractSubstring(responseData, "id='vergleichswert'><b>Vergleichswert:</b>", "</div>"); //$NON-NLS-1$ //$NON-NLS-2$
+ signatureDataURL = status.getBaseURL() + "/ShowSigobj.aspx" + //$NON-NLS-1$
+ MobileBKUHelper.extractSubstring(responseData, "ShowSigobj.aspx", "'"); //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ qrCode = MobileBKUHelper.extractValueFromTagWithParam(responseData, "img", "class", "qrcode", "src"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ log.debug("QR Code found: " + qrCode); //$NON-NLS-1$
+ status.setQRCode(qrCode);
+ } catch (Exception e) {
+ log.debug("No QR Code found"); //$NON-NLS-1$
+ }
+ try {
+ tanField = MobileBKUHelper.extractValueFromTagWithParam(responseData, "label", "id", "label_for_input_tan", "for"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ status.setTanField(tanField);
+ } catch (Exception e) {
+ log.debug("No tan field found"); //$NON-NLS-1$
+ }
+ try {
+ tanTextTan = tanField = MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "id", "text_tan"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ status.setIsAPPTan(tanTextTan);
+ }catch (Exception e) {
+ log.debug("No text_tan tag"); //$NON-NLS-1$
+ }
+
+ } else if (responseData.contains("sl:InfoboxReadResponse")) { //$NON-NLS-1$
+ // credentials ok! InfoboxReadResponse
+ log.debug("Credentials accepted - Response given"); //$NON-NLS-1$
+ getSigningState().setSignatureResponse(
+ new SLResponse(responseData, getStatus().getServer(), null, null));
+ return;
+ } else {
+ // error page
+ // extract error text!
+ try {
+ String errorMessage = MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "class", "ErrorClass"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ status.setErrorMessage(errorMessage);
+ } catch (Exception e) {
+ throw new SignatureException(MobileBKUHelper.extractSubstring(responseData, "<sl:ErrorCode>", "</sl:ErrorCode>") + ": " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ MobileBKUHelper.extractSubstring(responseData, "<sl:Info>", "</sl:Info>")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // force UI again!
+ status.setMobilePassword(null);
+ }
+
+ log.info("sessionID: " + sessionID); //$NON-NLS-1$
+ log.info("Vergleichswert: " + refVal); //$NON-NLS-1$
+ log.info("viewState: " + viewState); //$NON-NLS-1$
+ log.info("eventValidation: " + eventValidation); //$NON-NLS-1$
+ log.info("signatureDataURL: " + signatureDataURL); //$NON-NLS-1$
+
+ status.setSessionID(sessionID);
+ status.setRefVal(refVal);
+ status.setViewstate(viewState);
+ status.setEventvalidation(eventValidation);
+ status.setSignatureDataURL(signatureDataURL);
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#postTAN()
+ */
+ @Override
+ public String postTAN() throws IOException {
+ ATrustStatus status = getStatus();
+
+ MobileBKUHelper.registerTrustedSocketFactory();
+ HttpClient client = MobileBKUHelper.getHttpClient(getStatus());
+
+ PostMethod post = new PostMethod(status.getBaseURL()
+ + "/signature.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$
+ post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$
+ post.addParameter("__VIEWSTATE", status.getViewstate()); //$NON-NLS-1$
+ post.addParameter(
+ "__EVENTVALIDATION", status.getEventvalidation()); //$NON-NLS-1$
+ post.addParameter("input_tan", status.getTan()); //$NON-NLS-1$
+ post.addParameter("SignButton", "Signieren"); //$NON-NLS-1$ //$NON-NLS-2$
+ post.addParameter("Button1", "Identifizieren"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ return executePost(client, post);
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHandler#handleTANResponse(java.lang.String)
+ */
+ @Override
+ public void handleTANResponse(String responseData) {
+ getStatus().setErrorMessage(null);
+ if (responseData.contains("sl:CreateXMLSignatureResponse xmlns:sl") || //$NON-NLS-1$
+ responseData.contains("sl:CreateCMSSignatureResponse xmlns:sl")) { //$NON-NLS-1$
+ // success !!
+
+ getSigningState().setSignatureResponse(
+ new SLResponse(responseData, getStatus().getServer(), null, null));
+ } else {
+ try {
+ String tries = MobileBKUHelper.extractSubstring(
+ responseData, "Sie haben noch", "Versuch"); //$NON-NLS-1$ //$NON-NLS-2$
+ getStatus().setTanTries(Integer.parseInt(tries.trim()));
+ getStatus().setErrorMessage("mobileBKU.wrong_tan"); //$NON-NLS-1$
+ } catch (Exception e) {
+ getStatus().setTanTries(getStatus().getTanTries() - 1);
+ log.debug("Error parsing TAN response", e); //$NON-NLS-1$
+ }
+
+ if (getStatus().getTanTries() <= 0) {
+ getStatus().setErrorMessage(null);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ Dialog dialog = new Dialog(ATrustHandler.this.shell, Messages.getString("common.warning"), //$NON-NLS-1$
+ Messages.getString("mobileBKU.tan_tries_exceeded"), //$NON-NLS-1$
+ BUTTONS.OK_CANCEL, ICON.QUESTION);
+ if (dialog.open() == SWT.CANCEL) {
+ // Go back to BKU Selection
+ getStatus().setTanTries(-1);
+ } else {
+ // Start signature process over
+ getStatus().setTanTries(-2);
+ }
+ }
+ });
+ }
+ }
+ }
+
+ /**
+ * Cancel QR process, request SMS TAN
+ * @return the response
+ * @throws IOException Error during posting
+ */
+ public String postSMSRequest() throws IOException {
+ ATrustStatus status = getStatus();
+
+ MobileBKUHelper.registerTrustedSocketFactory();
+ HttpClient client = MobileBKUHelper.getHttpClient(getStatus());
+
+ GetMethod get = new GetMethod(status.getBaseURL()
+ + "/sendsms.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$
+ get.getParams().setContentCharset("utf-8"); //$NON-NLS-1$
+
+ return executeGet(client, get);
+ }
+
+ /**
+ * Get the QR code image
+ * @return the QR code image as a String
+ */
+ public InputStream getQRCode() {
+ //TODO: Update HTTPClient here
+
+ ATrustStatus status = getStatus();
+
+ MobileBKUHelper.registerTrustedSocketFactory();
+ HttpClient client = MobileBKUHelper.getHttpClient(getStatus());
+
+ GetMethod get = new GetMethod(status.getBaseURL() + "/" + //$NON-NLS-1$
+ status.getQRCode());
+
+ try {
+ log.debug("Getting " + get.getURI()); //$NON-NLS-1$
+ int returnCode = client.executeMethod(get);
+
+ if (returnCode != HttpStatus.SC_OK) {
+ log.error("Error getting QR code"); //$NON-NLS-1$
+ return null;
+ }
+
+ return get.getResponseBodyAsStream();
+ } catch (Exception e) {
+ log.error("Error getting QR code", e); //$NON-NLS-1$
+ return null;
+ }
+ }
+
+ /**
+ * Get Signature page after scanning QR code
+ * @return the response
+ * @throws IOException Error during get
+ */
+ public String getSignaturePage() throws IOException {
+ ATrustStatus status = getStatus();
+
+ MobileBKUHelper.registerTrustedSocketFactory();
+ HttpClient client = MobileBKUHelper.getHttpClient(getStatus());
+
+ GetMethod get = new GetMethod(status.getBaseURL()
+ + "/signature.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$
+
+ return executeGet(client, get);
+ }
+
+ /**
+ * Parse QR code response
+ * @param responseData
+ * @return whether a SL response was received
+ */
+ public boolean handleQRResponse(String responseData) {
+ getStatus().setErrorMessage(null);
+ if (responseData.contains("sl:CreateXMLSignatureResponse xmlns:sl") || //$NON-NLS-1$
+ responseData.contains("sl:CreateCMSSignatureResponse xmlns:sl")) { //$NON-NLS-1$
+ // success !!
+
+ getSigningState().setSignatureResponse(
+ new SLResponse(responseData, getStatus().getServer(), null, null));
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public ATrustStatus getStatus() {
+ return (ATrustStatus) getState().getStatus();
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.bku.mobile.MobileBKUHandler#useBase64Request()
+ */
+ @Override
+ public boolean useBase64Request() {
+ return this.useBase64;
+ }
+}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustStatus.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustStatus.java index ecfd9f2b..b81e15be 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustStatus.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustStatus.java @@ -1,120 +1,150 @@ -/* - * Copyright 2012 by A-SIT, Secure Information Technology Center Austria - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://joinup.ec.europa.eu/software/page/eupl - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - */ -package at.asit.pdfover.gui.bku.mobile; - -// Imports -import org.apache.commons.httpclient.Cookie; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import at.asit.pdfover.gui.workflow.config.ConfigProvider; - -/** - * A-Trust MobileBKUStatus implementation - */ -public class ATrustStatus extends AbstractMobileBKUStatusImpl { - /** - * SLF4J Logger instance - **/ - @SuppressWarnings("unused") - private static final Logger log = LoggerFactory - .getLogger(ATrustStatus.class); - - /** Maximum number of TAN tries */ - public static final int MOBILE_MAX_TAN_TRIES = 3; - - private String viewstate; - private String eventvalidation; - private String qrcode = null; - - /** - * Constructor - * @param provider the ConfigProvider - */ - public ATrustStatus(ConfigProvider provider) { - setPhoneNumber(provider.getDefaultMobileNumber()); - setMobilePassword(provider.getDefaultMobilePassword()); - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUStatus#getMaxTanTries() - */ - @Override - public int getMaxTanTries() { - return MOBILE_MAX_TAN_TRIES; - } - - /** - * @return the viewstate - */ - public String getViewstate() { - return this.viewstate; - } - - /** - * @param viewstate - * the viewstate to set - */ - public void setViewstate(String viewstate) { - this.viewstate = viewstate; - } - - /** - * @return the eventvalidation - */ - public String getEventvalidation() { - return this.eventvalidation; - } - - /** - * @param eventvalidation the eventvalidation to set - */ - public void setEventvalidation(String eventvalidation) { - this.eventvalidation = eventvalidation; - } - - /** - * @return the QR code - */ - public String getQRCode() { - return this.qrcode; - } - - /** - * @param qrcode - * the QR code to set - */ - public void setQRCode(String qrcode) { - this.qrcode = qrcode; - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.bku.mobile.MobileBKUStatus#parseCookies(org.apache.commons.httpclient.Cookie[]) - */ - @Override - public void parseCookies(Cookie[] cookies) { - //not needed yet - } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.bku.mobile.MobileBKUStatus#getCookies() - */ - @Override - public Cookie[] getCookies() { - //not needed yet - return null; - } -} +/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
+package at.asit.pdfover.gui.bku.mobile;
+
+// Imports
+import org.apache.commons.httpclient.Cookie;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import at.asit.pdfover.gui.workflow.config.ConfigProvider;
+
+/**
+ * A-Trust MobileBKUStatus implementation
+ */
+public class ATrustStatus extends AbstractMobileBKUStatusImpl {
+ /**
+ * SLF4J Logger instance
+ **/
+ @SuppressWarnings("unused")
+ private static final Logger log = LoggerFactory
+ .getLogger(ATrustStatus.class);
+
+ /** Maximum number of TAN tries */
+ public static final int MOBILE_MAX_TAN_TRIES = 3;
+
+ private String viewstate;
+ private String eventvalidation;
+ private String qrcode = null;
+ private boolean tanField = false;
+ private boolean isAPPTan = false;
+
+ /**
+ * Constructor
+ * @param provider the ConfigProvider
+ */
+ public ATrustStatus(ConfigProvider provider) {
+ setPhoneNumber(provider.getDefaultMobileNumber());
+ setMobilePassword(provider.getDefaultMobilePassword());
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUStatus#getMaxTanTries()
+ */
+ @Override
+ public int getMaxTanTries() {
+ return MOBILE_MAX_TAN_TRIES;
+ }
+
+ /**
+ * @return the viewstate
+ */
+ public String getViewstate() {
+ return this.viewstate;
+ }
+
+ /**
+ * @param viewstate
+ * the viewstate to set
+ */
+ public void setViewstate(String viewstate) {
+ this.viewstate = viewstate;
+ }
+
+ /**
+ * @return the eventvalidation
+ */
+ public String getEventvalidation() {
+ return this.eventvalidation;
+ }
+
+ /**
+ * @param eventvalidation the eventvalidation to set
+ */
+ public void setEventvalidation(String eventvalidation) {
+ this.eventvalidation = eventvalidation;
+ }
+
+ /**
+ * @return the QR code
+ */
+ public String getQRCode() {
+ return this.qrcode;
+ }
+
+ /**
+ * @param qrcode
+ * the QR code to set
+ */
+ public void setQRCode(String qrcode) {
+ this.qrcode = qrcode;
+ }
+
+ /**
+ * @param tanField
+ */
+ public void setTanField(String tanField) {
+ this.tanField = tanField.equals("input_tan"); //$NON-NLS-1$
+ }
+
+ /**
+ * @return boolean if response contained tan field
+ */
+ public boolean getTanField() {
+ return this.tanField;
+ }
+
+ /**
+ * @param tanString the tan string from the response
+ */
+ public void setIsAPPTan(String tanString) {
+ this.isAPPTan = !tanString.toLowerCase().contains("sms"); //$NON-NLS-1$
+ }
+
+ /**
+ * @return true if the user receives the tan via app
+ */
+ public boolean getIsAPPTan() {
+ return this.isAPPTan;
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.bku.mobile.MobileBKUStatus#parseCookies(org.apache.commons.httpclient.Cookie[])
+ */
+ @Override
+ public void parseCookies(Cookie[] cookies) {
+ //not needed yet
+ }
+
+ /* (non-Javadoc)
+ * @see at.asit.pdfover.gui.bku.mobile.MobileBKUStatus#getCookies()
+ */
+ @Override
+ public Cookie[] getCookies() {
+ //not needed yet
+ return null;
+ }
+}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java index 7bda7fc4..d34f89dc 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java @@ -1,484 +1,484 @@ -/* - * Copyright 2012 by A-SIT, Secure Information Technology Center Austria - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://joinup.ec.europa.eu/software/page/eupl - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - */ -package at.asit.pdfover.gui.composites; - -// Imports -import java.awt.Desktop; -import java.net.URI; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.TraverseEvent; -import org.eclipse.swt.events.TraverseListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.program.Program; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Link; -import org.eclipse.swt.widgets.Text; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import at.asit.pdfover.gui.Constants; -import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.states.State; - -/** - * Composite for entering the TAN for the mobile BKU - */ -public class MobileBKUEnterTANComposite extends StateComposite { - - /** - * - */ - private final class OkSelectionListener extends SelectionAdapter { - /** - * Empty constructor - */ - public OkSelectionListener() { - } - - @Override - public void widgetSelected(SelectionEvent e) { - if(!MobileBKUEnterTANComposite.this.btn_ok.getEnabled()) { - return; - } - - String tan = MobileBKUEnterTANComposite.this.txt_tan.getText(); - - tan = tan.trim(); - - if (tan.isEmpty()) { - MobileBKUEnterTANComposite.this.setMessage(Messages - .getString("error.NoTan")); //$NON-NLS-1$ - return; - } - - if (MobileBKUEnterTANComposite.this.refVal.startsWith(tan)) { - MobileBKUEnterTANComposite.this.setMessage(Messages - .getString("error.EnteredReferenceValue")); //$NON-NLS-1$ - return; - } - - if (tan.length() > 6) { - MobileBKUEnterTANComposite.this.setMessage(Messages - .getString("error.TanTooLong")); //$NON-NLS-1$ - return; - } - - MobileBKUEnterTANComposite.this.tan = tan; - MobileBKUEnterTANComposite.this.setUserAck(true); - MobileBKUEnterTANComposite.this.btn_ok.setEnabled(false); - //MobileBKUEnterTANComposite.this.state.updateStateMachine(); - //MobileBKUEnterTANComposite.this.btn_ok.setEnabled(true); - } - } - - /** - * - */ - private final class CancelSelectionListener extends SelectionAdapter { - /** - * Empty constructor - */ - public CancelSelectionListener() { - } - - @Override - public void widgetSelected(SelectionEvent e) { - MobileBKUEnterTANComposite.this.setUserCancel(true); - } - } - - /** - * SLF4J Logger instance - **/ - static final Logger log = LoggerFactory - .getLogger(MobileBKUEnterTANComposite.class); - - Text txt_tan; - - boolean userAck = false; - boolean userCancel = false; - - private Label lblRefVal; - - String refVal; - - String signatureData; - - /** - * @return the signatureData - */ - public String getSignatureData() { - return this.signatureData; - } - - /** - * @param signatureData - * the signatureData to set - */ - public void setSignatureData(String signatureData) { - this.signatureData = signatureData; - } - - String tan; - - private Label lblTries; - private Label lblRefValLabel; - private Label lblTan; - - Button btn_ok; - Button btn_cancel; - - /** - * @return the userAck - */ - public boolean isUserAck() { - return this.userAck; - } - - /** - * @return the userCancel - */ - public boolean isUserCancel() { - return this.userCancel; - } - - /** - * Set how many tries are left - * - * @param tries - */ - public void setTries(int tries) { - this.lblTries.setText(tries == 1 ? Messages.getString("tanEnter.try") : //$NON-NLS-1$ - String.format(Messages.getString("tanEnter.tries"), tries)); //$NON-NLS-1$ - } - - /** - * Set an error message - * @param errorMessage the error message - */ - public void setErrorMessage(String errorMessage) { - if (errorMessage == null) - this.lblTries.setText(""); //$NON-NLS-1$ - else - this.lblTries.setText( - Messages.getString("error.Title") + ": " + errorMessage); //$NON-NLS-1$ //$NON-NLS-2$ - } - - - /** - * Sets the message - * - * @param msg - */ - public void setMessage(String msg) { - this.lblTries.setText(msg); - this.lblTries.redraw(); - this.lblTries.getParent().layout(true, true); - } - - /** - * @param userAck - * the userAck to set - */ - public void setUserAck(boolean userAck) { - this.userAck = userAck; - } - - /** - * @param userCancel - * the userCancel to set - */ - public void setUserCancel(boolean userCancel) { - this.userCancel = userCancel; - } - - /** - * @return the reference value - */ - public String getRefVal() { - return this.refVal; - } - - /** - * Enables the submit button - */ - public void enableButton() { - this.btn_ok.setEnabled(true); - } - - /** - * @param refVal - * the reference value to set - */ - public void setRefVal(String refVal) { - this.refVal = refVal.trim(); - - if (this.refVal != null) { - this.lblRefVal.setText(this.refVal); - } else { - this.lblRefVal.setText(""); //$NON-NLS-1$ - } - - } - - /** - * @return the tan - */ - public String getTan() { - return this.tan; - } - - /** - * @param tan - * the tan to set - */ - public void setTan(String tan) { - this.tan = tan; - - if (this.tan == null) { - this.txt_tan.setText(""); //$NON-NLS-1$ - } else { - this.txt_tan.setText(this.tan); - } - } - - /** - * Selection Listener for open button - */ - private final class ShowSignatureDataListener extends SelectionAdapter { - /** - * Empty constructor - */ - public ShowSignatureDataListener() { - } - - @Override - public void widgetSelected(SelectionEvent e) { - try { - String signatureData = MobileBKUEnterTANComposite.this - .getSignatureData(); - if (signatureData != null && !signatureData.equals("")) { //$NON-NLS-1$ - log.debug("Trying to open " + signatureData); //$NON-NLS-1$ - if (Desktop.isDesktopSupported()) { - Desktop.getDesktop().browse(new URI(signatureData)); - } else { - log.info("SWT Desktop is not supported on this platform"); //$NON-NLS-1$ - Program.launch(signatureData); - } - } - } catch (Exception ex) { - log.error("OpenSelectionListener: ", ex); //$NON-NLS-1$ - } - } - } - - /** - * Create the composite. - * - * @param parent - * @param style - * @param state - */ - public MobileBKUEnterTANComposite(Composite parent, int style, State state) { - super(parent, style, state); - setLayout(new FormLayout()); - - final Composite containerComposite = new Composite(this, SWT.NATIVE); - containerComposite.addPaintListener(new PaintListener() { - @Override - public void paintControl(PaintEvent e) { - Rectangle clientArea = containerComposite.getClientArea(); - - // e.gc.setForeground(); - e.gc.setForeground(Constants.MAINBAR_ACTIVE_BACK_DARK); - e.gc.setLineWidth(3); - e.gc.setLineStyle(SWT.LINE_SOLID); - e.gc.drawRoundRectangle(clientArea.x, clientArea.y, - clientArea.width - 2, clientArea.height - 2, 10, 10); - } - }); - containerComposite.setLayout(new FormLayout()); - FormData fd_containerComposite = new FormData(); - fd_containerComposite.top = new FormAttachment(50, -120); - fd_containerComposite.bottom = new FormAttachment(50, 120); - fd_containerComposite.left = new FormAttachment(50, -200); - fd_containerComposite.right = new FormAttachment(50, 200); - containerComposite.setLayoutData(fd_containerComposite); - - this.lblRefValLabel = new Label(containerComposite, SWT.NATIVE); - this.lblRefValLabel.setAlignment(SWT.RIGHT); - FormData fd_lblRefValLabel = new FormData(); - // fd_lblRefValLabel.left = new FormAttachment(0, 20); - fd_lblRefValLabel.right = new FormAttachment(50, -10); - // fd_lblRefValLabel.top = new FormAttachment(30, -15); - fd_lblRefValLabel.bottom = new FormAttachment(50, -10); - this.lblRefValLabel.setLayoutData(fd_lblRefValLabel); - this.lblRefValLabel.setText(Messages - .getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ - - Label lbl_image = new Label(containerComposite, SWT.NATIVE); - - ImageData data = new ImageData(this.getClass().getResourceAsStream( - Constants.RES_IMG_MOBILE)); - Image mobile = new Image(getDisplay(), data); - - FormData fd_lbl_image = new FormData(); - fd_lbl_image.top = new FormAttachment(50, -1 * (data.width / 2)); - fd_lbl_image.bottom = new FormAttachment(50, data.width / 2); - fd_lbl_image.left = new FormAttachment(0, 10); - fd_lbl_image.width = data.width; - lbl_image.setLayoutData(fd_lbl_image); - lbl_image.setImage(mobile); - - this.lblRefVal = new Label(containerComposite, SWT.NATIVE); - FormData fd_lblRefVal = new FormData(); - fd_lblRefVal.left = new FormAttachment(50, 10); - fd_lblRefVal.right = new FormAttachment(100, -20); - // fd_lblRefVal.top = new FormAttachment(30, -15); - fd_lblRefVal.bottom = new FormAttachment(50, -10); - this.lblRefVal.setLayoutData(fd_lblRefVal); - this.lblRefVal.setText(""); //$NON-NLS-1$ - - this.lblTan = new Label(containerComposite, SWT.NATIVE); - this.lblTan.setAlignment(SWT.RIGHT); - FormData fd_lblTan = new FormData(); - // fd_lblTan.left = new FormAttachment(0, 20); - fd_lblTan.right = new FormAttachment(50, -10); - fd_lblTan.top = new FormAttachment(50, 10); - // fd_lblTan.bottom = new FormAttachment(50, 15); - this.lblTan.setLayoutData(fd_lblTan); - this.lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$ - - this.txt_tan = new Text(containerComposite, SWT.BORDER | SWT.NATIVE); - FormData fd_text = new FormData(); - fd_text.left = new FormAttachment(50, 10); - fd_text.right = new FormAttachment(100, -20); - fd_text.top = new FormAttachment(50, 10); - this.txt_tan.setEditable(true); - this.txt_tan.setLayoutData(fd_text); - - this.txt_tan.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_RETURN) { - if(MobileBKUEnterTANComposite.this.btn_ok.isEnabled()) { - (new OkSelectionListener()).widgetSelected(null); - } - } - } - }); - - this.txt_tan.addModifyListener(new ModifyListener() { - - @Override - public void modifyText(ModifyEvent e) { - - String text = MobileBKUEnterTANComposite.this.txt_tan.getText(); - //log.debug("Current TAN: " + text); //$NON-NLS-1$ - if (text.length() > 3 - && MobileBKUEnterTANComposite.this.getRefVal() - .startsWith(text.trim())) { - MobileBKUEnterTANComposite.this.setMessage(Messages - .getString("error.EnteredReferenceValue")); //$NON-NLS-1$ - } - } - }); - - Link lnk_sig_data = new Link(containerComposite, SWT.NATIVE | SWT.RESIZE); - - FormData fd_lnk_data = new FormData(); - fd_lnk_data.right = new FormAttachment(100, -20); - fd_lnk_data.top = new FormAttachment(0, 20); - lnk_sig_data.setEnabled(true); - lnk_sig_data.setLayoutData(fd_lnk_data); - lnk_sig_data.addSelectionListener(new ShowSignatureDataListener()); - lnk_sig_data.setText(Messages.getString("mobileBKU.show")); //$NON-NLS-1$ - lnk_sig_data.setToolTipText(Messages.getString("mobileBKU.show_tooltip")); //$NON-NLS-1$ - - this.btn_ok = new Button(containerComposite, SWT.NATIVE); - this.btn_cancel = new Button(containerComposite, SWT.NATIVE); - - this.lblTries = new Label(containerComposite, SWT.WRAP | SWT.NATIVE); - FormData fd_lbl_tries = new FormData(); - // fd_lbl_tries.left = new FormAttachment(15, 5); - fd_lbl_tries.right = new FormAttachment(this.btn_cancel, -10); - // fd_lbl_tries.top = new FormAttachment(70, -15); - fd_lbl_tries.bottom = new FormAttachment(100, -20); - this.lblTries.setLayoutData(fd_lbl_tries); - - FormData fd_btn_ok = new FormData(); - // fd_btn_ok.left = new FormAttachment(95, 0); - fd_btn_ok.right = new FormAttachment(100, -20); - //fd_btn_ok.left = new FormAttachment(100, -70); - fd_btn_ok.bottom = new FormAttachment(100, -20); - - this.btn_ok.setLayoutData(fd_btn_ok); - this.btn_ok.setText(Messages.getString("common.Ok")); //$NON-NLS-1$ - this.btn_ok.addSelectionListener(new OkSelectionListener()); - - FormData fd_btn_cancel = new FormData(); - // fd_btn_cancel.left = new FormAttachment(95, 0); - fd_btn_cancel.right = new FormAttachment(this.btn_ok, -20); - //fd_btn_cancel.left = new FormAttachment(100, -70); - fd_btn_cancel.bottom = new FormAttachment(100, -20); - - this.btn_cancel.setLayoutData(fd_btn_cancel); - this.btn_cancel.setText(Messages.getString("common.Cancel")); //$NON-NLS-1$ - this.btn_cancel.addSelectionListener(new CancelSelectionListener()); - } - - @Override - protected void checkSubclass() { - // Disable the check that prevents subclassing of SWT components - } - - /* - * (non-Javadoc) - * - * @see at.asit.pdfover.gui.composites.StateComposite#doLayout() - */ - @Override - public void doLayout() { - // Nothing to do - } - - /* - * (non-Javadoc) - * - * @see at.asit.pdfover.gui.composites.StateComposite#reloadResources() - */ - @Override - public void reloadResources() { - this.lblRefValLabel.setText(Messages - .getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ - this.lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$ - } -} +/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
+package at.asit.pdfover.gui.composites;
+
+// Imports
+import java.awt.Desktop;
+import java.net.URI;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import at.asit.pdfover.gui.Constants;
+import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.gui.workflow.states.State;
+
+/**
+ * Composite for entering the TAN for the mobile BKU
+ */
+public class MobileBKUEnterTANComposite extends StateComposite {
+
+ /**
+ *
+ */
+ private final class OkSelectionListener extends SelectionAdapter {
+ /**
+ * Empty constructor
+ */
+ public OkSelectionListener() {
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if(!MobileBKUEnterTANComposite.this.btn_ok.getEnabled()) {
+ return;
+ }
+
+ String tan = MobileBKUEnterTANComposite.this.txt_tan.getText();
+
+ tan = tan.trim();
+
+ if (tan.isEmpty()) {
+ MobileBKUEnterTANComposite.this.setMessage(Messages
+ .getString("error.NoTan")); //$NON-NLS-1$
+ return;
+ }
+
+ if (MobileBKUEnterTANComposite.this.refVal.startsWith(tan)) {
+ MobileBKUEnterTANComposite.this.setMessage(Messages
+ .getString("error.EnteredReferenceValue")); //$NON-NLS-1$
+ return;
+ }
+
+ if (tan.length() > 6) {
+ MobileBKUEnterTANComposite.this.setMessage(Messages
+ .getString("error.TanTooLong")); //$NON-NLS-1$
+ return;
+ }
+
+ MobileBKUEnterTANComposite.this.tan = tan;
+ MobileBKUEnterTANComposite.this.setUserAck(true);
+ MobileBKUEnterTANComposite.this.btn_ok.setEnabled(false);
+ //MobileBKUEnterTANComposite.this.state.updateStateMachine();
+ //MobileBKUEnterTANComposite.this.btn_ok.setEnabled(true);
+ }
+ }
+
+ /**
+ *
+ */
+ private final class CancelSelectionListener extends SelectionAdapter {
+ /**
+ * Empty constructor
+ */
+ public CancelSelectionListener() {
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ MobileBKUEnterTANComposite.this.setUserCancel(true);
+ }
+ }
+
+ /**
+ * SLF4J Logger instance
+ **/
+ static final Logger log = LoggerFactory
+ .getLogger(MobileBKUEnterTANComposite.class);
+
+ Text txt_tan;
+
+ boolean userAck = false;
+ boolean userCancel = false;
+
+ private Label lblRefVal;
+
+ String refVal;
+
+ String signatureData;
+
+ /**
+ * @return the signatureData
+ */
+ public String getSignatureData() {
+ return this.signatureData;
+ }
+
+ /**
+ * @param signatureData
+ * the signatureData to set
+ */
+ public void setSignatureData(String signatureData) {
+ this.signatureData = signatureData;
+ }
+
+ String tan;
+
+ private Label lblTries;
+ private Label lblRefValLabel;
+ private Label lblTan;
+
+ Button btn_ok;
+ Button btn_cancel;
+
+ /**
+ * @return the userAck
+ */
+ public boolean isUserAck() {
+ return this.userAck;
+ }
+
+ /**
+ * @return the userCancel
+ */
+ public boolean isUserCancel() {
+ return this.userCancel;
+ }
+
+ /**
+ * Set how many tries are left
+ *
+ * @param tries
+ */
+ public void setTries(int tries) {
+ this.lblTries.setText(tries == 1 ? Messages.getString("tanEnter.try") : //$NON-NLS-1$
+ String.format(Messages.getString("tanEnter.tries"), tries)); //$NON-NLS-1$
+ }
+
+ /**
+ * Set an error message
+ * @param errorMessage the error message
+ */
+ public void setErrorMessage(String errorMessage) {
+ if (errorMessage == null)
+ this.lblTries.setText(""); //$NON-NLS-1$
+ else
+ this.lblTries.setText(
+ Messages.getString("error.Title") + ": " + errorMessage); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ /**
+ * Sets the message
+ *
+ * @param msg
+ */
+ public void setMessage(String msg) {
+ this.lblTries.setText(msg);
+ this.lblTries.redraw();
+ this.lblTries.getParent().layout(true, true);
+ }
+
+ /**
+ * @param userAck
+ * the userAck to set
+ */
+ public void setUserAck(boolean userAck) {
+ this.userAck = userAck;
+ }
+
+ /**
+ * @param userCancel
+ * the userCancel to set
+ */
+ public void setUserCancel(boolean userCancel) {
+ this.userCancel = userCancel;
+ }
+
+ /**
+ * @return the reference value
+ */
+ public String getRefVal() {
+ return this.refVal;
+ }
+
+ /**
+ * Enables the submit button
+ */
+ public void enableButton() {
+ this.btn_ok.setEnabled(true);
+ }
+
+ /**
+ * @param refVal
+ * the reference value to set
+ */
+ public void setRefVal(String refVal) {
+ this.refVal = refVal.trim();
+
+ if (this.refVal != null) {
+ this.lblRefVal.setText(this.refVal);
+ } else {
+ this.lblRefVal.setText(""); //$NON-NLS-1$
+ }
+
+ }
+
+ /**
+ * @return the tan
+ */
+ public String getTan() {
+ return this.tan;
+ }
+
+ /**
+ * @param tan
+ * the tan to set
+ */
+ public void setTan(String tan) {
+ this.tan = tan;
+
+ if (this.tan == null) {
+ this.txt_tan.setText(""); //$NON-NLS-1$
+ } else {
+ this.txt_tan.setText(this.tan);
+ }
+ }
+
+ /**
+ * Selection Listener for open button
+ */
+ private final class ShowSignatureDataListener extends SelectionAdapter {
+ /**
+ * Empty constructor
+ */
+ public ShowSignatureDataListener() {
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ String signatureData = MobileBKUEnterTANComposite.this
+ .getSignatureData();
+ if (signatureData != null && !signatureData.equals("")) { //$NON-NLS-1$
+ log.debug("Trying to open " + signatureData); //$NON-NLS-1$
+ if (Desktop.isDesktopSupported()) {
+ Desktop.getDesktop().browse(new URI(signatureData));
+ } else {
+ log.info("SWT Desktop is not supported on this platform"); //$NON-NLS-1$
+ Program.launch(signatureData);
+ }
+ }
+ } catch (Exception ex) {
+ log.error("OpenSelectionListener: ", ex); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /**
+ * Create the composite.
+ *
+ * @param parent
+ * @param style
+ * @param state
+ */
+ public MobileBKUEnterTANComposite(Composite parent, int style, State state) {
+ super(parent, style, state);
+ setLayout(new FormLayout());
+
+ final Composite containerComposite = new Composite(this, SWT.NATIVE);
+ containerComposite.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle clientArea = containerComposite.getClientArea();
+
+ // e.gc.setForeground();
+ e.gc.setForeground(Constants.MAINBAR_ACTIVE_BACK_DARK);
+ e.gc.setLineWidth(3);
+ e.gc.setLineStyle(SWT.LINE_SOLID);
+ e.gc.drawRoundRectangle(clientArea.x, clientArea.y,
+ clientArea.width - 2, clientArea.height - 2, 10, 10);
+ }
+ });
+ containerComposite.setLayout(new FormLayout());
+ FormData fd_containerComposite = new FormData();
+ fd_containerComposite.top = new FormAttachment(50, -120);
+ fd_containerComposite.bottom = new FormAttachment(50, 120);
+ fd_containerComposite.left = new FormAttachment(50, -200);
+ fd_containerComposite.right = new FormAttachment(50, 200);
+ containerComposite.setLayoutData(fd_containerComposite);
+
+ this.lblRefValLabel = new Label(containerComposite, SWT.NATIVE);
+ this.lblRefValLabel.setAlignment(SWT.RIGHT);
+ FormData fd_lblRefValLabel = new FormData();
+ // fd_lblRefValLabel.left = new FormAttachment(0, 20);
+ fd_lblRefValLabel.right = new FormAttachment(50, -10);
+ // fd_lblRefValLabel.top = new FormAttachment(30, -15);
+ fd_lblRefValLabel.bottom = new FormAttachment(50, -10);
+ this.lblRefValLabel.setLayoutData(fd_lblRefValLabel);
+ this.lblRefValLabel.setText(Messages
+ .getString("tanEnter.ReferenceValue")); //$NON-NLS-1$
+
+ Label lbl_image = new Label(containerComposite, SWT.NATIVE);
+
+ ImageData data = new ImageData(this.getClass().getResourceAsStream(
+ Constants.RES_IMG_MOBILE));
+ Image mobile = new Image(getDisplay(), data);
+
+ FormData fd_lbl_image = new FormData();
+ fd_lbl_image.top = new FormAttachment(50, -1 * (data.width / 2));
+ fd_lbl_image.bottom = new FormAttachment(50, data.width / 2);
+ fd_lbl_image.left = new FormAttachment(0, 10);
+ fd_lbl_image.width = data.width;
+ lbl_image.setLayoutData(fd_lbl_image);
+ lbl_image.setImage(mobile);
+
+ this.lblRefVal = new Label(containerComposite, SWT.NATIVE);
+ FormData fd_lblRefVal = new FormData();
+ fd_lblRefVal.left = new FormAttachment(50, 10);
+ fd_lblRefVal.right = new FormAttachment(100, -20);
+ // fd_lblRefVal.top = new FormAttachment(30, -15);
+ fd_lblRefVal.bottom = new FormAttachment(50, -10);
+ this.lblRefVal.setLayoutData(fd_lblRefVal);
+ this.lblRefVal.setText(""); //$NON-NLS-1$
+
+ this.lblTan = new Label(containerComposite, SWT.NATIVE);
+ this.lblTan.setAlignment(SWT.RIGHT);
+ FormData fd_lblTan = new FormData();
+ // fd_lblTan.left = new FormAttachment(0, 20);
+ fd_lblTan.right = new FormAttachment(50, -10);
+ fd_lblTan.top = new FormAttachment(50, 10);
+ // fd_lblTan.bottom = new FormAttachment(50, 15);
+ this.lblTan.setLayoutData(fd_lblTan);
+ this.lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$
+
+ this.txt_tan = new Text(containerComposite, SWT.BORDER | SWT.NATIVE);
+ FormData fd_text = new FormData();
+ fd_text.left = new FormAttachment(50, 10);
+ fd_text.right = new FormAttachment(100, -20);
+ fd_text.top = new FormAttachment(50, 10);
+ this.txt_tan.setEditable(true);
+ this.txt_tan.setLayoutData(fd_text);
+
+ this.txt_tan.addTraverseListener(new TraverseListener() {
+
+ @Override
+ public void keyTraversed(TraverseEvent e) {
+ if (e.detail == SWT.TRAVERSE_RETURN) {
+ if(MobileBKUEnterTANComposite.this.btn_ok.isEnabled()) {
+ (new OkSelectionListener()).widgetSelected(null);
+ }
+ }
+ }
+ });
+
+ this.txt_tan.addModifyListener(new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+
+ String text = MobileBKUEnterTANComposite.this.txt_tan.getText();
+ //log.debug("Current TAN: " + text); //$NON-NLS-1$
+ if (text.length() > 3
+ && MobileBKUEnterTANComposite.this.getRefVal()
+ .startsWith(text.trim())) {
+ MobileBKUEnterTANComposite.this.setMessage(Messages
+ .getString("error.EnteredReferenceValue")); //$NON-NLS-1$
+ }
+ }
+ });
+
+ Link lnk_sig_data = new Link(containerComposite, SWT.NATIVE | SWT.RESIZE);
+
+ FormData fd_lnk_data = new FormData();
+ fd_lnk_data.right = new FormAttachment(100, -20);
+ fd_lnk_data.top = new FormAttachment(0, 20);
+ lnk_sig_data.setEnabled(true);
+ lnk_sig_data.setLayoutData(fd_lnk_data);
+ lnk_sig_data.addSelectionListener(new ShowSignatureDataListener());
+ lnk_sig_data.setText(Messages.getString("mobileBKU.show")); //$NON-NLS-1$
+ lnk_sig_data.setToolTipText(Messages.getString("mobileBKU.show_tooltip")); //$NON-NLS-1$
+
+ this.btn_ok = new Button(containerComposite, SWT.NATIVE);
+ this.btn_cancel = new Button(containerComposite, SWT.NATIVE);
+
+ this.lblTries = new Label(containerComposite, SWT.WRAP | SWT.NATIVE);
+ FormData fd_lbl_tries = new FormData();
+ // fd_lbl_tries.left = new FormAttachment(15, 5);
+ fd_lbl_tries.right = new FormAttachment(this.btn_cancel, -10);
+ // fd_lbl_tries.top = new FormAttachment(70, -15);
+ fd_lbl_tries.bottom = new FormAttachment(100, -20);
+ this.lblTries.setLayoutData(fd_lbl_tries);
+
+ FormData fd_btn_ok = new FormData();
+ // fd_btn_ok.left = new FormAttachment(95, 0);
+ fd_btn_ok.right = new FormAttachment(100, -20);
+ //fd_btn_ok.left = new FormAttachment(100, -70);
+ fd_btn_ok.bottom = new FormAttachment(100, -20);
+
+ this.btn_ok.setLayoutData(fd_btn_ok);
+ this.btn_ok.setText(Messages.getString("common.Ok")); //$NON-NLS-1$
+ this.btn_ok.addSelectionListener(new OkSelectionListener());
+
+ FormData fd_btn_cancel = new FormData();
+ // fd_btn_cancel.left = new FormAttachment(95, 0);
+ fd_btn_cancel.right = new FormAttachment(this.btn_ok, -20);
+ //fd_btn_cancel.left = new FormAttachment(100, -70);
+ fd_btn_cancel.bottom = new FormAttachment(100, -20);
+
+ this.btn_cancel.setLayoutData(fd_btn_cancel);
+ this.btn_cancel.setText(Messages.getString("common.Cancel")); //$NON-NLS-1$
+ this.btn_cancel.addSelectionListener(new CancelSelectionListener());
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see at.asit.pdfover.gui.composites.StateComposite#doLayout()
+ */
+ @Override
+ public void doLayout() {
+ // Nothing to do
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see at.asit.pdfover.gui.composites.StateComposite#reloadResources()
+ */
+ @Override
+ public void reloadResources() {
+ this.lblRefValLabel.setText(Messages
+ .getString("tanEnter.ReferenceValue")); //$NON-NLS-1$
+ this.lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$
+ }
+}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java index 3544c7f8..eb4771ba 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java @@ -90,8 +90,6 @@ public class MobileBKUFingerprintComposite extends StateComposite { static final Logger log = LoggerFactory
.getLogger(MobileBKUFingerprintComposite.class);
-// private Label lblFP;
-
boolean userCancel = false;
boolean userSMS = false;
boolean done = false;
@@ -304,16 +302,10 @@ public class MobileBKUFingerprintComposite extends StateComposite { this.lblFPLabel = new Label(containerComposite, SWT.NATIVE);
this.lblFPLabel.setAlignment(SWT.LEFT);
FormData fd_lblFPLabel = new FormData();
- fd_lblFPLabel.left = new FormAttachment(0, 0);
+ fd_lblFPLabel.left = new FormAttachment(25, 10);
fd_lblFPLabel.top = new FormAttachment(this.lblRefValLabel, 10);
this.lblFPLabel.setLayoutData(fd_lblFPLabel);
-// this.lblFP = new Label(containerComposite, SWT.NATIVE);
-// FormData fd_lblFP = new FormData();
-// fd_lblFP.left = new FormAttachment(50, 10);
-// fd_lblFP.right = new FormAttachment(100, -20);
-// fd_lblFP.top = new FormAttachment(this.lblRefVal, 10);
-// this.lblFP.setLayoutData(fd_lblFP);
this.lnk_sig_data = new Link(containerComposite, SWT.NATIVE | SWT.RESIZE);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java index 2b9bbe06..cbb0af41 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java @@ -1,485 +1,581 @@ -/* - * Copyright 2012 by A-SIT, Secure Information Technology Center Austria - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://joinup.ec.europa.eu/software/page/eupl - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - */ -package at.asit.pdfover.gui.workflow.states; - -import java.io.InputStream; -import java.util.Timer; -import java.util.TimerTask; - -// Imports -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import at.asit.pdfover.gui.MainWindow.Buttons; -import at.asit.pdfover.gui.MainWindowBehavior; -import at.asit.pdfover.gui.bku.MobileBKUConnector; -import at.asit.pdfover.gui.bku.mobile.ATrustHandler; -import at.asit.pdfover.gui.bku.mobile.ATrustStatus; -import at.asit.pdfover.gui.bku.mobile.IAIKHandler; -import at.asit.pdfover.gui.bku.mobile.IAIKStatus; -import at.asit.pdfover.gui.bku.mobile.MobileBKUHandler; -import at.asit.pdfover.gui.bku.mobile.MobileBKUStatus; -import at.asit.pdfover.gui.composites.MobileBKUEnterNumberComposite; -import at.asit.pdfover.gui.composites.MobileBKUEnterTANComposite; -import at.asit.pdfover.gui.composites.MobileBKUQRComposite; -import at.asit.pdfover.gui.composites.WaitingComposite; -import at.asit.pdfover.gui.controls.Dialog.BUTTONS; -import at.asit.pdfover.gui.controls.ErrorDialog; -import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.StateMachine; -import at.asit.pdfover.gui.workflow.config.ConfigProvider; -import at.asit.pdfover.signator.SigningState; - -/** - * Logical state for performing the BKU Request to the A-Trust Mobile BKU - */ -public class MobileBKUState extends State { - /** - * @param stateMachine - */ - public MobileBKUState(StateMachine stateMachine) { - super(stateMachine); - ConfigProvider provider = stateMachine.getConfigProvider(); - switch(provider.getMobileBKUType()) { - case A_TRUST: - this.status = new ATrustStatus(provider); - this.handler = new ATrustHandler(this, - stateMachine.getGUIProvider().getMainShell(), - provider.getMobileBKUBase64()); - break; - - case IAIK: - this.status = new IAIKStatus(provider); - this.handler = new IAIKHandler(this, - stateMachine.getGUIProvider().getMainShell()); - break; - } - - } - - /** - * SLF4J Logger instance - **/ - static final Logger log = LoggerFactory - .getLogger(MobileBKUState.class); - - SigningState signingState; - - Exception threadException = null; - - MobileBKUStatus status = null; - - MobileBKUHandler handler = null; - - MobileBKUEnterNumberComposite mobileBKUEnterNumberComposite = null; - - MobileBKUEnterTANComposite mobileBKUEnterTANComposite = null; - - MobileBKUQRComposite mobileBKUQRComposite = null; - - WaitingComposite waitingComposite = null; - - WaitingComposite getWaitingComposite() { - if (this.waitingComposite == null) { - this.waitingComposite = getStateMachine().getGUIProvider() - .createComposite(WaitingComposite.class, SWT.RESIZE, this); - } - - return this.waitingComposite; - } - - MobileBKUEnterTANComposite getMobileBKUEnterTANComposite() { - if (this.mobileBKUEnterTANComposite == null) { - this.mobileBKUEnterTANComposite = getStateMachine() - .getGUIProvider().createComposite( - MobileBKUEnterTANComposite.class, SWT.RESIZE, this); - } - - return this.mobileBKUEnterTANComposite; - } - - MobileBKUQRComposite getMobileBKUQRComposite() { - if (this.mobileBKUQRComposite == null) { - this.mobileBKUQRComposite = getStateMachine() - .getGUIProvider().createComposite( - MobileBKUQRComposite.class, SWT.RESIZE, this); - } - - return this.mobileBKUQRComposite; - } - - MobileBKUEnterNumberComposite getMobileBKUEnterNumberComposite() { - if (this.mobileBKUEnterNumberComposite == null) { - this.mobileBKUEnterNumberComposite = getStateMachine() - .getGUIProvider().createComposite( - MobileBKUEnterNumberComposite.class, SWT.RESIZE, - this); - } - - return this.mobileBKUEnterNumberComposite; - } - - /** - * Get the MobileBKUStatus - * @return the MobileBKUStatus - */ - public MobileBKUStatus getStatus() { - return this.status; - } - - /** - * Get the MobileBKUHandler - * @return the MobileBKUHandler - */ - public MobileBKUHandler getHandler() { - return this.handler; - } - - /** - * Get the mobile BKU URL - * @return the mobile BKU URL - */ - public String getURL() { - return getStateMachine().getConfigProvider().getMobileBKUURL(); - } - - /** - * @return the signingState - */ - public SigningState getSigningState() { - return this.signingState; - } - - /** - * @param threadException - * the threadException to set - */ - public void setThreadException(Exception threadException) { - this.threadException = threadException; - } - - /** - * Display an error message - * - * @param e - * the exception - */ - public void displayError(Exception e) { - String message = Messages.getString("error.Unexpected"); //$NON-NLS-1$ - log.error(message, e); - String errormsg = e.getLocalizedMessage(); - if (errormsg != null && !errormsg.isEmpty()) - message += ": " + errormsg; //$NON-NLS-1$ - displayError(message); - } - - /** - * Display an error message - * - * @param message - * the error message - */ - public void displayError(final String message) { - log.error(message); - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - ErrorDialog error = new ErrorDialog(getStateMachine().getGUIProvider() - .getMainShell(), message, BUTTONS.OK); - error.open(); - } - }); - } - - /** - * Make sure phone number and password are set in the MobileBKUStatus - */ - public void checkCredentials() { - final MobileBKUStatus mobileStatus = this.getStatus(); - // check if we have everything we need! - if (mobileStatus.getPhoneNumber() != null && !mobileStatus.getPhoneNumber().isEmpty() && - mobileStatus.getMobilePassword() != null && !mobileStatus.getMobilePassword().isEmpty()) - return; - - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - MobileBKUEnterNumberComposite ui = MobileBKUState.this - .getMobileBKUEnterNumberComposite(); - - if (!ui.isUserAck()) { - // We need number and password => show UI! - if (mobileStatus.getErrorMessage() != null - && !mobileStatus.getErrorMessage().isEmpty()) { - // set possible error message - ui.setErrorMessage(mobileStatus.getErrorMessage()); - mobileStatus.setErrorMessage(null); - } else if (mobileStatus instanceof ATrustStatus) { - ui.setErrorMessage(Messages.getString("mobileBKU.aTrustDisclaimer")); //$NON-NLS-1$ - } - - if (ui.getMobileNumber() == null - || ui.getMobileNumber().isEmpty()) { - // set possible phone number - ui.setMobileNumber(mobileStatus.getPhoneNumber()); - } - - if (ui.getMobilePassword() == null - || ui.getMobilePassword().isEmpty()) { - // set possible password - ui.setMobilePassword(mobileStatus.getMobilePassword()); - } - ui.enableButton(); - getStateMachine().getGUIProvider().display(ui); - - Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); - while (!ui.isUserAck() && !ui.isUserCancel()) { - if (!display.readAndDispatch()) { - display.sleep(); - } - } - } - - if (ui.isUserCancel()) { - ui.setUserCancel(false); - mobileStatus.setErrorMessage("cancel"); //$NON-NLS-1$ - return; - } - - // user hit ok - ui.setUserAck(false); - - // get number and password from UI - mobileStatus.setPhoneNumber(ui.getMobileNumber()); - mobileStatus.setMobilePassword(ui.getMobilePassword()); - - // show waiting composite - getStateMachine().getGUIProvider().display( - MobileBKUState.this.getWaitingComposite()); - } - }); - } - - /** - * Make sure TAN is set in the MobileBKUStatus - */ - public void checkTAN() { - final MobileBKUStatus mobileStatus = this.getStatus(); - - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - MobileBKUEnterTANComposite tan = MobileBKUState.this - .getMobileBKUEnterTANComposite(); - - if (!tan.isUserAck()) { - // we need the TAN - tan.setRefVal(mobileStatus.getRefVal()); - tan.setSignatureData(mobileStatus.getSignatureDataURL()); - tan.setErrorMessage(mobileStatus.getErrorMessage()); - if (mobileStatus.getTanTries() < mobileStatus.getMaxTanTries() - && mobileStatus.getTanTries() > 0) { - // show warning message x tries left! - // overrides error message - - tan.setTries(mobileStatus.getTanTries()); - } - tan.enableButton(); - getStateMachine().getGUIProvider().display(tan); - - Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); - while (!tan.isUserAck() && !tan.isUserCancel()) { - if (!display.readAndDispatch()) { - display.sleep(); - } - } - } - - if (tan.isUserCancel()) { - tan.setUserCancel(false); - mobileStatus.setErrorMessage("cancel"); //$NON-NLS-1$ - return; - } - - // user hit ok! - tan.setUserAck(false); - - mobileStatus.setTan(tan.getTan()); - - // show waiting composite - getStateMachine().getGUIProvider().display( - MobileBKUState.this.getWaitingComposite()); - } - }); - } - - /** - * Show QR code - */ - public void showQR() { - final ATrustStatus status = (ATrustStatus) this.getStatus(); - final ATrustHandler handler = (ATrustHandler) this.getHandler(); - - final Timer checkDone = new Timer(true); - checkDone.scheduleAtFixedRate(new TimerTask() { - - @Override - public void run() { - // ping signature page to see if code has been scanned - try { - String resp = handler.getSignaturePage(); - if (handler.handleQRResponse(resp)) { - log.debug("Signature page response: " + resp); //$NON-NLS-1$ - getMobileBKUQRComposite().setDone(true); - Display display = getStateMachine().getGUIProvider(). - getMainShell().getDisplay(); - display.wake(); - } - Display.getDefault().wake(); - } catch (Exception e) { - log.error("Error getting signature page", e); //$NON-NLS-1$ - } - } - }, 0, 5000); - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - MobileBKUQRComposite qr = getMobileBKUQRComposite(); - - qr.setRefVal(status.getRefVal()); - qr.setSignatureData(status.getSignatureDataURL()); - qr.setErrorMessage(status.getErrorMessage()); - InputStream qrcode = handler.getQRCode(); - if (qrcode == null) { - MobileBKUState.this.threadException = new Exception( - Messages.getString("error.FailedToLoadQRCode")); //$NON-NLS-1$ - } - qr.setQR(qrcode); - getStateMachine().getGUIProvider().display(qr); - - Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay(); - while (!qr.isUserCancel() && !qr.isUserSMS() && !qr.isDone()) { - if (!display.readAndDispatch()) { - display.sleep(); - } - } - checkDone.cancel(); - - if (qr.isUserCancel()) { - qr.setUserCancel(false); - status.setErrorMessage("cancel"); //$NON-NLS-1$ - return; - } - - if (qr.isUserSMS()) { - qr.setUserSMS(false); - status.setQRCode(null); - } - - if (qr.isDone()) - qr.setDone(false); - - // show waiting composite - getStateMachine().getGUIProvider().display( - MobileBKUState.this.getWaitingComposite()); - } - }); - } - - /* - * (non-Javadoc) - * - * @see - * at.asit.pdfover.gui.workflow.WorkflowState#update(at.asit.pdfover.gui - * .workflow.Workflow) - */ - @Override - public void run() { - this.signingState = getStateMachine().getStatus().getSigningState(); - - this.signingState.setBKUConnector(new MobileBKUConnector(this)); - log.debug("Setting base64 request to " + this.handler.useBase64Request()); //$NON-NLS-1$ - this.signingState.setUseBase64Request(this.handler.useBase64Request()); - - if (this.threadException != null) { - String message = Messages.getString("error.Unexpected"); //$NON-NLS-1$ - log.error(message, this.threadException); - String errormsg = this.threadException.getLocalizedMessage(); - if (errormsg != null && !errormsg.isEmpty()) - message += ": " + errormsg; //$NON-NLS-1$ - ErrorDialog error = new ErrorDialog( - getStateMachine().getGUIProvider().getMainShell(), - message, BUTTONS.OK); - // error.setException(this.threadException); - // this.setNextState(error); - error.open(); - getStateMachine().exit(); - return; - } - - getStateMachine().getGUIProvider().display( - this.getWaitingComposite()); - - this.setNextState(new at.asit.pdfover.gui.workflow.states.SigningState(getStateMachine())); - } - - /* - * (non-Javadoc) - * - * @see at.asit.pdfover.gui.workflow.states.State#cleanUp() - */ - @Override - public void cleanUp() { - if (this.mobileBKUEnterNumberComposite != null) - this.mobileBKUEnterNumberComposite.dispose(); - if (this.mobileBKUEnterTANComposite != null) - this.mobileBKUEnterTANComposite.dispose(); - if (this.waitingComposite != null) - this.waitingComposite.dispose(); - } - - /* - * (non-Javadoc) - * - * @see at.asit.pdfover.gui.workflow.states.State#setMainWindowBehavior() - */ - @Override - public void updateMainWindowBehavior() { - MainWindowBehavior behavior = getStateMachine().getStatus() - .getBehavior(); - behavior.reset(); - behavior.setActive(Buttons.OPEN, true); - behavior.setActive(Buttons.POSITION, true); - behavior.setActive(Buttons.SIGN, true); - behavior.setEnabled(Buttons.OPEN, true); - behavior.setEnabled(Buttons.POSITION, true); - //behavior.setEnabled(Buttons.SIGN, true); - } - - @Override - public String toString() { - return this.getClass().getName(); - } - - /** - * invoke state machine update in main thread - */ - public void invokeUpdate() { - getStateMachine().invokeUpdate(); - } -} +/*
+ * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://joinup.ec.europa.eu/software/page/eupl
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ */
+package at.asit.pdfover.gui.workflow.states;
+
+import java.io.InputStream;
+import java.util.Timer;
+import java.util.TimerTask;
+
+// Imports
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import at.asit.pdfover.gui.MainWindow.Buttons;
+import at.asit.pdfover.gui.MainWindowBehavior;
+import at.asit.pdfover.gui.bku.MobileBKUConnector;
+import at.asit.pdfover.gui.bku.mobile.ATrustHandler;
+import at.asit.pdfover.gui.bku.mobile.ATrustStatus;
+import at.asit.pdfover.gui.bku.mobile.IAIKHandler;
+import at.asit.pdfover.gui.bku.mobile.IAIKStatus;
+import at.asit.pdfover.gui.bku.mobile.MobileBKUHandler;
+import at.asit.pdfover.gui.bku.mobile.MobileBKUStatus;
+import at.asit.pdfover.gui.composites.MobileBKUEnterNumberComposite;
+import at.asit.pdfover.gui.composites.MobileBKUEnterTANComposite;
+import at.asit.pdfover.gui.composites.MobileBKUFingerprintComposite;
+import at.asit.pdfover.gui.composites.MobileBKUQRComposite;
+import at.asit.pdfover.gui.composites.WaitingComposite;
+import at.asit.pdfover.gui.controls.Dialog.BUTTONS;
+import at.asit.pdfover.gui.controls.ErrorDialog;
+import at.asit.pdfover.gui.utils.Messages;
+import at.asit.pdfover.gui.workflow.StateMachine;
+import at.asit.pdfover.gui.workflow.config.ConfigProvider;
+import at.asit.pdfover.signator.SigningState;
+
+/**
+ * Logical state for performing the BKU Request to the A-Trust Mobile BKU
+ */
+public class MobileBKUState extends State {
+ /**
+ * @param stateMachine
+ */
+ public MobileBKUState(StateMachine stateMachine) {
+ super(stateMachine);
+ ConfigProvider provider = stateMachine.getConfigProvider();
+ switch(provider.getMobileBKUType()) {
+ case A_TRUST:
+ this.status = new ATrustStatus(provider);
+ this.handler = new ATrustHandler(this,
+ stateMachine.getGUIProvider().getMainShell(),
+ provider.getMobileBKUBase64());
+ break;
+
+ case IAIK:
+ this.status = new IAIKStatus(provider);
+ this.handler = new IAIKHandler(this,
+ stateMachine.getGUIProvider().getMainShell());
+ break;
+ }
+
+ }
+
+ /**
+ * SLF4J Logger instance
+ **/
+ static final Logger log = LoggerFactory
+ .getLogger(MobileBKUState.class);
+
+ SigningState signingState;
+
+ Exception threadException = null;
+
+ MobileBKUStatus status = null;
+
+ MobileBKUHandler handler = null;
+
+ MobileBKUEnterNumberComposite mobileBKUEnterNumberComposite = null;
+
+ MobileBKUEnterTANComposite mobileBKUEnterTANComposite = null;
+
+ MobileBKUQRComposite mobileBKUQRComposite = null;
+
+ MobileBKUFingerprintComposite mobileBKUFingerprintComposite = null;
+
+ WaitingComposite waitingComposite = null;
+
+ WaitingComposite getWaitingComposite() {
+ if (this.waitingComposite == null) {
+ this.waitingComposite = getStateMachine().getGUIProvider()
+ .createComposite(WaitingComposite.class, SWT.RESIZE, this);
+ }
+
+ return this.waitingComposite;
+ }
+
+ MobileBKUEnterTANComposite getMobileBKUEnterTANComposite() {
+ if (this.mobileBKUEnterTANComposite == null) {
+ this.mobileBKUEnterTANComposite = getStateMachine()
+ .getGUIProvider().createComposite(
+ MobileBKUEnterTANComposite.class, SWT.RESIZE, this);
+ }
+
+ return this.mobileBKUEnterTANComposite;
+ }
+
+ MobileBKUQRComposite getMobileBKUQRComposite() {
+ if (this.mobileBKUQRComposite == null) {
+ this.mobileBKUQRComposite = getStateMachine()
+ .getGUIProvider().createComposite(
+ MobileBKUQRComposite.class, SWT.RESIZE, this);
+ }
+
+ return this.mobileBKUQRComposite;
+ }
+
+ MobileBKUEnterNumberComposite getMobileBKUEnterNumberComposite() {
+ if (this.mobileBKUEnterNumberComposite == null) {
+ this.mobileBKUEnterNumberComposite = getStateMachine()
+ .getGUIProvider().createComposite(
+ MobileBKUEnterNumberComposite.class, SWT.RESIZE,
+ this);
+ }
+
+ return this.mobileBKUEnterNumberComposite;
+ }
+
+
+
+
+ MobileBKUFingerprintComposite getMobileBKUFingerprintComposite() {
+ if (this.mobileBKUFingerprintComposite == null) {
+ this.mobileBKUFingerprintComposite = getStateMachine()
+ .getGUIProvider().createComposite(
+ MobileBKUFingerprintComposite.class, SWT.RESIZE,
+ this);
+ }
+
+ return this.mobileBKUFingerprintComposite;
+ }
+
+
+ /**
+ * Get the MobileBKUStatus
+ * @return the MobileBKUStatus
+ */
+ public MobileBKUStatus getStatus() {
+ return this.status;
+ }
+
+ /**
+ * Get the MobileBKUHandler
+ * @return the MobileBKUHandler
+ */
+ public MobileBKUHandler getHandler() {
+ return this.handler;
+ }
+
+ /**
+ * Get the mobile BKU URL
+ * @return the mobile BKU URL
+ */
+ public String getURL() {
+ return getStateMachine().getConfigProvider().getMobileBKUURL();
+ }
+
+ /**
+ * @return the signingState
+ */
+ public SigningState getSigningState() {
+ return this.signingState;
+ }
+
+ /**
+ * @param threadException
+ * the threadException to set
+ */
+ public void setThreadException(Exception threadException) {
+ this.threadException = threadException;
+ }
+
+ /**
+ * Display an error message
+ *
+ * @param e
+ * the exception
+ */
+ public void displayError(Exception e) {
+ String message = Messages.getString("error.Unexpected"); //$NON-NLS-1$
+ log.error(message, e);
+ String errormsg = e.getLocalizedMessage();
+ if (errormsg != null && !errormsg.isEmpty())
+ message += ": " + errormsg; //$NON-NLS-1$
+ displayError(message);
+ }
+
+ /**
+ * Display an error message
+ *
+ * @param message
+ * the error message
+ */
+ public void displayError(final String message) {
+ log.error(message);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ErrorDialog error = new ErrorDialog(getStateMachine().getGUIProvider()
+ .getMainShell(), message, BUTTONS.OK);
+ error.open();
+ }
+ });
+ }
+
+ /**
+ * Make sure phone number and password are set in the MobileBKUStatus
+ */
+ public void checkCredentials() {
+ final MobileBKUStatus mobileStatus = this.getStatus();
+ // check if we have everything we need!
+ if (mobileStatus.getPhoneNumber() != null && !mobileStatus.getPhoneNumber().isEmpty() &&
+ mobileStatus.getMobilePassword() != null && !mobileStatus.getMobilePassword().isEmpty())
+ return;
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ MobileBKUEnterNumberComposite ui = MobileBKUState.this
+ .getMobileBKUEnterNumberComposite();
+
+ if (!ui.isUserAck()) {
+ // We need number and password => show UI!
+ if (mobileStatus.getErrorMessage() != null
+ && !mobileStatus.getErrorMessage().isEmpty()) {
+ // set possible error message
+ ui.setErrorMessage(mobileStatus.getErrorMessage());
+ mobileStatus.setErrorMessage(null);
+ } else if (mobileStatus instanceof ATrustStatus) {
+ ui.setErrorMessage(Messages.getString("mobileBKU.aTrustDisclaimer")); //$NON-NLS-1$
+ }
+
+ if (ui.getMobileNumber() == null
+ || ui.getMobileNumber().isEmpty()) {
+ // set possible phone number
+ ui.setMobileNumber(mobileStatus.getPhoneNumber());
+ }
+
+ if (ui.getMobilePassword() == null
+ || ui.getMobilePassword().isEmpty()) {
+ // set possible password
+ ui.setMobilePassword(mobileStatus.getMobilePassword());
+ }
+ ui.enableButton();
+ getStateMachine().getGUIProvider().display(ui);
+
+ Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay();
+ while (!ui.isUserAck() && !ui.isUserCancel()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
+
+ if (ui.isUserCancel()) {
+ ui.setUserCancel(false);
+ mobileStatus.setErrorMessage("cancel"); //$NON-NLS-1$
+ return;
+ }
+
+ // user hit ok
+ ui.setUserAck(false);
+
+ // get number and password from UI
+ mobileStatus.setPhoneNumber(ui.getMobileNumber());
+ mobileStatus.setMobilePassword(ui.getMobilePassword());
+
+ // show waiting composite
+ getStateMachine().getGUIProvider().display(
+ MobileBKUState.this.getWaitingComposite());
+ }
+ });
+ }
+
+ /**
+ * Make sure TAN is set in the MobileBKUStatus
+ */
+ public void checkTAN() {
+ final MobileBKUStatus mobileStatus = this.getStatus();
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ MobileBKUEnterTANComposite tan = MobileBKUState.this
+ .getMobileBKUEnterTANComposite();
+
+ if (!tan.isUserAck()) {
+ // we need the TAN
+ tan.setRefVal(mobileStatus.getRefVal());
+ tan.setSignatureData(mobileStatus.getSignatureDataURL());
+ tan.setErrorMessage(mobileStatus.getErrorMessage());
+ if (mobileStatus.getTanTries() < mobileStatus.getMaxTanTries()
+ && mobileStatus.getTanTries() > 0) {
+ // show warning message x tries left!
+ // overrides error message
+
+ tan.setTries(mobileStatus.getTanTries());
+ }
+ tan.enableButton();
+ getStateMachine().getGUIProvider().display(tan);
+
+ Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay();
+ while (!tan.isUserAck() && !tan.isUserCancel()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ }
+
+ if (tan.isUserCancel()) {
+ tan.setUserCancel(false);
+ mobileStatus.setErrorMessage("cancel"); //$NON-NLS-1$
+ return;
+ }
+
+ // user hit ok!
+ tan.setUserAck(false);
+
+ mobileStatus.setTan(tan.getTan());
+
+ // show waiting composite
+ getStateMachine().getGUIProvider().display(
+ MobileBKUState.this.getWaitingComposite());
+ }
+ });
+ }
+
+ /**
+ * Show QR code
+ */
+ public void showQR() {
+ final ATrustStatus status = (ATrustStatus) this.getStatus();
+ final ATrustHandler handler = (ATrustHandler) this.getHandler();
+
+ final Timer checkDone = new Timer(true);
+ checkDone.scheduleAtFixedRate(new TimerTask() {
+
+ @Override
+ public void run() {
+ // ping signature page to see if code has been scanned
+ try {
+ String resp = handler.getSignaturePage();
+ if (handler.handleQRResponse(resp)) {
+ log.debug("Signature page response: " + resp); //$NON-NLS-1$
+ getMobileBKUQRComposite().setDone(true);
+ Display display = getStateMachine().getGUIProvider().
+ getMainShell().getDisplay();
+ display.wake();
+ }
+ Display.getDefault().wake();
+ } catch (Exception e) {
+ log.error("Error getting signature page", e); //$NON-NLS-1$
+ }
+ }
+ }, 0, 5000);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ MobileBKUQRComposite qr = getMobileBKUQRComposite();
+
+ qr.setRefVal(status.getRefVal());
+ qr.setSignatureData(status.getSignatureDataURL());
+ qr.setErrorMessage(status.getErrorMessage());
+ InputStream qrcode = handler.getQRCode();
+ if (qrcode == null) {
+ MobileBKUState.this.threadException = new Exception(
+ Messages.getString("error.FailedToLoadQRCode")); //$NON-NLS-1$
+ }
+ qr.setQR(qrcode);
+ getStateMachine().getGUIProvider().display(qr);
+
+ Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay();
+ while (!qr.isUserCancel() && !qr.isUserSMS() && !qr.isDone()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ checkDone.cancel();
+
+ if (qr.isUserCancel()) {
+ qr.setUserCancel(false);
+ status.setErrorMessage("cancel"); //$NON-NLS-1$
+ return;
+ }
+
+ if (qr.isUserSMS()) {
+ qr.setUserSMS(false);
+ status.setQRCode(null);
+ }
+
+ if (qr.isDone())
+ qr.setDone(false);
+
+ // show waiting composite
+ getStateMachine().getGUIProvider().display(
+ MobileBKUState.this.getWaitingComposite());
+ }
+ });
+ }
+
+
+ /**
+ * when fingerprint or faceid is selected in the app
+ * this information is shown
+ */
+ public void showFingerPrintInformation() {
+ final ATrustStatus status = (ATrustStatus) this.getStatus();
+ final ATrustHandler handler = (ATrustHandler) this.getHandler();
+
+ final Timer checkDone = new Timer(true);
+ checkDone.scheduleAtFixedRate(new TimerTask() {
+
+ @Override
+ public void run() {
+ // ping signature page to see if code has been scanned
+ try {
+ String resp = handler.getSignaturePage();
+ if (handler.handleQRResponse(resp)) {
+ log.debug("Signature page response: " + resp); //$NON-NLS-1$
+ getMobileBKUFingerprintComposite().setDone(true);
+ Display display = getStateMachine().getGUIProvider().
+ getMainShell().getDisplay();
+ display.wake();
+ }
+ Display.getDefault().wake();
+ } catch (Exception e) {
+ log.error("Error getting signature page", e); //$NON-NLS-1$
+ }
+ }
+ }, 0, 5000);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ MobileBKUFingerprintComposite fingerprintComposite = getMobileBKUFingerprintComposite();
+
+ fingerprintComposite.setRefVal(status.getRefVal());
+ fingerprintComposite.setSignatureData(status.getSignatureDataURL());
+ fingerprintComposite.setErrorMessage(status.getErrorMessage());
+ getStateMachine().getGUIProvider().display(fingerprintComposite);
+
+ Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay();
+ while (!fingerprintComposite.isUserCancel() && !fingerprintComposite.isUserSMS() && !fingerprintComposite.isDone()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ checkDone.cancel();
+
+ if (fingerprintComposite.isUserCancel()) {
+ fingerprintComposite.setUserCancel(false);
+ status.setErrorMessage("cancel"); //$NON-NLS-1$
+ return;
+ }
+
+ if (fingerprintComposite.isUserSMS()) {
+// fingerprintComposite.setUserSMS(false);
+ status.setQRCode(null);
+ }
+
+ if (fingerprintComposite.isDone())
+ fingerprintComposite.setDone(false);
+
+ // show waiting composite
+ getStateMachine().getGUIProvider().display(
+ MobileBKUState.this.getWaitingComposite());
+ }
+ });
+ }
+
+ /**
+ * @return a boolean true if the user has pressed the sms tan button
+ */
+ public boolean getSMSStatus() {
+
+ return this.getMobileBKUFingerprintComposite().isUserSMS();
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * at.asit.pdfover.gui.workflow.WorkflowState#update(at.asit.pdfover.gui
+ * .workflow.Workflow)
+ */
+ @Override
+ public void run() {
+ this.signingState = getStateMachine().getStatus().getSigningState();
+
+ this.signingState.setBKUConnector(new MobileBKUConnector(this));
+ log.debug("Setting base64 request to " + this.handler.useBase64Request()); //$NON-NLS-1$
+ this.signingState.setUseBase64Request(this.handler.useBase64Request());
+
+ if (this.threadException != null) {
+ String message = Messages.getString("error.Unexpected"); //$NON-NLS-1$
+ log.error(message, this.threadException);
+ String errormsg = this.threadException.getLocalizedMessage();
+ if (errormsg != null && !errormsg.isEmpty())
+ message += ": " + errormsg; //$NON-NLS-1$
+ ErrorDialog error = new ErrorDialog(
+ getStateMachine().getGUIProvider().getMainShell(),
+ message, BUTTONS.OK);
+ // error.setException(this.threadException);
+ // this.setNextState(error);
+ error.open();
+ getStateMachine().exit();
+ return;
+ }
+
+ getStateMachine().getGUIProvider().display(
+ this.getWaitingComposite());
+
+ this.setNextState(new at.asit.pdfover.gui.workflow.states.SigningState(getStateMachine()));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see at.asit.pdfover.gui.workflow.states.State#cleanUp()
+ */
+ @Override
+ public void cleanUp() {
+ if (this.mobileBKUEnterNumberComposite != null)
+ this.mobileBKUEnterNumberComposite.dispose();
+ if (this.mobileBKUEnterTANComposite != null)
+ this.mobileBKUEnterTANComposite.dispose();
+ if (this.waitingComposite != null)
+ this.waitingComposite.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see at.asit.pdfover.gui.workflow.states.State#setMainWindowBehavior()
+ */
+ @Override
+ public void updateMainWindowBehavior() {
+ MainWindowBehavior behavior = getStateMachine().getStatus()
+ .getBehavior();
+ behavior.reset();
+ behavior.setActive(Buttons.OPEN, true);
+ behavior.setActive(Buttons.POSITION, true);
+ behavior.setActive(Buttons.SIGN, true);
+ behavior.setEnabled(Buttons.OPEN, true);
+ behavior.setEnabled(Buttons.POSITION, true);
+ //behavior.setEnabled(Buttons.SIGN, true);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName();
+ }
+
+ /**
+ * invoke state machine update in main thread
+ */
+ public void invokeUpdate() {
+ getStateMachine().invokeUpdate();
+ }
+}
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index 3f69b0ad..e2f821da 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -1,224 +1,225 @@ -#Eclipse messages class -#Fri Jun 26 16:29:30 CEST 2015 -BKU.KS=Keystore -BKU.LOCAL=Local CCE -BKU.MOBILE=Mobile CCE -BKU.NONE=no default -BKUSelectionComposite.btnMobile.text=MOBILE -TrustedSocketFactory.FailedToCreateSecureConnection=Failed to create secure network connection -advanced_config.AutoPosition=Automatic positioning -advanced_config.AutoPosition_ToolTip=Activate this option to automatically position the signature -advanced_config.BKUSelection_Title=CC&E Selection -advanced_config.BKUSelection_ToolTip=Select the default CCE to use during signature -advanced_config.KeystoreEnabled=Enable keystore signing -advanced_config.KeystoreEnabled_ToolTip=Enables the possibility to sign with a local keystore -advanced_config.LocaleSelection_Title=Interface &language selection -advanced_config.LocaleSelection_ToolTip=Select the interface language for PDF-Over -advanced_config.OutputFolder=Default output folder\: -advanced_config.OutputFolder.Dialog=Select a folder -advanced_config.OutputFolder.Dialog_Title=Select Output folder -advanced_config.OutputFolder_Title=&Output location -advanced_config.OutputFolder_ToolTip=Select the folder where the signed document will be saved automatically (clear this field to disable automatic saving, enter a single dot (".") to denote the input document directory) -advanced_config.PdfACompat=PDF/A compatibility -advanced_config.PdfACompat_ToolTip=Whether to make signature PDF/A compatible (increases pdf size) -advanced_config.ProxyHost=Host\: -advanced_config.ProxyHost_Template=Hostname or IP of the proxy server -advanced_config.ProxyHost_ToolTip=To use a proxy server enter the hostname or the IP here -advanced_config.ProxyPass=Password\: -advanced_config.ProxyPass_Template=Password for proxy authentication -advanced_config.ProxyPass_ToolTip=To use proxy authentication enter password here -advanced_config.ProxyPort=Port\: -advanced_config.ProxyPort_Template=Port of the proxy server [1-65535] -advanced_config.ProxyPort_ToolTip=To use a proxy server enter the port number here -advanced_config.ProxyUser=Username\: -advanced_config.ProxyUser_Template=Username for proxy authentication -advanced_config.ProxyUser_ToolTip=To use proxy authentication enter username here -advanced_config.Proxy_Title=&Proxy -advanced_config.SigPHTransparency=Signature placeholder transparency -advanced_config.SigPHTransparencyMax=Opaque -advanced_config.SigPHTransparencyMin=Invisible -advanced_config.SigPHTransparencyTooltip=Set the transparency of the signature placeholder in the positioning step -advanced_config.Signature_Title=Si&gnature -advanced_config.UpdateCheck=Automatically check for updates -advanced_config.UpdateCheck_Title=Updates -advanced_config.UpdateCheck_ToolTip=Shows a notification when a new version is available -advanced_config.UseMarker=Search for signature markers -advanced_config.UseMarker_ToolTip=Activate this option to scan the document for signature markers. In case there is a marker available, you will be asked whether to automatically position your signature according to the marker. -argument.error.output=is not a directory -argument.help.autopos=Enables automatic signature positioning -argument.help.bku=Select the CCE to use. Possible values are\: LOCAL, MOBILE, KS. Example\: -b MOBILE -argument.help.config=Defines which configuration file to use. Example\: -c <config file> -argument.help.emblem=Sets the signature logo file to use for the signature. Example\: -e <emblem file> -argument.help.help=Shows this help message -argument.help.input=Sets the document to sign. Example\: -i <input document> -argument.help.keystorealias=Sets the keystore key alias. Example \: -ksalias <alias> -argument.help.keystorefile=Sets the keystore file. Example \: -ks <keystore file> -argument.help.keystorekeypass=Sets the keystore password. Example \: -kspass <password> -argument.help.keystorestorepass=Sets the keystore key password. Example \: -kskeypass <password> -argument.help.keystoretype=Sets the keystore type. Example \: -kstype [PKCS12|JKS|JCEKS] -argument.help.number=Sets the telephone number to use for mobile CCE. Example\: -n <number> -argument.help.output=Sets the output folder or file to use. Example\: -o <folder> -argument.help.password=Sets the password to use for mobile CCE. Example\: -p <password> -argument.help.proxyhost=Sets the proxy host to use. Example\: -proxy <hostname/IP> -argument.help.proxypass=Sets the proxy password to use. Example\: -proxypass <password> -argument.help.proxyport=Sets the proxy port to use. Example\: -proxyport <port> -argument.help.proxyuser=Sets the proxy username to use. Example\: -proxyuser <username> -argument.help.skipfinish=Enables skipping of the "Finish" dialog (if successfully saved) -argument.help.vis=Sets the visibility of a signature. Example\: -v "true" -argument.info.help=The following options are available\: -argument.invalid.bku=CCE argument invalid\! Usage\: -argument.invalid.config=Configuration file argument invalid\! Usage\: -argument.invalid.emblem=Signature logo argument invalid\! Usage\: -argument.invalid.input=Document to sign argument invalid\! Usage\: -argument.invalid.keystorealias=Keystore alias invalid\! Usage\: -argument.invalid.keystorefile=Keystore file invalid\! Usage\: -argument.invalid.keystorekeypass=Keystore key password invalid\! Usage\: -argument.invalid.keystorestorepass=Keystore password invalid\! Usage\: -argument.invalid.keystoretype=Keystore type invalid\! Usage\: -argument.invalid.number=Phone number argument invalid\! Usage\: -argument.invalid.output=Output folder argument invalid\! Usage\: -argument.invalid.password=Mobile CCE password invalid\! Usage\: -argument.invalid.proxyhost=Proxy host argument invalid\! Usage\: -argument.invalid.proxypass=Proxy password argument invalid\! Usage\: -argument.invalid.proxyport=Proxy port argument invalid\! Usage\: -argument.invalid.proxyuser=Proxy username argument invalid\! Usage\: -argument.invalid.vis=Profile Visbility argument invalid\! Usage\: -bku_selection.card=&Card -bku_selection.ks=&Keystore -bku_selection.mobile=&Mobile -common.AllExtension_Description=All files -common.Cancel=C&ancel -common.GIFExtension_Description=GIF files -common.ImageExtension_Description=All supported image files -common.JPGExtension_Description=JPG files -common.KeystoreExtension_Description=Keystore files -common.KSExtension_Description=Java keystore files -common.Ok=O&K -common.PDFExtension_Description=PDF documents -common.PKCS12Extension_Description=PKCS12 keystore files -common.PNGExtension_Description=PNG files -common.Save=&Save -common.browse=&Browse -common.info=Information -common.open=Open -common.warning=Warning -config.About=A&bout %s -config.AboutText=This software is freely provided by A-SIT under the conditions of the EUPL.\nTerms and details at <a>http://demo.a-sit.at/lizenzbedingungen/</a>.\n\nNotice that components can have different licenses, partly restricting their free use to EUPL-licensed software. -config.Advanced=Ad&vanced -config.Keystore=&Keystore -config.Simple=Basi&c -dataSourceSelection.DropLabel=Drag document here -dataSourceSelection.DropLabel2=or... -dataSourceSelection.browse=&Browse for PDF on your computer -dataSourceSelection.usePlaceholderTitle=Info -dataSourceSelection.usePlaceholderText=A marker has been found where the creator of the document wants you to put your signature. Do you want to use it? -error.CmdLineArgs=Error parsing the command-line arguments\: -error.Details=Details -error.EnteredReferenceValue=You entered the reference value\! -error.FailedToGetSignedDocument=Failed to get signed document. -error.FailedToLoadEmblem=Failed to load the signature logo -error.FailedToLoadQRCode=Failed to load the QR code -error.FailedToOpenDocument=Failed to open signed document\: %s. -error.FailedToSaveSettings=Failed to save configuration file\! -error.FileNotExist=File %s does not exist\! -error.IOError=Input/Output Error -error.Initialization=Initialization failed. Please check your configuration. -error.InvalidBKU=Invalid CCE selection. Please check. -error.InvalidLocale=Locale not valid -error.InvalidPhoneNumber=Given phone number is invalid\! Example\: +43664123456789 -error.InvalidSettings=Invalid settings are still present. Please check your input. -error.KeyStore=Error loading they keystore. Wrong password? -error.KeyStoreAliasExist=Key alias %s not found in keystore -error.KeyStoreAliasNoKey=Alias %s is not a key -error.KeyStoreFileNotExist=Keystore file %s does not exist\! -error.KeyStoreKeyPass=Key password invalid -error.LocalBKU=Please check if a local CCE (citizen card environment) is running\n\nYou need a CCE to access your citizen card. Further information under www.buergerkarte.at -error.MayNotBeAPDF=This may not be a PDF file -error.NoTan=No TAN entered -error.PDFProtected=This PDF file is encrypted and can therefore not be signed -error.PDFPwdProtected=This PDF file is password protected and can therefore not be signed -error.PositioningNotPossible=Manual positioning currently not possible due to a Java Bug. Using automatic positioning. -error.PrepareDocument=Failed to prepare document for signature. -error.Retry=Retry -error.SWTLib=Error loading SWT library -error.SaveOutputFolder=Failed to save signed document to configured output folder. -error.Signatur=Signature error -error.SignaturePanel.NoPage=No page selected -error.SignaturePanel.NoRender=Could not render page -error.TanTooLong=Entered TAN too long -error.Title=Error -error.TitleFatal=Fatal Error -error.Unexpected=Unexpected Error -exception.InvalidEmblemFile=%s is an invalid signature logo file\! -exception.InvalidPort=%s is invalid\: has to be a number between %d and %d -exception.PasswordTooLong=Given password is too long\! -exception.PasswordTooShort=Given password is too short\! -exception.PathNotDirectory=Path %s does not denote a directory\! -exception.PathNotExist=Path %s does not exist\! -keystore.KeystoreStorePassEntry=Please enter keystore password: -keystore.KeystoreKeyPassEntry=Please enter key password: -keystore_config.Keystore_Title=Keystore -keystore_config.KeystoreAlias=Key alias -keystore_config.KeystoreFile=Keystore file -keystore_config.KeystoreFile_ToolTip=Path to the keystore file -keystore_config.KeystoreFile.Dialog=Choose the keystore -keystore_config.KeystoreFile.Dialog_Title=Keystore selection -keystore_config.KeystoreKeyPass=Key password -keystore_config.KeystoreKeyPass_ToolTip=Warning: The password is stored in plain text. Leave empty to get prompted for password during signing. -keystore_config.KeystoreStorePass=Keystore password -keystore_config.KeystoreStorePass_ToolTip=Warning: The password is stored in plain text. Leave empty to get prompted for password during signing. -keystore_config.KeystoreType=Keystore type -keystore_config.KeystoreType_JKS=Java keystore -keystore_config.KeystoreType_PKCS12=PKCS12 -keystore_config.Load=Load keystore -keystore_config.Load_ToolTip=Load keystore to show available key aliases -main.about=About %s -main.configuration=Configuration -main.done=Finish -main.hide=Hide %s -main.position=Positioning -main.quit=Quit %s -main.signature=Signing -mobileBKU.aTrustDisclaimer=This service is provided by A-Trust -mobileBKU.certExpiresSoon=Since the validity of your certificate expires in the next few days, a new activation is necessary (free of charge). Press "Yes" to visit https\://www.handy-signatur.at/ now, and then sign in to your account. -mobileBKU.notice=Notice from server\: -mobileBKU.number=Number\: -mobileBKU.password=Password\: -mobileBKU.show=<a>Show signature data</a> -mobileBKU.show_tooltip=Shows the data to be signed -mobileBKU.tan_tries_exceeded=TAN tries exceeded, request a new TAN? -mobileBKU.wrong_tan=TAN not accepted -output.file_ask_overwrite=File %s already exists, do you want to overwrite it? -output.link_open_message=You can open the signed file <a>here</a>. -output.link_save_message=You can save the signed file -output.save_failed=Saving file %s failed\: %s -output.success_message=Signature was successful -positioning.newPage=Create &new Page -positioning.page=Page %d of %d -positioning.removeNewPage=Undo &new Page -positioning.sign=&Sign -positioning.signature=Signature -simple_config.ClearEmblem=Clea&r -simple_config.EmblemEmpty=Drag and Drop an image here\nor use the browse button \nto select a signature logo. -simple_config.Emblem_Title=Signature &logo -simple_config.ExampleNumber=+43676123456789 -simple_config.ExampleNumber_ToolTip=To use a default mobile phone number enter it here -simple_config.MobileBKU_Title=&Mobile signature -simple_config.Note=Text\: -simple_config.Note_Default=This document is signed with a qualified electronic signature. According to Art. 25 para. 2 of the Regulation (EU) No 910/2014 of 23. July 2014 ("eIDAS-Regulation") it shall have the equivalent legal effect of a handwritten signature. -simple_config.Note_Default_Old=This document is signed with a qualified electronic signature. According to \u00A7\u00A04 art.\u00A01 of the Signature Act it in principle is legally equivalent to a handwritten signature. -simple_config.Note_SetDefault=Restore default -simple_config.Note_Title=Signature &Note -simple_config.Note_Tooltip=Add an optional note to display on your Signature -simple_config.PhoneNumber=Mobile number\: -simple_config.SigBlockLang_Title=Signature block lan&guage\: -simple_config.SigBlockLang_ToolTip=Select the language to be used in the signature block displayed on the signed document -tanEnter.QR=QR code\: -tanEnter.ReferenceValue=Reference value\: -tanEnter.SMS=Request &SMS -tanEnter.TAN=TAN\: -tanEnter.tries=%d tries left\! -tanEnter.try=Only 1 try left\! -version_check.UpdateText=Version %s is available.\nOpen download page now? -version_check.UpdateTitle=New version available\! -waiting.message=Signature creation in progress... +#Eclipse messages class
+#Fri Jun 26 16:29:30 CEST 2015
+BKU.KS=Keystore
+BKU.LOCAL=Local CCE
+BKU.MOBILE=Mobile CCE
+BKU.NONE=no default
+BKUSelectionComposite.btnMobile.text=MOBILE
+TrustedSocketFactory.FailedToCreateSecureConnection=Failed to create secure network connection
+advanced_config.AutoPosition=Automatic positioning
+advanced_config.AutoPosition_ToolTip=Activate this option to automatically position the signature
+advanced_config.BKUSelection_Title=CC&E Selection
+advanced_config.BKUSelection_ToolTip=Select the default CCE to use during signature
+advanced_config.KeystoreEnabled=Enable keystore signing
+advanced_config.KeystoreEnabled_ToolTip=Enables the possibility to sign with a local keystore
+advanced_config.LocaleSelection_Title=Interface &language selection
+advanced_config.LocaleSelection_ToolTip=Select the interface language for PDF-Over
+advanced_config.OutputFolder=Default output folder\:
+advanced_config.OutputFolder.Dialog=Select a folder
+advanced_config.OutputFolder.Dialog_Title=Select Output folder
+advanced_config.OutputFolder_Title=&Output location
+advanced_config.OutputFolder_ToolTip=Select the folder where the signed document will be saved automatically (clear this field to disable automatic saving, enter a single dot (".") to denote the input document directory)
+advanced_config.PdfACompat=PDF/A compatibility
+advanced_config.PdfACompat_ToolTip=Whether to make signature PDF/A compatible (increases pdf size)
+advanced_config.ProxyHost=Host\:
+advanced_config.ProxyHost_Template=Hostname or IP of the proxy server
+advanced_config.ProxyHost_ToolTip=To use a proxy server enter the hostname or the IP here
+advanced_config.ProxyPass=Password\:
+advanced_config.ProxyPass_Template=Password for proxy authentication
+advanced_config.ProxyPass_ToolTip=To use proxy authentication enter password here
+advanced_config.ProxyPort=Port\:
+advanced_config.ProxyPort_Template=Port of the proxy server [1-65535]
+advanced_config.ProxyPort_ToolTip=To use a proxy server enter the port number here
+advanced_config.ProxyUser=Username\:
+advanced_config.ProxyUser_Template=Username for proxy authentication
+advanced_config.ProxyUser_ToolTip=To use proxy authentication enter username here
+advanced_config.Proxy_Title=&Proxy
+advanced_config.SigPHTransparency=Signature placeholder transparency
+advanced_config.SigPHTransparencyMax=Opaque
+advanced_config.SigPHTransparencyMin=Invisible
+advanced_config.SigPHTransparencyTooltip=Set the transparency of the signature placeholder in the positioning step
+advanced_config.Signature_Title=Si&gnature
+advanced_config.UpdateCheck=Automatically check for updates
+advanced_config.UpdateCheck_Title=Updates
+advanced_config.UpdateCheck_ToolTip=Shows a notification when a new version is available
+advanced_config.UseMarker=Search for signature markers
+advanced_config.UseMarker_ToolTip=Activate this option to scan the document for signature markers. In case there is a marker available, you will be asked whether to automatically position your signature according to the marker.
+argument.error.output=is not a directory
+argument.help.autopos=Enables automatic signature positioning
+argument.help.bku=Select the CCE to use. Possible values are\: LOCAL, MOBILE, KS. Example\: -b MOBILE
+argument.help.config=Defines which configuration file to use. Example\: -c <config file>
+argument.help.emblem=Sets the signature logo file to use for the signature. Example\: -e <emblem file>
+argument.help.help=Shows this help message
+argument.help.input=Sets the document to sign. Example\: -i <input document>
+argument.help.keystorealias=Sets the keystore key alias. Example \: -ksalias <alias>
+argument.help.keystorefile=Sets the keystore file. Example \: -ks <keystore file>
+argument.help.keystorekeypass=Sets the keystore password. Example \: -kspass <password>
+argument.help.keystorestorepass=Sets the keystore key password. Example \: -kskeypass <password>
+argument.help.keystoretype=Sets the keystore type. Example \: -kstype [PKCS12|JKS|JCEKS]
+argument.help.number=Sets the telephone number to use for mobile CCE. Example\: -n <number>
+argument.help.output=Sets the output folder or file to use. Example\: -o <folder>
+argument.help.password=Sets the password to use for mobile CCE. Example\: -p <password>
+argument.help.proxyhost=Sets the proxy host to use. Example\: -proxy <hostname/IP>
+argument.help.proxypass=Sets the proxy password to use. Example\: -proxypass <password>
+argument.help.proxyport=Sets the proxy port to use. Example\: -proxyport <port>
+argument.help.proxyuser=Sets the proxy username to use. Example\: -proxyuser <username>
+argument.help.skipfinish=Enables skipping of the "Finish" dialog (if successfully saved)
+argument.help.vis=Sets the visibility of a signature. Example\: -v "true"
+argument.info.help=The following options are available\:
+argument.invalid.bku=CCE argument invalid\! Usage\:
+argument.invalid.config=Configuration file argument invalid\! Usage\:
+argument.invalid.emblem=Signature logo argument invalid\! Usage\:
+argument.invalid.input=Document to sign argument invalid\! Usage\:
+argument.invalid.keystorealias=Keystore alias invalid\! Usage\:
+argument.invalid.keystorefile=Keystore file invalid\! Usage\:
+argument.invalid.keystorekeypass=Keystore key password invalid\! Usage\:
+argument.invalid.keystorestorepass=Keystore password invalid\! Usage\:
+argument.invalid.keystoretype=Keystore type invalid\! Usage\:
+argument.invalid.number=Phone number argument invalid\! Usage\:
+argument.invalid.output=Output folder argument invalid\! Usage\:
+argument.invalid.password=Mobile CCE password invalid\! Usage\:
+argument.invalid.proxyhost=Proxy host argument invalid\! Usage\:
+argument.invalid.proxypass=Proxy password argument invalid\! Usage\:
+argument.invalid.proxyport=Proxy port argument invalid\! Usage\:
+argument.invalid.proxyuser=Proxy username argument invalid\! Usage\:
+argument.invalid.vis=Profile Visbility argument invalid\! Usage\:
+bku_selection.card=&Card
+bku_selection.ks=&Keystore
+bku_selection.mobile=&Mobile
+common.AllExtension_Description=All files
+common.Cancel=C&ancel
+common.GIFExtension_Description=GIF files
+common.ImageExtension_Description=All supported image files
+common.JPGExtension_Description=JPG files
+common.KeystoreExtension_Description=Keystore files
+common.KSExtension_Description=Java keystore files
+common.Ok=O&K
+common.PDFExtension_Description=PDF documents
+common.PKCS12Extension_Description=PKCS12 keystore files
+common.PNGExtension_Description=PNG files
+common.Save=&Save
+common.browse=&Browse
+common.info=Information
+common.open=Open
+common.warning=Warning
+config.About=A&bout %s
+config.AboutText=This software is freely provided by A-SIT under the conditions of the EUPL.\nTerms and details at <a>http://demo.a-sit.at/lizenzbedingungen/</a>.\n\nNotice that components can have different licenses, partly restricting their free use to EUPL-licensed software.
+config.Advanced=Ad&vanced
+config.Keystore=&Keystore
+config.Simple=Basi&c
+dataSourceSelection.DropLabel=Drag document here
+dataSourceSelection.DropLabel2=or...
+dataSourceSelection.browse=&Browse for PDF on your computer
+dataSourceSelection.usePlaceholderTitle=Info
+dataSourceSelection.usePlaceholderText=A marker has been found where the creator of the document wants you to put your signature. Do you want to use it?
+error.CmdLineArgs=Error parsing the command-line arguments\:
+error.Details=Details
+error.EnteredReferenceValue=You entered the reference value\!
+error.FailedToGetSignedDocument=Failed to get signed document.
+error.FailedToLoadEmblem=Failed to load the signature logo
+error.FailedToLoadQRCode=Failed to load the QR code
+error.FailedToOpenDocument=Failed to open signed document\: %s.
+error.FailedToSaveSettings=Failed to save configuration file\!
+error.FileNotExist=File %s does not exist\!
+error.IOError=Input/Output Error
+error.Initialization=Initialization failed. Please check your configuration.
+error.InvalidBKU=Invalid CCE selection. Please check.
+error.InvalidLocale=Locale not valid
+error.InvalidPhoneNumber=Given phone number is invalid\! Example\: +43664123456789
+error.InvalidSettings=Invalid settings are still present. Please check your input.
+error.KeyStore=Error loading they keystore. Wrong password?
+error.KeyStoreAliasExist=Key alias %s not found in keystore
+error.KeyStoreAliasNoKey=Alias %s is not a key
+error.KeyStoreFileNotExist=Keystore file %s does not exist\!
+error.KeyStoreKeyPass=Key password invalid
+error.LocalBKU=Please check if a local CCE (citizen card environment) is running\n\nYou need a CCE to access your citizen card. Further information under www.buergerkarte.at
+error.MayNotBeAPDF=This may not be a PDF file
+error.NoTan=No TAN entered
+error.PDFProtected=This PDF file is encrypted and can therefore not be signed
+error.PDFPwdProtected=This PDF file is password protected and can therefore not be signed
+error.PositioningNotPossible=Manual positioning currently not possible due to a Java Bug. Using automatic positioning.
+error.PrepareDocument=Failed to prepare document for signature.
+error.Retry=Retry
+error.SWTLib=Error loading SWT library
+error.SaveOutputFolder=Failed to save signed document to configured output folder.
+error.Signatur=Signature error
+error.SignaturePanel.NoPage=No page selected
+error.SignaturePanel.NoRender=Could not render page
+error.TanTooLong=Entered TAN too long
+error.Title=Error
+error.TitleFatal=Fatal Error
+error.Unexpected=Unexpected Error
+exception.InvalidEmblemFile=%s is an invalid signature logo file\!
+exception.InvalidPort=%s is invalid\: has to be a number between %d and %d
+exception.PasswordTooLong=Given password is too long\!
+exception.PasswordTooShort=Given password is too short\!
+exception.PathNotDirectory=Path %s does not denote a directory\!
+exception.PathNotExist=Path %s does not exist\!
+keystore.KeystoreStorePassEntry=Please enter keystore password:
+keystore.KeystoreKeyPassEntry=Please enter key password:
+keystore_config.Keystore_Title=Keystore
+keystore_config.KeystoreAlias=Key alias
+keystore_config.KeystoreFile=Keystore file
+keystore_config.KeystoreFile_ToolTip=Path to the keystore file
+keystore_config.KeystoreFile.Dialog=Choose the keystore
+keystore_config.KeystoreFile.Dialog_Title=Keystore selection
+keystore_config.KeystoreKeyPass=Key password
+keystore_config.KeystoreKeyPass_ToolTip=Warning: The password is stored in plain text. Leave empty to get prompted for password during signing.
+keystore_config.KeystoreStorePass=Keystore password
+keystore_config.KeystoreStorePass_ToolTip=Warning: The password is stored in plain text. Leave empty to get prompted for password during signing.
+keystore_config.KeystoreType=Keystore type
+keystore_config.KeystoreType_JKS=Java keystore
+keystore_config.KeystoreType_PKCS12=PKCS12
+keystore_config.Load=Load keystore
+keystore_config.Load_ToolTip=Load keystore to show available key aliases
+main.about=About %s
+main.configuration=Configuration
+main.done=Finish
+main.hide=Hide %s
+main.position=Positioning
+main.quit=Quit %s
+main.signature=Signing
+mobileBKU.aTrustDisclaimer=This service is provided by A-Trust
+mobileBKU.certExpiresSoon=Since the validity of your certificate expires in the next few days, a new activation is necessary (free of charge). Press "Yes" to visit https\://www.handy-signatur.at/ now, and then sign in to your account.
+mobileBKU.notice=Notice from server\:
+mobileBKU.number=Number\:
+mobileBKU.password=Password\:
+mobileBKU.show=<a>Show signature data</a>
+mobileBKU.show_tooltip=Shows the data to be signed
+mobileBKU.tan_tries_exceeded=TAN tries exceeded, request a new TAN?
+mobileBKU.wrong_tan=TAN not accepted
+output.file_ask_overwrite=File %s already exists, do you want to overwrite it?
+output.link_open_message=You can open the signed file <a>here</a>.
+output.link_save_message=You can save the signed file
+output.save_failed=Saving file %s failed\: %s
+output.success_message=Signature was successful
+positioning.newPage=Create &new Page
+positioning.page=Page %d of %d
+positioning.removeNewPage=Undo &new Page
+positioning.sign=&Sign
+positioning.signature=Signature
+simple_config.ClearEmblem=Clea&r
+simple_config.EmblemEmpty=Drag and Drop an image here\nor use the browse button \nto select a signature logo.
+simple_config.Emblem_Title=Signature &logo
+simple_config.ExampleNumber=+43676123456789
+simple_config.ExampleNumber_ToolTip=To use a default mobile phone number enter it here
+simple_config.MobileBKU_Title=&Mobile signature
+simple_config.Note=Text\:
+simple_config.Note_Default=This document is signed with a qualified electronic signature. According to Art. 25 para. 2 of the Regulation (EU) No 910/2014 of 23. July 2014 ("eIDAS-Regulation") it shall have the equivalent legal effect of a handwritten signature.
+simple_config.Note_Default_Old=This document is signed with a qualified electronic signature. According to \u00A7\u00A04 art.\u00A01 of the Signature Act it in principle is legally equivalent to a handwritten signature.
+simple_config.Note_SetDefault=Restore default
+simple_config.Note_Title=Signature &Note
+simple_config.Note_Tooltip=Add an optional note to display on your Signature
+simple_config.PhoneNumber=Mobile number\:
+simple_config.SigBlockLang_Title=Signature block lan&guage\:
+simple_config.SigBlockLang_ToolTip=Select the language to be used in the signature block displayed on the signed document
+tanEnter.QR=QR code\:
+tanEnter.FP=Please open the Handy-Signature app\nand confirm the signature.
+tanEnter.ReferenceValue=Reference value\:
+tanEnter.SMS=Request &SMS
+tanEnter.TAN=TAN\:
+tanEnter.tries=%d tries left\!
+tanEnter.try=Only 1 try left\!
+version_check.UpdateText=Version %s is available.\nOpen download page now?
+version_check.UpdateTitle=New version available\!
+waiting.message=Signature creation in progress...
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties index f6b8500f..1b2bbae1 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties @@ -1,222 +1,224 @@ -#Eclipse messages class -#Fri Jun 26 18:01:09 CEST 2015 -BKU.KS=Keystore -BKU.LOCAL=Lokale BKU -BKU.MOBILE=Handy-BKU -BKU.NONE=Keine Voreinstellung -BKUSelectionComposite.btnMobile.text=Handy -TrustedSocketFactory.FailedToCreateSecureConnection=Konnte keine sichere Verbindung erstellen -advanced_config.AutoPosition=Automatische Positionierung -advanced_config.AutoPosition_ToolTip=Aktivieren Sie diese Option, um die Signatur automatisch zu positionieren -advanced_config.BKUSelection_Title=&BKU-Auswahl -advanced_config.BKUSelection_ToolTip=W\u00E4hlen Sie die BKU, mit der die Signatur durchgef\u00FChrt werden soll -advanced_config.KeystoreEnabled=Keystore-Signatur aktivieren -advanced_config.KeystoreEnabled_ToolTip=Aktiviert die M\u00F6glichkeit, mit einem lokalen Keystore zu signieren -advanced_config.LocaleSelection_Title=S&prachauswahl -advanced_config.LocaleSelection_ToolTip=W\u00E4hlen Sie die Sprache f\u00FCr das Benutzerinterface -advanced_config.OutputFolder=Standard-Ausgabeordner\: -advanced_config.OutputFolder.Dialog=W\u00E4hlen Sie einen Ordner -advanced_config.OutputFolder.Dialog_Title=Ausgabeordner w\u00E4hlen -advanced_config.OutputFolder_Title=Ausgabe&ort -advanced_config.OutputFolder_ToolTip=W\u00E4hlen Sie einen Ordner, in dem signierte Dokumente automatisch abgelegt werden (deaktivert, wenn das Feld leer ist; ein einzelner Punkt (".") w\u00E4hlt das Verzeichnis des Ursprungsdokuments) -advanced_config.PdfACompat=PDF/A-Kompatibilit\u00E4t -advanced_config.PdfACompat_ToolTip=Ob die Signatur PDF/A-kompatibel sein soll (erh\u00F6ht PDF-Gr\u00F6\u00DFe) -advanced_config.ProxyHost=Host\: -advanced_config.ProxyHost_Template=Hostname oder IP des Proxy-Servers -advanced_config.ProxyHost_ToolTip=Um einen Proxy zu verwenden Hostname/IP hier eingeben -advanced_config.ProxyPass=Passwort\: -advanced_config.ProxyPass_Template=Passwort f\u00FCr den Proxy-Server -advanced_config.ProxyPass_ToolTip=F\u00FCr Proxy-Authentifizierung Passwort hier eingeben -advanced_config.ProxyPort=Port\: -advanced_config.ProxyPort_Template=Port des Proxy-Servers [1-65535] -advanced_config.ProxyPort_ToolTip=Um einen Proxy zu verwenden Portnummer hier eingeben -advanced_config.ProxyUser=Benutzer\: -advanced_config.ProxyUser_Template=Benutzername f\u00FCr den Proxy-Server -advanced_config.ProxyUser_ToolTip=F\u00FCr Proxy-Authentifizierung Benutzername hier eingeben -advanced_config.Proxy_Title=&Proxy -advanced_config.SigPHTransparency=Signaturplatzhalter-Transparenz -advanced_config.SigPHTransparencyMax=Undurchsichtig -advanced_config.SigPHTransparencyMin=Unsichtbar -advanced_config.SigPHTransparencyTooltip=W\u00E4hlt die Transparenz des Signaturplatzhalters im Schritt "Positionierung" -advanced_config.Signature_Title=Si&gnatur -advanced_config.UpdateCheck=Automatisch auf Updates \u00FCberpr\u00FCfen -advanced_config.UpdateCheck_Title=Updates -advanced_config.UpdateCheck_ToolTip=Zeigt eine Benachrichtigung, wenn eine neue Version verf\u00FCgbar ist -advanced_config.UseMarker=Nach Signaturplatzhaltern suchen -advanced_config.UseMarker_ToolTip=Aktivieren Sie diese Option, um das Dokument nach Signaturplatzhaltern zu durchsuchen. Sollte ein Platzhatler gefunden werden werden Sie gefragt ob Sie die Signatur in den Platzhalter einf\u00FCgen wollen. -argument.error.output=ist kein Ordner -argument.help.autopos=Aktiviert automatische Positionierung der Signatur -argument.help.bku=W\u00E4hlen Sie die BKU. G\u00FCltige Werte\: LOCAL, MOBILE, KS. Bsp.\: -b MOBILE -argument.help.config=Auswahl der Konfigurationsdatei. Bsp.\: -c <Dateiname> -argument.help.emblem=W\u00E4hlt die Bildmarke f\u00FCr die Signatur. Bsp.\: -e <Dateiname> -argument.help.help=Zeigt diese Hilfe an -argument.help.input=W\u00E4hlt das zu signierende Dokument. Bsp.\: -i <Dateiname> -argument.help.keystorealias=W\u00E4hlt das Keystore Key-Alias. Bsp.\: -ksalias <Alias> -argument.help.keystorefile=W\u00E4hlt die Keystore-Datei. Bsp.\: -ks <Dateiname> -argument.help.keystorekeypass=W\u00E4hlt das Keystore Key-Password. Bsp.\: -kskeypass <Passwort> -argument.help.keystorestorepass=W\u00E4hlt das Keystore-Password. Bsp.\: -kspass <Passwort> -argument.help.keystoretype=W\u00E4hlt den Keystore-Typ. Bsp.\: -kstype [PKCS12|JKS|JCEKS] -argument.help.number=W\u00E4hlt die Telefonnummer f\u00FCr die Handy-BKU. Bsp.\: -n <Nummer> -argument.help.output=W\u00E4hlt den Ausgabeordner oder die Ausgabedatei. Bsp.\: -o <Ordner> -argument.help.password=W\u00E4hlt das Passwort f\u00FCr die Handy-BKU. Bsp.\: -p <Passwort> -argument.help.proxyhost=W\u00E4hlt den Proxy-Server. Bsp.\: -proxy <Hostname/IP> -argument.help.proxypass=W\u00E4hlt das Proxy-Passwort. Bsp.\: -proxypass <Passwort> -argument.help.proxyport=W\u00E4hlt den Proxy-Server-Port. Bsp.\: -proxyport <Portnummer> -argument.help.proxyuser=W\u00E4hlt den Proxy-Benutznamen. Bsp.\: -proxyuser <Benutzername> -argument.help.skipfinish=Aktiviert das \u00DCberspringen des "Fertig"-Dialogs (falls Speichern erfolgreich) -argument.info.help=Die folgenden Optionen sind verf\u00FCgbar\: -argument.invalid.bku=BKU-Auswahl ung\u00FCltig\! Verwendung\: -argument.invalid.config=Konfigurationsdatei ung\u00FCltig\! Verwendung\: -argument.invalid.emblem=Bildmarke ung\u00FCltig\! Verwendung\: -argument.invalid.input=Dokument ung\u00FCltig\! Verwendung\: -argument.invalid.keystorealias=Keystore-Alias ung\u00FCltig\! Verwendung\: -argument.invalid.keystorefile=Keystore-Datei ung\u00FCltig\! Verwendung\: -argument.invalid.keystorekeypass=Keystore Key-Passwort ung\u00FCltig\! Verwendung\: -argument.invalid.keystorestorepass=Keystore-Passwort ung\u00FCltig\! Verwendung\: -argument.invalid.keystoretype=Keystore-Typ ung\u00FCltig\! Verwendung\: -argument.invalid.number=Telefonnummer ung\u00FCltig\! Verwendung\: -argument.invalid.output=Ausgabeordner ung\u00FCltig\! Verwendung\: -argument.invalid.password=Handy-BKU Passwort ung\u00FCltig\! Verwendung\: -argument.invalid.proxyhost=Proxy-Host ung\u00FCltig\! Verwendung\: -argument.invalid.proxypass=Proxy-Passwort ung\u00FCltig\! Verwendung\: -argument.invalid.proxyport=Proxy-Port ung\u00FCltig\! Verwendung\: -argument.invalid.proxyuser=Proxy-Benutzername ung\u00FCltig\! Verwendung\: -bku_selection.card=&Karte -bku_selection.ks=Key&Store -bku_selection.mobile=&Handy -common.AllExtension_Description=Alle Dateien -common.Cancel=&Abbrechen -common.GIFExtension_Description=GIF-Bilder -common.ImageExtension_Description=Alle unterst\u00FCtzen Bilder -common.JPGExtension_Description=JPG-Bilder -common.KeystoreExtension_Description=Keystores -common.KSExtension_Description=Java Keystores -common.Ok=O&K -common.PDFExtension_Description=PDF-Dokumente -common.PKCS12Extension_Description=PKCS12 Keystores -common.PNGExtension_Description=PNG-Bilder -common.Save=&Speichern -common.browse=&Durchsuchen -common.info=Information -common.open=\u00D6ffnen -common.warning=Warnung -config.About=\u00DC&ber %s -config.AboutText=Diese Software wird von A-SIT unter den Bedingungen der EUPL frei zur Verfügung gestellt.\nLizenbedingungen unter <a>http://demo.a-sit.at/lizenzbedingungen/</a>.\n\nBeachten Sie, dass Komponenten unter eigenen Lizenzen zur Verfügung gestellt werden, die teilweise nur für EUPL-lizensierte Software zur freien Verwendung vorgesehen sind. -config.Advanced=Er&weitert -config.Keystore=&Keystore -config.Simple=&Einfach -dataSourceSelection.DropLabel=Dokument hierher ziehen -dataSourceSelection.DropLabel2=oder... -dataSourceSelection.browse=&Durchsuchen um ein Dokument zu w\u00E4hlen -dataSourceSelection.usePlaceholderTitle=Info -dataSourceSelection.usePlaceholderText=Im vorliegenden Dokument wurde ein Signaturplatzhalter gefunden. Soll dieser verwendet werden? -error.CmdLineArgs=Fehler bei den Befehlszeilen-Parametern\: -error.Details=Details -error.EnteredReferenceValue=Sie haben den Vergleichswert eingegeben\! -error.FailedToGetSignedDocument=Konnte signiertes Dokument nicht erhalten. -error.FailedToLoadEmblem=Konnte Bildmarke nicht speichern -error.FailedToLoadQRCode=Konnte den QR code nicht laden -error.FailedToOpenDocument=Konnte signiertes Dokument nicht \u00F6ffnen\: %s. -error.FailedToSaveSettings=Konnte Konfigurationsdatei nicht speichern\! -error.FileNotExist=Datei %s existiert nicht\! -error.IOError=Ein-/Ausgabe-Fehler -error.Initialization=Initialisierung fehlgeschlagen. Bitte \u00FCberpr\u00FCfen Sie Ihre Konfiguration. -error.InvalidBKU=Ung\u00FCltige BKU-Auswahl. Bitte \u00FCberpr\u00FCfen. -error.InvalidLocale=Ung\u00FCltige Sprache -error.InvalidPhoneNumber=Telefonnummer ung\u00FCltig\! Beispiel\: +43664123456789 -error.InvalidSettings=Ung\u00FCltige Einstellungen vorhanden. Bitte \u00FCberpr\u00FCfen. -error.KeyStore=Fehler beim Laden des KeyStores. Falsches Passwort? -error.KeyStoreAliasExist=Key-Alias %s nicht im Keystore gefunden -error.KeyStoreAliasNoKey=Alias %s ist kein Schlüssel -error.KeyStoreFileNotExist=Keystore-Datei %s existiert nicht\! -error.KeyStoreKeyPass=Schl\u00FCssel-Passwort nicht akzeptiert -error.LocalBKU=Bitte pr\u00FCfen sie, ob Ihre lokale BKU (B\u00FCrgerkartenumgebung) l\u00E4uft\n\nSie ben\u00F6tigen eine BKU, um auf Ihre B\u00FCrgerkarte zuzugreifen. Weitere Informationen unter www.buergerkarte.at -error.MayNotBeAPDF=Dies ist m\u00F6glicherweise keine PDF-Datei -error.NoTan=Keine TAN eingeben -error.PDFProtected=Diese PDF-Datei ist verschl\u00FCsselt und kann daher nicht signiert werden -error.PDFPwdProtected=Diese PDF-Datei ist Passwortgesch\u00FCtzt und kann daher nicht signiert werden -error.PositioningNotPossible=Positionsauswahl ist im Moment nicht verf\u00FCgbar wegen eines Java Fehlers. Die Position wird automatisch bestimmt. -error.PrepareDocument=Konnte Dokument nicht zur Signatur vorbereiten. -error.Retry=Wiederholen -error.SWTLib=Fehler beim Laden der SWT-Bibliothek -error.SaveOutputFolder=Konnte Dokument nicht in den konfigurierten Ausgabeordner speichern. -error.Signatur=Signatur-Fehler -error.SignaturePanel.NoPage=Keine Seite gew\u00E4hlt -error.SignaturePanel.NoRender=Konnte Seite nicht darstellen -error.TanTooLong=Eingegebene TAN zu lange -error.Title=Fehler -error.TitleFatal=Fataler Fehler -error.Unexpected=Unerwarteter Fehler -exception.InvalidEmblemFile=%s ist eine ung\u00FCltige Bildmarken-Datei\! -exception.InvalidPort=%s ist ung\u00FCltig\: muss eine Nummer zwischen %d und %d sein. -exception.PasswordTooLong=Eingegebenes Passwort ist zu lange\! -exception.PasswordTooShort=Eingegebenes Passwort ist zu kurz\! -exception.PathNotDirectory=Pfad %s ist kein g\u00FCltiger Ordner\! -exception.PathNotExist=Pfad %s existiert nicht\! -keystore.KeystoreStorePassEntry=Keystore-Passwort eingeben: -keystore.KeystoreKeyPassEntry=Schl\u00FCssel-Passwort eingeben: -keystore_config.Keystore_Title=Keystore -keystore_config.KeystoreAlias=Schl\u00FCssel-Alias -keystore_config.KeystoreFile=Keystore-Datei -keystore_config.KeystoreFile_ToolTip=Pfad zur Keystore-Datei -keystore_config.KeystoreFile.Dialog=W\u00E4hlen Sie den Keystore -keystore_config.KeystoreFile.Dialog_Title=Keystore w\u00E4hlen -keystore_config.KeystoreKeyPass=Schl\u00FCssel-Passwort -keystore_config.KeystoreKeyPass_ToolTip=Achtung: das Passwort wird im Klartext gespeichert. Leer lassen, um beim Signieren zur Eingabe aufgefordert zu werden. -keystore_config.KeystoreStorePass=Keystore-Passwort -keystore_config.KeystoreStorePass_ToolTip=Achtung: das Passwort wird im Klartext gespeichert. Leer lassen, um beim Signieren zur Eingabe aufgefordert zu werden. -keystore_config.KeystoreType=Keystore-Typ -keystore_config.KeystoreType_JKS=Java-Keystore -keystore_config.KeystoreType_PKCS12=PKCS12 -keystore_config.Load=Keystore laden -keystore_config.Load_ToolTip=Keystore laden, um die verf\u00FCgbaren Schl\u00FCssel-Aliases anzuzeigen -main.about=\u00DCber %s -main.configuration=Konfiguration -main.done=Fertig -main.hide=%s ausblenden -main.position=Positionierung -main.quit=%s beenden -main.signature=Signatur -mobileBKU.aTrustDisclaimer=Dieses Service wird von der Fa. A-Trust zu Verf\u00FCgung gestellt -mobileBKU.certExpiresSoon=Da die G\u00FCltigkeit Ihres Zertifikats in den n\u00E4chsten Tagen endet, ist eine erneute Aktivierung erforderlich (geb\u00FChrenfrei). W\u00E4hlen Sie "Ja" um https\://www.handy-signatur.at/ zu \u00F6ffnen, und loggen Sie sich dann in Ihr Konto ein. -mobileBKU.notice=Nachricht vom Server\: -mobileBKU.number=Nummer\: -mobileBKU.password=Passwort\: -mobileBKU.show=<a>Signaturdaten anzeigen</a> -mobileBKU.show_tooltip=Zeigt die zu signierenden Daten an -mobileBKU.tan_tries_exceeded=Zu viele TAN-Versuche, neue TAN anfordern? -mobileBKU.wrong_tan=TAN nicht akzeptiert -output.file_ask_overwrite=Datei %s existiert bereits, wollen Sie sie \u00FCberschreiben? -output.link_open_message=Sie k\u00F6nnen das signierte Dokument <a>hier</a> \u00F6ffnen. -output.link_save_message=Sie k\u00F6nnen das signierte Dokument speichern -output.save_failed=Datei %s konnte nicht gespeichert werden\: %s -output.success_message=Signatur war erfolgreich -positioning.newPage=&Neue Seite anlegen -positioning.page=Seite %d von %d -positioning.removeNewPage=&Neue Seite r\u00FCckg\u00E4ngig -positioning.sign=&Signieren -positioning.signature=Signatur -simple_config.ClearEmblem=Ent&fernen -simple_config.EmblemEmpty=Ziehen Sie ein Bild hierher\noder verwenden sie Durchsuchen \num eine Bildmarke zu w\u00E4hlen. -simple_config.Emblem_Title=&Bildmarke -simple_config.ExampleNumber=+43676123456789 -simple_config.ExampleNumber_ToolTip=Um die Handynummer voreinzustellen hier eingeben -simple_config.MobileBKU_Title=&Handy-Signatur -simple_config.Note=Text\: -simple_config.Note_Default=Dieses mit einer qualifizierten elektronischen Signatur versehene Dokument hat gem\u00E4\u00DF Art. 25 Abs. 2 der Verordnung (EU) Nr. 910/2014 vom 23.\u00A0Juli\u00A02014 ("eIDAS-VO") die gleiche Rechtswirkung wie ein handschriftlich unterschriebenes Dokument. -simple_config.Note_Default_Old=Dieses mit einer qualifizierten elektronischen Signatur versehene Dokument ist gem\u00E4\u00DF \u00A7\u00A04 Abs.\u00A01 Signaturgesetz einem handschriftlich unterschriebenen Dokument grunds\u00E4tzlich rechtlich gleichgestellt. -simple_config.Note_SetDefault=Standard wiederherstellen -simple_config.Note_Title=Signaturhi&nweis -simple_config.Note_Tooltip=Ein optionaler Hinweis, der in Ihrer Signatur angezeigt wird -simple_config.PhoneNumber=Handynummer\: -simple_config.SigBlockLang_Title=Sp&rache des Signaturblocks\: -simple_config.SigBlockLang_ToolTip=W\u00E4hlen Sie eine Sprache f\u00FCr den Signaturblock, der am signierten Dokument erscheint -tanEnter.QR=QR Code\: -tanEnter.ReferenceValue=Vergleichswert\: -tanEnter.SMS=&SMS anfordern -tanEnter.TAN=TAN\: -tanEnter.tries=%d Versuche \u00FCbrig\! -tanEnter.try=Nur noch 1 Versuch \u00FCbrig\! -version_check.UpdateText=Version %s ist verf\u00FCgbar\nJetzt Download-Seite \u00F6ffnen? -version_check.UpdateTitle=Neue Version verf\u00FCgbar\! -waiting.message=Signaturerstellung l\u00E4uft... +#Eclipse messages class
+#Fri Jun 26 18:01:09 CEST 2015
+BKU.KS=Keystore
+BKU.LOCAL=Lokale BKU
+BKU.MOBILE=Handy-BKU
+BKU.NONE=Keine Voreinstellung
+BKUSelectionComposite.btnMobile.text=Handy
+TrustedSocketFactory.FailedToCreateSecureConnection=Konnte keine sichere Verbindung erstellen
+advanced_config.AutoPosition=Automatische Positionierung
+advanced_config.AutoPosition_ToolTip=Aktivieren Sie diese Option, um die Signatur automatisch zu positionieren
+advanced_config.BKUSelection_Title=&BKU-Auswahl
+advanced_config.BKUSelection_ToolTip=W\u00E4hlen Sie die BKU, mit der die Signatur durchgef\u00FChrt werden soll
+advanced_config.KeystoreEnabled=Keystore-Signatur aktivieren
+advanced_config.KeystoreEnabled_ToolTip=Aktiviert die M\u00F6glichkeit, mit einem lokalen Keystore zu signieren
+advanced_config.LocaleSelection_Title=S&prachauswahl
+advanced_config.LocaleSelection_ToolTip=W\u00E4hlen Sie die Sprache f\u00FCr das Benutzerinterface
+advanced_config.OutputFolder=Standard-Ausgabeordner\:
+advanced_config.OutputFolder.Dialog=W\u00E4hlen Sie einen Ordner
+advanced_config.OutputFolder.Dialog_Title=Ausgabeordner w\u00E4hlen
+advanced_config.OutputFolder_Title=Ausgabe&ort
+advanced_config.OutputFolder_ToolTip=W\u00E4hlen Sie einen Ordner, in dem signierte Dokumente automatisch abgelegt werden (deaktivert, wenn das Feld leer ist; ein einzelner Punkt (".") w\u00E4hlt das Verzeichnis des Ursprungsdokuments)
+advanced_config.PdfACompat=PDF/A-Kompatibilit\u00E4t
+advanced_config.PdfACompat_ToolTip=Ob die Signatur PDF/A-kompatibel sein soll (erh\u00F6ht PDF-Gr\u00F6\u00DFe)
+advanced_config.ProxyHost=Host\:
+advanced_config.ProxyHost_Template=Hostname oder IP des Proxy-Servers
+advanced_config.ProxyHost_ToolTip=Um einen Proxy zu verwenden Hostname/IP hier eingeben
+advanced_config.ProxyPass=Passwort\:
+advanced_config.ProxyPass_Template=Passwort f\u00FCr den Proxy-Server
+advanced_config.ProxyPass_ToolTip=F\u00FCr Proxy-Authentifizierung Passwort hier eingeben
+advanced_config.ProxyPort=Port\:
+advanced_config.ProxyPort_Template=Port des Proxy-Servers [1-65535]
+advanced_config.ProxyPort_ToolTip=Um einen Proxy zu verwenden Portnummer hier eingeben
+advanced_config.ProxyUser=Benutzer\:
+advanced_config.ProxyUser_Template=Benutzername f\u00FCr den Proxy-Server
+advanced_config.ProxyUser_ToolTip=F\u00FCr Proxy-Authentifizierung Benutzername hier eingeben
+advanced_config.Proxy_Title=&Proxy
+advanced_config.SigPHTransparency=Signaturplatzhalter-Transparenz
+advanced_config.SigPHTransparencyMax=Undurchsichtig
+advanced_config.SigPHTransparencyMin=Unsichtbar
+advanced_config.SigPHTransparencyTooltip=W\u00E4hlt die Transparenz des Signaturplatzhalters im Schritt "Positionierung"
+advanced_config.Signature_Title=Si&gnatur
+advanced_config.UpdateCheck=Automatisch auf Updates \u00FCberpr\u00FCfen
+advanced_config.UpdateCheck_Title=Updates
+advanced_config.UpdateCheck_ToolTip=Zeigt eine Benachrichtigung, wenn eine neue Version verf\u00FCgbar ist
+advanced_config.UseMarker=Nach Signaturplatzhaltern suchen
+advanced_config.UseMarker_ToolTip=Aktivieren Sie diese Option, um das Dokument nach Signaturplatzhaltern zu durchsuchen. Sollte ein Platzhatler gefunden werden werden Sie gefragt ob Sie die Signatur in den Platzhalter einf\u00FCgen wollen.
+argument.error.output=ist kein Ordner
+argument.help.autopos=Aktiviert automatische Positionierung der Signatur
+argument.help.bku=W\u00E4hlen Sie die BKU. G\u00FCltige Werte\: LOCAL, MOBILE, KS. Bsp.\: -b MOBILE
+argument.help.config=Auswahl der Konfigurationsdatei. Bsp.\: -c <Dateiname>
+argument.help.emblem=W\u00E4hlt die Bildmarke f\u00FCr die Signatur. Bsp.\: -e <Dateiname>
+argument.help.help=Zeigt diese Hilfe an
+argument.help.input=W\u00E4hlt das zu signierende Dokument. Bsp.\: -i <Dateiname>
+argument.help.keystorealias=W\u00E4hlt das Keystore Key-Alias. Bsp.\: -ksalias <Alias>
+argument.help.keystorefile=W\u00E4hlt die Keystore-Datei. Bsp.\: -ks <Dateiname>
+argument.help.keystorekeypass=W\u00E4hlt das Keystore Key-Password. Bsp.\: -kskeypass <Passwort>
+argument.help.keystorestorepass=W\u00E4hlt das Keystore-Password. Bsp.\: -kspass <Passwort>
+argument.help.keystoretype=W\u00E4hlt den Keystore-Typ. Bsp.\: -kstype [PKCS12|JKS|JCEKS]
+argument.help.number=W\u00E4hlt die Telefonnummer f\u00FCr die Handy-BKU. Bsp.\: -n <Nummer>
+argument.help.output=W\u00E4hlt den Ausgabeordner oder die Ausgabedatei. Bsp.\: -o <Ordner>
+argument.help.password=W\u00E4hlt das Passwort f\u00FCr die Handy-BKU. Bsp.\: -p <Passwort>
+argument.help.proxyhost=W\u00E4hlt den Proxy-Server. Bsp.\: -proxy <Hostname/IP>
+argument.help.proxypass=W\u00E4hlt das Proxy-Passwort. Bsp.\: -proxypass <Passwort>
+argument.help.proxyport=W\u00E4hlt den Proxy-Server-Port. Bsp.\: -proxyport <Portnummer>
+argument.help.proxyuser=W\u00E4hlt den Proxy-Benutznamen. Bsp.\: -proxyuser <Benutzername>
+argument.help.skipfinish=Aktiviert das \u00DCberspringen des "Fertig"-Dialogs (falls Speichern erfolgreich)
+argument.info.help=Die folgenden Optionen sind verf\u00FCgbar\:
+argument.invalid.bku=BKU-Auswahl ung\u00FCltig\! Verwendung\:
+argument.invalid.config=Konfigurationsdatei ung\u00FCltig\! Verwendung\:
+argument.invalid.emblem=Bildmarke ung\u00FCltig\! Verwendung\:
+argument.invalid.input=Dokument ung\u00FCltig\! Verwendung\:
+argument.invalid.keystorealias=Keystore-Alias ung\u00FCltig\! Verwendung\:
+argument.invalid.keystorefile=Keystore-Datei ung\u00FCltig\! Verwendung\:
+argument.invalid.keystorekeypass=Keystore Key-Passwort ung\u00FCltig\! Verwendung\:
+argument.invalid.keystorestorepass=Keystore-Passwort ung\u00FCltig\! Verwendung\:
+argument.invalid.keystoretype=Keystore-Typ ung\u00FCltig\! Verwendung\:
+argument.invalid.number=Telefonnummer ung\u00FCltig\! Verwendung\:
+argument.invalid.output=Ausgabeordner ung\u00FCltig\! Verwendung\:
+argument.invalid.password=Handy-BKU Passwort ung\u00FCltig\! Verwendung\:
+argument.invalid.proxyhost=Proxy-Host ung\u00FCltig\! Verwendung\:
+argument.invalid.proxypass=Proxy-Passwort ung\u00FCltig\! Verwendung\:
+argument.invalid.proxyport=Proxy-Port ung\u00FCltig\! Verwendung\:
+argument.invalid.proxyuser=Proxy-Benutzername ung\u00FCltig\! Verwendung\:
+bku_selection.card=&Karte
+bku_selection.ks=Key&Store
+bku_selection.mobile=&Handy
+common.AllExtension_Description=Alle Dateien
+common.Cancel=&Abbrechen
+common.GIFExtension_Description=GIF-Bilder
+common.ImageExtension_Description=Alle unterst\u00FCtzen Bilder
+common.JPGExtension_Description=JPG-Bilder
+common.KeystoreExtension_Description=Keystores
+common.KSExtension_Description=Java Keystores
+common.Ok=O&K
+common.PDFExtension_Description=PDF-Dokumente
+common.PKCS12Extension_Description=PKCS12 Keystores
+common.PNGExtension_Description=PNG-Bilder
+common.Save=&Speichern
+common.browse=&Durchsuchen
+common.info=Information
+common.open=\u00D6ffnen
+common.warning=Warnung
+config.About=\u00DC&ber %s
+config.AboutText=Diese Software wird von A-SIT unter den Bedingungen der EUPL frei zur Verfügung gestellt.\nLizenbedingungen unter <a>http://demo.a-sit.at/lizenzbedingungen/</a>.\n\nBeachten Sie, dass Komponenten unter eigenen Lizenzen zur Verfügung gestellt werden, die teilweise nur für EUPL-lizensierte Software zur freien Verwendung vorgesehen sind.
+config.Advanced=Er&weitert
+config.Keystore=&Keystore
+config.Simple=&Einfach
+dataSourceSelection.DropLabel=Dokument hierher ziehen
+dataSourceSelection.DropLabel2=oder...
+dataSourceSelection.browse=&Durchsuchen um ein Dokument zu w\u00E4hlen
+dataSourceSelection.usePlaceholderTitle=Info
+dataSourceSelection.usePlaceholderText=Im vorliegenden Dokument wurde ein Signaturplatzhalter gefunden. Soll dieser verwendet werden?
+error.CmdLineArgs=Fehler bei den Befehlszeilen-Parametern\:
+error.Details=Details
+error.EnteredReferenceValue=Sie haben den Vergleichswert eingegeben\!
+error.FailedToGetSignedDocument=Konnte signiertes Dokument nicht erhalten.
+error.FailedToLoadEmblem=Konnte Bildmarke nicht speichern
+error.FailedToLoadQRCode=Konnte den QR code nicht laden
+error.FailedToOpenDocument=Konnte signiertes Dokument nicht \u00F6ffnen\: %s.
+error.FailedToSaveSettings=Konnte Konfigurationsdatei nicht speichern\!
+error.FileNotExist=Datei %s existiert nicht\!
+error.IOError=Ein-/Ausgabe-Fehler
+error.Initialization=Initialisierung fehlgeschlagen. Bitte \u00FCberpr\u00FCfen Sie Ihre Konfiguration.
+error.InvalidBKU=Ung\u00FCltige BKU-Auswahl. Bitte \u00FCberpr\u00FCfen.
+error.InvalidLocale=Ung\u00FCltige Sprache
+error.InvalidPhoneNumber=Telefonnummer ung\u00FCltig\! Beispiel\: +43664123456789
+error.InvalidSettings=Ung\u00FCltige Einstellungen vorhanden. Bitte \u00FCberpr\u00FCfen.
+error.KeyStore=Fehler beim Laden des KeyStores. Falsches Passwort?
+error.KeyStoreAliasExist=Key-Alias %s nicht im Keystore gefunden
+error.KeyStoreAliasNoKey=Alias %s ist kein Schlüssel
+error.KeyStoreFileNotExist=Keystore-Datei %s existiert nicht\!
+error.KeyStoreKeyPass=Schl\u00FCssel-Passwort nicht akzeptiert
+error.LocalBKU=Bitte pr\u00FCfen sie, ob Ihre lokale BKU (B\u00FCrgerkartenumgebung) l\u00E4uft\n\nSie ben\u00F6tigen eine BKU, um auf Ihre B\u00FCrgerkarte zuzugreifen. Weitere Informationen unter www.buergerkarte.at
+error.MayNotBeAPDF=Dies ist m\u00F6glicherweise keine PDF-Datei
+error.NoTan=Keine TAN eingeben
+error.PDFProtected=Diese PDF-Datei ist verschl\u00FCsselt und kann daher nicht signiert werden
+error.PDFPwdProtected=Diese PDF-Datei ist Passwortgesch\u00FCtzt und kann daher nicht signiert werden
+error.PositioningNotPossible=Positionsauswahl ist im Moment nicht verf\u00FCgbar wegen eines Java Fehlers. Die Position wird automatisch bestimmt.
+error.PrepareDocument=Konnte Dokument nicht zur Signatur vorbereiten.
+error.Retry=Wiederholen
+error.SWTLib=Fehler beim Laden der SWT-Bibliothek
+error.SaveOutputFolder=Konnte Dokument nicht in den konfigurierten Ausgabeordner speichern.
+error.Signatur=Signatur-Fehler
+error.SignaturePanel.NoPage=Keine Seite gew\u00E4hlt
+error.SignaturePanel.NoRender=Konnte Seite nicht darstellen
+error.TanTooLong=Eingegebene TAN zu lange
+error.Title=Fehler
+error.TitleFatal=Fataler Fehler
+error.Unexpected=Unerwarteter Fehler
+exception.InvalidEmblemFile=%s ist eine ung\u00FCltige Bildmarken-Datei\!
+exception.InvalidPort=%s ist ung\u00FCltig\: muss eine Nummer zwischen %d und %d sein.
+exception.PasswordTooLong=Eingegebenes Passwort ist zu lange\!
+exception.PasswordTooShort=Eingegebenes Passwort ist zu kurz\!
+exception.PathNotDirectory=Pfad %s ist kein g\u00FCltiger Ordner\!
+exception.PathNotExist=Pfad %s existiert nicht\!
+keystore.KeystoreStorePassEntry=Keystore-Passwort eingeben:
+keystore.KeystoreKeyPassEntry=Schl\u00FCssel-Passwort eingeben:
+keystore_config.Keystore_Title=Keystore
+keystore_config.KeystoreAlias=Schl\u00FCssel-Alias
+keystore_config.KeystoreFile=Keystore-Datei
+keystore_config.KeystoreFile_ToolTip=Pfad zur Keystore-Datei
+keystore_config.KeystoreFile.Dialog=W\u00E4hlen Sie den Keystore
+keystore_config.KeystoreFile.Dialog_Title=Keystore w\u00E4hlen
+keystore_config.KeystoreKeyPass=Schl\u00FCssel-Passwort
+keystore_config.KeystoreKeyPass_ToolTip=Achtung: das Passwort wird im Klartext gespeichert. Leer lassen, um beim Signieren zur Eingabe aufgefordert zu werden.
+keystore_config.KeystoreStorePass=Keystore-Passwort
+keystore_config.KeystoreStorePass_ToolTip=Achtung: das Passwort wird im Klartext gespeichert. Leer lassen, um beim Signieren zur Eingabe aufgefordert zu werden.
+keystore_config.KeystoreType=Keystore-Typ
+keystore_config.KeystoreType_JKS=Java-Keystore
+keystore_config.KeystoreType_PKCS12=PKCS12
+keystore_config.Load=Keystore laden
+keystore_config.Load_ToolTip=Keystore laden, um die verf\u00FCgbaren Schl\u00FCssel-Aliases anzuzeigen
+main.about=\u00DCber %s
+main.configuration=Konfiguration
+main.done=Fertig
+main.hide=%s ausblenden
+main.position=Positionierung
+main.quit=%s beenden
+main.signature=Signatur
+mobileBKU.aTrustDisclaimer=Dieses Service wird von der Fa. A-Trust zu Verf\u00FCgung gestellt
+mobileBKU.certExpiresSoon=Da die G\u00FCltigkeit Ihres Zertifikats in den n\u00E4chsten Tagen endet, ist eine erneute Aktivierung erforderlich (geb\u00FChrenfrei). W\u00E4hlen Sie "Ja" um https\://www.handy-signatur.at/ zu \u00F6ffnen, und loggen Sie sich dann in Ihr Konto ein.
+mobileBKU.notice=Nachricht vom Server\:
+mobileBKU.number=Nummer\:
+mobileBKU.password=Passwort\:
+mobileBKU.show=<a>Signaturdaten anzeigen</a>
+mobileBKU.show_tooltip=Zeigt die zu signierenden Daten an
+mobileBKU.tan_tries_exceeded=Zu viele TAN-Versuche, neue TAN anfordern?
+mobileBKU.wrong_tan=TAN nicht akzeptiert
+output.file_ask_overwrite=Datei %s existiert bereits, wollen Sie sie \u00FCberschreiben?
+output.link_open_message=Sie k\u00F6nnen das signierte Dokument <a>hier</a> \u00F6ffnen.
+output.link_save_message=Sie k\u00F6nnen das signierte Dokument speichern
+output.save_failed=Datei %s konnte nicht gespeichert werden\: %s
+output.success_message=Signatur war erfolgreich
+positioning.newPage=&Neue Seite anlegen
+positioning.page=Seite %d von %d
+positioning.removeNewPage=&Neue Seite r\u00FCckg\u00E4ngig
+positioning.sign=&Signieren
+positioning.signature=Signatur
+simple_config.ClearEmblem=Ent&fernen
+simple_config.EmblemEmpty=Ziehen Sie ein Bild hierher\noder verwenden sie Durchsuchen \num eine Bildmarke zu w\u00E4hlen.
+simple_config.Emblem_Title=&Bildmarke
+simple_config.ExampleNumber=+43676123456789
+simple_config.ExampleNumber_ToolTip=Um die Handynummer voreinzustellen hier eingeben
+simple_config.MobileBKU_Title=&Handy-Signatur
+simple_config.Note=Text\:
+simple_config.Note_Default=Dieses mit einer qualifizierten elektronischen Signatur versehene Dokument hat gem\u00E4\u00DF Art. 25 Abs. 2 der Verordnung (EU) Nr. 910/2014 vom 23.\u00A0Juli\u00A02014 ("eIDAS-VO") die gleiche Rechtswirkung wie ein handschriftlich unterschriebenes Dokument.
+simple_config.Note_Default_Old=Dieses mit einer qualifizierten elektronischen Signatur versehene Dokument ist gem\u00E4\u00DF \u00A7\u00A04 Abs.\u00A01 Signaturgesetz einem handschriftlich unterschriebenen Dokument grunds\u00E4tzlich rechtlich gleichgestellt.
+simple_config.Note_SetDefault=Standard wiederherstellen
+simple_config.Note_Title=Signaturhi&nweis
+simple_config.Note_Tooltip=Ein optionaler Hinweis, der in Ihrer Signatur angezeigt wird
+simple_config.PhoneNumber=Handynummer\:
+simple_config.SigBlockLang_Title=Sp&rache des Signaturblocks\:
+simple_config.SigBlockLang_ToolTip=W\u00E4hlen Sie eine Sprache f\u00FCr den Signaturblock, der am signierten Dokument erscheint
+tanEnter.QR=QR Code\:
+tanEnter.FP=Bitte \u00f6ffnen Sie die Handy-Signatur App\nund best\u00e4tigen Sie die Signatur.
+tanEnter.ReferenceValue=Vergleichswert\:
+tanEnter.SMS=&SMS anfordern
+tanEnter.TAN=TAN\:
+tanEnter.APPTAN=Bitte \u00f6ffnen Sie die Handy-Signatur App\nTAN\:
+tanEnter.tries=%d Versuche \u00FCbrig\!
+tanEnter.try=Nur noch 1 Versuch \u00FCbrig\!
+version_check.UpdateText=Version %s ist verf\u00FCgbar\nJetzt Download-Seite \u00F6ffnen?
+version_check.UpdateTitle=Neue Version verf\u00FCgbar\!
+waiting.message=Signaturerstellung l\u00E4uft...
|