From 32d17447a258188b2d534bcb0bf65a659ba7b7d0 Mon Sep 17 00:00:00 2001 From: mcentner Date: Fri, 29 Aug 2008 12:11:34 +0000 Subject: Initial import. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/keystore.ks | Bin 0 -> 5635 bytes BKUApplet/pom.xml | 117 +++++++++ BKUApplet/src/main/java/META-INF/MANIFEST.MF | 3 + .../at/gv/egiz/bku/online/applet/BKUApplet.java | 101 ++++++++ .../at/gv/egiz/bku/online/applet/BKUWorker.java | 286 +++++++++++++++++++++ .../online/applet/InternalSSLSocketFactory.java | 101 ++++++++ .../applet/InternalSSLSocketFactoryException.java | 45 ++++ .../gv/egiz/bku/online/applet/Messages.properties | 58 +++++ .../egiz/bku/online/applet/Messages_de.properties | 42 +++ .../at/gv/egiz/bku/online/applet/images/logo.png | Bin 0 -> 4035 bytes .../at/gv/egiz/stal/client/STALServiceTest.java | 96 +++++++ 11 files changed, 849 insertions(+) create mode 100644 BKUApplet/keystore.ks create mode 100644 BKUApplet/pom.xml create mode 100644 BKUApplet/src/main/java/META-INF/MANIFEST.MF create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java create mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties create mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties create mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png create mode 100644 BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java (limited to 'BKUApplet') diff --git a/BKUApplet/keystore.ks b/BKUApplet/keystore.ks new file mode 100644 index 00000000..824c3a40 Binary files /dev/null and b/BKUApplet/keystore.ks differ diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml new file mode 100644 index 00000000..35672e51 --- /dev/null +++ b/BKUApplet/pom.xml @@ -0,0 +1,117 @@ + + + + bku + at.gv.egiz + 1.0-SNAPSHOT + + 4.0.0 + at.gv.egiz + BKUApplet + BKU Applet + 1.0-SNAPSHOT + + + + + maven-dependency-plugin + + + unpack + + unpack + + + ${project.build.outputDirectory} + META-INF\/ + + + at.gv.egiz + smcc + jar + + + at.gv.egiz + smccSTAL + jar + + + at.gv.egiz + STAL + jar + + + at.gv.egiz + STALService + jar + + + at.gv.egiz + BKUCommonGUI + jar + + + + + + + + maven-jar-plugin + + + + sign + + + + + + false + false + + false + true + + + test-applet signer + ./keystore.ks + storepass + keypass + true + + + + + + + at.gv.egiz + smcc + 1.0-SNAPSHOT + + + at.gv.egiz + STAL + 1.0-SNAPSHOT + + + at.gv.egiz + STALService + 1.0-SNAPSHOT + + + at.gv.egiz + smccSTAL + 1.0-SNAPSHOT + + + at.gv.egiz + BKUCommonGUI + 1.0-SNAPSHOT + + + commons-logging + commons-logging + + + \ No newline at end of file diff --git a/BKUApplet/src/main/java/META-INF/MANIFEST.MF b/BKUApplet/src/main/java/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/BKUApplet/src/main/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java new file mode 100644 index 00000000..56cc5ea2 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -0,0 +1,101 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package at.gv.egiz.bku.online.applet; + +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.net.ssl.HttpsURLConnection; +import javax.swing.JApplet; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.gui.BKUGUIFacade; +import at.gv.egiz.bku.gui.BKUGUIFactory; + +/** + * + * + * + */ +public class BKUApplet extends JApplet { + + private static Log log = LogFactory.getLog(BKUApplet.class); + + public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; + + public final static String LOCALE_PARAM_KEY = "Locale"; + public final static String LOGO_URL_KEY="LogoURL"; + public final static String WSDL_URL="WSDL_URL"; + public final static String SESSION_ID="SessionID"; + + protected ResourceBundle resourceBundle; + protected BKUWorker worker; + protected Thread workerThread; + + public BKUApplet() { + } + + public void init() { + log.debug("Called init()"); + try { + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getSocketFactory()); + HttpsURLConnection.setDefaultHostnameVerifier(InternalSSLSocketFactory.getHostNameVerifier()); + } catch (InternalSSLSocketFactoryException e) { + log.error(e); + } + String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); + if (localeString != null) { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, + new Locale(localeString)); + } else { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); + } + BKUGUIFacade gui = BKUGUIFactory.createGUI(); + gui.init(getContentPane(), localeString); + worker = new BKUWorker(gui, this, resourceBundle); + } + + public void start() { + log.debug("Called start()"); + workerThread = new Thread(worker); + workerThread.start(); + } + + public void stop() { + log.debug("Called stop()"); + if ((workerThread != null) && (workerThread.isAlive())) { + workerThread.interrupt(); + } + } + + public void destroy() { + log.debug("Called destroy()"); + } + + /** + * Applet configuration parameters + * + * @param paramKey + * @return + */ + public String getMyAppletParameter(String paramKey) { + log.info("Getting parameter: "+paramKey+ ": "+ getParameter(paramKey)); + return getParameter(paramKey); + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java new file mode 100644 index 00000000..38fd6428 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -0,0 +1,286 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package at.gv.egiz.bku.online.applet; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; + +import javax.xml.namespace.QName; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.gui.BKUGUIFacade; +import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; +import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; +import at.gv.egiz.smcc.SignatureCard; +import at.gv.egiz.smcc.util.SMCCHelper; +import at.gv.egiz.stal.QuitRequest; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.STALResponse; +import at.gv.egiz.stal.service.GetNextRequestResponseType; +import at.gv.egiz.stal.service.GetNextRequestType; +import at.gv.egiz.stal.service.ObjectFactory; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.STALService; + +public class BKUWorker extends AbstractSMCCSTAL implements Runnable, + ActionListener, SMCCSTALRequestHandler { + + private static Log log = LogFactory.getLog(BKUWorker.class); + + protected BKUGUIFacade gui; + protected BKUApplet parent; + private STALPortType stalPort; + protected List actionCommandList = new ArrayList(); + protected Boolean actionPerformed = false; + protected boolean finished = false; + protected ResourceBundle errorMessages; + + /** + * + * @param gui + * must not be null + */ + public BKUWorker(BKUGUIFacade gui, BKUApplet parent, + ResourceBundle errorMessageBundle) { + if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { + throw new NullPointerException("Parameter must not be set to null"); + } + this.gui = gui; + this.parent = parent; + this.errorMessages = errorMessageBundle; + addRequestHandler(QuitRequest.class, this); + } + + private STALPortType getSTALPort() throws MalformedURLException { + URL wsdlURL = null; + String wsdlLocation = parent.getMyAppletParameter(BKUApplet.WSDL_URL); + URL codebase = parent.getCodeBase(); + log.debug("Connecting to webservice: " + wsdlLocation); + if (wsdlLocation != null) { + try { + if (codebase.getProtocol().equalsIgnoreCase("file")) { + // for debugging in appletrunner + wsdlURL = new URL(wsdlLocation); + } else { + wsdlURL = new URL(codebase, wsdlLocation); + } + } catch (MalformedURLException ex) { + log.fatal("Paremeter 'wsdlLocation' is not a vailid URL.", ex); + throw new MalformedURLException(ex.getMessage()); + } + } else { + log.fatal("Paremeter 'wsdlLocation' is not set."); + throw new MalformedURLException("Null WSDL url"); + } + log.debug("Found WSDL url: " + wsdlURL); + QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", + "STALService"); + STALService stal = new STALService(wsdlURL, endpointName); + return stal.getSTALPort(); + } + + @Override + public void run() { + gui.showWelcomeDialog(); + try { + stalPort = getSTALPort(); + } catch (Exception e) { + log.fatal("Failed to call STAL service.", e); + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("failed.WS")); + try { + waitForAction(); + } catch (InterruptedException e1) { + log.error(e1); + } + return; + } + + ObjectFactory factory = new ObjectFactory(); + GetNextRequestType nextRequest = factory.createGetNextRequestType(); + + String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); + if (sessionId == null) { + // use the testsession for testing + sessionId = "TestSession"; + } + nextRequest.setSessionId(sessionId); + do { + GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); + log.info("Got " + resp.getRequest().size() + " requests from server."); + List stalRequests = resp.getRequest(); + List responses = handleRequest(stalRequests); + log.info("Got " + responses.size() + " responses."); + nextRequest = factory.createGetNextRequestType(); + nextRequest.setSessionId(sessionId); + nextRequest.getResponse().addAll(responses); + } while (!finished); + log.info("Done " + Thread.currentThread().getName()); + gui.showWelcomeDialog(); + sendRedirect(); + } + + protected void sendRedirect() { + log.info("Done, sending redirect to get BKU response"); + String redirectURL = parent.getMyAppletParameter("redirectURL"); + String redirectTarget = parent.getMyAppletParameter("redirectTarget"); + log.info("Redirecting to: " + redirectURL + " target: " + redirectTarget); + URL url = null; + if (redirectURL != null) { + try { + url = new URL(parent.getCodeBase(),redirectURL + ";jsessionid=" + + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); + } catch (MalformedURLException ex) { + log.warn("Parameter 'redirectURL': " + redirectURL + + " not a valid URL.", ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) + } + if (url != null) { + if (redirectTarget == null) { + log.info("Done. Trying to redirect to " + url + " ..."); + parent.getAppletContext().showDocument(url); + } else { + log.info("Done. Trying to redirect to " + url + " (target=" + + redirectTarget + ") ..."); + parent.getAppletContext().showDocument(url, redirectTarget); + } + } + } else { + log.error("No redirect URL set"); + } + } + + protected synchronized void waitForAction() throws InterruptedException { + log.info("Waiting for Action"); + while (!actionPerformed) { + wait(); + } + actionPerformed = false; + } + + protected synchronized void actionOccured() { + log.info("Received Action"); + actionPerformed = true; + notifyAll(); + } + + @Override + public void actionPerformed(ActionEvent e) { + log.info("Action: " + e); + if (actionCommandList != null) { + if (actionCommandList.contains(e.getActionCommand())) { + actionOccured(); + } + } else { + actionOccured(); + } + } + + @Override + protected boolean waitForCard() { + SMCCHelper smccHelper = new SMCCHelper(); + actionCommandList.clear(); + actionCommandList.add("cancel"); + // while no sigcard found or cancel button pressed + int oldValue = SMCCHelper.PC_SC_NOT_SUPPORTED; // this is a save default + while ((signatureCard == null) && (!actionPerformed)) { + switch (smccHelper.getResultCode()) { + case SMCCHelper.PC_SC_NOT_SUPPORTED: + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.TERMINAL_NOT_PRESENT: + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.CARD_NOT_SUPPORTED: + if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showCardNotSupportedDialog(this, "cancel"); + oldValue = SMCCHelper.CARD_NOT_SUPPORTED; + } + break; + case SMCCHelper.NO_CARD: + if (oldValue != SMCCHelper.NO_CARD) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showInsertCardDialog(this, "cancel"); + oldValue = SMCCHelper.NO_CARD; + } + break; + case SMCCHelper.CARD_FOUND: + gui.showWelcomeDialog(); + signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); + return false; + } + smccHelper.update(3000); + } + return signatureCard == null; + } + + @Override + public STALResponse handleRequest(STALRequest request) { + if (request instanceof QuitRequest) { + finished = true; + } else { + log.error("Unexpected request to handle: " + request); + } + return null; + } + + @Override + public void init(SignatureCard sc, BKUGUIFacade gui) { + } + + @Override + public SMCCSTALRequestHandler newInstance() { + return this; + } + + @Override + public boolean requireCard() { + return false; + } + + @Override + protected BKUGUIFacade getGUI() { + return gui; + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java new file mode 100644 index 00000000..ab04d2b6 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java @@ -0,0 +1,101 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.bku.online.applet; + +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.X509TrustManager; + +public class InternalSSLSocketFactory { + + private SSLSocketFactory factory; + + public static SSLSocketFactory getSocketFactory() throws InternalSSLSocketFactoryException { + return new InternalSSLSocketFactory().factory; + } + + public static HostnameVerifier getHostNameVerifier() throws InternalSSLSocketFactoryException { + return (new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }); + } + + public InternalSSLSocketFactory() throws InternalSSLSocketFactoryException { + SSLContext sslContext; + try { + sslContext = SSLContext.getInstance("TLSv1"); + sslContext.getClientSessionContext().setSessionTimeout(0); + KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509"); + + KeyStore keyStore = KeyStore.getInstance("JKS"); + keyStore.load(null, null); + keyManagerFactory.init(keyStore, null); + + sslContext.init(keyManagerFactory.getKeyManagers(), + new X509TrustManager[] { new AcceptAllTrustManager() }, + null); + } catch (NoSuchAlgorithmException e) { + throw new InternalSSLSocketFactoryException(e); + } catch (CertificateException e) { + throw new InternalSSLSocketFactoryException(e); + } catch (IOException e) { + throw new InternalSSLSocketFactoryException(e); + } catch (KeyStoreException e) { + throw new InternalSSLSocketFactoryException(e); + } catch (UnrecoverableKeyException e) { + throw new InternalSSLSocketFactoryException(e); + } catch (KeyManagementException e) { + throw new InternalSSLSocketFactoryException(e); + } + + this.factory = sslContext.getSocketFactory(); + } + + class AcceptAllTrustManager implements X509TrustManager { + + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + public void checkClientTrusted(X509Certificate[] chain, String authType) { + } + + public void checkServerTrusted(X509Certificate[] chain, String authType) { + //FIXME + } + } +}; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java new file mode 100644 index 00000000..c620284a --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java @@ -0,0 +1,45 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.bku.online.applet; + +/** + * + * @author mcentner + */ +public class InternalSSLSocketFactoryException extends Exception { + + public InternalSSLSocketFactoryException(Throwable cause) { + super(cause); + } + + public InternalSSLSocketFactoryException(String message, Throwable cause) { + super(message, cause); + } + + public InternalSSLSocketFactoryException(String message) { + super(message); + } + + public InternalSSLSocketFactoryException() { + } + +} diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties new file mode 100644 index 00000000..752004e8 --- /dev/null +++ b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties @@ -0,0 +1,58 @@ +# Copyright 2008 Federal Chancellery Austria and +# Graz University of Technology +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# -------- BEGIN bootstrap applet -----------# +java16required=This Applet requires Java 1.6 or higher to run. \ + Please download and install a recent version of Java. \ +

For Windows, Linux and Solaris plattforms you can download Java from \ + http://java.sun.com/javase/downloads.\ +

+ +failedtostart=Failed to start Applet. \ +

{0}

+# -------- END bootstrap applet -----------# + + +applet.name=Online Citicen Card Environment (CCE) + +nopcscsupport=The Java plattform does not seem to provide \ +a PC/SC interface to acces a smartcard. + +nocardterminal=Can not find a connected smartcard reader.\ +

Either there is no smartcard reader connected, or \ + no PC/SC driver is installed for a connected smartcard reader.

+ +insertcard=Please insert your citicen card (B\u00FCrgerkarte) into your \ + smartcard reader. + +unsupportedcard=The inserted smartcard is not supported.\ +

Please insert your citicen card (B\u00FCrgerkarte) \ + into your smartcard reader.

+ +enterpin=Please enter {0} \(min {1}, max {2} digits\). + +enterpinretries=Please enter {0} \(min {1}, max {2} digits, {3} retries left\). + +pinwrong=Entered PIN is wrong. + +button.ok=Ok + +button.cancel=Cancel + +status.findpcsc=Looking for PC/SC support + +status.findsupportedcard=Looking for a supported smartcard + +failed.WS=Webservice cannot be reached. \ No newline at end of file diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties new file mode 100644 index 00000000..e6b815e9 --- /dev/null +++ b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties @@ -0,0 +1,42 @@ +# Copyright 2008 Federal Chancellery Austria and +# Graz University of Technology +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# -------- BEGIN bootstrap applet -----------# +java16required=Dieses Applet ben\u00F6tigt Java Version 1.6 oder h\u00F6her. \ + Bitte installieren sie eine aktulle Version von Java. \ +

F\u00FCr Windows, Linux and Solaris kann Java von \ + http://java.sun.com/javase/downloads \ + heruntergeladen werden.

+ +failedtostart=Das Applet konnte nicht gestartet werden. \ +

{0}

+# -------- END bootstrap applet -----------# + +applet.name=Online B\u00FCrgerkartenumgebung (BKU) + +nopcscsupport=Die Java-Installation stellt keine \ + PC/SC-Schnittstelle zum Zugriff auf eine Chipkarte zur Verf\u00FCgung. + +nocardterminal=Es konnte kein Chipkartenleser gefunden werden.\ +

Entweder, es ist kein Chipkartenleser angeschlossen, oder \ + f\u00FCr den angeschlossenen Chipkartenleser ist kein PC/SC-Treiber \ + installiert.

+ +insertcard=Bitte stecken Sie ihre B\u00FCrgerkarte in den Chipkartenleser. + +unsupportedcard=Die gesteckte Chipkarte wird nicht unterst\u00FCtzt.\ +

Bitte stecken Sie ihre B\u00FCrgerkare in den Chipkartenleser

+ +failed.WS=Das Webservice kann nicht erreicht werden. \ No newline at end of file diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png new file mode 100644 index 00000000..eee4be4f Binary files /dev/null and b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png differ diff --git a/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java new file mode 100644 index 00000000..9b58798d --- /dev/null +++ b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java @@ -0,0 +1,96 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.stal.client; + +import static org.junit.Assert.assertNotNull; + +import java.net.MalformedURLException; +import java.net.URL; + +import javax.xml.namespace.QName; + +import org.junit.Test; + +import at.gv.egiz.stal.InfoboxReadRequest; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.service.GetHashDataInputFault; +import at.gv.egiz.stal.service.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.GetHashDataInputType; +import at.gv.egiz.stal.service.GetNextRequestResponseType; +import at.gv.egiz.stal.service.GetNextRequestType; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.STALService; + +/** + * + * @author clemens + */ +public class STALServiceTest { + +// @Test + public void callSTAL() { + try { + URL endpointURL = new URL("http://localhost:8080/bkuonline/stal?wsdl"); + QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", "STALService"); + STALService stal = new STALService(endpointURL, endpointName); +// stal = new STALService(); + STALPortType port = stal.getSTALPort(); + + GetNextRequestType nrReq = new GetNextRequestType(); + nrReq.setSessionId("TestSession"); //STALServiceImpl.TEST_SESSION_ID); +// req.getResponse().add(new ErrorResponse(1234)); + GetNextRequestResponseType nrResp = port.getNextRequest(nrReq); + assertNotNull(nrResp); + System.out.println("got response: " + nrResp.getRequest().size()); + for (STALRequest stalReq : nrResp.getRequest()) { + if (stalReq instanceof InfoboxReadRequest) { + String ibid = ((InfoboxReadRequest) stalReq).getInfoboxIdentifier(); + String did = ((InfoboxReadRequest) stalReq).getDomainIdentifier(); + System.out.println(" received InfoboxReadRequest for " + ibid + ", " + did); + } else { + System.out.println(" received STAL request " + stalReq.getClass().getName()); + } + } + + GetHashDataInputType hdReq = new GetHashDataInputType(); + hdReq.setSessionId("TestSession"); //STALServiceImpl.TEST_SESSION_ID); + GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); + ref.setID("refId"); + hdReq.getReference().add(ref); + GetHashDataInputResponseType hdResp = port.getHashDataInput(hdReq); + GetHashDataInputResponseType.Reference hdRef = hdResp.getReference().get(0); + System.out.println("got HashDataInput " + new String(hdRef.getValue())); + + + } catch (GetHashDataInputFault ex) { + ex.printStackTrace(); + } catch (MalformedURLException ex) { + ex.printStackTrace(); + } + } + + @Test + public void testSTAL() { + //TODO + } + +} -- cgit v1.2.3 From 63f2a4f1f098cc39bd092fef77a94d73056f51f6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 5 Sep 2008 13:38:24 +0000 Subject: HashDataInput git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@19 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 4 +- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 543 +++++++++++---------- .../bku/online/applet/WSSignRequestHandler.java | 90 ++++ .../src/main/resources/commons-logging.properties | 16 + BKUApplet/src/main/resources/simplelog.properties | 25 + 5 files changed, 405 insertions(+), 273 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java create mode 100644 BKUApplet/src/main/resources/commons-logging.properties create mode 100644 BKUApplet/src/main/resources/simplelog.properties (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 56cc5ea2..5d4d0dab 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -29,9 +29,7 @@ import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIFactory; /** - * - * - * + * Note: all swing code is executed by the event dispatch thread (see BKUGUIFacade) */ public class BKUApplet extends JApplet { diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 38fd6428..f7b5fb2f 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -14,273 +14,276 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package at.gv.egiz.bku.online.applet; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.ResourceBundle; - -import javax.xml.namespace.QName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.gui.BKUGUIFacade; -import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; -import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; -import at.gv.egiz.smcc.SignatureCard; -import at.gv.egiz.smcc.util.SMCCHelper; -import at.gv.egiz.stal.QuitRequest; -import at.gv.egiz.stal.STALRequest; -import at.gv.egiz.stal.STALResponse; -import at.gv.egiz.stal.service.GetNextRequestResponseType; -import at.gv.egiz.stal.service.GetNextRequestType; -import at.gv.egiz.stal.service.ObjectFactory; -import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.STALService; - -public class BKUWorker extends AbstractSMCCSTAL implements Runnable, - ActionListener, SMCCSTALRequestHandler { - - private static Log log = LogFactory.getLog(BKUWorker.class); - - protected BKUGUIFacade gui; - protected BKUApplet parent; - private STALPortType stalPort; - protected List actionCommandList = new ArrayList(); - protected Boolean actionPerformed = false; - protected boolean finished = false; - protected ResourceBundle errorMessages; - - /** - * - * @param gui - * must not be null - */ - public BKUWorker(BKUGUIFacade gui, BKUApplet parent, - ResourceBundle errorMessageBundle) { - if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { - throw new NullPointerException("Parameter must not be set to null"); - } - this.gui = gui; - this.parent = parent; - this.errorMessages = errorMessageBundle; - addRequestHandler(QuitRequest.class, this); - } - - private STALPortType getSTALPort() throws MalformedURLException { - URL wsdlURL = null; - String wsdlLocation = parent.getMyAppletParameter(BKUApplet.WSDL_URL); - URL codebase = parent.getCodeBase(); - log.debug("Connecting to webservice: " + wsdlLocation); - if (wsdlLocation != null) { - try { - if (codebase.getProtocol().equalsIgnoreCase("file")) { - // for debugging in appletrunner - wsdlURL = new URL(wsdlLocation); - } else { - wsdlURL = new URL(codebase, wsdlLocation); - } - } catch (MalformedURLException ex) { - log.fatal("Paremeter 'wsdlLocation' is not a vailid URL.", ex); - throw new MalformedURLException(ex.getMessage()); - } - } else { - log.fatal("Paremeter 'wsdlLocation' is not set."); - throw new MalformedURLException("Null WSDL url"); - } - log.debug("Found WSDL url: " + wsdlURL); - QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", - "STALService"); - STALService stal = new STALService(wsdlURL, endpointName); - return stal.getSTALPort(); - } - - @Override - public void run() { - gui.showWelcomeDialog(); - try { - stalPort = getSTALPort(); - } catch (Exception e) { - log.fatal("Failed to call STAL service.", e); - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("failed.WS")); - try { - waitForAction(); - } catch (InterruptedException e1) { - log.error(e1); - } - return; - } - - ObjectFactory factory = new ObjectFactory(); - GetNextRequestType nextRequest = factory.createGetNextRequestType(); - - String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); - if (sessionId == null) { - // use the testsession for testing - sessionId = "TestSession"; - } - nextRequest.setSessionId(sessionId); - do { - GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); - log.info("Got " + resp.getRequest().size() + " requests from server."); - List stalRequests = resp.getRequest(); - List responses = handleRequest(stalRequests); - log.info("Got " + responses.size() + " responses."); - nextRequest = factory.createGetNextRequestType(); - nextRequest.setSessionId(sessionId); - nextRequest.getResponse().addAll(responses); - } while (!finished); - log.info("Done " + Thread.currentThread().getName()); - gui.showWelcomeDialog(); - sendRedirect(); - } - - protected void sendRedirect() { - log.info("Done, sending redirect to get BKU response"); - String redirectURL = parent.getMyAppletParameter("redirectURL"); - String redirectTarget = parent.getMyAppletParameter("redirectTarget"); - log.info("Redirecting to: " + redirectURL + " target: " + redirectTarget); - URL url = null; - if (redirectURL != null) { - try { - url = new URL(parent.getCodeBase(),redirectURL + ";jsessionid=" - + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); - } catch (MalformedURLException ex) { - log.warn("Parameter 'redirectURL': " + redirectURL - + " not a valid URL.", ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) - } - if (url != null) { - if (redirectTarget == null) { - log.info("Done. Trying to redirect to " + url + " ..."); - parent.getAppletContext().showDocument(url); - } else { - log.info("Done. Trying to redirect to " + url + " (target=" - + redirectTarget + ") ..."); - parent.getAppletContext().showDocument(url, redirectTarget); - } - } - } else { - log.error("No redirect URL set"); - } - } - - protected synchronized void waitForAction() throws InterruptedException { - log.info("Waiting for Action"); - while (!actionPerformed) { - wait(); - } - actionPerformed = false; - } - - protected synchronized void actionOccured() { - log.info("Received Action"); - actionPerformed = true; - notifyAll(); - } - - @Override - public void actionPerformed(ActionEvent e) { - log.info("Action: " + e); - if (actionCommandList != null) { - if (actionCommandList.contains(e.getActionCommand())) { - actionOccured(); - } - } else { - actionOccured(); - } - } - - @Override - protected boolean waitForCard() { - SMCCHelper smccHelper = new SMCCHelper(); - actionCommandList.clear(); - actionCommandList.add("cancel"); - // while no sigcard found or cancel button pressed - int oldValue = SMCCHelper.PC_SC_NOT_SUPPORTED; // this is a save default - while ((signatureCard == null) && (!actionPerformed)) { - switch (smccHelper.getResultCode()) { - case SMCCHelper.PC_SC_NOT_SUPPORTED: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, - "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.TERMINAL_NOT_PRESENT: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, - "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.CARD_NOT_SUPPORTED: - if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { - actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showCardNotSupportedDialog(this, "cancel"); - oldValue = SMCCHelper.CARD_NOT_SUPPORTED; - } - break; - case SMCCHelper.NO_CARD: - if (oldValue != SMCCHelper.NO_CARD) { - actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showInsertCardDialog(this, "cancel"); - oldValue = SMCCHelper.NO_CARD; - } - break; - case SMCCHelper.CARD_FOUND: - gui.showWelcomeDialog(); - signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); - return false; - } - smccHelper.update(3000); - } - return signatureCard == null; - } - - @Override - public STALResponse handleRequest(STALRequest request) { - if (request instanceof QuitRequest) { - finished = true; - } else { - log.error("Unexpected request to handle: " + request); - } - return null; - } - - @Override - public void init(SignatureCard sc, BKUGUIFacade gui) { - } - - @Override - public SMCCSTALRequestHandler newInstance() { - return this; - } - - @Override - public boolean requireCard() { - return false; - } - - @Override - protected BKUGUIFacade getGUI() { - return gui; - } -} +package at.gv.egiz.bku.online.applet; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; + +import javax.xml.namespace.QName; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.gui.BKUGUIFacade; +import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; +import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; +import at.gv.egiz.smcc.SignatureCard; +import at.gv.egiz.smcc.util.SMCCHelper; +import at.gv.egiz.stal.QuitRequest; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.STALResponse; +import at.gv.egiz.stal.SignRequest; +import at.gv.egiz.stal.service.GetNextRequestResponseType; +import at.gv.egiz.stal.service.GetNextRequestType; +import at.gv.egiz.stal.service.ObjectFactory; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.STALService; + +public class BKUWorker extends AbstractSMCCSTAL implements Runnable, + ActionListener, SMCCSTALRequestHandler { + + private static Log log = LogFactory.getLog(BKUWorker.class); + + protected BKUGUIFacade gui; + protected BKUApplet parent; + private STALPortType stalPort; + protected List actionCommandList = new ArrayList(); + protected Boolean actionPerformed = false; + protected boolean finished = false; + protected ResourceBundle errorMessages; + + /** + * + * @param gui + * must not be null + */ + public BKUWorker(BKUGUIFacade gui, BKUApplet parent, + ResourceBundle errorMessageBundle) { + if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { + throw new NullPointerException("Parameter must not be set to null"); + } + this.gui = gui; + this.parent = parent; + this.errorMessages = errorMessageBundle; + addRequestHandler(QuitRequest.class, this); + //register SignRequestHandler once we have a webservice port + } + + private STALPortType getSTALPort() throws MalformedURLException { + URL wsdlURL = null; + String wsdlLocation = parent.getMyAppletParameter(BKUApplet.WSDL_URL); + URL codebase = parent.getCodeBase(); + log.debug("Connecting to webservice: " + wsdlLocation); + if (wsdlLocation != null) { + try { + if (codebase.getProtocol().equalsIgnoreCase("file")) { + // for debugging in appletrunner + wsdlURL = new URL(wsdlLocation); + } else { + wsdlURL = new URL(codebase, wsdlLocation); + } + } catch (MalformedURLException ex) { + log.fatal("Paremeter 'wsdlLocation' is not a vailid URL.", ex); + throw new MalformedURLException(ex.getMessage()); + } + } else { + log.fatal("Paremeter 'wsdlLocation' is not set."); + throw new MalformedURLException("Null WSDL url"); + } + log.debug("Found WSDL url: " + wsdlURL); + QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", + "STALService"); + STALService stal = new STALService(wsdlURL, endpointName); + return stal.getSTALPort(); + } + + @Override + public void run() { + gui.showWelcomeDialog(); + try { + stalPort = getSTALPort(); + } catch (Exception e) { + log.fatal("Failed to call STAL service.", e); + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("failed.WS")); + try { + waitForAction(); + } catch (InterruptedException e1) { + log.error(e1); + } + return; + } + + ObjectFactory factory = new ObjectFactory(); + GetNextRequestType nextRequest = factory.createGetNextRequestType(); + + String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); + if (sessionId == null) { + // use the testsession for testing + sessionId = "TestSession"; + } + nextRequest.setSessionId(sessionId); + addRequestHandler(SignRequest.class, new WSSignRequestHandler(sessionId, stalPort)); + do { + GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); + log.info("Got " + resp.getRequest().size() + " requests from server."); + List stalRequests = resp.getRequest(); + List responses = handleRequest(stalRequests); + log.info("Got " + responses.size() + " responses."); + nextRequest = factory.createGetNextRequestType(); + nextRequest.setSessionId(sessionId); + nextRequest.getResponse().addAll(responses); + } while (!finished); + log.info("Done " + Thread.currentThread().getName()); + gui.showWelcomeDialog(); + sendRedirect(); + } + + protected void sendRedirect() { + log.info("Done, sending redirect to get BKU response"); + String redirectURL = parent.getMyAppletParameter("redirectURL"); + String redirectTarget = parent.getMyAppletParameter("redirectTarget"); + log.info("Redirecting to: " + redirectURL + " target: " + redirectTarget); + URL url = null; + if (redirectURL != null) { + try { + url = new URL(parent.getCodeBase(),redirectURL + ";jsessionid=" + + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); + } catch (MalformedURLException ex) { + log.warn("Parameter 'redirectURL': " + redirectURL + + " not a valid URL.", ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) + } + if (url != null) { + if (redirectTarget == null) { + log.info("Done. Trying to redirect to " + url + " ..."); + parent.getAppletContext().showDocument(url); + } else { + log.info("Done. Trying to redirect to " + url + " (target=" + + redirectTarget + ") ..."); + parent.getAppletContext().showDocument(url, redirectTarget); + } + } + } else { + log.error("No redirect URL set"); + } + } + + protected synchronized void waitForAction() throws InterruptedException { + log.info("Waiting for Action"); + while (!actionPerformed) { + wait(); + } + actionPerformed = false; + } + + protected synchronized void actionOccured() { + log.info("Received Action"); + actionPerformed = true; + notifyAll(); + } + + @Override + public void actionPerformed(ActionEvent e) { + log.info("Action: " + e); + if (actionCommandList != null) { + if (actionCommandList.contains(e.getActionCommand())) { + actionOccured(); + } + } else { + actionOccured(); + } + } + + @Override + protected boolean waitForCard() { + SMCCHelper smccHelper = new SMCCHelper(); + actionCommandList.clear(); + actionCommandList.add("cancel"); + // while no sigcard found or cancel button pressed + int oldValue = SMCCHelper.PC_SC_NOT_SUPPORTED; // this is a save default + while ((signatureCard == null) && (!actionPerformed)) { + switch (smccHelper.getResultCode()) { + case SMCCHelper.PC_SC_NOT_SUPPORTED: + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.TERMINAL_NOT_PRESENT: + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.CARD_NOT_SUPPORTED: + if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showCardNotSupportedDialog(this, "cancel"); + oldValue = SMCCHelper.CARD_NOT_SUPPORTED; + } + break; + case SMCCHelper.NO_CARD: + if (oldValue != SMCCHelper.NO_CARD) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showInsertCardDialog(this, "cancel"); + oldValue = SMCCHelper.NO_CARD; + } + break; + case SMCCHelper.CARD_FOUND: + gui.showWelcomeDialog(); + signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); + return false; + } + smccHelper.update(3000); + } + return signatureCard == null; + } + + @Override + public STALResponse handleRequest(STALRequest request) { + if (request instanceof QuitRequest) { + finished = true; + } else { + log.error("Unexpected request to handle: " + request); + } + return null; + } + + @Override + public void init(SignatureCard sc, BKUGUIFacade gui) { + } + + @Override + public SMCCSTALRequestHandler newInstance() { + return this; + } + + @Override + public boolean requireCard() { + return false; + } + + @Override + protected BKUGUIFacade getGUI() { + return gui; + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java new file mode 100644 index 00000000..f9965240 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java @@ -0,0 +1,90 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.impl.ByteArrayHashDataInput; +import at.gv.egiz.stal.service.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.GetHashDataInputType; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author clemens + */ +public class WSSignRequestHandler extends SignRequestHandler { + + private static final Log log = LogFactory.getLog(WSSignRequestHandler.class); + STALPortType stalPort; + String sessId; + + public WSSignRequestHandler(String sessId, STALPortType stalPort) { + if (stalPort == null || sessId == null) { + throw new NullPointerException("STAL port must not be null"); + } + this.sessId = sessId; + this.stalPort = stalPort; + } + + @Override + protected List getHashDataInputs(List dsigReferences) throws Exception { + GetHashDataInputType request = new GetHashDataInputType(); + request.setSessionId(sessId); + for (ReferenceType dsigRef : dsigReferences) { + //don't get Manifest, QualifyingProperties, ... + if (dsigRef.getType() == null) { + String dsigRefId = dsigRef.getId(); + if (dsigRefId != null) { + GetHashDataInputType.Reference reference = new GetHashDataInputType.Reference(); + reference.setID(dsigRefId); + request.getReference().add(reference); + } else { + throw new Exception("Cannot get HashDataInput for dsig:Reference without Id attribute"); + } + } + } + + if (log.isDebugEnabled()) { + log.debug("Calling GetHashDataInput for session " + sessId); + } + GetHashDataInputResponseType response = stalPort.getHashDataInput(request); + ArrayList hashDataInputs = new ArrayList(); + for (GetHashDataInputResponseType.Reference reference : response.getReference()) { + byte[] hdi = reference.getValue(); + String id = reference.getID(); + String mimeType = reference.getMimeType(); + + if (log.isDebugEnabled()) { + log.debug("Got HashDataInput " + id + " (" + mimeType + ")"); + } + hashDataInputs.add(new ByteArrayHashDataInput(hdi, id, mimeType)); + } + return hashDataInputs; + } + + @Override + public SMCCSTALRequestHandler newInstance() { + return new WSSignRequestHandler(this.sessId, this.stalPort); + } +} diff --git a/BKUApplet/src/main/resources/commons-logging.properties b/BKUApplet/src/main/resources/commons-logging.properties new file mode 100644 index 00000000..faa21c47 --- /dev/null +++ b/BKUApplet/src/main/resources/commons-logging.properties @@ -0,0 +1,16 @@ +# Copyright 2008 Federal Chancellery Austria and +# Graz University of Technology +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog \ No newline at end of file diff --git a/BKUApplet/src/main/resources/simplelog.properties b/BKUApplet/src/main/resources/simplelog.properties new file mode 100644 index 00000000..d62508cf --- /dev/null +++ b/BKUApplet/src/main/resources/simplelog.properties @@ -0,0 +1,25 @@ +# Copyright 2008 Federal Chancellery Austria and +# Graz University of Technology +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Logging detail level, +# Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). +org.apache.commons.logging.simplelog.defaultlog=debug +# Logs the Log instance used +org.apache.commons.logging.simplelog.showlogname=true +#Logs the class name with package(or Path) +#( Valid Values "true","false". Default Value "true") +org.apache.commons.logging.simplelog.showShortLogname=true +#Logs date and time( Valid Values "true","false". Default Value "false") +org.apache.commons.logging.simplelog.showdatetime=false -- cgit v1.2.3 From c7cbf8a12db4fcb77fd374392e88c3fa04b1e100 Mon Sep 17 00:00:00 2001 From: wbauer Date: Tue, 9 Sep 2008 09:54:32 +0000 Subject: added check to avoid sending baseid to non .gv.at domains git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@25 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 139 ++++++------ .../at/gv/egiz/bku/online/applet/BKUWorker.java | 25 ++- .../online/applet/InternalSSLSocketFactory.java | 237 +++++++++++++-------- .../applet/InternalSSLSocketFactoryException.java | 45 ---- 4 files changed, 240 insertions(+), 206 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 5d4d0dab..8289f30b 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -1,19 +1,19 @@ /* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package at.gv.egiz.bku.online.applet; import java.util.Locale; @@ -29,71 +29,68 @@ import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIFactory; /** - * Note: all swing code is executed by the event dispatch thread (see BKUGUIFacade) + * Note: all swing code is executed by the event dispatch thread (see + * BKUGUIFacade) */ public class BKUApplet extends JApplet { - private static Log log = LogFactory.getLog(BKUApplet.class); + private static Log log = LogFactory.getLog(BKUApplet.class); + + public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; - public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; + public final static String LOCALE_PARAM_KEY = "Locale"; + public final static String LOGO_URL_KEY = "LogoURL"; + public final static String WSDL_URL = "WSDL_URL"; + public final static String SESSION_ID = "SessionID"; - public final static String LOCALE_PARAM_KEY = "Locale"; - public final static String LOGO_URL_KEY="LogoURL"; - public final static String WSDL_URL="WSDL_URL"; - public final static String SESSION_ID="SessionID"; + protected ResourceBundle resourceBundle; + protected BKUWorker worker; + protected Thread workerThread; - protected ResourceBundle resourceBundle; - protected BKUWorker worker; - protected Thread workerThread; - - public BKUApplet() { - } + public BKUApplet() { + } - public void init() { - log.debug("Called init()"); - try { - HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getSocketFactory()); - HttpsURLConnection.setDefaultHostnameVerifier(InternalSSLSocketFactory.getHostNameVerifier()); - } catch (InternalSSLSocketFactoryException e) { - log.error(e); - } - String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); - if (localeString != null) { - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, - new Locale(localeString)); - } else { - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); - } - BKUGUIFacade gui = BKUGUIFactory.createGUI(); - gui.init(getContentPane(), localeString); - worker = new BKUWorker(gui, this, resourceBundle); - } + public void init() { + log.debug("Called init()"); + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory + .getInstance()); + String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); + if (localeString != null) { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, + new Locale(localeString)); + } else { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); + } + BKUGUIFacade gui = BKUGUIFactory.createGUI(); + gui.init(getContentPane(), localeString); + worker = new BKUWorker(gui, this, resourceBundle); + } - public void start() { - log.debug("Called start()"); - workerThread = new Thread(worker); - workerThread.start(); - } + public void start() { + log.debug("Called start()"); + workerThread = new Thread(worker); + workerThread.start(); + } - public void stop() { - log.debug("Called stop()"); - if ((workerThread != null) && (workerThread.isAlive())) { - workerThread.interrupt(); - } - } + public void stop() { + log.debug("Called stop()"); + if ((workerThread != null) && (workerThread.isAlive())) { + workerThread.interrupt(); + } + } - public void destroy() { - log.debug("Called destroy()"); - } + public void destroy() { + log.debug("Called destroy()"); + } - /** - * Applet configuration parameters - * - * @param paramKey - * @return - */ - public String getMyAppletParameter(String paramKey) { - log.info("Getting parameter: "+paramKey+ ": "+ getParameter(paramKey)); - return getParameter(paramKey); - } + /** + * Applet configuration parameters + * + * @param paramKey + * @return + */ + public String getMyAppletParameter(String paramKey) { + log.info("Getting parameter: " + paramKey + ": " + getParameter(paramKey)); + return getParameter(paramKey); + } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index f7b5fb2f..042c6a83 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -34,6 +34,8 @@ import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; import at.gv.egiz.smcc.SignatureCard; import at.gv.egiz.smcc.util.SMCCHelper; +import at.gv.egiz.stal.ErrorResponse; +import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.QuitRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; @@ -107,6 +109,8 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, gui.showWelcomeDialog(); try { stalPort = getSTALPort(); + + } catch (Exception e) { log.fatal("Failed to call STAL service.", e); actionCommandList.clear(); @@ -134,7 +138,26 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); log.info("Got " + resp.getRequest().size() + " requests from server."); List stalRequests = resp.getRequest(); - List responses = handleRequest(stalRequests); + boolean handle = true; + for (STALRequest request : stalRequests) { + if (request instanceof InfoboxReadRequest) { + InfoboxReadRequest infobx = (InfoboxReadRequest) request; + if (infobx.getInfoboxIdentifier().equals("IdentityLink")) { + if (infobx.getDomainIdentifier() == null) { + if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { + handle = false; + } + } + } + } + } + List responses; + if (handle) { + responses = handleRequest(stalRequests); + } else { + responses = new ArrayList(1); + responses.add(new ErrorResponse(6002)); + } log.info("Got " + responses.size() + " responses."); nextRequest = factory.createGetNextRequestType(); nextRequest.setSessionId(sessionId); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java index ab04d2b6..79c369a2 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java @@ -1,19 +1,19 @@ /* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /* * To change this template, choose Tools | Templates * and open the template in the editor. @@ -22,80 +22,139 @@ package at.gv.egiz.bku.online.applet; import java.io.IOException; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; +import java.net.InetAddress; +import java.net.Socket; +import java.net.UnknownHostException; +import java.security.cert.CertificateParsingException; import java.security.cert.X509Certificate; +import java.util.Collection; +import java.util.List; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLPeerUnverifiedException; +import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.X509TrustManager; - -public class InternalSSLSocketFactory { - - private SSLSocketFactory factory; - - public static SSLSocketFactory getSocketFactory() throws InternalSSLSocketFactoryException { - return new InternalSSLSocketFactory().factory; - } - - public static HostnameVerifier getHostNameVerifier() throws InternalSSLSocketFactoryException { - return (new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }); - } - - public InternalSSLSocketFactory() throws InternalSSLSocketFactoryException { - SSLContext sslContext; - try { - sslContext = SSLContext.getInstance("TLSv1"); - sslContext.getClientSessionContext().setSessionTimeout(0); - KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509"); - - KeyStore keyStore = KeyStore.getInstance("JKS"); - keyStore.load(null, null); - keyManagerFactory.init(keyStore, null); - - sslContext.init(keyManagerFactory.getKeyManagers(), - new X509TrustManager[] { new AcceptAllTrustManager() }, - null); - } catch (NoSuchAlgorithmException e) { - throw new InternalSSLSocketFactoryException(e); - } catch (CertificateException e) { - throw new InternalSSLSocketFactoryException(e); - } catch (IOException e) { - throw new InternalSSLSocketFactoryException(e); - } catch (KeyStoreException e) { - throw new InternalSSLSocketFactoryException(e); - } catch (UnrecoverableKeyException e) { - throw new InternalSSLSocketFactoryException(e); - } catch (KeyManagementException e) { - throw new InternalSSLSocketFactoryException(e); - } - - this.factory = sslContext.getSocketFactory(); - } - - class AcceptAllTrustManager implements X509TrustManager { - - public X509Certificate[] getAcceptedIssuers() { - return null; - } - - public void checkClientTrusted(X509Certificate[] chain, String authType) { - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) { - //FIXME - } - } -}; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class InternalSSLSocketFactory extends SSLSocketFactory { + + private static InternalSSLSocketFactory instance = new InternalSSLSocketFactory(); + + private final static Log log = LogFactory + .getLog(InternalSSLSocketFactory.class); + + private final static String GOV_DOMAIN = ".gv.at"; + + private SSLSocket sslSocket; + + private SSLSocketFactory proxy; + + private InternalSSLSocketFactory() { + proxy = HttpsURLConnection.getDefaultSSLSocketFactory(); + } + + public static InternalSSLSocketFactory getInstance() { + return instance; + } + + @Override + public Socket createSocket() throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(); + return sslSocket; + } + + @Override + public Socket createSocket(String arg0, int arg1) throws IOException, + UnknownHostException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1); + + return sslSocket; + } + + @Override + public Socket createSocket(InetAddress arg0, int arg1) throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1); + return sslSocket; + } + + @Override + public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3) + throws IOException, UnknownHostException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); + return sslSocket; + } + + @Override + public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2, + int arg3) throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); + return sslSocket; + } + + @Override + public Socket createSocket(Socket arg0, String arg1, int arg2, boolean arg3) + throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); + return sslSocket; + } + + @Override + public String[] getDefaultCipherSuites() { + return proxy.getDefaultCipherSuites(); + } + + @Override + public String[] getSupportedCipherSuites() { + return proxy.getSupportedCipherSuites(); + } + + public boolean isEgovAgency() { + log.info("Checking if server is egov agency"); + if (sslSocket != null) { + try { + X509Certificate cert = (X509Certificate) sslSocket.getSession() + .getPeerCertificates()[0]; + log.info("Server cert: " + cert); + return isGovAgency(cert); + } catch (SSLPeerUnverifiedException e) { + log.error(e); + return false; + } + } + log.info("Not a SSL connection"); + return false; + } + + public static boolean isGovAgency(X509Certificate cert) { + String[] rdns = (cert.getSubjectX500Principal().getName()).split(","); + for (String rdn : rdns) { + if (rdn.startsWith("CN=")) { + String dns = rdn.split("=")[1]; + if (dns.endsWith(GOV_DOMAIN)) { + return true; + } + } + } + try { + Collection> sanList = cert.getSubjectAlternativeNames(); + if (sanList != null) { + for (List san : sanList) { + if ((Integer) san.get(0) == 2) { + String dns = (String) san.get(1); + if (dns.endsWith(GOV_DOMAIN)) { + return true; + } + } + } + } + } catch (CertificateParsingException e) { + log.error(e); + } + if (cert.getExtensionValue("1.2.40.0.10.1.1.1") != null) { + return true; + } + return false; + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java deleted file mode 100644 index c620284a..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactoryException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package at.gv.egiz.bku.online.applet; - -/** - * - * @author mcentner - */ -public class InternalSSLSocketFactoryException extends Exception { - - public InternalSSLSocketFactoryException(Throwable cause) { - super(cause); - } - - public InternalSSLSocketFactoryException(String message, Throwable cause) { - super(message, cause); - } - - public InternalSSLSocketFactoryException(String message) { - super(message); - } - - public InternalSSLSocketFactoryException() { - } - -} -- cgit v1.2.3 From a3361b40aa8f92849c50db27e349e17b87bebb1e Mon Sep 17 00:00:00 2001 From: wbauer Date: Tue, 9 Sep 2008 12:40:52 +0000 Subject: improved security handling and added shutdown handler git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@27 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java index 79c369a2..fa3587e4 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java @@ -40,13 +40,13 @@ import org.apache.commons.logging.LogFactory; public class InternalSSLSocketFactory extends SSLSocketFactory { + private final static String GOV_DOMAIN = ".gv.at"; + private static InternalSSLSocketFactory instance = new InternalSSLSocketFactory(); private final static Log log = LogFactory .getLog(InternalSSLSocketFactory.class); - private final static String GOV_DOMAIN = ".gv.at"; - private SSLSocket sslSocket; private SSLSocketFactory proxy; -- cgit v1.2.3 From bdc1c691b571e55f6806d3ac9bc3dad4fcb2691d Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 10 Sep 2008 16:53:40 +0000 Subject: waitDialog git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@29 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 042c6a83..51ac243c 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -272,7 +272,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } break; case SMCCHelper.CARD_FOUND: - gui.showWelcomeDialog(); + gui.showWaitDialog(null); signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); return false; } -- cgit v1.2.3 From 3794536434fdbb06067eddcfd248898ce85f85a1 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 12 Sep 2008 13:06:34 +0000 Subject: gui 0.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@34 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 102 ++++++++++----------- 1 file changed, 49 insertions(+), 53 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 8289f30b..c7df0871 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -34,63 +34,59 @@ import at.gv.egiz.bku.gui.BKUGUIFactory; */ public class BKUApplet extends JApplet { - private static Log log = LogFactory.getLog(BKUApplet.class); + private static Log log = LogFactory.getLog(BKUApplet.class); + public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; + public final static String LOCALE_PARAM_KEY = "Locale"; + public final static String LOGO_URL_KEY = "LogoURL"; + public final static String WSDL_URL = "WSDL_URL"; + public final static String SESSION_ID = "SessionID"; + protected ResourceBundle resourceBundle; + protected BKUWorker worker; + protected Thread workerThread; - public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; + public BKUApplet() { + } - public final static String LOCALE_PARAM_KEY = "Locale"; - public final static String LOGO_URL_KEY = "LogoURL"; - public final static String WSDL_URL = "WSDL_URL"; - public final static String SESSION_ID = "SessionID"; + public void init() { + log.debug("Called init()"); + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); + String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); + if (localeString != null) { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, + new Locale(localeString)); + } else { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); + } + BKUGUIFacade gui = BKUGUIFactory.createGUI(); + gui.init(getContentPane(), localeString); + worker = new BKUWorker(gui, this, resourceBundle); + } - protected ResourceBundle resourceBundle; - protected BKUWorker worker; - protected Thread workerThread; + public void start() { + log.debug("Called start()"); + workerThread = new Thread(worker); + workerThread.start(); + } - public BKUApplet() { - } + public void stop() { + log.debug("Called stop()"); + if ((workerThread != null) && (workerThread.isAlive())) { + workerThread.interrupt(); + } + } - public void init() { - log.debug("Called init()"); - HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory - .getInstance()); - String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); - if (localeString != null) { - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, - new Locale(localeString)); - } else { - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); - } - BKUGUIFacade gui = BKUGUIFactory.createGUI(); - gui.init(getContentPane(), localeString); - worker = new BKUWorker(gui, this, resourceBundle); - } + public void destroy() { + log.debug("Called destroy()"); + } - public void start() { - log.debug("Called start()"); - workerThread = new Thread(worker); - workerThread.start(); - } - - public void stop() { - log.debug("Called stop()"); - if ((workerThread != null) && (workerThread.isAlive())) { - workerThread.interrupt(); - } - } - - public void destroy() { - log.debug("Called destroy()"); - } - - /** - * Applet configuration parameters - * - * @param paramKey - * @return - */ - public String getMyAppletParameter(String paramKey) { - log.info("Getting parameter: " + paramKey + ": " + getParameter(paramKey)); - return getParameter(paramKey); - } + /** + * Applet configuration parameters + * + * @param paramKey + * @return + */ + public String getMyAppletParameter(String paramKey) { + log.info("Getting parameter: " + paramKey + ": " + getParameter(paramKey)); + return getParameter(paramKey); + } } -- cgit v1.2.3 From 0df8bb10302989f41ed420ec0ff29b2fc2005471 Mon Sep 17 00:00:00 2001 From: wbauer Date: Mon, 15 Sep 2008 14:18:53 +0000 Subject: Migrated BKULocal to BKUCommonGUI and minor bug fixes git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@37 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 51ac243c..cd96a481 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -75,6 +75,17 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, addRequestHandler(QuitRequest.class, this); //register SignRequestHandler once we have a webservice port } + + /** + * Used for non applet variants + * @param gui + * @param errorMessageBundle + */ + protected BKUWorker(BKUGUIFacade gui, ResourceBundle errorMessageBundle) { + this.gui = gui; + this.errorMessages = errorMessageBundle; + addRequestHandler(QuitRequest.class, this); + } private STALPortType getSTALPort() throws MalformedURLException { URL wsdlURL = null; -- cgit v1.2.3 From 677bff2bdb7b2cb327930f0596d5f3133363295c Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 15 Sep 2008 18:00:30 +0000 Subject: encoding git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@38 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java index f9965240..5186de1a 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java @@ -74,11 +74,12 @@ public class WSSignRequestHandler extends SignRequestHandler { byte[] hdi = reference.getValue(); String id = reference.getID(); String mimeType = reference.getMimeType(); + String encoding = reference.getEncoding(); if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + id + " (" + mimeType + ")"); + log.debug("Got HashDataInput " + id + " (" + mimeType + ";" + encoding + ")"); } - hashDataInputs.add(new ByteArrayHashDataInput(hdi, id, mimeType)); + hashDataInputs.add(new ByteArrayHashDataInput(hdi, id, mimeType, encoding)); } return hashDataInputs; } -- cgit v1.2.3 From cf82096145bbdd548e388c1bc25f0e703b9b4624 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 17 Sep 2008 17:17:10 +0000 Subject: hashdatainput digest verification git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@44 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../bku/online/applet/WSSignRequestHandler.java | 139 ++++++++++++++------- 1 file changed, 94 insertions(+), 45 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java index 5186de1a..6dae264c 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java @@ -16,15 +16,20 @@ */ package at.gv.egiz.bku.online.applet; -import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.impl.ByteArrayHashDataInput; import at.gv.egiz.stal.service.GetHashDataInputResponseType; import at.gv.egiz.stal.service.GetHashDataInputType; import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.signedinfo.DigestMethodType; import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.security.DigestException; +import java.security.MessageDigest; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -35,57 +40,101 @@ import org.apache.commons.logging.LogFactory; */ public class WSSignRequestHandler extends SignRequestHandler { - private static final Log log = LogFactory.getLog(WSSignRequestHandler.class); - STALPortType stalPort; - String sessId; + private static final Log log = LogFactory.getLog(WSSignRequestHandler.class); + STALPortType stalPort; + String sessId; - public WSSignRequestHandler(String sessId, STALPortType stalPort) { - if (stalPort == null || sessId == null) { - throw new NullPointerException("STAL port must not be null"); - } - this.sessId = sessId; - this.stalPort = stalPort; + public WSSignRequestHandler(String sessId, STALPortType stalPort) { + if (stalPort == null || sessId == null) { + throw new NullPointerException("STAL port must not be null"); } + this.sessId = sessId; + this.stalPort = stalPort; + } - @Override - protected List getHashDataInputs(List dsigReferences) throws Exception { - GetHashDataInputType request = new GetHashDataInputType(); - request.setSessionId(sessId); - for (ReferenceType dsigRef : dsigReferences) { - //don't get Manifest, QualifyingProperties, ... - if (dsigRef.getType() == null) { - String dsigRefId = dsigRef.getId(); - if (dsigRefId != null) { - GetHashDataInputType.Reference reference = new GetHashDataInputType.Reference(); - reference.setID(dsigRefId); - request.getReference().add(reference); - } else { - throw new Exception("Cannot get HashDataInput for dsig:Reference without Id attribute"); - } - } - } + @Override + public List getCashedHashDataInputs(List signedReferences) throws Exception { - if (log.isDebugEnabled()) { - log.debug("Calling GetHashDataInput for session " + sessId); - } - GetHashDataInputResponseType response = stalPort.getHashDataInput(request); - ArrayList hashDataInputs = new ArrayList(); - for (GetHashDataInputResponseType.Reference reference : response.getReference()) { - byte[] hdi = reference.getValue(); - String id = reference.getID(); - String mimeType = reference.getMimeType(); - String encoding = reference.getEncoding(); + GetHashDataInputType request = new GetHashDataInputType(); + request.setSessionId(sessId); + + HashMap idRefMap = new HashMap(); + for (ReferenceType reference : signedReferences) { + //don't get Manifest, QualifyingProperties, ... + if (reference.getType() == null) { + String referenceId = reference.getId(); + if (referenceId != null) { + idRefMap.put(referenceId, reference); + GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); + ref.setID(referenceId); + request.getReference().add(ref); - if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + id + " (" + mimeType + ";" + encoding + ")"); - } - hashDataInputs.add(new ByteArrayHashDataInput(hdi, id, mimeType, encoding)); + } else { + throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); } - return hashDataInputs; + } } - @Override - public SMCCSTALRequestHandler newInstance() { - return new WSSignRequestHandler(this.sessId, this.stalPort); + if (log.isDebugEnabled()) { + log.debug("Calling GetHashDataInput for session " + sessId); } + GetHashDataInputResponseType response = stalPort.getHashDataInput(request); + ArrayList hashDataInputs = new ArrayList(); + + for (GetHashDataInputResponseType.Reference reference : response.getReference()) { + + String id = reference.getID(); + byte[] hdi = reference.getValue(); + if (hdi == null) { + throw new Exception("Failed to resolve digest value for reference " + id); + } + String mimeType = reference.getMimeType(); + String encoding = reference.getEncoding(); + + if (log.isDebugEnabled()) { + log.debug("Got HashDataInput " + id + " (" + mimeType + ";" + encoding + ")"); + } + + ReferenceType dsigRef = idRefMap.get(id); + DigestMethodType dm = dsigRef.getDigestMethod(); + if (dm == null) { + throw new Exception("Failed to verify digest value for reference " + id + ": no digest algorithm"); + } + //TODO + String mdAlg = dm.getAlgorithm(); + if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) + mdAlg = "SHA-1"; + else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) + mdAlg = "SHA-256"; + else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg)) + mdAlg = "SHA-224"; + else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg)) + mdAlg = "SHA-224"; + else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) + mdAlg = "SHA-384"; + else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) + mdAlg = "SHA-512"; + else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) + mdAlg = "MD2"; + else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) + mdAlg = "MD5"; + else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) + mdAlg = "RipeMD-160"; + MessageDigest md = MessageDigest.getInstance(mdAlg); + byte[] hdiDigest = md.digest(hdi); + if (log.isDebugEnabled()) + log.debug("Comparing digest values... "); + if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) { + log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue())); + throw new DigestException("Bad digest value for reference " + id + ": " + dsigRef.getDigestValue()); + } + hashDataInputs.add(new ByteArrayHashDataInput(hdi, id, mimeType, encoding)); + } + return hashDataInputs; + } + + @Override + public SMCCSTALRequestHandler newInstance() { + return new WSSignRequestHandler(this.sessId, this.stalPort); + } } -- cgit v1.2.3 From 03f5ae9e9068168b294c042d68a58637e71a54ee Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 23 Sep 2008 14:09:02 +0000 Subject: bitte warten... git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@59 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index cd96a481..465bde78 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -283,7 +283,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } break; case SMCCHelper.CARD_FOUND: - gui.showWaitDialog(null); +// gui.showWaitDialog(null); signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); return false; } -- cgit v1.2.3 From 0168154a4a0777fd7ae2bc3a097c12b33781d75a Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 24 Sep 2008 13:08:04 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@61 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 1 + BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index c7df0871..34dd9bbd 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -48,6 +48,7 @@ public class BKUApplet extends JApplet { } public void init() { + log.info("Welcome to MOCCA\n"); log.debug("Called init()"); HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 465bde78..8190e5ec 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -175,7 +175,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, nextRequest.getResponse().addAll(responses); } while (!finished); log.info("Done " + Thread.currentThread().getName()); - gui.showWelcomeDialog(); +// gui.showWelcomeDialog(); sendRedirect(); } -- cgit v1.2.3 From afa2741d7257ee3e98f400e211d96f584c4ef778 Mon Sep 17 00:00:00 2001 From: wbauer Date: Fri, 26 Sep 2008 13:36:57 +0000 Subject: added error dialog for unexpected internal errors git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@74 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 131 +++++++++++---------- 1 file changed, 70 insertions(+), 61 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 8190e5ec..35fe652f 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -1,19 +1,19 @@ /* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package at.gv.egiz.bku.online.applet; import java.awt.event.ActionEvent; @@ -73,11 +73,12 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, this.parent = parent; this.errorMessages = errorMessageBundle; addRequestHandler(QuitRequest.class, this); - //register SignRequestHandler once we have a webservice port + // register SignRequestHandler once we have a webservice port } - + /** * Used for non applet variants + * * @param gui * @param errorMessageBundle */ @@ -96,7 +97,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, try { if (codebase.getProtocol().equalsIgnoreCase("file")) { // for debugging in appletrunner - wsdlURL = new URL(wsdlLocation); + wsdlURL = new URL(wsdlLocation); } else { wsdlURL = new URL(codebase, wsdlLocation); } @@ -120,8 +121,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, gui.showWelcomeDialog(); try { stalPort = getSTALPort(); - - + } catch (Exception e) { log.fatal("Failed to call STAL service.", e); actionCommandList.clear(); @@ -134,48 +134,57 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } return; } + try { + ObjectFactory factory = new ObjectFactory(); + GetNextRequestType nextRequest = factory.createGetNextRequestType(); - ObjectFactory factory = new ObjectFactory(); - GetNextRequestType nextRequest = factory.createGetNextRequestType(); - - String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); - if (sessionId == null) { - // use the testsession for testing - sessionId = "TestSession"; - } - nextRequest.setSessionId(sessionId); - addRequestHandler(SignRequest.class, new WSSignRequestHandler(sessionId, stalPort)); - do { - GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); - log.info("Got " + resp.getRequest().size() + " requests from server."); - List stalRequests = resp.getRequest(); - boolean handle = true; - for (STALRequest request : stalRequests) { - if (request instanceof InfoboxReadRequest) { - InfoboxReadRequest infobx = (InfoboxReadRequest) request; - if (infobx.getInfoboxIdentifier().equals("IdentityLink")) { - if (infobx.getDomainIdentifier() == null) { - if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { - handle = false; - } - } - } - } - } - List responses; - if (handle) { - responses = handleRequest(stalRequests); - } else { - responses = new ArrayList(1); - responses.add(new ErrorResponse(6002)); + String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); + if (sessionId == null) { + // use the testsession for testing + sessionId = "TestSession"; } - log.info("Got " + responses.size() + " responses."); - nextRequest = factory.createGetNextRequestType(); nextRequest.setSessionId(sessionId); - nextRequest.getResponse().addAll(responses); - } while (!finished); - log.info("Done " + Thread.currentThread().getName()); -// gui.showWelcomeDialog(); + addRequestHandler(SignRequest.class, new WSSignRequestHandler(sessionId, + stalPort)); + do { + GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); + log.info("Got " + resp.getRequest().size() + " requests from server."); + List stalRequests = resp.getRequest(); + boolean handle = true; + for (STALRequest request : stalRequests) { + if (request instanceof InfoboxReadRequest) { + InfoboxReadRequest infobx = (InfoboxReadRequest) request; + if (infobx.getInfoboxIdentifier().equals("IdentityLink")) { + if (infobx.getDomainIdentifier() == null) { + if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { + handle = false; + } + } + } + } + } + List responses; + if (handle) { + responses = handleRequest(stalRequests); + } else { + responses = new ArrayList(1); + responses.add(new ErrorResponse(6002)); + } + log.info("Got " + responses.size() + " responses."); + nextRequest = factory.createGetNextRequestType(); + nextRequest.setSessionId(sessionId); + nextRequest.getResponse().addAll(responses); + } while (!finished); + log.info("Done " + Thread.currentThread().getName()); + // gui.showWelcomeDialog(); + } catch (Exception ex) { + gui.showErrorDialog("Sorry, an internal error occured: " + ex.getMessage()); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + } sendRedirect(); } @@ -187,7 +196,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, URL url = null; if (redirectURL != null) { try { - url = new URL(parent.getCodeBase(),redirectURL + ";jsessionid=" + url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); } catch (MalformedURLException ex) { log.warn("Parameter 'redirectURL': " + redirectURL @@ -283,7 +292,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } break; case SMCCHelper.CARD_FOUND: -// gui.showWaitDialog(null); + // gui.showWaitDialog(null); signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); return false; } -- cgit v1.2.3 From d0879e9058943c6afa1912ccbeae936db2811f26 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 30 Sep 2008 13:54:54 +0000 Subject: backport to JAXWS2.0 STALService initial connect() git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@76 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 189 ++++++++++++--------- .../bku/online/applet/WSSignRequestHandler.java | 4 +- .../at/gv/egiz/stal/client/STALServiceTest.java | 20 ++- 3 files changed, 119 insertions(+), 94 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 35fe652f..a87b04c4 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -34,23 +34,23 @@ import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; import at.gv.egiz.smcc.SignatureCard; import at.gv.egiz.smcc.util.SMCCHelper; -import at.gv.egiz.stal.ErrorResponse; -import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.QuitRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; -import at.gv.egiz.stal.SignRequest; -import at.gv.egiz.stal.service.GetNextRequestResponseType; -import at.gv.egiz.stal.service.GetNextRequestType; -import at.gv.egiz.stal.service.ObjectFactory; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; +import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; +import at.gv.egiz.stal.service.types.ErrorResponseType; +import at.gv.egiz.stal.service.types.RequestType; +import at.gv.egiz.stal.service.types.ResponseType; +import at.gv.egiz.stal.util.STALTranslator; public class BKUWorker extends AbstractSMCCSTAL implements Runnable, - ActionListener, SMCCSTALRequestHandler { + ActionListener, SMCCSTALRequestHandler { private static Log log = LogFactory.getLog(BKUWorker.class); - protected BKUGUIFacade gui; protected BKUApplet parent; private STALPortType stalPort; @@ -65,7 +65,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, * must not be null */ public BKUWorker(BKUGUIFacade gui, BKUApplet parent, - ResourceBundle errorMessageBundle) { + ResourceBundle errorMessageBundle) { if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { throw new NullPointerException("Parameter must not be set to null"); } @@ -73,7 +73,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, this.parent = parent; this.errorMessages = errorMessageBundle; addRequestHandler(QuitRequest.class, this); - // register SignRequestHandler once we have a webservice port + // register SignRequestHandler once we have a webservice port } /** @@ -111,7 +111,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } log.debug("Found WSDL url: " + wsdlURL); QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", - "STALService"); + "STALService"); STALService stal = new STALService(wsdlURL, endpointName); return stal.getSTALPort(); } @@ -135,49 +135,75 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, return; } try { - ObjectFactory factory = new ObjectFactory(); - GetNextRequestType nextRequest = factory.createGetNextRequestType(); - String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); if (sessionId == null) { // use the testsession for testing sessionId = "TestSession"; } - nextRequest.setSessionId(sessionId); - addRequestHandler(SignRequest.class, new WSSignRequestHandler(sessionId, - stalPort)); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WSSignRequestHandler(sessionId, stalPort)); + + ObjectFactory of = new ObjectFactory(); + GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); do { - GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); - log.info("Got " + resp.getRequest().size() + " requests from server."); - List stalRequests = resp.getRequest(); + List requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); + List stalRequests = STALTranslator.translateRequests(requests); + + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder("Received "); + sb.append(stalRequests.size()); + sb.append(" STAL requests: "); + for (STALRequest r : stalRequests) { + sb.append(r.getClass()); + sb.append(' '); + } + log.info(sb.toString()); + } + boolean handle = true; for (STALRequest request : stalRequests) { - if (request instanceof InfoboxReadRequest) { - InfoboxReadRequest infobx = (InfoboxReadRequest) request; - if (infobx.getInfoboxIdentifier().equals("IdentityLink")) { - if (infobx.getDomainIdentifier() == null) { - if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { - handle = false; - } + if (request instanceof at.gv.egiz.stal.InfoboxReadRequest) { + at.gv.egiz.stal.InfoboxReadRequest r = (at.gv.egiz.stal.InfoboxReadRequest) request; + String infoboxId = r.getInfoboxIdentifier(); + String domainId = r.getDomainIdentifier(); + if ("IdentityLink".equals(infoboxId) && domainId == null) { + if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { + handle = false; } } } } - List responses; + + List responses; if (handle) { - responses = handleRequest(stalRequests); + List stalResponses = handleRequest(stalRequests); + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder(stalResponses.size()); + sb.append(" STAL responses: "); + for (STALResponse r : stalResponses) { + sb.append(r.getClass()); + sb.append(' '); + } + log.info(sb.toString()); + } + responses = STALTranslator.fromSTAL(stalResponses); } else { - responses = new ArrayList(1); - responses.add(new ErrorResponse(6002)); + responses = new ArrayList(1); + ErrorResponseType err = new ErrorResponseType(); + err.setErrorCode(6002); +// err.setErrorMessage(); + responses.add(err); + } + + if (!finished) { + GetNextRequestType nextRequest = of.createGetNextRequestType(); + nextRequest.setSessionId(sessionId); + nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); + nextRequestResp = stalPort.getNextRequest(nextRequest); } - log.info("Got " + responses.size() + " responses."); - nextRequest = factory.createGetNextRequestType(); - nextRequest.setSessionId(sessionId); - nextRequest.getResponse().addAll(responses); } while (!finished); log.info("Done " + Thread.currentThread().getName()); - // gui.showWelcomeDialog(); } catch (Exception ex) { + log.error(ex.getMessage(), ex); gui.showErrorDialog("Sorry, an internal error occured: " + ex.getMessage()); try { waitForAction(); @@ -196,20 +222,17 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, URL url = null; if (redirectURL != null) { try { - url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" - + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); + url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); } catch (MalformedURLException ex) { - log.warn("Parameter 'redirectURL': " + redirectURL - + " not a valid URL.", ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) + log.warn("Parameter 'redirectURL': " + redirectURL + " not a valid URL.", ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) } if (url != null) { if (redirectTarget == null) { log.info("Done. Trying to redirect to " + url + " ..."); parent.getAppletContext().showDocument(url); } else { - log.info("Done. Trying to redirect to " + url + " (target=" - + redirectTarget + ") ..."); + log.info("Done. Trying to redirect to " + url + " (target=" + redirectTarget + ") ..."); parent.getAppletContext().showDocument(url, redirectTarget); } } @@ -253,48 +276,48 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, int oldValue = SMCCHelper.PC_SC_NOT_SUPPORTED; // this is a save default while ((signatureCard == null) && (!actionPerformed)) { switch (smccHelper.getResultCode()) { - case SMCCHelper.PC_SC_NOT_SUPPORTED: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, - "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.TERMINAL_NOT_PRESENT: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, - "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.CARD_NOT_SUPPORTED: - if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { + case SMCCHelper.PC_SC_NOT_SUPPORTED: actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showCardNotSupportedDialog(this, "cancel"); - oldValue = SMCCHelper.CARD_NOT_SUPPORTED; - } - break; - case SMCCHelper.NO_CARD: - if (oldValue != SMCCHelper.NO_CARD) { + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.TERMINAL_NOT_PRESENT: actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showInsertCardDialog(this, "cancel"); - oldValue = SMCCHelper.NO_CARD; - } - break; - case SMCCHelper.CARD_FOUND: - // gui.showWaitDialog(null); - signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); - return false; + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.CARD_NOT_SUPPORTED: + if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showCardNotSupportedDialog(this, "cancel"); + oldValue = SMCCHelper.CARD_NOT_SUPPORTED; + } + break; + case SMCCHelper.NO_CARD: + if (oldValue != SMCCHelper.NO_CARD) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showInsertCardDialog(this, "cancel"); + oldValue = SMCCHelper.NO_CARD; + } + break; + case SMCCHelper.CARD_FOUND: + // gui.showWaitDialog(null); + signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); + return false; } smccHelper.update(3000); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java index 6dae264c..5f422164 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java @@ -20,9 +20,9 @@ import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; import at.gv.egiz.bku.smccstal.SignRequestHandler; import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.impl.ByteArrayHashDataInput; -import at.gv.egiz.stal.service.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.GetHashDataInputType; import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; import at.gv.egiz.stal.signedinfo.DigestMethodType; import at.gv.egiz.stal.signedinfo.ReferenceType; import java.security.DigestException; diff --git a/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java index 9b58798d..63da8225 100644 --- a/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java +++ b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java @@ -33,12 +33,14 @@ import org.junit.Test; import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.service.GetHashDataInputFault; -import at.gv.egiz.stal.service.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.GetHashDataInputType; -import at.gv.egiz.stal.service.GetNextRequestResponseType; -import at.gv.egiz.stal.service.GetNextRequestType; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; +import at.gv.egiz.stal.service.types.InfoboxReadRequestType; +import at.gv.egiz.stal.service.types.RequestType; /** * @@ -60,11 +62,11 @@ public class STALServiceTest { // req.getResponse().add(new ErrorResponse(1234)); GetNextRequestResponseType nrResp = port.getNextRequest(nrReq); assertNotNull(nrResp); - System.out.println("got response: " + nrResp.getRequest().size()); - for (STALRequest stalReq : nrResp.getRequest()) { - if (stalReq instanceof InfoboxReadRequest) { - String ibid = ((InfoboxReadRequest) stalReq).getInfoboxIdentifier(); - String did = ((InfoboxReadRequest) stalReq).getDomainIdentifier(); + System.out.println("got response: " + nrResp.getInfoboxReadRequestOrSignRequestOrQuitRequest().size()); + for (RequestType stalReq : nrResp.getInfoboxReadRequestOrSignRequestOrQuitRequest()) { + if (stalReq instanceof InfoboxReadRequestType) { + String ibid = ((InfoboxReadRequestType) stalReq).getInfoboxIdentifier(); + String did = ((InfoboxReadRequestType) stalReq).getDomainIdentifier(); System.out.println(" received InfoboxReadRequest for " + ibid + ", " + did); } else { System.out.println(" received STAL request " + stalReq.getClass().getName()); -- cgit v1.2.3 From 8ccd9ab69dc74762567930f4c576a359502f1071 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 30 Sep 2008 16:37:59 +0000 Subject: showErrorDialog l10n git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@77 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index a87b04c4..12eb9d00 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -126,7 +126,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, log.fatal("Failed to call STAL service.", e); actionCommandList.clear(); actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("failed.WS")); + gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, new Object[] {e.getMessage()}); try { waitForAction(); } catch (InterruptedException e1) { @@ -204,7 +204,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, log.info("Done " + Thread.currentThread().getName()); } catch (Exception ex) { log.error(ex.getMessage(), ex); - gui.showErrorDialog("Sorry, an internal error occured: " + ex.getMessage()); + gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {ex.getMessage()}); try { waitForAction(); } catch (InterruptedException e) { @@ -279,8 +279,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, case SMCCHelper.PC_SC_NOT_SUPPORTED: actionCommandList.clear(); actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, - "ok"); + gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, this, "ok"); try { waitForAction(); } catch (InterruptedException e) { @@ -290,8 +289,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, case SMCCHelper.TERMINAL_NOT_PRESENT: actionCommandList.clear(); actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, - "ok"); + gui.showErrorDialog(BKUGUIFacade.ERR_NO_CARDTERMINAL,null,this,"ok"); try { waitForAction(); } catch (InterruptedException e) { -- cgit v1.2.3 From 35364f7492308692bd690c17f5527f4157eb583a Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 7 Oct 2008 17:59:28 +0000 Subject: hashdata digest git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@82 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../bku/online/applet/WSSignRequestHandler.java | 60 ++++++++++++++++------ BKUApplet/src/main/resources/simplelog.properties | 2 +- 2 files changed, 45 insertions(+), 17 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java index 5f422164..3a36a290 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java @@ -31,6 +31,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; +import java.util.Map.Entry; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -58,15 +59,18 @@ public class WSSignRequestHandler extends SignRequestHandler { GetHashDataInputType request = new GetHashDataInputType(); request.setSessionId(sessId); - HashMap idRefMap = new HashMap(); - for (ReferenceType reference : signedReferences) { + HashMap idSignedRefMap = new HashMap(); + for (ReferenceType signedRef : signedReferences) { //don't get Manifest, QualifyingProperties, ... - if (reference.getType() == null) { - String referenceId = reference.getId(); - if (referenceId != null) { - idRefMap.put(referenceId, reference); + if (signedRef.getType() == null) { + String signedRefId = signedRef.getId(); + if (signedRefId != null) { + if (log.isTraceEnabled()) { + log.trace("requesting hashdata input for reference " + signedRefId); + } + idSignedRefMap.put(signedRefId, signedRef); GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); - ref.setID(referenceId); + ref.setID(signedRefId); request.getReference().add(ref); } else { @@ -76,31 +80,52 @@ public class WSSignRequestHandler extends SignRequestHandler { } if (log.isDebugEnabled()) { - log.debug("Calling GetHashDataInput for session " + sessId); + log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); } GetHashDataInputResponseType response = stalPort.getHashDataInput(request); ArrayList hashDataInputs = new ArrayList(); + //hashdata inputs returned from service + HashMap idRefMap = new HashMap(); for (GetHashDataInputResponseType.Reference reference : response.getReference()) { - String id = reference.getID(); byte[] hdi = reference.getValue(); if (hdi == null) { - throw new Exception("Failed to resolve digest value for reference " + id); + throw new Exception("Did not receive hashdata input for reference " + id); + } + idRefMap.put(id, reference); + } + + for (String signedRefId : idSignedRefMap.keySet()) { + log.info("validating hashdata input for reference " + signedRefId); + + GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId); + if (reference == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); } + +// } +// +// for (GetHashDataInputResponseType.Reference reference : response.getReference()) { +// +// String id = reference.getID(); + byte[] hdi = reference.getValue(); String mimeType = reference.getMimeType(); String encoding = reference.getEncoding(); + if (hdi == null) { + throw new Exception("No hashdata input provided for reference " + signedRefId); + } if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + id + " (" + mimeType + ";" + encoding + ")"); + log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); } - ReferenceType dsigRef = idRefMap.get(id); + ReferenceType dsigRef = idSignedRefMap.get(signedRefId); DigestMethodType dm = dsigRef.getDigestMethod(); + if (dm == null) { - throw new Exception("Failed to verify digest value for reference " + id + ": no digest algorithm"); + throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); } - //TODO String mdAlg = dm.getAlgorithm(); if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) mdAlg = "SHA-1"; @@ -120,15 +145,18 @@ public class WSSignRequestHandler extends SignRequestHandler { mdAlg = "MD5"; else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) mdAlg = "RipeMD-160"; + else { + throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg); + } MessageDigest md = MessageDigest.getInstance(mdAlg); byte[] hdiDigest = md.digest(hdi); if (log.isDebugEnabled()) log.debug("Comparing digest values... "); if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) { log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue())); - throw new DigestException("Bad digest value for reference " + id + ": " + dsigRef.getDigestValue()); + throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue())); } - hashDataInputs.add(new ByteArrayHashDataInput(hdi, id, mimeType, encoding)); + hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); } return hashDataInputs; } diff --git a/BKUApplet/src/main/resources/simplelog.properties b/BKUApplet/src/main/resources/simplelog.properties index d62508cf..51be76a8 100644 --- a/BKUApplet/src/main/resources/simplelog.properties +++ b/BKUApplet/src/main/resources/simplelog.properties @@ -15,7 +15,7 @@ # Logging detail level, # Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). -org.apache.commons.logging.simplelog.defaultlog=debug +org.apache.commons.logging.simplelog.defaultlog=trace # Logs the Log instance used org.apache.commons.logging.simplelog.showlogname=true #Logs the class name with package(or Path) -- cgit v1.2.3 From d7a3b8fdb62c881afb87838f2bb03b4c4b58e16d Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 8 Oct 2008 15:59:43 +0000 Subject: simpleGUI (header,chipperling removed) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@87 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 30 ++++++++++++++++++++++++---- BKUApplet/src/test/resources/appletTest.html | 29 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 BKUApplet/src/test/resources/appletTest.html (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 35672e51..130749c5 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -1,6 +1,5 @@ - + bku at.gv.egiz @@ -11,7 +10,6 @@ BKUApplet BKU Applet 1.0-SNAPSHOT - @@ -81,6 +79,30 @@ true + + maven-dependency-plugin + + + copytestlibs + + copy + + + + + commons-logging + commons-logging + + + iaik + iaik_jce_me4se + + + ${project.build.directory}/test-libs + + + + @@ -114,4 +136,4 @@ commons-logging - \ No newline at end of file + diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html new file mode 100644 index 00000000..3b944a40 --- /dev/null +++ b/BKUApplet/src/test/resources/appletTest.html @@ -0,0 +1,29 @@ + + + +
+ + + + + +
+ + \ No newline at end of file -- cgit v1.2.3 From a8d050168ad30c59087d9b8f7b399f0ffbb671d8 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 9 Oct 2008 07:54:29 +0000 Subject: SimpleGUI (one button) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@88 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/test/resources/appletTest.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 3b944a40..5b10d6b5 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -19,7 +19,7 @@
+ width=190 height=130> -- cgit v1.2.3 From f993d336e51b9f7898aeeff2e5ae6785066d1e5b Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 9 Oct 2008 16:23:52 +0000 Subject: demo integration beta1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@94 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/hs_err_pid32072.log | 453 +++++++++++++++++++++ .../at/gv/egiz/bku/online/applet/BKUApplet.java | 17 +- 2 files changed, 469 insertions(+), 1 deletion(-) create mode 100644 BKUApplet/hs_err_pid32072.log (limited to 'BKUApplet') diff --git a/BKUApplet/hs_err_pid32072.log b/BKUApplet/hs_err_pid32072.log new file mode 100644 index 00000000..cf86d1c5 --- /dev/null +++ b/BKUApplet/hs_err_pid32072.log @@ -0,0 +1,453 @@ +# +# An unexpected error has been detected by Java Runtime Environment: +# +# SIGBUS (0x7) at pc=0xb7bcbc53, pid=32072, tid=3033660304 +# +# Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode, sharing linux-x86) +# Problematic frame: +# C [libzip.so+0xbc53] +# +# If you would like to submit a bug report, please visit: +# http://java.sun.com/webapps/bugreport/crash.jsp +# The crash happened outside the Java Virtual Machine in native code. +# See problematic frame for where to report the bug. +# + +--------------- T H R E A D --------------- + +Current thread (0xb4faa400): JavaThread "Thread-2" [_thread_in_native, id=32091, stack(0xb4ccf000,0xb4d20000)] + +siginfo:si_signo=SIGBUS: si_errno=0, si_code=2 (BUS_ADRERR), si_addr=0xb5804fc0 + +Registers: +EAX=0x080576a8, EBX=0xb7bd07bc, ECX=0xb5803000, EDX=0x0002d000 +ESP=0xb4d1dc10, EBP=0xb4d1dc38, ESI=0xb5804fa3, EDI=0x0839b310 +EIP=0xb7bcbc53, CR2=0xb5804fc0, EFLAGS=0x00210286 + +Top of Stack: (sp=0xb4d1dc10) +0xb4d1dc10: 00000030 b4fa9370 b4fa9378 b4fa9764 +0xb4d1dc20: 08057568 08057568 b7bcbc0b b7bd07bc +0xb4d1dc30: 0828f3cc 00000000 b4d1dc68 b7bcc00b +0xb4d1dc40: 080576a8 0828f3cc 00000000 00000000 +0xb4d1dc50: b4faa400 00000004 87c67713 b7bd07bc +0xb4d1dc60: b4d1dcb0 b4faa4f4 b4d1e0d8 b7bc31b9 +0xb4d1dc70: 080576a8 b4d1dcb0 00000025 00000025 +0xb4d1dc80: b4d1dcb0 6c706d69 49554765 2e303124 + +Instructions: (pc=0xb7bcbc53) +0xb7bcbc43: 8b 70 04 8b 45 08 8b 48 10 8b 50 1c 01 ce 29 d6 +0xb7bcbc53: 0f b6 46 1d 0f b6 56 1c c1 e0 08 09 c2 89 55 f0 + +Stack: [0xb4ccf000,0xb4d20000], sp=0xb4d1dc10, free space=315k +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +C [libzip.so+0xbc53] +C [libzip.so+0xc00b] ZIP_GetEntry+0x10b +C [libzip.so+0x31b9] Java_java_util_zip_ZipFile_getEntry+0xc9 +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +J sun.misc.URLClassPath$JarLoader.getResource(Ljava/lang/String;Z)Lsun/misc/Resource; +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::StubRoutines (1) +V [libjvm.so+0x21c5cd] +V [libjvm.so+0x310748] +V [libjvm.so+0x21c460] +V [libjvm.so+0x272313] +C [libjava.so+0xaa5c] Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2+0x3c +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::StubRoutines (1) +V [libjvm.so+0x21c5cd] +V [libjvm.so+0x310748] +V [libjvm.so+0x21c0f1] +V [libjvm.so+0x21c1da] +V [libjvm.so+0x375867] +V [libjvm.so+0x374305] +V [libjvm.so+0x373377] +V [libjvm.so+0x373082] +V [libjvm.so+0x1bc043] +V [libjvm.so+0x20c8e6] +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::StubRoutines (1) +V [libjvm.so+0x21c5cd] +V [libjvm.so+0x310748] +V [libjvm.so+0x21bee0] +V [libjvm.so+0x21bf6d] +V [libjvm.so+0x28c175] +V [libjvm.so+0x391f8d] +V [libjvm.so+0x3113f9] +C [libpthread.so.0+0x54fb] + +Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +J sun.misc.URLClassPath$JarLoader.getResource(Ljava/lang/String;Z)Lsun/misc/Resource; +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::StubRoutines (1) +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::StubRoutines (1) +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::Interpreter +v ~BufferBlob::StubRoutines (1) + +--------------- P R O C E S S --------------- + +Java Threads: ( => current thread ) + 0xb5702400 JavaThread "Thread-3" [_thread_blocked, id=32217, stack(0xb4c7e000,0xb4ccf000)] +=>0xb4faa400 JavaThread "Thread-2" [_thread_in_native, id=32091, stack(0xb4ccf000,0xb4d20000)] + 0x0828e400 JavaThread "AWT-EventQueue-1" [_thread_blocked, id=32089, stack(0xb4eaf000,0xb4f00000)] + 0xb57b9400 JavaThread "TimerQueue" daemon [_thread_blocked, id=32088, stack(0xb4dd5000,0xb4e26000)] + 0xb4f8a400 JavaThread "DestroyJavaVM" [_thread_blocked, id=32073, stack(0xb7c43000,0xb7c94000)] + 0xb57a1400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=32086, stack(0xb507f000,0xb50d0000)] + 0xb57a0800 JavaThread "AWT-Shutdown" [_thread_blocked, id=32085, stack(0xb50d0000,0xb5121000)] + 0xb5792000 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=32082, stack(0xb520c000,0xb525d000)] + 0xb5751000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=32081, stack(0xb5285000,0xb52d6000)] + 0xb5700c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=32079, stack(0xb5823000,0xb5874000)] + 0x0808c000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=32078, stack(0xb5874000,0xb58f5000)] + 0x0808ac00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=32077, stack(0xb58f5000,0xb5946000)] + 0x08081c00 JavaThread "Finalizer" daemon [_thread_blocked, id=32076, stack(0xb598c000,0xb59dd000)] + 0x08080c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=32075, stack(0xb59dd000,0xb5a2e000)] + +Other Threads: + 0x0807f400 VMThread [stack: 0xb5a2e000,0xb5aaf000] [id=32074] + 0xb570a400 WatcherThread [stack: 0xb567f000,0xb5700000] [id=32080] + +VM state:not at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: None + +Heap + def new generation total 960K, used 512K [0x8bfe0000, 0x8c0e0000, 0x8c4c0000) + eden space 896K, 50% used [0x8bfe0000, 0x8c050378, 0x8c0c0000) + from space 64K, 100% used [0x8c0d0000, 0x8c0e0000, 0x8c0e0000) + to space 64K, 0% used [0x8c0c0000, 0x8c0c0000, 0x8c0d0000) + tenured generation total 4096K, used 3837K [0x8c4c0000, 0x8c8c0000, 0x8ffe0000) + the space 4096K, 93% used [0x8c4c0000, 0x8c87f6a0, 0x8c87f800, 0x8c8c0000) + compacting perm gen total 12288K, used 6940K [0x8ffe0000, 0x90be0000, 0x93fe0000) + the space 12288K, 56% used [0x8ffe0000, 0x906a7308, 0x906a7400, 0x90be0000) + ro space 8192K, 73% used [0x93fe0000, 0x945c34a0, 0x945c3600, 0x947e0000) + rw space 12288K, 58% used [0x947e0000, 0x94ed8668, 0x94ed8800, 0x953e0000) + +Dynamic libraries: +06000000-0641b000 r-xp 00000000 08:02 1085428 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/libjvm.so +0641b000-06435000 rwxp 0041a000 08:02 1085428 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/libjvm.so +06435000-06855000 rwxp 06435000 00:00 0 +08048000-08052000 r-xp 00000000 08:02 1085534 /usr/lib/jvm/java-6-sun-1.6.0.06/bin/appletviewer +08052000-08053000 rwxp 00009000 08:02 1085534 /usr/lib/jvm/java-6-sun-1.6.0.06/bin/appletviewer +08053000-083f5000 rwxp 08053000 00:00 0 [heap] +8bfe0000-8c0e0000 rwxp 8bfe0000 00:00 0 +8c0e0000-8c4c0000 rwxp 8c0e0000 00:00 0 +8c4c0000-8c8c0000 rwxp 8c4c0000 00:00 0 +8c8c0000-8ffe0000 rwxp 8c8c0000 00:00 0 +8ffe0000-90be0000 rwxp 8ffe0000 00:00 0 +90be0000-93fe0000 rwxp 90be0000 00:00 0 +93fe0000-945c4000 r-xs 00001000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa +945c4000-947e0000 rwxp 945c4000 00:00 0 +947e0000-94ed9000 rwxp 005e5000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa +94ed9000-953e0000 rwxp 94ed9000 00:00 0 +953e0000-954b9000 rwxp 00cde000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa +954b9000-957e0000 rwxp 954b9000 00:00 0 +957e0000-957e4000 r-xs 00db7000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa +957e4000-95be0000 rwxp 957e4000 00:00 0 +b4c7e000-b4c81000 ---p b4c7e000 00:00 0 +b4c81000-b4ccf000 rwxp b4c81000 00:00 0 +b4ccf000-b4cd2000 ---p b4ccf000 00:00 0 +b4cd2000-b4d20000 rwxp b4cd2000 00:00 0 +b4d20000-b4d23000 r-xs 00000000 08:02 3560016 /var/cache/fontconfig/5e10083637a12ecd1bff191eb66bfa2f-x86.cache-2 +b4d23000-b4d29000 r-xs 00000000 08:02 3560014 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-x86.cache-2 +b4d29000-b4d2c000 r-xs 00000000 08:02 3560019 /var/cache/fontconfig/e383d7ea5fbe662a33d9b44caf393297-x86.cache-2 +b4d2c000-b4d31000 r-xs 00000000 08:02 3560011 /var/cache/fontconfig/bddabcf04192498a6a74911686fc6962-x86.cache-2 +b4d31000-b4d34000 r-xs 00000000 08:02 3556212 /var/cache/fontconfig/a46337af8a0b4c9b317ad981ec3bdf87-x86.cache-2 +b4d34000-b4d35000 r-xs 00000000 08:02 3560013 /var/cache/fontconfig/fd9505950c048a77dc4b710eb6a628ed-x86.cache-2 +b4d35000-b4d37000 r-xs 00000000 08:02 3560021 /var/cache/fontconfig/ddc79d3ea06a7c6ffa86ede85f3bb5df-x86.cache-2 +b4d37000-b4d38000 r-xs 00000000 08:02 3560164 /var/cache/fontconfig/e3fa16a14183b06aa45b3e009278fd14-x86.cache-2 +b4d38000-b4d39000 r-xs 00000000 08:02 3560125 /var/cache/fontconfig/e7071f4a29fa870f4323321c154eba04-x86.cache-2 +b4d39000-b4d3a000 r-xs 00000000 08:02 3560023 /var/cache/fontconfig/a2ab74764b07279e7c36ddb1d302cf26-x86.cache-2 +b4d3a000-b4d3e000 r-xs 00000000 08:02 3560003 /var/cache/fontconfig/921a30a17f0be15c70ac14043cb7a739-x86.cache-2 +b4d3e000-b4d3f000 r-xs 00000000 08:02 3560018 /var/cache/fontconfig/c69f04ab05004e31a6d5e715764f16d8-x86.cache-2 +b4d3f000-b4d40000 r-xs 00000000 08:02 3560008 /var/cache/fontconfig/4c73fe0c47614734b17d736dbde7580a-x86.cache-2 +b4d40000-b4d42000 r-xs 00000000 08:02 3560007 /var/cache/fontconfig/646addb8444faa74ee138aa00ab0b6a0-x86.cache-2 +b4d42000-b4d45000 r-xs 00000000 08:02 3560006 /var/cache/fontconfig/a755afe4a08bf5b97852ceb7400b47bc-x86.cache-2 +b4d45000-b4d47000 r-xs 00000000 08:02 3560015 /var/cache/fontconfig/20bd79ad97094406f7d1b9654bfbd926-x86.cache-2 +b4d47000-b4d49000 r-xs 00000000 08:02 3560009 /var/cache/fontconfig/9c0624108b9a2ae8552f664125be8356-x86.cache-2 +b4d49000-b4d50000 r-xs 00000000 08:02 3560004 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-x86.cache-2 +b4d50000-b4d53000 r-xs 00000000 08:02 3560012 /var/cache/fontconfig/de156ccd2eddbdc19d37a45b8b2aac9c-x86.cache-2 +b4d53000-b4d55000 r-xs 00000000 08:02 3556204 /var/cache/fontconfig/da1bd5ca8443ffe22927a23ce431d198-x86.cache-2 +b4d55000-b4d5d000 r-xs 00000000 08:02 3560169 /var/cache/fontconfig/e3de0de479f42330eadf588a55fb5bf4-x86.cache-2 +b4d5d000-b4d65000 r-xs 00000000 08:02 2409868 /var/cache/fontconfig/0f34bcd4b6ee430af32735b75db7f02b-x86.cache-2 +b4d65000-b4d66000 r-xs 00000000 08:02 3560126 /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-x86.cache-2 +b4d66000-b4d88000 r-xs 00000000 08:02 1392718 /var/cache/fontconfig/365b55f210c0a22e9a19e35191240f32-x86.cache-2 +b4d88000-b4d8a000 r-xs 00000000 08:02 3560017 /var/cache/fontconfig/2c5ba8142dffc8bf0377700342b8ca1a-x86.cache-2 +b4d8a000-b4d8d000 r-xs 00000000 08:02 3560022 /var/cache/fontconfig/de9486f0b47a4d768a594cb4198cb1c6-x86.cache-2 +b4d8d000-b4d94000 r-xs 00000000 08:02 3556202 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-x86.cache-2 +b4d94000-b4d99000 r-xs 00000000 08:02 3558093 /var/cache/fontconfig/105b9c7e6f0a4f82d8c9b6e39c52c6f9-x86.cache-2 +b4d99000-b4d9c000 r-xs 00000000 08:02 3560677 /var/cache/fontconfig/6386b86020ecc1ef9690bb720a13964f-x86.cache-2 +b4d9c000-b4da7000 r-xs 00000000 08:02 3556115 /var/cache/fontconfig/089dead882dea3570ffc31a9898cfb69-x86.cache-2 +b4da7000-b4db4000 r-xs 00000000 08:02 2409873 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 +b4dd5000-b4dd8000 ---p b4dd5000 00:00 0 +b4dd8000-b4e26000 rwxp b4dd8000 00:00 0 +b4e3b000-b4e46000 rwxs 00000000 00:09 1831534605 /SYSV00000000 (deleted) +b4e46000-b4e47000 r--s 0000f000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e47000-b4e48000 r--s 0000e000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e48000-b4e49000 r--s 0000d000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e49000-b4e4a000 r--s 0000c000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e4a000-b4e4b000 r--s 0000b000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e4b000-b4e4c000 r--s 0000a000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e4c000-b4e4d000 r--s 00009000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e4d000-b4e4e000 r--s 00008000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e4e000-b4e4f000 r--s 00007000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e4f000-b4e50000 r--s 00006000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e50000-b4e51000 r--s 00005000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e51000-b4e52000 r--s 00004000 00:11 751021 /var/run/pcscd/pcscd.pub +b4e52000-b4e5a000 r-xp 00000000 08:02 901283 /usr/lib/libpcsclite.so.1.0.0 +b4e5a000-b4e5b000 rwxp 00008000 08:02 901283 /usr/lib/libpcsclite.so.1.0.0 +b4e5b000-b4e5d000 r-xp 00000000 08:02 1085449 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libj2pcsc.so +b4e5d000-b4e5e000 rwxp 00001000 08:02 1085449 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libj2pcsc.so +b4e5e000-b4e61000 rwxp b4e5e000 00:00 0 +b4e61000-b4eaf000 rwxp b4e61000 00:00 0 +b4eaf000-b4eb2000 ---p b4eaf000 00:00 0 +b4eb2000-b4fd2000 rwxp b4eb2000 00:00 0 +b4fd2000-b5000000 ---p b4fd2000 00:00 0 +b5000000-b5001000 r--s 00003000 00:11 751021 /var/run/pcscd/pcscd.pub +b5001000-b5004000 r-xs 00027000 08:02 1086682 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/ext/sunjce_provider.jar +b5004000-b5036000 rwxp b5004000 00:00 0 +b5036000-b503a000 r-xs 00000000 08:02 3555788 /var/cache/fontconfig/4a195c91033ef4528a35b4a1ac51414e-x86.cache-2 +b503a000-b5048000 r-xs 00000000 08:02 3557818 /var/cache/fontconfig/865f88548240fee46819705c6468c165-x86.cache-2 +b5048000-b504f000 r-xs 00110000 08:02 1065527 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/resources.jar +b504f000-b5077000 rwxp b504f000 00:00 0 +b5077000-b507e000 r-xp 00000000 08:02 1085443 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnio.so +b507e000-b507f000 rwxp 00006000 08:02 1085443 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnio.so +b507f000-b5082000 ---p b507f000 00:00 0 +b5082000-b50d0000 rwxp b5082000 00:00 0 +b50d0000-b50d3000 ---p b50d0000 00:00 0 +b50d3000-b5121000 rwxp b50d3000 00:00 0 +b5121000-b5124000 r-xs 00000000 08:02 3560016 /var/cache/fontconfig/5e10083637a12ecd1bff191eb66bfa2f-x86.cache-2 +b5124000-b512a000 r-xs 00000000 08:02 3560014 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-x86.cache-2 +b512a000-b512d000 r-xs 00000000 08:02 3560019 /var/cache/fontconfig/e383d7ea5fbe662a33d9b44caf393297-x86.cache-2 +b512d000-b5132000 r-xs 00000000 08:02 3560011 /var/cache/fontconfig/bddabcf04192498a6a74911686fc6962-x86.cache-2 +b5132000-b5135000 r-xs 00000000 08:02 3556212 /var/cache/fontconfig/a46337af8a0b4c9b317ad981ec3bdf87-x86.cache-2 +b5135000-b5136000 r-xs 00000000 08:02 3560013 /var/cache/fontconfig/fd9505950c048a77dc4b710eb6a628ed-x86.cache-2 +b5136000-b5138000 r-xs 00000000 08:02 3560021 /var/cache/fontconfig/ddc79d3ea06a7c6ffa86ede85f3bb5df-x86.cache-2 +b5138000-b5139000 r-xs 00000000 08:02 3560164 /var/cache/fontconfig/e3fa16a14183b06aa45b3e009278fd14-x86.cache-2 +b5139000-b513a000 r-xs 00000000 08:02 3560125 /var/cache/fontconfig/e7071f4a29fa870f4323321c154eba04-x86.cache-2 +b513a000-b513b000 r-xs 00000000 08:02 3560023 /var/cache/fontconfig/a2ab74764b07279e7c36ddb1d302cf26-x86.cache-2 +b513b000-b513f000 r-xs 00000000 08:02 3560003 /var/cache/fontconfig/921a30a17f0be15c70ac14043cb7a739-x86.cache-2 +b513f000-b5140000 r-xs 00000000 08:02 3560018 /var/cache/fontconfig/c69f04ab05004e31a6d5e715764f16d8-x86.cache-2 +b5140000-b5141000 r-xs 00000000 08:02 3560008 /var/cache/fontconfig/4c73fe0c47614734b17d736dbde7580a-x86.cache-2 +b5141000-b5143000 r-xs 00000000 08:02 3560007 /var/cache/fontconfig/646addb8444faa74ee138aa00ab0b6a0-x86.cache-2 +b5143000-b5146000 r-xs 00000000 08:02 3560006 /var/cache/fontconfig/a755afe4a08bf5b97852ceb7400b47bc-x86.cache-2 +b5146000-b5148000 r-xs 00000000 08:02 3560015 /var/cache/fontconfig/20bd79ad97094406f7d1b9654bfbd926-x86.cache-2 +b5148000-b514a000 r-xs 00000000 08:02 3560009 /var/cache/fontconfig/9c0624108b9a2ae8552f664125be8356-x86.cache-2 +b514a000-b5151000 r-xs 00000000 08:02 3560004 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-x86.cache-2 +b5151000-b5154000 r-xs 00000000 08:02 3560012 /var/cache/fontconfig/de156ccd2eddbdc19d37a45b8b2aac9c-x86.cache-2 +b5154000-b5156000 r-xs 00000000 08:02 3556204 /var/cache/fontconfig/da1bd5ca8443ffe22927a23ce431d198-x86.cache-2 +b5156000-b515e000 r-xs 00000000 08:02 3560169 /var/cache/fontconfig/e3de0de479f42330eadf588a55fb5bf4-x86.cache-2 +b515e000-b5166000 r-xs 00000000 08:02 2409868 /var/cache/fontconfig/0f34bcd4b6ee430af32735b75db7f02b-x86.cache-2 +b5166000-b5167000 r-xs 00000000 08:02 3560126 /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-x86.cache-2 +b5167000-b5189000 r-xs 00000000 08:02 1392718 /var/cache/fontconfig/365b55f210c0a22e9a19e35191240f32-x86.cache-2 +b5189000-b518b000 r-xs 00000000 08:02 3560017 /var/cache/fontconfig/2c5ba8142dffc8bf0377700342b8ca1a-x86.cache-2 +b518b000-b518e000 r-xs 00000000 08:02 3560022 /var/cache/fontconfig/de9486f0b47a4d768a594cb4198cb1c6-x86.cache-2 +b518e000-b5195000 r-xs 00000000 08:02 3556202 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-x86.cache-2 +b5195000-b519a000 r-xs 00000000 08:02 3558093 /var/cache/fontconfig/105b9c7e6f0a4f82d8c9b6e39c52c6f9-x86.cache-2 +b519a000-b519d000 r-xs 00000000 08:02 3560677 /var/cache/fontconfig/6386b86020ecc1ef9690bb720a13964f-x86.cache-2 +b519d000-b51a8000 r-xs 00000000 08:02 3556115 /var/cache/fontconfig/089dead882dea3570ffc31a9898cfb69-x86.cache-2 +b51a8000-b51b5000 r-xs 00000000 08:02 2409873 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 +b51b5000-b51bb000 r-xs 00091000 08:02 1065704 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/jsse.jar +b51bb000-b51be000 rwxp b51bb000 00:00 0 +b51be000-b520c000 rwxp b51be000 00:00 0 +b520c000-b520f000 ---p b520c000 00:00 0 +b520f000-b525d000 rwxp b520f000 00:00 0 +b525d000-b5264000 r-xp 00000000 08:02 1343649 /usr/lib/libXrender.so.1.3.0 +b5264000-b5265000 rwxp 00007000 08:02 1343649 /usr/lib/libXrender.so.1.3.0 +b5265000-b526d000 r-xp 00000000 08:02 1343710 /usr/lib/libXcursor.so.1.0.2 +b526d000-b526e000 rwxp 00007000 08:02 1343710 /usr/lib/libXcursor.so.1.0.2 +b526e000-b526f000 r--s 00002000 00:11 751021 /var/run/pcscd/pcscd.pub +b526f000-b5271000 r-xs 00017000 08:02 4065150 /home/clemens/workspace/mocca/BKUApplet/target/test-libs/iaik_jce_me4se-3.04.jar +b5271000-b5284000 r-xp 00000000 08:02 1085442 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnet.so +b5284000-b5285000 rwxp 00013000 08:02 1085442 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnet.so +b5285000-b5288000 ---p b5285000 00:00 0 +b5288000-b52d6000 rwxp b5288000 00:00 0 +b52d6000-b5354000 r-xp 00000000 08:02 1085586 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libfontmanager.so +b5354000-b535e000 rwxp 0007e000 08:02 1085586 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libfontmanager.so +b535e000-b5363000 rwxp b535e000 00:00 0 +b5363000-b536a000 r-xp 00000000 08:02 1343653 /usr/lib/libXi.so.6.0.0 +b536a000-b536b000 rwxp 00006000 08:02 1343653 /usr/lib/libXi.so.6.0.0 +b536b000-b5378000 r-xp 00000000 08:02 902010 /usr/lib/libXext.so.6.4.0 +b5378000-b5379000 rwxp 0000d000 08:02 902010 /usr/lib/libXext.so.6.4.0 +b5379000-b53ba000 r-xp 00000000 08:02 1085581 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/xawt/libmawt.so +b53ba000-b53bd000 rwxp 00040000 08:02 1085581 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/xawt/libmawt.so +b53bd000-b5438000 r-xp 00000000 08:02 1085578 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libawt.so +b5438000-b543f000 rwxp 0007b000 08:02 1085578 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libawt.so +b543f000-b5463000 rwxp b543f000 00:00 0 +b5463000-b54c2000 r-xs 00b89000 08:02 1085573 /usr/lib/jvm/java-6-sun-1.6.0.06/lib/tools.jar +b54c2000-b54f4000 rwxp b54c2000 00:00 0 +b54f4000-b567f000 r-xs 02df0000 08:02 1065570 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/rt.jar +b567f000-b5680000 ---p b567f000 00:00 0 +b5680000-b5800000 rwxp b5680000 00:00 0 +b5800000-b5801000 r--s 00001000 00:11 751021 /var/run/pcscd/pcscd.pub +b5801000-b5803000 r-xs 0000d000 08:02 4065123 /home/clemens/workspace/mocca/BKUApplet/target/test-libs/commons-logging-1.1.1.jar +b5803000-b5807000 r-xs 0002d000 08:02 4050367 /home/clemens/workspace/mocca/BKUApplet/target/BKUApplet-1.0-SNAPSHOT.jar +b5807000-b580b000 r-xp 00000000 08:02 1343688 /usr/lib/libXtst.so.6.1.0 +b580b000-b580c000 rwxp 00003000 08:02 1343688 /usr/lib/libXtst.so.6.1.0 +b580c000-b5810000 r-xp 00000000 08:02 905383 /usr/lib/libXfixes.so.3.1.0 +b5810000-b5811000 rwxp 00003000 08:02 905383 /usr/lib/libXfixes.so.3.1.0 +b5811000-b5815000 r-xs 00000000 08:02 3555788 /var/cache/fontconfig/4a195c91033ef4528a35b4a1ac51414e-x86.cache-2 +b5815000-b5823000 r-xs 00000000 08:02 3557818 /var/cache/fontconfig/865f88548240fee46819705c6468c165-x86.cache-2 +b5823000-b5826000 ---p b5823000 00:00 0 +b5826000-b5874000 rwxp b5826000 00:00 0 +b5874000-b5877000 ---p b5874000 00:00 0 +b5877000-b58f5000 rwxp b5877000 00:00 0 +b58f5000-b58f8000 ---p b58f5000 00:00 0 +b58f8000-b5946000 rwxp b58f8000 00:00 0 +b5946000-b594d000 r-xs 00000000 08:02 912666 /usr/lib/gconv/gconv-modules.cache +b594d000-b598c000 r-xp 00000000 08:02 2162962 /usr/lib/locale/de_AT.utf8/LC_CTYPE +b598c000-b598f000 ---p b598c000 00:00 0 +b598f000-b59dd000 rwxp b598f000 00:00 0 +b59dd000-b59e0000 ---p b59dd000 00:00 0 +b59e0000-b5a2e000 rwxp b59e0000 00:00 0 +b5a2e000-b5a2f000 ---p b5a2e000 00:00 0 +b5a2f000-b5abd000 rwxp b5a2f000 00:00 0 +b5abd000-b5ad7000 rwxp b5abd000 00:00 0 +b5ad7000-b5ada000 rwxp b5ad7000 00:00 0 +b5ada000-b5af5000 rwxp b5ada000 00:00 0 +b5af5000-b5af6000 rwxp b5af5000 00:00 0 +b5af6000-b5af7000 rwxp b5af6000 00:00 0 +b5af7000-b5afa000 rwxp b5af7000 00:00 0 +b5afa000-b5b15000 rwxp b5afa000 00:00 0 +b5b15000-b5b1b000 rwxp b5b15000 00:00 0 +b5b1b000-b5b35000 rwxp b5b1b000 00:00 0 +b5b35000-b5b46000 rwxp b5b35000 00:00 0 +b5b46000-b5bc0000 rwxp b5b46000 00:00 0 +b5bc0000-b5d10000 rwxp b5bc0000 00:00 0 +b5d10000-b7bc0000 rwxp b5d10000 00:00 0 +b7bc0000-b7bcf000 r-xp 00000000 08:02 1085437 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libzip.so +b7bcf000-b7bd1000 rwxp 0000e000 08:02 1085437 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libzip.so +b7bd1000-b7bf4000 r-xp 00000000 08:02 1085434 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libjava.so +b7bf4000-b7bf6000 rwxp 00023000 08:02 1085434 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libjava.so +b7bf6000-b7bff000 r-xp 00000000 08:02 2785878 /lib/tls/i686/cmov/libnss_files-2.7.so +b7bff000-b7c01000 rwxp 00008000 08:02 2785878 /lib/tls/i686/cmov/libnss_files-2.7.so +b7c01000-b7c09000 r-xp 00000000 08:02 2785986 /lib/tls/i686/cmov/libnss_nis-2.7.so +b7c09000-b7c0b000 rwxp 00007000 08:02 2785986 /lib/tls/i686/cmov/libnss_nis-2.7.so +b7c0b000-b7c1f000 r-xp 00000000 08:02 2785874 /lib/tls/i686/cmov/libnsl-2.7.so +b7c1f000-b7c21000 rwxp 00013000 08:02 2785874 /lib/tls/i686/cmov/libnsl-2.7.so +b7c21000-b7c23000 rwxp b7c21000 00:00 0 +b7c23000-b7c24000 r--s 00000000 00:11 751021 /var/run/pcscd/pcscd.pub +b7c24000-b7c25000 r-xs 00000000 08:02 3556750 /var/cache/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-x86.cache-2 +b7c25000-b7c26000 r-xs 00000000 08:02 3556750 /var/cache/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-x86.cache-2 +b7c26000-b7c31000 r-xp 00000000 08:02 1085433 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libverify.so +b7c31000-b7c32000 rwxp 0000b000 08:02 1085433 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libverify.so +b7c32000-b7c3a000 rwxs 00000000 08:02 1328188 /tmp/hsperfdata_clemens/32072 +b7c3a000-b7c41000 r-xp 00000000 08:02 2786023 /lib/tls/i686/cmov/librt-2.7.so +b7c41000-b7c43000 rwxp 00006000 08:02 2786023 /lib/tls/i686/cmov/librt-2.7.so +b7c43000-b7c46000 ---p b7c43000 00:00 0 +b7c46000-b7c94000 rwxp b7c46000 00:00 0 +b7c94000-b7cb7000 r-xp 00000000 08:02 2785871 /lib/tls/i686/cmov/libm-2.7.so +b7cb7000-b7cb9000 rwxp 00023000 08:02 2785871 /lib/tls/i686/cmov/libm-2.7.so +b7cb9000-b7cba000 rwxp b7cb9000 00:00 0 +b7cba000-b7cbe000 r-xp 00000000 08:02 905230 /usr/lib/libXdmcp.so.6.0.0 +b7cbe000-b7cbf000 rwxp 00003000 08:02 905230 /usr/lib/libXdmcp.so.6.0.0 +b7cbf000-b7cc1000 r-xp 00000000 08:02 901311 /usr/lib/libXau.so.6.0.0 +b7cc1000-b7cc2000 rwxp 00001000 08:02 901311 /usr/lib/libXau.so.6.0.0 +b7cc2000-b7cd9000 r-xp 00000000 08:02 901194 /usr/lib/libxcb.so.1.0.0 +b7cd9000-b7cda000 rwxp 00016000 08:02 901194 /usr/lib/libxcb.so.1.0.0 +b7cda000-b7cdb000 rwxp b7cda000 00:00 0 +b7cdb000-b7cdc000 r-xp 00000000 08:02 901196 /usr/lib/libxcb-xlib.so.0.0.0 +b7cdc000-b7cdd000 rwxp 00000000 08:02 901196 /usr/lib/libxcb-xlib.so.0.0.0 +b7cdd000-b7e26000 r-xp 00000000 08:02 2785863 /lib/tls/i686/cmov/libc-2.7.so +b7e26000-b7e27000 r-xp 00149000 08:02 2785863 /lib/tls/i686/cmov/libc-2.7.so +b7e27000-b7e29000 rwxp 0014a000 08:02 2785863 /lib/tls/i686/cmov/libc-2.7.so +b7e29000-b7e2c000 rwxp b7e29000 00:00 0 +b7e2c000-b7e2e000 r-xp 00000000 08:02 2785869 /lib/tls/i686/cmov/libdl-2.7.so +b7e2e000-b7e30000 rwxp 00001000 08:02 2785869 /lib/tls/i686/cmov/libdl-2.7.so +b7e30000-b7e37000 r-xp 00000000 08:02 1085436 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/jli/libjli.so +b7e37000-b7e39000 rwxp 00006000 08:02 1085436 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/jli/libjli.so +b7e39000-b7f1d000 r-xp 00000000 08:02 901308 /usr/lib/libX11.so.6.2.0 +b7f1d000-b7f20000 rwxp 000e4000 08:02 901308 /usr/lib/libX11.so.6.2.0 +b7f20000-b7f21000 rwxp b7f20000 00:00 0 +b7f21000-b7f35000 r-xp 00000000 08:02 2786020 /lib/tls/i686/cmov/libpthread-2.7.so +b7f35000-b7f37000 rwxp 00013000 08:02 2786020 /lib/tls/i686/cmov/libpthread-2.7.so +b7f37000-b7f3e000 rwxp b7f37000 00:00 0 +b7f3e000-b7f45000 r-xp 00000000 08:02 2785875 /lib/tls/i686/cmov/libnss_compat-2.7.so +b7f45000-b7f47000 rwxp 00006000 08:02 2785875 /lib/tls/i686/cmov/libnss_compat-2.7.so +b7f47000-b7f4d000 r-xp 00000000 08:02 1085422 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/native_threads/libhpi.so +b7f4d000-b7f4e000 rwxp 00006000 08:02 1085422 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/native_threads/libhpi.so +b7f4e000-b7f4f000 rwxp b7f4e000 00:00 0 +b7f4f000-b7f50000 r-xp b7f4f000 00:00 0 +b7f50000-b7f52000 rwxp b7f50000 00:00 0 +b7f52000-b7f53000 r-xp b7f52000 00:00 0 [vdso] +b7f53000-b7f6d000 r-xp 00000000 08:02 2786582 /lib/ld-2.7.so +b7f6d000-b7f6f000 rwxp 00019000 08:02 2786582 /lib/ld-2.7.so +bfaac000-bfac1000 rwxp bffeb000 00:00 0 [stack] + +VM Arguments: +jvm_args: -Dapplication.home=/usr/lib/jvm/java-6-sun-1.6.0.06 +java_command: sun.applet.Main target/test-classes/appletTest.html +Launcher Type: SUN_STANDARD + +Environment Variables: +JAVA_HOME=/usr/lib/jvm/java-6-sun +PATH=/home/clemens/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games +LD_LIBRARY_PATH=/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.06/jre/../lib/i386 +SHELL=/bin/bash +DISPLAY=:0 + +Signal Handlers: +SIGSEGV: [libjvm.so+0x3be710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGBUS: [libjvm.so+0x3be710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGFPE: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGPIPE: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGXFSZ: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGILL: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000 +SIGUSR2: [libjvm.so+0x311850], sa_mask[0]=0x00000000, sa_flags=0x10000004 +SIGHUP: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGINT: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGTERM: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 +SIGQUIT: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 + + +--------------- S Y S T E M --------------- + +OS:lenny/sid + +uname:Linux 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 +libc:glibc 2.7 NPTL 2.7 +rlimit: STACK 8192k, CORE 0k, NPROC 16381, NOFILE 1024, AS infinity +load average:0.84 0.39 0.22 + +CPU:total 2 (1 cores per cpu, 2 threads per core) family 15 model 4 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht + +Memory: 4k page, physical 2075432k(62584k free), swap 1542200k(1502244k free) + +vm_info: Java HotSpot(TM) Client VM (10.0-b22) for linux-x86 JRE (1.6.0_06-b02), built on Mar 25 2008 00:39:19 by "java_re" with gcc 3.2.1-7a (J2SE release) + +time: Thu Oct 9 12:01:31 2008 +elapsed time: 55 seconds + diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 34dd9bbd..6a781729 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -16,9 +16,12 @@ */ package at.gv.egiz.bku.online.applet; +import java.net.MalformedURLException; import java.util.Locale; import java.util.ResourceBundle; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; @@ -27,6 +30,7 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIFactory; +import java.net.URL; /** * Note: all swing code is executed by the event dispatch thread (see @@ -40,6 +44,8 @@ public class BKUApplet extends JApplet { public final static String LOGO_URL_KEY = "LogoURL"; public final static String WSDL_URL = "WSDL_URL"; public final static String SESSION_ID = "SessionID"; + public static final String BACKGROUND_PARAM = "background"; + protected ResourceBundle resourceBundle; protected BKUWorker worker; protected Thread workerThread; @@ -58,8 +64,17 @@ public class BKUApplet extends JApplet { } else { resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); } + String backgroundString = getMyAppletParameter(BACKGROUND_PARAM); + URL background = null; + if (backgroundString != null) { + try { + background = new URL(backgroundString); + } catch (MalformedURLException ex) { + log.warn(ex.getMessage() + ", using default background"); + } + } BKUGUIFacade gui = BKUGUIFactory.createGUI(); - gui.init(getContentPane(), localeString); + gui.init(getContentPane(), localeString, background); worker = new BKUWorker(gui, this, resourceBundle); } -- cgit v1.2.3 From 8852be703a5cacaf271575ccee04bbe27612d16b Mon Sep 17 00:00:00 2001 From: wbauer Date: Fri, 10 Oct 2008 12:35:07 +0000 Subject: Improved Quit Handling for multiple applet instances git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@101 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 4 + .../at/gv/egiz/bku/online/applet/BKUWorker.java | 125 ++++++++++++--------- .../bku/online/applet/MultiInstanceHandler.java | 49 ++++++++ .../at/gv/egiz/bku/online/applet/QuitHandler.java | 37 ++++++ 4 files changed, 160 insertions(+), 55 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 6a781729..ab38c163 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -30,6 +30,9 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIFactory; +import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; +import at.gv.egiz.stal.QuitRequest; + import java.net.URL; /** @@ -56,6 +59,7 @@ public class BKUApplet extends JApplet { public void init() { log.info("Welcome to MOCCA\n"); log.debug("Called init()"); + AbstractSMCCSTAL.addRequestHandler(QuitRequest.class, QuitHandler.getInstance()); HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); if (localeString != null) { diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 12eb9d00..fbf74162 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -48,7 +48,7 @@ import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.util.STALTranslator; public class BKUWorker extends AbstractSMCCSTAL implements Runnable, - ActionListener, SMCCSTALRequestHandler { + ActionListener, SMCCSTALRequestHandler { private static Log log = LogFactory.getLog(BKUWorker.class); protected BKUGUIFacade gui; @@ -65,15 +65,15 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, * must not be null */ public BKUWorker(BKUGUIFacade gui, BKUApplet parent, - ResourceBundle errorMessageBundle) { + ResourceBundle errorMessageBundle) { if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { throw new NullPointerException("Parameter must not be set to null"); } this.gui = gui; this.parent = parent; this.errorMessages = errorMessageBundle; - addRequestHandler(QuitRequest.class, this); - // register SignRequestHandler once we have a webservice port + QuitHandler.getInstance().registerHandlerInstance(this); + // register SignRequestHandler once we have a webservice port } /** @@ -85,7 +85,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected BKUWorker(BKUGUIFacade gui, ResourceBundle errorMessageBundle) { this.gui = gui; this.errorMessages = errorMessageBundle; - addRequestHandler(QuitRequest.class, this); + QuitHandler.getInstance().registerHandlerInstance(this); } private STALPortType getSTALPort() throws MalformedURLException { @@ -111,7 +111,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } log.debug("Found WSDL url: " + wsdlURL); QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", - "STALService"); + "STALService"); STALService stal = new STALService(wsdlURL, endpointName); return stal.getSTALPort(); } @@ -126,7 +126,8 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, log.fatal("Failed to call STAL service.", e); actionCommandList.clear(); actionCommandList.add("ok"); - gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, new Object[] {e.getMessage()}); + gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, + new Object[] { e.getMessage() }); try { waitForAction(); } catch (InterruptedException e1) { @@ -140,13 +141,16 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, // use the testsession for testing sessionId = "TestSession"; } - addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WSSignRequestHandler(sessionId, stalPort)); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, + new WSSignRequestHandler(sessionId, stalPort)); ObjectFactory of = new ObjectFactory(); GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); do { - List requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); - List stalRequests = STALTranslator.translateRequests(requests); + List requests = nextRequestResp + .getInfoboxReadRequestOrSignRequestOrQuitRequest(); + List stalRequests = STALTranslator + .translateRequests(requests); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Received "); @@ -190,27 +194,33 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, responses = new ArrayList(1); ErrorResponseType err = new ErrorResponseType(); err.setErrorCode(6002); -// err.setErrorMessage(); + // err.setErrorMessage(); responses.add(err); } if (!finished) { + log.info("Not finished yet (BKUWorker: " + this + + "), sending responses"); GetNextRequestType nextRequest = of.createGetNextRequestType(); nextRequest.setSessionId(sessionId); - nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); + nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse() + .addAll(responses); nextRequestResp = stalPort.getNextRequest(nextRequest); } } while (!finished); log.info("Done " + Thread.currentThread().getName()); } catch (Exception ex) { log.error(ex.getMessage(), ex); - gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {ex.getMessage()}); + gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] { ex + .getMessage() }); try { waitForAction(); } catch (InterruptedException e) { log.error(e); } } + signatureCard.disconnect(false); + QuitHandler.getInstance().unregisterHandlerInstance(this); sendRedirect(); } @@ -222,17 +232,20 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, URL url = null; if (redirectURL != null) { try { - url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); + url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" + + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); } catch (MalformedURLException ex) { - log.warn("Parameter 'redirectURL': " + redirectURL + " not a valid URL.", ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) + log.warn("Parameter 'redirectURL': " + redirectURL + + " not a valid URL.", ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) } if (url != null) { if (redirectTarget == null) { log.info("Done. Trying to redirect to " + url + " ..."); parent.getAppletContext().showDocument(url); } else { - log.info("Done. Trying to redirect to " + url + " (target=" + redirectTarget + ") ..."); + log.info("Done. Trying to redirect to " + url + " (target=" + + redirectTarget + ") ..."); parent.getAppletContext().showDocument(url, redirectTarget); } } @@ -276,46 +289,46 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, int oldValue = SMCCHelper.PC_SC_NOT_SUPPORTED; // this is a save default while ((signatureCard == null) && (!actionPerformed)) { switch (smccHelper.getResultCode()) { - case SMCCHelper.PC_SC_NOT_SUPPORTED: + case SMCCHelper.PC_SC_NOT_SUPPORTED: + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, this, "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.TERMINAL_NOT_PRESENT: + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(BKUGUIFacade.ERR_NO_CARDTERMINAL, null, this, "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.CARD_NOT_SUPPORTED: + if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, this, "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.TERMINAL_NOT_PRESENT: + actionCommandList.add("cancel"); + gui.showCardNotSupportedDialog(this, "cancel"); + oldValue = SMCCHelper.CARD_NOT_SUPPORTED; + } + break; + case SMCCHelper.NO_CARD: + if (oldValue != SMCCHelper.NO_CARD) { actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(BKUGUIFacade.ERR_NO_CARDTERMINAL,null,this,"ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.CARD_NOT_SUPPORTED: - if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { - actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showCardNotSupportedDialog(this, "cancel"); - oldValue = SMCCHelper.CARD_NOT_SUPPORTED; - } - break; - case SMCCHelper.NO_CARD: - if (oldValue != SMCCHelper.NO_CARD) { - actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showInsertCardDialog(this, "cancel"); - oldValue = SMCCHelper.NO_CARD; - } - break; - case SMCCHelper.CARD_FOUND: - // gui.showWaitDialog(null); - signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); - return false; + actionCommandList.add("cancel"); + gui.showInsertCardDialog(this, "cancel"); + oldValue = SMCCHelper.NO_CARD; + } + break; + case SMCCHelper.CARD_FOUND: + // gui.showWaitDialog(null); + signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); + return false; } smccHelper.update(3000); } @@ -325,6 +338,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, @Override public STALResponse handleRequest(STALRequest request) { if (request instanceof QuitRequest) { + log.info("Setting state to: finished for BKUWorker " + this); finished = true; } else { log.error("Unexpected request to handle: " + request); @@ -350,4 +364,5 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected BKUGUIFacade getGUI() { return gui; } + } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java new file mode 100644 index 00000000..a07df559 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java @@ -0,0 +1,49 @@ +package at.gv.egiz.bku.online.applet; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.gui.BKUGUIFacade; +import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; +import at.gv.egiz.smcc.SignatureCard; +import at.gv.egiz.stal.QuitRequest; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.STALResponse; + +public abstract class MultiInstanceHandler implements SMCCSTALRequestHandler { + + private static Log log = LogFactory.getLog(MultiInstanceHandler.class); + + protected List handlerList = new ArrayList(); + + + + protected MultiInstanceHandler() { + } + + public void registerHandlerInstance(SMCCSTALRequestHandler handler) { + handlerList.add(handler); + } + + public void unregisterHandlerInstance(SMCCSTALRequestHandler handler) { + handlerList.remove(handler); + } + + + @Override + public void init(SignatureCard sc, BKUGUIFacade gui) { + } + + @Override + public SMCCSTALRequestHandler newInstance() { + return this; + } + + @Override + public boolean requireCard() { + return false; + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java new file mode 100644 index 00000000..ab07e1a8 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java @@ -0,0 +1,37 @@ +package at.gv.egiz.bku.online.applet; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; +import at.gv.egiz.stal.QuitRequest; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.STALResponse; + +public class QuitHandler extends MultiInstanceHandler { + + private static Log log = LogFactory.getLog(QuitHandler.class); + + private static QuitHandler instance = new QuitHandler(); + + private QuitHandler() { + } + + public static QuitHandler getInstance() { + return instance; + } + + @Override + public STALResponse handleRequest(STALRequest request) { + if (request instanceof QuitRequest) { + log.info("Received QuitCommand"); + for (SMCCSTALRequestHandler handler : handlerList) { + handler.handleRequest(request); + } + } else { + log.error("Unexpected request to handle: " + request); + } + return null; + } + +} -- cgit v1.2.3 From 255269ab17404fa1249c257e88815cbbee6e0d0f Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 13 Oct 2008 12:53:57 +0000 Subject: ExternalDisplaySignRequestHandler git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@105 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 1 + .../at/gv/egiz/bku/online/applet/BKUWorker.java | 32 +++- .../applet/ExternalDisplaySignRequestHandler.java | 45 ++++++ .../online/applet/SignRequestHandlerFactory.java | 21 +++ .../bku/online/applet/WSSignRequestHandler.java | 168 --------------------- .../applet/WebServiceSignRequestHandler.java | 167 ++++++++++++++++++++ 6 files changed, 263 insertions(+), 171 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index ab38c163..32c4feaa 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -46,6 +46,7 @@ public class BKUApplet extends JApplet { public final static String LOCALE_PARAM_KEY = "Locale"; public final static String LOGO_URL_KEY = "LogoURL"; public final static String WSDL_URL = "WSDL_URL"; + public final static String HASHDATA_URL = "HashDataURL"; public final static String SESSION_ID = "SessionID"; public static final String BACKGROUND_PARAM = "background"; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index fbf74162..d5ba4e40 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -46,6 +46,7 @@ import at.gv.egiz.stal.service.types.ErrorResponseType; import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.util.STALTranslator; +import java.applet.AppletContext; public class BKUWorker extends AbstractSMCCSTAL implements Runnable, ActionListener, SMCCSTALRequestHandler { @@ -54,6 +55,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected BKUGUIFacade gui; protected BKUApplet parent; private STALPortType stalPort; + private URL hashDataURL; protected List actionCommandList = new ArrayList(); protected Boolean actionPerformed = false; protected boolean finished = false; @@ -115,13 +117,30 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, STALService stal = new STALService(wsdlURL, endpointName); return stal.getSTALPort(); } + + private URL getHashDataURL() throws MalformedURLException { + String hashDataParam = parent.getMyAppletParameter(BKUApplet.HASHDATA_URL); + URL codebase = parent.getCodeBase(); + if (hashDataParam != null) { + try { + return new URL(codebase, hashDataParam); +// log.debug("Found HashDataInputServlet URL: " + hashDataURL); + } catch (MalformedURLException ex) { + log.fatal("Paremeter " + BKUApplet.HASHDATA_URL + " is not a vailid URL.", ex); + throw new MalformedURLException(ex.getMessage()); + } + } else { + log.fatal("Paremeter " + BKUApplet.HASHDATA_URL + " not set"); + throw new MalformedURLException(BKUApplet.HASHDATA_URL + " not set"); + } + } @Override public void run() { gui.showWelcomeDialog(); try { stalPort = getSTALPort(); - + hashDataURL = getHashDataURL(); } catch (Exception e) { log.fatal("Failed to call STAL service.", e); actionCommandList.clear(); @@ -135,14 +154,21 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } return; } + + //TODO factory for SignRequestHandler providing either WebServiceHDISignRequestHandler or ExternalHDIDisplaySignRequestHandler + AppletContext ctx = parent.getAppletContext(); + log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); + try { String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); if (sessionId == null) { // use the testsession for testing sessionId = "TestSession"; } - addRequestHandler(at.gv.egiz.stal.SignRequest.class, - new WSSignRequestHandler(sessionId, stalPort)); + +// log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); +// addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); ObjectFactory of = new ObjectFactory(); GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java new file mode 100644 index 00000000..a9bbc559 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.applet.AppletContext; +import java.net.URL; +import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author clemens + */ +public class ExternalDisplaySignRequestHandler extends SignRequestHandler { + + private static final Log log = LogFactory.getLog(ExternalDisplaySignRequestHandler.class); + + AppletContext ctx; + URL hashDataURL; + + public ExternalDisplaySignRequestHandler(AppletContext ctx, URL hashDataURL) { + this.ctx = ctx; + this.hashDataURL = hashDataURL; + } + + @Override + public SMCCSTALRequestHandler newInstance() { + return new ExternalDisplaySignRequestHandler(ctx, hashDataURL); + } + + @Override + public void displayHashDataInputs(List signedReferences) throws Exception { + //TODO pass reference Id's to servlet (TODO servlet) + log.debug("displaying hashdata inputs at " + hashDataURL); + ctx.showDocument(hashDataURL, "_blank"); + } + +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java new file mode 100644 index 00000000..327ea8aa --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.smccstal.SignRequestHandler; + +/** + * + * @author clemens + */ +public class SignRequestHandlerFactory { + + static SignRequestHandler getInstance() { + //TODO return ExternalDisplaySignRequestHandler by default, WebServiceSignRequestHandler if requested + //TODO get configuration as param + return null; + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java deleted file mode 100644 index 3a36a290..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package at.gv.egiz.bku.online.applet; - -import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.HashDataInput; -import at.gv.egiz.stal.impl.ByteArrayHashDataInput; -import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.types.GetHashDataInputType; -import at.gv.egiz.stal.signedinfo.DigestMethodType; -import at.gv.egiz.stal.signedinfo.ReferenceType; -import java.security.DigestException; -import java.security.MessageDigest; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * - * @author clemens - */ -public class WSSignRequestHandler extends SignRequestHandler { - - private static final Log log = LogFactory.getLog(WSSignRequestHandler.class); - STALPortType stalPort; - String sessId; - - public WSSignRequestHandler(String sessId, STALPortType stalPort) { - if (stalPort == null || sessId == null) { - throw new NullPointerException("STAL port must not be null"); - } - this.sessId = sessId; - this.stalPort = stalPort; - } - - @Override - public List getCashedHashDataInputs(List signedReferences) throws Exception { - - GetHashDataInputType request = new GetHashDataInputType(); - request.setSessionId(sessId); - - HashMap idSignedRefMap = new HashMap(); - for (ReferenceType signedRef : signedReferences) { - //don't get Manifest, QualifyingProperties, ... - if (signedRef.getType() == null) { - String signedRefId = signedRef.getId(); - if (signedRefId != null) { - if (log.isTraceEnabled()) { - log.trace("requesting hashdata input for reference " + signedRefId); - } - idSignedRefMap.put(signedRefId, signedRef); - GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); - ref.setID(signedRefId); - request.getReference().add(ref); - - } else { - throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); - } - } - } - - if (log.isDebugEnabled()) { - log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); - } - GetHashDataInputResponseType response = stalPort.getHashDataInput(request); - ArrayList hashDataInputs = new ArrayList(); - - //hashdata inputs returned from service - HashMap idRefMap = new HashMap(); - for (GetHashDataInputResponseType.Reference reference : response.getReference()) { - String id = reference.getID(); - byte[] hdi = reference.getValue(); - if (hdi == null) { - throw new Exception("Did not receive hashdata input for reference " + id); - } - idRefMap.put(id, reference); - } - - for (String signedRefId : idSignedRefMap.keySet()) { - log.info("validating hashdata input for reference " + signedRefId); - - GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId); - if (reference == null) { - throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); - } - -// } -// -// for (GetHashDataInputResponseType.Reference reference : response.getReference()) { -// -// String id = reference.getID(); - byte[] hdi = reference.getValue(); - String mimeType = reference.getMimeType(); - String encoding = reference.getEncoding(); - - if (hdi == null) { - throw new Exception("No hashdata input provided for reference " + signedRefId); - } - if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); - } - - ReferenceType dsigRef = idSignedRefMap.get(signedRefId); - DigestMethodType dm = dsigRef.getDigestMethod(); - - if (dm == null) { - throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); - } - String mdAlg = dm.getAlgorithm(); - if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) - mdAlg = "SHA-1"; - else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) - mdAlg = "SHA-256"; - else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg)) - mdAlg = "SHA-224"; - else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg)) - mdAlg = "SHA-224"; - else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) - mdAlg = "SHA-384"; - else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) - mdAlg = "SHA-512"; - else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) - mdAlg = "MD2"; - else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) - mdAlg = "MD5"; - else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) - mdAlg = "RipeMD-160"; - else { - throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg); - } - MessageDigest md = MessageDigest.getInstance(mdAlg); - byte[] hdiDigest = md.digest(hdi); - if (log.isDebugEnabled()) - log.debug("Comparing digest values... "); - if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) { - log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue())); - throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue())); - } - hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); - } - return hashDataInputs; - } - - @Override - public SMCCSTALRequestHandler newInstance() { - return new WSSignRequestHandler(this.sessId, this.stalPort); - } -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java new file mode 100644 index 00000000..4a87b8b5 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java @@ -0,0 +1,167 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.impl.ByteArrayHashDataInput; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.signedinfo.DigestMethodType; +import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.security.DigestException; +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * @author clemens + */ +public class WebServiceSignRequestHandler extends SignRequestHandler { + + private static final Log log = LogFactory.getLog(WebServiceSignRequestHandler.class); + STALPortType stalPort; + String sessId; + + public WebServiceSignRequestHandler(String sessId, STALPortType stalPort) { + if (stalPort == null || sessId == null) { + throw new NullPointerException("STAL port must not be null"); + } + this.sessId = sessId; + this.stalPort = stalPort; + } + + @Override + public void displayHashDataInputs(List signedReferences) throws Exception { + + GetHashDataInputType request = new GetHashDataInputType(); + request.setSessionId(sessId); + + HashMap idSignedRefMap = new HashMap(); + for (ReferenceType signedRef : signedReferences) { + //don't get Manifest, QualifyingProperties, ... + if (signedRef.getType() == null) { + String signedRefId = signedRef.getId(); + if (signedRefId != null) { + if (log.isTraceEnabled()) { + log.trace("requesting hashdata input for reference " + signedRefId); + } + idSignedRefMap.put(signedRefId, signedRef); + GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); + ref.setID(signedRefId); + request.getReference().add(ref); + + } else { + throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); + } + } + } + + if (log.isDebugEnabled()) { + log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); + } + GetHashDataInputResponseType response = stalPort.getHashDataInput(request); + ArrayList hashDataInputs = new ArrayList(); + + //hashdata inputs returned from service + HashMap idRefMap = new HashMap(); + for (GetHashDataInputResponseType.Reference reference : response.getReference()) { + String id = reference.getID(); + byte[] hdi = reference.getValue(); + if (hdi == null) { + throw new Exception("Did not receive hashdata input for reference " + id); + } + idRefMap.put(id, reference); + } + + for (String signedRefId : idSignedRefMap.keySet()) { + log.info("validating hashdata input for reference " + signedRefId); + + GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId); + if (reference == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); + } + +// } +// +// for (GetHashDataInputResponseType.Reference reference : response.getReference()) { +// +// String id = reference.getID(); + byte[] hdi = reference.getValue(); + String mimeType = reference.getMimeType(); + String encoding = reference.getEncoding(); + + if (hdi == null) { + throw new Exception("No hashdata input provided for reference " + signedRefId); + } + if (log.isDebugEnabled()) { + log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); + } + + ReferenceType dsigRef = idSignedRefMap.get(signedRefId); + DigestMethodType dm = dsigRef.getDigestMethod(); + + if (dm == null) { + throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); + } + String mdAlg = dm.getAlgorithm(); + if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) + mdAlg = "SHA-1"; + else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) + mdAlg = "SHA-256"; + else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg)) + mdAlg = "SHA-224"; + else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg)) + mdAlg = "SHA-224"; + else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) + mdAlg = "SHA-384"; + else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) + mdAlg = "SHA-512"; + else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) + mdAlg = "MD2"; + else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) + mdAlg = "MD5"; + else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) + mdAlg = "RipeMD-160"; + else { + throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg); + } + MessageDigest md = MessageDigest.getInstance(mdAlg); + byte[] hdiDigest = md.digest(hdi); + if (log.isDebugEnabled()) + log.debug("Comparing digest values... "); + if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) { + log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue())); + throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue())); + } + hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); + } + + gui.showHashDataInputDialog(hashDataInputs, this, "ok"); + } + + @Override + public SMCCSTALRequestHandler newInstance() { + return new WebServiceSignRequestHandler(this.sessId, this.stalPort); + } +} -- cgit v1.2.3 From 128dc80f2e484b224c131abc8de6fab204d71d19 Mon Sep 17 00:00:00 2001 From: wbauer Date: Mon, 13 Oct 2008 13:23:17 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@106 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index d5ba4e40..b11413d6 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -245,7 +245,9 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, log.error(e); } } - signatureCard.disconnect(false); + if (signatureCard != null) { + signatureCard.disconnect(false); + } QuitHandler.getInstance().unregisterHandlerInstance(this); sendRedirect(); } -- cgit v1.2.3 From aa099311111a1d53f999705762aceb4005ecc187 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 13 Oct 2008 13:59:06 +0000 Subject: config guiStyle simple/advanced, hashdatadisplay internal/external git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@107 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 11 ++++++++-- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 25 +++++++++++++++------- .../online/applet/SignRequestHandlerFactory.java | 21 ------------------ BKUApplet/src/test/resources/appletTest.html | 6 +++++- 4 files changed, 31 insertions(+), 32 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 32c4feaa..96c0e7eb 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -42,13 +42,19 @@ import java.net.URL; public class BKUApplet extends JApplet { private static Log log = LogFactory.getLog(BKUApplet.class); + public static final String GUI_STYLE = "GuiStyle"; public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; public final static String LOCALE_PARAM_KEY = "Locale"; public final static String LOGO_URL_KEY = "LogoURL"; public final static String WSDL_URL = "WSDL_URL"; + public static final String HASHDATA_DISPLAY = "HashDataDisplay"; public final static String HASHDATA_URL = "HashDataURL"; public final static String SESSION_ID = "SessionID"; - public static final String BACKGROUND_PARAM = "background"; + public static final String BACKGROUND_PARAM = "Background"; + public static final String REDIRECT_URL = "RedirectURL"; + public static final String REDIRECT_TARGET = "RedirectTarget"; + + public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; protected ResourceBundle resourceBundle; protected BKUWorker worker; @@ -78,7 +84,8 @@ public class BKUApplet extends JApplet { log.warn(ex.getMessage() + ", using default background"); } } - BKUGUIFacade gui = BKUGUIFactory.createGUI(); + String guiStyle = getMyAppletParameter(GUI_STYLE); + BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); gui.init(getContentPane(), localeString, background); worker = new BKUWorker(gui, this, resourceBundle); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index b11413d6..350925ce 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -55,7 +55,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected BKUGUIFacade gui; protected BKUApplet parent; private STALPortType stalPort; - private URL hashDataURL; +// private URL hashDataURL; protected List actionCommandList = new ArrayList(); protected Boolean actionPerformed = false; protected boolean finished = false; @@ -140,7 +140,6 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, gui.showWelcomeDialog(); try { stalPort = getSTALPort(); - hashDataURL = getHashDataURL(); } catch (Exception e) { log.fatal("Failed to call STAL service.", e); actionCommandList.clear(); @@ -155,10 +154,10 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, return; } - //TODO factory for SignRequestHandler providing either WebServiceHDISignRequestHandler or ExternalHDIDisplaySignRequestHandler - AppletContext ctx = parent.getAppletContext(); - log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); - addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); +// //TODO factory for SignRequestHandler providing either WebServiceHDISignRequestHandler or ExternalHDIDisplaySignRequestHandler +// AppletContext ctx = parent.getAppletContext(); +// log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); +// addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); try { String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); @@ -167,6 +166,16 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, sessionId = "TestSession"; } + String hashDataDisplayStyle = parent.getMyAppletParameter(BKUApplet.HASHDATA_DISPLAY); + if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { + log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); + } else { //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) { + URL hashDataURL = getHashDataURL(); + log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(parent.getAppletContext(), hashDataURL)); + } + // log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); // addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); @@ -254,8 +263,8 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected void sendRedirect() { log.info("Done, sending redirect to get BKU response"); - String redirectURL = parent.getMyAppletParameter("redirectURL"); - String redirectTarget = parent.getMyAppletParameter("redirectTarget"); + String redirectURL = parent.getMyAppletParameter(BKUApplet.REDIRECT_URL); + String redirectTarget = parent.getMyAppletParameter(BKUApplet.REDIRECT_TARGET); log.info("Redirecting to: " + redirectURL + " target: " + redirectTarget); URL url = null; if (redirectURL != null) { diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java deleted file mode 100644 index 327ea8aa..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/SignRequestHandlerFactory.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package at.gv.egiz.bku.online.applet; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; - -/** - * - * @author clemens - */ -public class SignRequestHandlerFactory { - - static SignRequestHandler getInstance() { - //TODO return ExternalDisplaySignRequestHandler by default, WebServiceSignRequestHandler if requested - //TODO get configuration as param - return null; - } -} diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 5b10d6b5..b8a0770e 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -20,9 +20,13 @@ + + + + - + -- cgit v1.2.3 From de95f8219adf98710992b6716778b174bc2d2fcc Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 13 Oct 2008 16:43:46 +0000 Subject: BKUGUI / SimpleGUI aligned git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@109 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/test/resources/appletTest.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index b8a0770e..472000de 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -20,7 +20,7 @@ - + -- cgit v1.2.3 From 11411c3d236e10b237ec1c7a1904e64dc2508551 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 14 Oct 2008 14:47:06 +0000 Subject: GUI retry error msg git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@115 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 130749c5..a20a613d 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -103,6 +103,13 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + true + + -- cgit v1.2.3 From d56504bc815d41ac9142967915b7e6224c2cf529 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 15 Oct 2008 13:41:21 +0000 Subject: remove hashdatainputproxy git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@119 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java | 5 ----- 1 file changed, 5 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 350925ce..3f64de3d 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -154,11 +154,6 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, return; } -// //TODO factory for SignRequestHandler providing either WebServiceHDISignRequestHandler or ExternalHDIDisplaySignRequestHandler -// AppletContext ctx = parent.getAppletContext(); -// log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); -// addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); - try { String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); if (sessionId == null) { -- cgit v1.2.3 From ef8dc449ddc60008bce9264c73b4162cc487c174 Mon Sep 17 00:00:00 2001 From: wbauer Date: Thu, 16 Oct 2008 07:51:13 +0000 Subject: Changed STAL Handler from static registration to one Object per STAL instance git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@121 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 8 +--- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 17 +++----- .../applet/ExternalDisplaySignRequestHandler.java | 12 ++---- .../bku/online/applet/MultiInstanceHandler.java | 49 ---------------------- .../at/gv/egiz/bku/online/applet/QuitHandler.java | 37 ---------------- .../applet/WebServiceSignRequestHandler.java | 24 +++++------ 6 files changed, 20 insertions(+), 127 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 96c0e7eb..97b5869f 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -17,11 +17,10 @@ package at.gv.egiz.bku.online.applet; import java.net.MalformedURLException; +import java.net.URL; import java.util.Locale; import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; @@ -30,10 +29,6 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIFactory; -import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; -import at.gv.egiz.stal.QuitRequest; - -import java.net.URL; /** * Note: all swing code is executed by the event dispatch thread (see @@ -66,7 +61,6 @@ public class BKUApplet extends JApplet { public void init() { log.info("Welcome to MOCCA\n"); log.debug("Called init()"); - AbstractSMCCSTAL.addRequestHandler(QuitRequest.class, QuitHandler.getInstance()); HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); if (localeString != null) { diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 3f64de3d..f708826d 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -37,16 +37,15 @@ import at.gv.egiz.smcc.util.SMCCHelper; import at.gv.egiz.stal.QuitRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; -import at.gv.egiz.stal.service.types.GetNextRequestResponseType; -import at.gv.egiz.stal.service.types.GetNextRequestType; -import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; import at.gv.egiz.stal.service.types.ErrorResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; +import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.util.STALTranslator; -import java.applet.AppletContext; public class BKUWorker extends AbstractSMCCSTAL implements Runnable, ActionListener, SMCCSTALRequestHandler { @@ -74,7 +73,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, this.gui = gui; this.parent = parent; this.errorMessages = errorMessageBundle; - QuitHandler.getInstance().registerHandlerInstance(this); + addRequestHandler(QuitRequest.class, this); // register SignRequestHandler once we have a webservice port } @@ -87,7 +86,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected BKUWorker(BKUGUIFacade gui, ResourceBundle errorMessageBundle) { this.gui = gui; this.errorMessages = errorMessageBundle; - QuitHandler.getInstance().registerHandlerInstance(this); + addRequestHandler(QuitRequest.class, this); } private STALPortType getSTALPort() throws MalformedURLException { @@ -252,7 +251,6 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, if (signatureCard != null) { signatureCard.disconnect(false); } - QuitHandler.getInstance().unregisterHandlerInstance(this); sendRedirect(); } @@ -382,11 +380,6 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, public void init(SignatureCard sc, BKUGUIFacade gui) { } - @Override - public SMCCSTALRequestHandler newInstance() { - return this; - } - @Override public boolean requireCard() { return false; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java index a9bbc559..2ac1bc62 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java @@ -5,15 +5,16 @@ package at.gv.egiz.bku.online.applet; -import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.signedinfo.ReferenceType; import java.applet.AppletContext; import java.net.URL; import java.util.List; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.signedinfo.ReferenceType; + /** * * @author clemens @@ -30,11 +31,6 @@ public class ExternalDisplaySignRequestHandler extends SignRequestHandler { this.hashDataURL = hashDataURL; } - @Override - public SMCCSTALRequestHandler newInstance() { - return new ExternalDisplaySignRequestHandler(ctx, hashDataURL); - } - @Override public void displayHashDataInputs(List signedReferences) throws Exception { //TODO pass reference Id's to servlet (TODO servlet) diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java deleted file mode 100644 index a07df559..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/MultiInstanceHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package at.gv.egiz.bku.online.applet; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.gui.BKUGUIFacade; -import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; -import at.gv.egiz.smcc.SignatureCard; -import at.gv.egiz.stal.QuitRequest; -import at.gv.egiz.stal.STALRequest; -import at.gv.egiz.stal.STALResponse; - -public abstract class MultiInstanceHandler implements SMCCSTALRequestHandler { - - private static Log log = LogFactory.getLog(MultiInstanceHandler.class); - - protected List handlerList = new ArrayList(); - - - - protected MultiInstanceHandler() { - } - - public void registerHandlerInstance(SMCCSTALRequestHandler handler) { - handlerList.add(handler); - } - - public void unregisterHandlerInstance(SMCCSTALRequestHandler handler) { - handlerList.remove(handler); - } - - - @Override - public void init(SignatureCard sc, BKUGUIFacade gui) { - } - - @Override - public SMCCSTALRequestHandler newInstance() { - return this; - } - - @Override - public boolean requireCard() { - return false; - } -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java deleted file mode 100644 index ab07e1a8..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/QuitHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egiz.bku.online.applet; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; -import at.gv.egiz.stal.QuitRequest; -import at.gv.egiz.stal.STALRequest; -import at.gv.egiz.stal.STALResponse; - -public class QuitHandler extends MultiInstanceHandler { - - private static Log log = LogFactory.getLog(QuitHandler.class); - - private static QuitHandler instance = new QuitHandler(); - - private QuitHandler() { - } - - public static QuitHandler getInstance() { - return instance; - } - - @Override - public STALResponse handleRequest(STALRequest request) { - if (request instanceof QuitRequest) { - log.info("Received QuitCommand"); - for (SMCCSTALRequestHandler handler : handlerList) { - handler.handleRequest(request); - } - } else { - log.error("Unexpected request to handle: " + request); - } - return null; - } - -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java index 4a87b8b5..b417fd33 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java @@ -16,24 +16,25 @@ */ package at.gv.egiz.bku.online.applet; -import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.HashDataInput; -import at.gv.egiz.stal.impl.ByteArrayHashDataInput; -import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.types.GetHashDataInputType; -import at.gv.egiz.stal.signedinfo.DigestMethodType; -import at.gv.egiz.stal.signedinfo.ReferenceType; import java.security.DigestException; import java.security.MessageDigest; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.impl.ByteArrayHashDataInput; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.signedinfo.DigestMethodType; +import at.gv.egiz.stal.signedinfo.ReferenceType; + /** * @author clemens */ @@ -159,9 +160,4 @@ public class WebServiceSignRequestHandler extends SignRequestHandler { gui.showHashDataInputDialog(hashDataInputs, this, "ok"); } - - @Override - public SMCCSTALRequestHandler newInstance() { - return new WebServiceSignRequestHandler(this.sessId, this.stalPort); - } } -- cgit v1.2.3 From 036dd1a8054c5dc818d01e238eb9480d67da478d Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 30 Oct 2008 17:43:40 +0000 Subject: Help Icon git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@130 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 158 ++++++++++++--------- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 24 +--- .../bku/online/applet/ExternalHelpListener.java | 70 +++++++++ BKUApplet/src/main/resources/simplelog.properties | 2 +- BKUApplet/src/test/resources/appletTest.html | 9 +- 5 files changed, 174 insertions(+), 89 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 97b5869f..470534da 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -21,6 +21,8 @@ import java.net.URL; import java.util.Locale; import java.util.ResourceBundle; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; @@ -36,79 +38,105 @@ import at.gv.egiz.bku.gui.BKUGUIFactory; */ public class BKUApplet extends JApplet { - private static Log log = LogFactory.getLog(BKUApplet.class); - public static final String GUI_STYLE = "GuiStyle"; - public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; - public final static String LOCALE_PARAM_KEY = "Locale"; - public final static String LOGO_URL_KEY = "LogoURL"; - public final static String WSDL_URL = "WSDL_URL"; - public static final String HASHDATA_DISPLAY = "HashDataDisplay"; - public final static String HASHDATA_URL = "HashDataURL"; - public final static String SESSION_ID = "SessionID"; - public static final String BACKGROUND_PARAM = "Background"; - public static final String REDIRECT_URL = "RedirectURL"; - public static final String REDIRECT_TARGET = "RedirectTarget"; - - public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; - - protected ResourceBundle resourceBundle; - protected BKUWorker worker; - protected Thread workerThread; + private static Log log = LogFactory.getLog(BKUApplet.class); + public static final String GUI_STYLE = "GuiStyle"; + public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; + public final static String LOCALE_PARAM_KEY = "Locale"; + public final static String LOGO_URL_KEY = "LogoURL"; + public final static String WSDL_URL = "WSDL_URL"; + public static final String HASHDATA_DISPLAY = "HashDataDisplay"; + public final static String HASHDATA_URL = "HashDataURL"; + public final static String HELP_URL = "HelpURL"; + public final static String SESSION_ID = "SessionID"; + public static final String BACKGROUND_PARAM = "Background"; + public static final String REDIRECT_URL = "RedirectURL"; + public static final String REDIRECT_TARGET = "RedirectTarget"; + public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; + protected ResourceBundle resourceBundle; + protected BKUWorker worker; + protected Thread workerThread; - public BKUApplet() { - } + public BKUApplet() { + } - public void init() { - log.info("Welcome to MOCCA\n"); - log.debug("Called init()"); - HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); - String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); - if (localeString != null) { - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, + @Override + public void init() { + log.info("Welcome to MOCCA\n"); + log.debug("Called init()"); + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); + String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); + if (localeString != null) { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, new Locale(localeString)); - } else { - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); - } - String backgroundString = getMyAppletParameter(BACKGROUND_PARAM); - URL background = null; - if (backgroundString != null) { - try { - background = new URL(backgroundString); - } catch (MalformedURLException ex) { - log.warn(ex.getMessage() + ", using default background"); - } - } - String guiStyle = getMyAppletParameter(GUI_STYLE); - BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); - gui.init(getContentPane(), localeString, background); - worker = new BKUWorker(gui, this, resourceBundle); + } else { + resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); } - - public void start() { - log.debug("Called start()"); - workerThread = new Thread(worker); - workerThread.start(); + String backgroundString = getMyAppletParameter(BACKGROUND_PARAM); + URL background = null; + if (backgroundString != null) { + try { + background = new URL(backgroundString); + } catch (MalformedURLException ex) { + log.warn(ex.getMessage() + ", using default background"); + } } - - public void stop() { - log.debug("Called stop()"); - if ((workerThread != null) && (workerThread.isAlive())) { - workerThread.interrupt(); - } + String guiStyle = getMyAppletParameter(GUI_STYLE); + BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); + ExternalHelpListener helpListener = null; + try { + URL helpURL = getMyAppletParameterURL(HELP_URL); + helpListener = new ExternalHelpListener(getAppletContext(), helpURL, localeString); + } catch (MalformedURLException ex) { + log.error("invalid help URL: " + ex.getMessage()); } + gui.init(getContentPane(), localeString, background, helpListener); + worker = new BKUWorker(gui, this, resourceBundle); + } - public void destroy() { - log.debug("Called destroy()"); + @Override + public void start() { + log.debug("Called start()"); + workerThread = new Thread(worker); + workerThread.start(); + } + + @Override + public void stop() { + log.debug("Called stop()"); + if ((workerThread != null) && (workerThread.isAlive())) { + workerThread.interrupt(); } + } + + @Override + public void destroy() { + log.debug("Called destroy()"); + } + + /** + * Applet configuration parameters + * + * @param paramKey + * @return + */ + String getMyAppletParameter(String paramKey) { + log.info("Getting parameter: " + paramKey + ": " + getParameter(paramKey)); + return getParameter(paramKey); + } - /** - * Applet configuration parameters - * - * @param paramKey - * @return - */ - public String getMyAppletParameter(String paramKey) { - log.info("Getting parameter: " + paramKey + ": " + getParameter(paramKey)); - return getParameter(paramKey); + URL getMyAppletParameterURL(String param) throws MalformedURLException { + String hashDataParam = getMyAppletParameter(param); //BKUApplet.HASHDATA_URL); + if (hashDataParam != null) { + URL codebase = getCodeBase(); + try { + return new URL(codebase, hashDataParam); + } catch (MalformedURLException ex) { + log.error("Paremeter " + param + " is not a valid URL.", ex); + throw new MalformedURLException(ex.getMessage()); + } + } else { + log.error("Paremeter " + param + " not set"); + throw new MalformedURLException(param + " not set"); } + } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index f708826d..78f3dc12 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -24,6 +24,8 @@ import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.xml.namespace.QName; import org.apache.commons.logging.Log; @@ -46,6 +48,7 @@ import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.util.STALTranslator; +import javax.naming.ConfigurationException; public class BKUWorker extends AbstractSMCCSTAL implements Runnable, ActionListener, SMCCSTALRequestHandler { @@ -68,7 +71,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, public BKUWorker(BKUGUIFacade gui, BKUApplet parent, ResourceBundle errorMessageBundle) { if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { - throw new NullPointerException("Parameter must not be set to null"); + throw new NullPointerException("Parameter must not be set to null"); } this.gui = gui; this.parent = parent; @@ -117,23 +120,6 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, return stal.getSTALPort(); } - private URL getHashDataURL() throws MalformedURLException { - String hashDataParam = parent.getMyAppletParameter(BKUApplet.HASHDATA_URL); - URL codebase = parent.getCodeBase(); - if (hashDataParam != null) { - try { - return new URL(codebase, hashDataParam); -// log.debug("Found HashDataInputServlet URL: " + hashDataURL); - } catch (MalformedURLException ex) { - log.fatal("Paremeter " + BKUApplet.HASHDATA_URL + " is not a vailid URL.", ex); - throw new MalformedURLException(ex.getMessage()); - } - } else { - log.fatal("Paremeter " + BKUApplet.HASHDATA_URL + " not set"); - throw new MalformedURLException(BKUApplet.HASHDATA_URL + " not set"); - } - } - @Override public void run() { gui.showWelcomeDialog(); @@ -165,7 +151,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); } else { //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) { - URL hashDataURL = getHashDataURL(); + URL hashDataURL = parent.getMyAppletParameterURL(BKUApplet.HASHDATA_URL); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(parent.getAppletContext(), hashDataURL)); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java new file mode 100644 index 00000000..4d6d5851 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package at.gv.egiz.bku.online.applet; + +import java.applet.AppletContext; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.net.MalformedURLException; +import java.net.URL; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author clemens + */ +public class ExternalHelpListener implements ActionListener { + + protected final static Log log = LogFactory.getLog(ExternalHelpListener.class); + protected AppletContext ctx; + protected String helpURLBase; + protected String locale; + + public ExternalHelpListener(AppletContext ctx, URL helpURL, String locale) { + if (ctx == null) { + throw new RuntimeException("no applet context provided"); + } + if (helpURL == null || "".equals(helpURL)) { + throw new RuntimeException("no help URL provided"); + } + this.ctx = ctx; + this.helpURLBase = helpURL.toString(); + this.locale = locale; + } + + @Override + public void actionPerformed(ActionEvent e) { + log.debug("received help action: " + e.getActionCommand()); + URL helpURL; + try { + String urlString = helpURLBase; + if (locale != null) { + urlString = appendParameter(urlString, "locale", locale); + } + if (e.getActionCommand() != null && !"".equals(e.getActionCommand())) { + urlString = appendParameter(urlString, "topic", e.getActionCommand()); + } + helpURL = new URL(urlString); + } catch (MalformedURLException ex) { + try { + log.error("failed to create help URL: " + ex.getMessage()); + helpURL = new URL(helpURLBase); + } catch (MalformedURLException ex1) { + log.error("failed to create default help URL, requested help will not be displayed"); + return; + } + } + ctx.showDocument(helpURL, "_blank"); + } + + private String appendParameter(String url, String paramName, String paramValue) { + if (url.indexOf('?') < 0) { + return url + "?" + paramName + "=" + paramValue; + } else { + return url + "&" + paramName + "=" + paramValue; + } + } +} diff --git a/BKUApplet/src/main/resources/simplelog.properties b/BKUApplet/src/main/resources/simplelog.properties index 51be76a8..d62508cf 100644 --- a/BKUApplet/src/main/resources/simplelog.properties +++ b/BKUApplet/src/main/resources/simplelog.properties @@ -15,7 +15,7 @@ # Logging detail level, # Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). -org.apache.commons.logging.simplelog.defaultlog=trace +org.apache.commons.logging.simplelog.defaultlog=debug # Logs the Log instance used org.apache.commons.logging.simplelog.showlogname=true #Logs the class name with package(or Path) diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 472000de..daf8445b 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -19,14 +19,15 @@
- + width=300 height=200> + - + + - +
-- cgit v1.2.3 From 8479ef50c84e8998f7909074df6a23c2ff0aa5b0 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 31 Oct 2008 12:33:18 +0000 Subject: Help Icon git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@132 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/nb-configuration.xml | 6 ++++++ .../applet/ExternalDisplaySignRequestHandler.java | 16 ++++++++++++++-- .../gv/egiz/bku/online/applet/ExternalHelpListener.java | 17 +++++++++++++++-- .../bku/online/applet/InternalSSLSocketFactory.java | 4 ---- .../bku/online/applet/WebServiceSignRequestHandler.java | 1 + 5 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 BKUApplet/nb-configuration.xml (limited to 'BKUApplet') diff --git a/BKUApplet/nb-configuration.xml b/BKUApplet/nb-configuration.xml new file mode 100644 index 00000000..352a03be --- /dev/null +++ b/BKUApplet/nb-configuration.xml @@ -0,0 +1,6 @@ + + + + bka + + diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java index 2ac1bc62..2c9fde71 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java @@ -1,6 +1,18 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package at.gv.egiz.bku.online.applet; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java index 4d6d5851..f92a6963 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java @@ -1,7 +1,20 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package at.gv.egiz.bku.online.applet; import java.applet.AppletContext; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java index fa3587e4..c3417d63 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java @@ -14,10 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ package at.gv.egiz.bku.online.applet; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java index b417fd33..ddbe76bf 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package at.gv.egiz.bku.online.applet; import java.security.DigestException; -- cgit v1.2.3 From 9be429abebb90f3e4e97c215a354acedc4e0f49d Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 31 Oct 2008 12:42:49 +0000 Subject: License git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@134 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/nb-configuration.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 BKUApplet/nb-configuration.xml (limited to 'BKUApplet') diff --git a/BKUApplet/nb-configuration.xml b/BKUApplet/nb-configuration.xml deleted file mode 100644 index 352a03be..00000000 --- a/BKUApplet/nb-configuration.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - bka - - -- cgit v1.2.3 From 4032e46810c24dc3f013de296a2133f4651696b9 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 31 Oct 2008 15:30:34 +0000 Subject: local HelpListener card locked/not activated git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@137 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../egiz/bku/online/applet/AppletHelpListener.java | 46 ++++++++++++ .../at/gv/egiz/bku/online/applet/BKUApplet.java | 4 +- .../bku/online/applet/ExternalHelpListener.java | 83 ---------------------- 3 files changed, 48 insertions(+), 85 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java new file mode 100644 index 00000000..a0305eb4 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java @@ -0,0 +1,46 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.gui.AbstractHelpListener; +import java.applet.AppletContext; +import java.net.URL; + +/** + * + * @author clemens + */ +public class AppletHelpListener extends AbstractHelpListener { + + protected AppletContext ctx; + + public AppletHelpListener(AppletContext ctx, URL helpURL, String locale) { + super(helpURL, locale); + if (ctx == null) { + throw new RuntimeException("no applet context provided"); + } + this.ctx = ctx; + } + + @Override + public void showDocument(URL helpDocument) throws Exception { + ctx.showDocument(helpDocument, "_blank"); + } + + +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 470534da..2b0188bb 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -82,10 +82,10 @@ public class BKUApplet extends JApplet { } String guiStyle = getMyAppletParameter(GUI_STYLE); BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); - ExternalHelpListener helpListener = null; + AppletHelpListener helpListener = null; try { URL helpURL = getMyAppletParameterURL(HELP_URL); - helpListener = new ExternalHelpListener(getAppletContext(), helpURL, localeString); + helpListener = new AppletHelpListener(getAppletContext(), helpURL, localeString); } catch (MalformedURLException ex) { log.error("invalid help URL: " + ex.getMessage()); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java deleted file mode 100644 index f92a6963..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package at.gv.egiz.bku.online.applet; - -import java.applet.AppletContext; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.MalformedURLException; -import java.net.URL; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * - * @author clemens - */ -public class ExternalHelpListener implements ActionListener { - - protected final static Log log = LogFactory.getLog(ExternalHelpListener.class); - protected AppletContext ctx; - protected String helpURLBase; - protected String locale; - - public ExternalHelpListener(AppletContext ctx, URL helpURL, String locale) { - if (ctx == null) { - throw new RuntimeException("no applet context provided"); - } - if (helpURL == null || "".equals(helpURL)) { - throw new RuntimeException("no help URL provided"); - } - this.ctx = ctx; - this.helpURLBase = helpURL.toString(); - this.locale = locale; - } - - @Override - public void actionPerformed(ActionEvent e) { - log.debug("received help action: " + e.getActionCommand()); - URL helpURL; - try { - String urlString = helpURLBase; - if (locale != null) { - urlString = appendParameter(urlString, "locale", locale); - } - if (e.getActionCommand() != null && !"".equals(e.getActionCommand())) { - urlString = appendParameter(urlString, "topic", e.getActionCommand()); - } - helpURL = new URL(urlString); - } catch (MalformedURLException ex) { - try { - log.error("failed to create help URL: " + ex.getMessage()); - helpURL = new URL(helpURLBase); - } catch (MalformedURLException ex1) { - log.error("failed to create default help URL, requested help will not be displayed"); - return; - } - } - ctx.showDocument(helpURL, "_blank"); - } - - private String appendParameter(String url, String paramName, String paramValue) { - if (url.indexOf('?') < 0) { - return url + "?" + paramName + "=" + paramValue; - } else { - return url + "&" + paramName + "=" + paramValue; - } - } -} -- cgit v1.2.3 From 9829de9c9b19dcca15676aaf9737195cc059a66c Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 3 Nov 2008 09:37:14 +0000 Subject: local HelpListener DesktopAPI git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@138 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java | 3 ++- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java index a0305eb4..4040431f 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java @@ -20,6 +20,7 @@ package at.gv.egiz.bku.online.applet; import at.gv.egiz.bku.gui.AbstractHelpListener; import java.applet.AppletContext; import java.net.URL; +import java.util.Locale; /** * @@ -29,7 +30,7 @@ public class AppletHelpListener extends AbstractHelpListener { protected AppletContext ctx; - public AppletHelpListener(AppletContext ctx, URL helpURL, String locale) { + public AppletHelpListener(AppletContext ctx, URL helpURL, Locale locale) { super(helpURL, locale); if (ctx == null) { throw new RuntimeException("no applet context provided"); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 2b0188bb..50d66d80 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -65,9 +65,11 @@ public class BKUApplet extends JApplet { log.debug("Called init()"); HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); + Locale locale = null; if (localeString != null) { + locale = new Locale(localeString); resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, - new Locale(localeString)); + locale); } else { resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); } @@ -85,7 +87,7 @@ public class BKUApplet extends JApplet { AppletHelpListener helpListener = null; try { URL helpURL = getMyAppletParameterURL(HELP_URL); - helpListener = new AppletHelpListener(getAppletContext(), helpURL, localeString); + helpListener = new AppletHelpListener(getAppletContext(), helpURL, locale); } catch (MalformedURLException ex) { log.error("invalid help URL: " + ex.getMessage()); } -- cgit v1.2.3 From 6211ed7f96c4ee6e1616a7c1e44477b9f3e8117f Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 3 Nov 2008 12:36:42 +0000 Subject: localization git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@140 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 20 +++++++------------- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 17 ++++++----------- .../at/gv/egiz/bku/online/applet/images/logo.png | Bin 4035 -> 0 bytes 3 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 50d66d80..bde055ec 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -40,7 +40,6 @@ public class BKUApplet extends JApplet { private static Log log = LogFactory.getLog(BKUApplet.class); public static final String GUI_STYLE = "GuiStyle"; - public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages"; public final static String LOCALE_PARAM_KEY = "Locale"; public final static String LOGO_URL_KEY = "LogoURL"; public final static String WSDL_URL = "WSDL_URL"; @@ -52,7 +51,6 @@ public class BKUApplet extends JApplet { public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; - protected ResourceBundle resourceBundle; protected BKUWorker worker; protected Thread workerThread; @@ -64,14 +62,9 @@ public class BKUApplet extends JApplet { log.info("Welcome to MOCCA\n"); log.debug("Called init()"); HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); - String localeString = getMyAppletParameter(LOCALE_PARAM_KEY); - Locale locale = null; - if (localeString != null) { - locale = new Locale(localeString); - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE, - locale); - } else { - resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE); + String locale = getMyAppletParameter(LOCALE_PARAM_KEY); + if (locale != null) { + this.setLocale(new Locale(locale)); } String backgroundString = getMyAppletParameter(BACKGROUND_PARAM); URL background = null; @@ -84,15 +77,16 @@ public class BKUApplet extends JApplet { } String guiStyle = getMyAppletParameter(GUI_STYLE); BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); + log.debug("setting GUI locale to " + getLocale()); AppletHelpListener helpListener = null; try { URL helpURL = getMyAppletParameterURL(HELP_URL); - helpListener = new AppletHelpListener(getAppletContext(), helpURL, locale); + helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale()); } catch (MalformedURLException ex) { log.error("invalid help URL: " + ex.getMessage()); } - gui.init(getContentPane(), localeString, background, helpListener); - worker = new BKUWorker(gui, this, resourceBundle); + gui.init(getContentPane(), getLocale(), background, helpListener); + worker = new BKUWorker(gui, this); } @Override diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 78f3dc12..843f6c4c 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -48,7 +48,6 @@ import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.util.STALTranslator; -import javax.naming.ConfigurationException; public class BKUWorker extends AbstractSMCCSTAL implements Runnable, ActionListener, SMCCSTALRequestHandler { @@ -57,25 +56,22 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, protected BKUGUIFacade gui; protected BKUApplet parent; private STALPortType stalPort; -// private URL hashDataURL; protected List actionCommandList = new ArrayList(); protected Boolean actionPerformed = false; protected boolean finished = false; - protected ResourceBundle errorMessages; /** * * @param gui * must not be null */ - public BKUWorker(BKUGUIFacade gui, BKUApplet parent, - ResourceBundle errorMessageBundle) { - if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { + public BKUWorker(BKUGUIFacade gui, BKUApplet parent) { + if (gui == null || parent == null) { throw new NullPointerException("Parameter must not be set to null"); } this.gui = gui; + this.locale = gui.getLocale(); this.parent = parent; - this.errorMessages = errorMessageBundle; addRequestHandler(QuitRequest.class, this); // register SignRequestHandler once we have a webservice port } @@ -86,9 +82,9 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, * @param gui * @param errorMessageBundle */ - protected BKUWorker(BKUGUIFacade gui, ResourceBundle errorMessageBundle) { + protected BKUWorker(BKUGUIFacade gui) { this.gui = gui; - this.errorMessages = errorMessageBundle; + this.locale = gui.getLocale(); addRequestHandler(QuitRequest.class, this); } @@ -342,8 +338,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } break; case SMCCHelper.CARD_FOUND: - // gui.showWaitDialog(null); - signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); + signatureCard = smccHelper.getSignatureCard(locale); return false; } smccHelper.update(3000); diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png deleted file mode 100644 index eee4be4f..00000000 Binary files a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png and /dev/null differ -- cgit v1.2.3 From 4d27cbd65e358f9ae778b6911e8de527e86f6bda Mon Sep 17 00:00:00 2001 From: mcentner Date: Mon, 3 Nov 2008 14:31:47 +0000 Subject: Localization default language set to German (de). git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@141 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/Messages.properties | 58 ---------------------- .../egiz/bku/online/applet/Messages_de.properties | 42 ---------------- 2 files changed, 100 deletions(-) delete mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties delete mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties deleted file mode 100644 index 752004e8..00000000 --- a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2008 Federal Chancellery Austria and -# Graz University of Technology -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -------- BEGIN bootstrap applet -----------# -java16required=This Applet requires Java 1.6 or higher to run. \ - Please download and install a recent version of Java. \ -

For Windows, Linux and Solaris plattforms you can download Java from \ - http://java.sun.com/javase/downloads.\ -

- -failedtostart=Failed to start Applet. \ -

{0}

-# -------- END bootstrap applet -----------# - - -applet.name=Online Citicen Card Environment (CCE) - -nopcscsupport=The Java plattform does not seem to provide \ -a PC/SC interface to acces a smartcard. - -nocardterminal=Can not find a connected smartcard reader.\ -

Either there is no smartcard reader connected, or \ - no PC/SC driver is installed for a connected smartcard reader.

- -insertcard=Please insert your citicen card (B\u00FCrgerkarte) into your \ - smartcard reader. - -unsupportedcard=The inserted smartcard is not supported.\ -

Please insert your citicen card (B\u00FCrgerkarte) \ - into your smartcard reader.

- -enterpin=Please enter {0} \(min {1}, max {2} digits\). - -enterpinretries=Please enter {0} \(min {1}, max {2} digits, {3} retries left\). - -pinwrong=Entered PIN is wrong. - -button.ok=Ok - -button.cancel=Cancel - -status.findpcsc=Looking for PC/SC support - -status.findsupportedcard=Looking for a supported smartcard - -failed.WS=Webservice cannot be reached. \ No newline at end of file diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties deleted file mode 100644 index e6b815e9..00000000 --- a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2008 Federal Chancellery Austria and -# Graz University of Technology -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -------- BEGIN bootstrap applet -----------# -java16required=Dieses Applet ben\u00F6tigt Java Version 1.6 oder h\u00F6her. \ - Bitte installieren sie eine aktulle Version von Java. \ -

F\u00FCr Windows, Linux and Solaris kann Java von \ - http://java.sun.com/javase/downloads \ - heruntergeladen werden.

- -failedtostart=Das Applet konnte nicht gestartet werden. \ -

{0}

-# -------- END bootstrap applet -----------# - -applet.name=Online B\u00FCrgerkartenumgebung (BKU) - -nopcscsupport=Die Java-Installation stellt keine \ - PC/SC-Schnittstelle zum Zugriff auf eine Chipkarte zur Verf\u00FCgung. - -nocardterminal=Es konnte kein Chipkartenleser gefunden werden.\ -

Entweder, es ist kein Chipkartenleser angeschlossen, oder \ - f\u00FCr den angeschlossenen Chipkartenleser ist kein PC/SC-Treiber \ - installiert.

- -insertcard=Bitte stecken Sie ihre B\u00FCrgerkarte in den Chipkartenleser. - -unsupportedcard=Die gesteckte Chipkarte wird nicht unterst\u00FCtzt.\ -

Bitte stecken Sie ihre B\u00FCrgerkare in den Chipkartenleser

- -failed.WS=Das Webservice kann nicht erreicht werden. \ No newline at end of file -- cgit v1.2.3 From c7c00fbb89717c2a3a51f64908ad78a61ae70da0 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 5 Nov 2008 10:05:54 +0000 Subject: BKUWorker refactoring jssessionId git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@148 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 205 +++++++++++ .../bku/online/applet/AppletParameterProvider.java | 57 ++++ .../at/gv/egiz/bku/online/applet/BKUApplet.java | 125 ++++--- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 374 --------------------- .../applet/WebServiceSignRequestHandler.java | 2 +- 5 files changed, 343 insertions(+), 420 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java new file mode 100644 index 00000000..2141165b --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -0,0 +1,205 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.smccstal.AbstractBKUWorker; +import at.gv.egiz.bku.gui.BKUGUIFacade; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.STALResponse; +import at.gv.egiz.stal.SignRequest; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.STALService; +import at.gv.egiz.stal.service.types.ErrorResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; +import at.gv.egiz.stal.service.types.ObjectFactory; +import at.gv.egiz.stal.service.types.RequestType; +import at.gv.egiz.stal.service.types.ResponseType; +import at.gv.egiz.stal.util.STALTranslator; +import java.applet.AppletContext; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; + +/** + * + * @author Clemens Orthacker + */ +public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { + + protected AppletContext ctx; + protected AppletParameterProvider params; + protected String sessionId; + protected STALPortType stalPort; + + public AppletBKUWorker(BKUGUIFacade gui, AppletContext ctx, AppletParameterProvider paramProvider) { + super(gui); + if (ctx == null) { + throw new NullPointerException("Applet context not provided"); + } + if (paramProvider == null) { + throw new NullPointerException("No applet parameters provided"); + } + this.ctx = ctx; + this.params = paramProvider; + + sessionId = params.getAppletParameter(BKUApplet.SESSION_ID); + if (sessionId == null) { + sessionId = "TestSession"; + log.info("using dummy sessionId " + sessionId); + } + } + + @Override + public void run() { + gui.showWelcomeDialog(); + try { + stalPort = getSTALPort(); + } catch (Exception e) { + log.fatal("Failed to get STAL web-service port: " + e.getMessage(), e); + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, + new Object[]{e.getMessage()}); + try { + waitForAction(); + } catch (InterruptedException e1) { + log.error(e1); + } + return; + } + + try { + registerSignRequestHandler(); + + ObjectFactory of = new ObjectFactory(); + + GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); + do { + List requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); + List stalRequests = STALTranslator.translateRequests(requests); + + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder("Received "); + sb.append(stalRequests.size()); + sb.append(" STAL requests: "); + for (STALRequest r : stalRequests) { + sb.append(r.getClass()); + sb.append(' '); + } + log.info(sb.toString()); + } + + boolean handle = true; + for (STALRequest request : stalRequests) { + if (request instanceof at.gv.egiz.stal.InfoboxReadRequest) { + at.gv.egiz.stal.InfoboxReadRequest r = (at.gv.egiz.stal.InfoboxReadRequest) request; + String infoboxId = r.getInfoboxIdentifier(); + String domainId = r.getDomainIdentifier(); + if ("IdentityLink".equals(infoboxId) && domainId == null) { + if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { + handle = false; + } + } + } + } + + List responses; + if (handle) { + List stalResponses = handleRequest(stalRequests); + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder(stalResponses.size()); + sb.append(" STAL responses: "); + for (STALResponse r : stalResponses) { + sb.append(r.getClass()); + sb.append(' '); + } + log.info(sb.toString()); + } + responses = STALTranslator.fromSTAL(stalResponses); + } else { + responses = new ArrayList(1); + ErrorResponseType err = of.createErrorResponseType(); + err.setErrorCode(6002); + // err.setErrorMessage(); + responses.add(err); + } + + if (!finished) { + log.info("Not finished yet (BKUWorker: " + this + "), sending responses"); + GetNextRequestType nextRequest = of.createGetNextRequestType(); + nextRequest.setSessionId(sessionId); + nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); + nextRequestResp = stalPort.getNextRequest(nextRequest); + } + } while (!finished); + log.info("Done " + Thread.currentThread().getName()); + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[]{ex.getMessage()}); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + } + if (signatureCard != null) { + signatureCard.disconnect(false); + } + sendRedirect(); + } + + protected void sendRedirect() { + try { + URL redirectURL = params.getURLParameter(BKUApplet.REDIRECT_URL, sessionId); + String redirectTarget = params.getAppletParameter(BKUApplet.REDIRECT_TARGET); + if (redirectTarget == null) { + log.info("Done. Redirecting to " + redirectURL + " ..."); + ctx.showDocument(redirectURL); + } else { + log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); + ctx.showDocument(redirectURL, redirectTarget); + } + } catch (MalformedURLException ex) { + log.warn("Failed to redirect: " + ex.getMessage(), ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) + } + } + + private STALPortType getSTALPort() throws MalformedURLException { + URL wsdlURL = params.getURLParameter(BKUApplet.WSDL_URL); + log.debug("STAL WSDL at " + wsdlURL); + QName endpointName = new QName(BKUApplet.STAL_WSDL_NS, BKUApplet.STAL_SERVICE); + STALService stal = new STALService(wsdlURL, endpointName); + return stal.getSTALPort(); + } + + private void registerSignRequestHandler() throws MalformedURLException { + String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); + if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { + log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); + addRequestHandler(SignRequest.class, new WebServiceSignRequestHandler(stalPort, sessionId)); + } else { + //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) { + URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId); + log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); + addRequestHandler(SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); + } + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java new file mode 100644 index 00000000..42e2d6ff --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java @@ -0,0 +1,57 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package at.gv.egiz.bku.online.applet; + +import java.net.MalformedURLException; +import java.net.URL; + +/** + * + * @author Clemens Orthacker + */ +public interface AppletParameterProvider { + + /** + * Applet configuration parameters + * + * @param paramKey + * @return null if no parameter is provided for the given key + */ + String getAppletParameter(String paramKey); + + /** + * Get applet configuration parameter as (absolute) URL + * + * @param paramKey + * @return a URL + * @throws MalformedURLException if configured URL is invalid + * or no parameter is provided for the given key + */ + URL getURLParameter(String paramKey) throws MalformedURLException; + + /** + * Get applet configuration parameter as (absolute) URL + * + * @param paramKey + * @param sessionId adds the jsessionid to the URL + * @return a URL + * @throws MalformedURLException if configured URL is invalid + * or no parameter is provided for the given key + */ + URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException; +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index bde055ec..f3eecdf9 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -16,6 +16,7 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.smccstal.AbstractBKUWorker; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; @@ -36,9 +37,13 @@ import at.gv.egiz.bku.gui.BKUGUIFactory; * Note: all swing code is executed by the event dispatch thread (see * BKUGUIFacade) */ -public class BKUApplet extends JApplet { +public class BKUApplet extends JApplet implements AppletParameterProvider { private static Log log = LogFactory.getLog(BKUApplet.class); + + /** + * Applet parameter keys + */ public static final String GUI_STYLE = "GuiStyle"; public final static String LOCALE_PARAM_KEY = "Locale"; public final static String LOGO_URL_KEY = "LogoURL"; @@ -51,42 +56,59 @@ public class BKUApplet extends JApplet { public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; - protected BKUWorker worker; + + /** + * STAL WSDL namespace and service name + */ + public static final String STAL_WSDL_NS = "http://www.egiz.gv.at/wsdl/stal"; + public static final String STAL_SERVICE = "STALService"; + + /** + * Dummy session id, used if no sessionId parameter is provided + */ + protected static final String TEST_SESSION_ID = "TestSession"; + + /** + * STAL + */ + protected AppletBKUWorker worker; protected Thread workerThread; - public BKUApplet() { - } - + /** + * Factory method to create and wire HelpListener, GUI and BKUWorker. + */ @Override public void init() { - log.info("Welcome to MOCCA\n"); + log.info("Welcome to MOCCA"); log.debug("Called init()"); + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); - String locale = getMyAppletParameter(LOCALE_PARAM_KEY); - if (locale != null) { - this.setLocale(new Locale(locale)); - } - String backgroundString = getMyAppletParameter(BACKGROUND_PARAM); - URL background = null; - if (backgroundString != null) { - try { - background = new URL(backgroundString); - } catch (MalformedURLException ex) { - log.warn(ex.getMessage() + ", using default background"); - } + + String locale = getAppletParameter(LOCALE_PARAM_KEY); + String guiStyle = getAppletParameter(GUI_STYLE); + URL backgroundImgURL = null; + URL helpURL = null; + try { + helpURL = getURLParameter(HELP_URL, getAppletParameter(SESSION_ID)); + } catch (MalformedURLException ex) { + log.warn("failed to load help URL, disabling help: " + ex.getMessage()); } - String guiStyle = getMyAppletParameter(GUI_STYLE); - BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); - log.debug("setting GUI locale to " + getLocale()); - AppletHelpListener helpListener = null; try { - URL helpURL = getMyAppletParameterURL(HELP_URL); - helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale()); + backgroundImgURL = getURLParameter(BACKGROUND_PARAM); } catch (MalformedURLException ex) { - log.error("invalid help URL: " + ex.getMessage()); + log.info("failed to load applet background image, using default: " + ex.getMessage()); } - gui.init(getContentPane(), getLocale(), background, helpListener); - worker = new BKUWorker(gui, this); + + if (locale != null) { + this.setLocale(new Locale(locale)); + } + log.debug("setting locale to " + getLocale()); + + BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); + AppletHelpListener helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale()); + gui.init(getContentPane(), getLocale(), backgroundImgURL, helpListener); + + worker = new AppletBKUWorker(gui, getAppletContext(), this); } @Override @@ -109,30 +131,43 @@ public class BKUApplet extends JApplet { log.debug("Called destroy()"); } - /** - * Applet configuration parameters - * - * @param paramKey - * @return - */ - String getMyAppletParameter(String paramKey) { - log.info("Getting parameter: " + paramKey + ": " + getParameter(paramKey)); - return getParameter(paramKey); + @Override + public String getAppletParameter(String paramKey) { + String param = getParameter(paramKey); + log.info("applet parameter: " + paramKey + ": " + param); + return param; } - URL getMyAppletParameterURL(String param) throws MalformedURLException { - String hashDataParam = getMyAppletParameter(param); //BKUApplet.HASHDATA_URL); - if (hashDataParam != null) { + @Override + public URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { + String urlParam = getParameter(paramKey); + if (urlParam != null) { URL codebase = getCodeBase(); try { - return new URL(codebase, hashDataParam); + URL url; + if (codebase.getProtocol().equalsIgnoreCase("file")) { + // for debugging in appletrunner + url = new URL(urlParam); + } else { + if (sessionId != null) { + urlParam = urlParam + ";jsessionid=" + sessionId; + } + url = new URL(codebase, urlParam); + } + log.info("applet parameter " + url); + return url; } catch (MalformedURLException ex) { - log.error("Paremeter " + param + " is not a valid URL.", ex); - throw new MalformedURLException(ex.getMessage()); - } + log.error("applet paremeter " + urlParam + " is not a valid URL: " + ex.getMessage()); + throw ex; + } } else { - log.error("Paremeter " + param + " not set"); - throw new MalformedURLException(param + " not set"); + log.error("applet paremeter " + urlParam + " not set"); + throw new MalformedURLException(urlParam + " not set"); } } + + @Override + public URL getURLParameter(String paramKey) throws MalformedURLException { + return getURLParameter(paramKey, null); + } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java deleted file mode 100644 index 843f6c4c..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package at.gv.egiz.bku.online.applet; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.ResourceBundle; - -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.xml.namespace.QName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.gui.BKUGUIFacade; -import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; -import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; -import at.gv.egiz.smcc.SignatureCard; -import at.gv.egiz.smcc.util.SMCCHelper; -import at.gv.egiz.stal.QuitRequest; -import at.gv.egiz.stal.STALRequest; -import at.gv.egiz.stal.STALResponse; -import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.STALService; -import at.gv.egiz.stal.service.types.ErrorResponseType; -import at.gv.egiz.stal.service.types.GetNextRequestResponseType; -import at.gv.egiz.stal.service.types.GetNextRequestType; -import at.gv.egiz.stal.service.types.ObjectFactory; -import at.gv.egiz.stal.service.types.RequestType; -import at.gv.egiz.stal.service.types.ResponseType; -import at.gv.egiz.stal.util.STALTranslator; - -public class BKUWorker extends AbstractSMCCSTAL implements Runnable, - ActionListener, SMCCSTALRequestHandler { - - private static Log log = LogFactory.getLog(BKUWorker.class); - protected BKUGUIFacade gui; - protected BKUApplet parent; - private STALPortType stalPort; - protected List actionCommandList = new ArrayList(); - protected Boolean actionPerformed = false; - protected boolean finished = false; - - /** - * - * @param gui - * must not be null - */ - public BKUWorker(BKUGUIFacade gui, BKUApplet parent) { - if (gui == null || parent == null) { - throw new NullPointerException("Parameter must not be set to null"); - } - this.gui = gui; - this.locale = gui.getLocale(); - this.parent = parent; - addRequestHandler(QuitRequest.class, this); - // register SignRequestHandler once we have a webservice port - } - - /** - * Used for non applet variants - * - * @param gui - * @param errorMessageBundle - */ - protected BKUWorker(BKUGUIFacade gui) { - this.gui = gui; - this.locale = gui.getLocale(); - addRequestHandler(QuitRequest.class, this); - } - - private STALPortType getSTALPort() throws MalformedURLException { - URL wsdlURL = null; - String wsdlLocation = parent.getMyAppletParameter(BKUApplet.WSDL_URL); - URL codebase = parent.getCodeBase(); - log.debug("Connecting to webservice: " + wsdlLocation); - if (wsdlLocation != null) { - try { - if (codebase.getProtocol().equalsIgnoreCase("file")) { - // for debugging in appletrunner - wsdlURL = new URL(wsdlLocation); - } else { - wsdlURL = new URL(codebase, wsdlLocation); - } - } catch (MalformedURLException ex) { - log.fatal("Paremeter 'wsdlLocation' is not a vailid URL.", ex); - throw new MalformedURLException(ex.getMessage()); - } - } else { - log.fatal("Paremeter 'wsdlLocation' is not set."); - throw new MalformedURLException("Null WSDL url"); - } - log.debug("Found WSDL url: " + wsdlURL); - QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", - "STALService"); - STALService stal = new STALService(wsdlURL, endpointName); - return stal.getSTALPort(); - } - - @Override - public void run() { - gui.showWelcomeDialog(); - try { - stalPort = getSTALPort(); - } catch (Exception e) { - log.fatal("Failed to call STAL service.", e); - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, - new Object[] { e.getMessage() }); - try { - waitForAction(); - } catch (InterruptedException e1) { - log.error(e1); - } - return; - } - - try { - String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); - if (sessionId == null) { - // use the testsession for testing - sessionId = "TestSession"; - } - - String hashDataDisplayStyle = parent.getMyAppletParameter(BKUApplet.HASHDATA_DISPLAY); - if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { - log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); - } else { //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) { - URL hashDataURL = parent.getMyAppletParameterURL(BKUApplet.HASHDATA_URL); - log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); - addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(parent.getAppletContext(), hashDataURL)); - } - -// log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); -// addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WebServiceSignRequestHandler(sessionId, stalPort)); - - ObjectFactory of = new ObjectFactory(); - GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); - do { - List requests = nextRequestResp - .getInfoboxReadRequestOrSignRequestOrQuitRequest(); - List stalRequests = STALTranslator - .translateRequests(requests); - - if (log.isInfoEnabled()) { - StringBuilder sb = new StringBuilder("Received "); - sb.append(stalRequests.size()); - sb.append(" STAL requests: "); - for (STALRequest r : stalRequests) { - sb.append(r.getClass()); - sb.append(' '); - } - log.info(sb.toString()); - } - - boolean handle = true; - for (STALRequest request : stalRequests) { - if (request instanceof at.gv.egiz.stal.InfoboxReadRequest) { - at.gv.egiz.stal.InfoboxReadRequest r = (at.gv.egiz.stal.InfoboxReadRequest) request; - String infoboxId = r.getInfoboxIdentifier(); - String domainId = r.getDomainIdentifier(); - if ("IdentityLink".equals(infoboxId) && domainId == null) { - if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { - handle = false; - } - } - } - } - - List responses; - if (handle) { - List stalResponses = handleRequest(stalRequests); - if (log.isInfoEnabled()) { - StringBuilder sb = new StringBuilder(stalResponses.size()); - sb.append(" STAL responses: "); - for (STALResponse r : stalResponses) { - sb.append(r.getClass()); - sb.append(' '); - } - log.info(sb.toString()); - } - responses = STALTranslator.fromSTAL(stalResponses); - } else { - responses = new ArrayList(1); - ErrorResponseType err = new ErrorResponseType(); - err.setErrorCode(6002); - // err.setErrorMessage(); - responses.add(err); - } - - if (!finished) { - log.info("Not finished yet (BKUWorker: " + this - + "), sending responses"); - GetNextRequestType nextRequest = of.createGetNextRequestType(); - nextRequest.setSessionId(sessionId); - nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse() - .addAll(responses); - nextRequestResp = stalPort.getNextRequest(nextRequest); - } - } while (!finished); - log.info("Done " + Thread.currentThread().getName()); - } catch (Exception ex) { - log.error(ex.getMessage(), ex); - gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] { ex - .getMessage() }); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - } - if (signatureCard != null) { - signatureCard.disconnect(false); - } - sendRedirect(); - } - - protected void sendRedirect() { - log.info("Done, sending redirect to get BKU response"); - String redirectURL = parent.getMyAppletParameter(BKUApplet.REDIRECT_URL); - String redirectTarget = parent.getMyAppletParameter(BKUApplet.REDIRECT_TARGET); - log.info("Redirecting to: " + redirectURL + " target: " + redirectTarget); - URL url = null; - if (redirectURL != null) { - try { - url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" - + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); - } catch (MalformedURLException ex) { - log.warn("Parameter 'redirectURL': " + redirectURL - + " not a valid URL.", ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) - } - if (url != null) { - if (redirectTarget == null) { - log.info("Done. Trying to redirect to " + url + " ..."); - parent.getAppletContext().showDocument(url); - } else { - log.info("Done. Trying to redirect to " + url + " (target=" - + redirectTarget + ") ..."); - parent.getAppletContext().showDocument(url, redirectTarget); - } - } - } else { - log.error("No redirect URL set"); - } - } - - protected synchronized void waitForAction() throws InterruptedException { - log.info("Waiting for Action"); - while (!actionPerformed) { - wait(); - } - actionPerformed = false; - } - - protected synchronized void actionOccured() { - log.info("Received Action"); - actionPerformed = true; - notifyAll(); - } - - @Override - public void actionPerformed(ActionEvent e) { - log.info("Action: " + e); - if (actionCommandList != null) { - if (actionCommandList.contains(e.getActionCommand())) { - actionOccured(); - } - } else { - actionOccured(); - } - } - - @Override - protected boolean waitForCard() { - SMCCHelper smccHelper = new SMCCHelper(); - actionCommandList.clear(); - actionCommandList.add("cancel"); - // while no sigcard found or cancel button pressed - int oldValue = SMCCHelper.PC_SC_NOT_SUPPORTED; // this is a save default - while ((signatureCard == null) && (!actionPerformed)) { - switch (smccHelper.getResultCode()) { - case SMCCHelper.PC_SC_NOT_SUPPORTED: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, this, "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.TERMINAL_NOT_PRESENT: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(BKUGUIFacade.ERR_NO_CARDTERMINAL, null, this, "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.CARD_NOT_SUPPORTED: - if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { - actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showCardNotSupportedDialog(this, "cancel"); - oldValue = SMCCHelper.CARD_NOT_SUPPORTED; - } - break; - case SMCCHelper.NO_CARD: - if (oldValue != SMCCHelper.NO_CARD) { - actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showInsertCardDialog(this, "cancel"); - oldValue = SMCCHelper.NO_CARD; - } - break; - case SMCCHelper.CARD_FOUND: - signatureCard = smccHelper.getSignatureCard(locale); - return false; - } - smccHelper.update(3000); - } - return signatureCard == null; - } - - @Override - public STALResponse handleRequest(STALRequest request) { - if (request instanceof QuitRequest) { - log.info("Setting state to: finished for BKUWorker " + this); - finished = true; - } else { - log.error("Unexpected request to handle: " + request); - } - return null; - } - - @Override - public void init(SignatureCard sc, BKUGUIFacade gui) { - } - - @Override - public boolean requireCard() { - return false; - } - - @Override - protected BKUGUIFacade getGUI() { - return gui; - } - -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java index ddbe76bf..014065f2 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java @@ -45,7 +45,7 @@ public class WebServiceSignRequestHandler extends SignRequestHandler { STALPortType stalPort; String sessId; - public WebServiceSignRequestHandler(String sessId, STALPortType stalPort) { + public WebServiceSignRequestHandler(STALPortType stalPort, String sessId) { if (stalPort == null || sessId == null) { throw new NullPointerException("STAL port must not be null"); } -- cgit v1.2.3 From 2cf6fcb31e85b0e3b367121219932ec86b205da8 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 5 Nov 2008 14:42:05 +0000 Subject: help jsp git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@151 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index f3eecdf9..4eab7e89 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -89,7 +89,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { URL backgroundImgURL = null; URL helpURL = null; try { - helpURL = getURLParameter(HELP_URL, getAppletParameter(SESSION_ID)); + helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); } catch (MalformedURLException ex) { log.warn("failed to load help URL, disabling help: " + ex.getMessage()); } -- cgit v1.2.3 From 8171050e1b21733a5e55ce97ebc9134f6afb1abb Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 5 Nov 2008 17:22:51 +0000 Subject: java.awt.Desktop BROWSE for help and hashdatadisplay git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@152 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 2 +- .../egiz/bku/online/applet/AppletHelpListener.java | 35 +++++++++++++++------- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 6 +--- .../applet/ExternalDisplaySignRequestHandler.java | 27 ++++++++++++----- BKUApplet/src/test/resources/appletTest.html | 2 +- 5 files changed, 48 insertions(+), 24 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 2141165b..cf842d55 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -199,7 +199,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) { URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); - addRequestHandler(SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL)); + addRequestHandler(SignRequest.class, new ExternalDisplaySignRequestHandler(hashDataURL)); // } } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java index 4040431f..743dc7ef 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java @@ -18,30 +18,45 @@ package at.gv.egiz.bku.online.applet; import at.gv.egiz.bku.gui.AbstractHelpListener; -import java.applet.AppletContext; +import java.awt.Desktop; import java.net.URL; import java.util.Locale; /** - * + * Now uses java.awt.Desktop, which deprecates + * the distinction between local and applet help listener + * TODO: integrate in AbstractHelpListener + * + * @deprecated * @author clemens */ public class AppletHelpListener extends AbstractHelpListener { - protected AppletContext ctx; +// protected AppletContext ctx; + protected Desktop desktop; - public AppletHelpListener(AppletContext ctx, URL helpURL, Locale locale) { + public AppletHelpListener(URL helpURL, Locale locale) { super(helpURL, locale); - if (ctx == null) { - throw new RuntimeException("no applet context provided"); +// if (ctx == null) { +// throw new RuntimeException("no applet context provided"); +// } +// this.ctx = ctx; + if (Desktop.isDesktopSupported()) { + this.desktop = Desktop.getDesktop(); } - this.ctx = ctx; } @Override public void showDocument(URL helpDocument) throws Exception { - ctx.showDocument(helpDocument, "_blank"); +// ctx.showDocument(helpDocument, "_blank"); + if (desktop == null) { + log.error("Failed to open default browser: Desktop API not available (libgnome installed?)"); + } else { + if (!desktop.isSupported(Desktop.Action.BROWSE)) { + log.error("Failed to open default browser: The system provides the Desktop API, but does not support the BROWSE action"); + } else { + Desktop.getDesktop().browse(helpDocument.toURI()); + } + } } - - } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 4eab7e89..482273b0 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -16,14 +16,10 @@ */ package at.gv.egiz.bku.online.applet; -import at.gv.egiz.bku.smccstal.AbstractBKUWorker; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; -import java.util.ResourceBundle; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; @@ -105,7 +101,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { log.debug("setting locale to " + getLocale()); BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); - AppletHelpListener helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale()); + AppletHelpListener helpListener = new AppletHelpListener(helpURL, getLocale()); //getAppletContext(), gui.init(getContentPane(), getLocale(), backgroundImgURL, helpListener); worker = new AppletBKUWorker(gui, getAppletContext(), this); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java index 2c9fde71..e4567a6c 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java @@ -17,7 +17,6 @@ package at.gv.egiz.bku.online.applet; -import java.applet.AppletContext; import java.net.URL; import java.util.List; @@ -26,28 +25,42 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.smccstal.SignRequestHandler; import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.awt.Desktop; /** * - * @author clemens + * @author Clemens Orthacker */ public class ExternalDisplaySignRequestHandler extends SignRequestHandler { private static final Log log = LogFactory.getLog(ExternalDisplaySignRequestHandler.class); - AppletContext ctx; - URL hashDataURL; +// AppletContext ctx; + protected URL hashDataURL; + protected Desktop desktop; - public ExternalDisplaySignRequestHandler(AppletContext ctx, URL hashDataURL) { - this.ctx = ctx; + public ExternalDisplaySignRequestHandler(URL hashDataURL) { +// this.ctx = ctx; this.hashDataURL = hashDataURL; + if (Desktop.isDesktopSupported()) { + desktop = Desktop.getDesktop(); + } } @Override public void displayHashDataInputs(List signedReferences) throws Exception { //TODO pass reference Id's to servlet (TODO servlet) log.debug("displaying hashdata inputs at " + hashDataURL); - ctx.showDocument(hashDataURL, "_blank"); +// ctx.showDocument(hashDataURL, "_blank"); + if (desktop == null) { + log.error("Failed to open default browser: Desktop API not available (libgnome installed?)"); + } else { + if (!desktop.isSupported(Desktop.Action.BROWSE)) { + log.error("Failed to open default browser: The system provides the Desktop API, but does not support the BROWSE action"); + } else { + Desktop.getDesktop().browse(hashDataURL.toURI()); + } + } } } diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index daf8445b..5aec1998 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -23,7 +23,7 @@ - + -- cgit v1.2.3 From 1a459eb89e4e91308e1022abb8ddd0cae1d8e619 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 6 Nov 2008 12:24:24 +0000 Subject: error msg ws.unreachable dummy helplistener git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@153 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 482273b0..829cc79d 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -83,9 +83,10 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { String locale = getAppletParameter(LOCALE_PARAM_KEY); String guiStyle = getAppletParameter(GUI_STYLE); URL backgroundImgURL = null; - URL helpURL = null; + AppletHelpListener helpListener = null; try { - helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); + URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); + helpListener = new AppletHelpListener(helpURL, getLocale()); //getAppletContext(), } catch (MalformedURLException ex) { log.warn("failed to load help URL, disabling help: " + ex.getMessage()); } @@ -101,7 +102,6 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { log.debug("setting locale to " + getLocale()); BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); - AppletHelpListener helpListener = new AppletHelpListener(helpURL, getLocale()); //getAppletContext(), gui.init(getContentPane(), getLocale(), backgroundImgURL, helpListener); worker = new AppletBKUWorker(gui, getAppletContext(), this); -- cgit v1.2.3 From 82c59c9d862d3ee9ad43fdc1509d0b5a61cc107c Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 11 Nov 2008 12:15:15 +0000 Subject: Frame HashData Display Interrupt in waitForAction (applet closed) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@161 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 12 +- .../bku/online/applet/AppletHashDataDisplay.java | 167 ++++++++++++++++ .../egiz/bku/online/applet/AppletHelpListener.java | 33 +-- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 4 +- .../bku/online/applet/BrowserHashDataDisplay.java | 52 +++++ .../applet/ExternalDisplaySignRequestHandler.java | 66 ------ .../bku/online/applet/JDialogHashDataDisplay.java | 221 +++++++++++++++++++++ .../applet/WebServiceSignRequestHandler.java | 164 --------------- BKUApplet/src/main/resources/simplelog.properties | 2 +- BKUApplet/src/test/resources/appletTest.html | 4 +- 10 files changed, 462 insertions(+), 263 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index cf842d55..8e88c012 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -31,6 +31,7 @@ import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.util.STALTranslator; import java.applet.AppletContext; +import java.awt.Dimension; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; @@ -194,12 +195,15 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - addRequestHandler(SignRequest.class, new WebServiceSignRequestHandler(stalPort, sessionId)); - } else { - //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) { + addRequestHandler(SignRequest.class, new AppletHashDataDisplay(stalPort, sessionId)); + } else if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); - addRequestHandler(SignRequest.class, new ExternalDisplaySignRequestHandler(hashDataURL)); // + addRequestHandler(SignRequest.class, new BrowserHashDataDisplay(ctx, hashDataURL)); + } else { + //BKUApplet.HASHDATA_DISPLAY_FRAME + log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); + addRequestHandler(SignRequest.class, new JDialogHashDataDisplay(stalPort, sessionId, new Dimension(400, 300), locale)); } } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java new file mode 100644 index 00000000..b77485d9 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java @@ -0,0 +1,167 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package at.gv.egiz.bku.online.applet; + +import java.security.DigestException; +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.impl.ByteArrayHashDataInput; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.signedinfo.DigestMethodType; +import at.gv.egiz.stal.signedinfo.ReferenceType; + +/** + * A SignRequesthandler displaying hashdata inputs in the applet + * (only plaintext data is displayed, other hashdata inputs may be saved to disk). + * + * @author Clemens Orthacker + */ +public class AppletHashDataDisplay extends SignRequestHandler { + + private static final Log log = LogFactory.getLog(AppletHashDataDisplay.class); + STALPortType stalPort; + String sessId; + + public AppletHashDataDisplay(STALPortType stalPort, String sessId) { + if (stalPort == null || sessId == null) { + throw new NullPointerException("STAL port must not be null"); + } + this.sessId = sessId; + this.stalPort = stalPort; + } + + @Override + public void displayHashDataInputs(List signedReferences) throws Exception { + + GetHashDataInputType request = new GetHashDataInputType(); + request.setSessionId(sessId); + + HashMap idSignedRefMap = new HashMap(); + for (ReferenceType signedRef : signedReferences) { + //don't get Manifest, QualifyingProperties, ... + if (signedRef.getType() == null) { + String signedRefId = signedRef.getId(); + if (signedRefId != null) { + if (log.isTraceEnabled()) { + log.trace("requesting hashdata input for reference " + signedRefId); + } + idSignedRefMap.put(signedRefId, signedRef); + GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); + ref.setID(signedRefId); + request.getReference().add(ref); + + } else { + throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); + } + } + } + + if (log.isDebugEnabled()) { + log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); + } + GetHashDataInputResponseType response = stalPort.getHashDataInput(request); + ArrayList hashDataInputs = new ArrayList(); + + //hashdata inputs returned from service + HashMap idRefMap = new HashMap(); + for (GetHashDataInputResponseType.Reference reference : response.getReference()) { + String id = reference.getID(); + byte[] hdi = reference.getValue(); + if (hdi == null) { + throw new Exception("Did not receive hashdata input for reference " + id); + } + idRefMap.put(id, reference); + } + + for (String signedRefId : idSignedRefMap.keySet()) { + log.info("validating hashdata input for reference " + signedRefId); + + GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId); + if (reference == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); + } + +// } +// +// for (GetHashDataInputResponseType.Reference reference : response.getReference()) { +// +// String id = reference.getID(); + byte[] hdi = reference.getValue(); + String mimeType = reference.getMimeType(); + String encoding = reference.getEncoding(); + + if (hdi == null) { + throw new Exception("No hashdata input provided for reference " + signedRefId); + } + if (log.isDebugEnabled()) { + log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); + } + + ReferenceType dsigRef = idSignedRefMap.get(signedRefId); + DigestMethodType dm = dsigRef.getDigestMethod(); + + if (dm == null) { + throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); + } + String mdAlg = dm.getAlgorithm(); + if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) + mdAlg = "SHA-1"; + else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) + mdAlg = "SHA-256"; + else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg)) + mdAlg = "SHA-224"; + else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg)) + mdAlg = "SHA-224"; + else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) + mdAlg = "SHA-384"; + else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) + mdAlg = "SHA-512"; + else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) + mdAlg = "MD2"; + else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) + mdAlg = "MD5"; + else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) + mdAlg = "RipeMD-160"; + else { + throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg); + } + MessageDigest md = MessageDigest.getInstance(mdAlg); + byte[] hdiDigest = md.digest(hdi); + if (log.isDebugEnabled()) + log.debug("Comparing digest values... "); + if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) { + log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue())); + throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue())); + } + hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); + } + + gui.showHashDataInputDialog(hashDataInputs, false, this, "ok"); + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java index 743dc7ef..5d199872 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java @@ -18,45 +18,28 @@ package at.gv.egiz.bku.online.applet; import at.gv.egiz.bku.gui.AbstractHelpListener; -import java.awt.Desktop; +import java.applet.AppletContext; import java.net.URL; import java.util.Locale; /** - * Now uses java.awt.Desktop, which deprecates - * the distinction between local and applet help listener - * TODO: integrate in AbstractHelpListener * - * @deprecated - * @author clemens + * @author Clemens Orthacker */ public class AppletHelpListener extends AbstractHelpListener { -// protected AppletContext ctx; - protected Desktop desktop; + protected AppletContext ctx; - public AppletHelpListener(URL helpURL, Locale locale) { + public AppletHelpListener(AppletContext ctx, URL helpURL, Locale locale) { super(helpURL, locale); -// if (ctx == null) { -// throw new RuntimeException("no applet context provided"); -// } -// this.ctx = ctx; - if (Desktop.isDesktopSupported()) { - this.desktop = Desktop.getDesktop(); + if (ctx == null) { + throw new RuntimeException("no applet context provided"); } + this.ctx = ctx; } @Override public void showDocument(URL helpDocument) throws Exception { -// ctx.showDocument(helpDocument, "_blank"); - if (desktop == null) { - log.error("Failed to open default browser: Desktop API not available (libgnome installed?)"); - } else { - if (!desktop.isSupported(Desktop.Action.BROWSE)) { - log.error("Failed to open default browser: The system provides the Desktop API, but does not support the BROWSE action"); - } else { - Desktop.getDesktop().browse(helpDocument.toURI()); - } - } + ctx.showDocument(helpDocument, "_blank"); } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 829cc79d..9d640dee 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -52,6 +52,8 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; + public static final String HASHDATA_DISPLAY_BROWSER = "browser"; + public static final String HASHDATA_DISPLAY_FRAME = "frame"; /** * STAL WSDL namespace and service name @@ -86,7 +88,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { AppletHelpListener helpListener = null; try { URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); - helpListener = new AppletHelpListener(helpURL, getLocale()); //getAppletContext(), + helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale()); } catch (MalformedURLException ex) { log.warn("failed to load help URL, disabling help: " + ex.getMessage()); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java new file mode 100644 index 00000000..c30921da --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java @@ -0,0 +1,52 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package at.gv.egiz.bku.online.applet; + +import java.net.URL; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.applet.AppletContext; + +/** + * + * @author Clemens Orthacker + */ +public class BrowserHashDataDisplay extends SignRequestHandler { + + private static final Log log = LogFactory.getLog(BrowserHashDataDisplay.class); + + protected AppletContext ctx; + protected URL hashDataURL; + + public BrowserHashDataDisplay(AppletContext ctx, URL hashDataURL) { + this.ctx = ctx; + this.hashDataURL = hashDataURL; + } + + @Override + public void displayHashDataInputs(List signedReferences) throws Exception { + //TODO pass reference Id's to servlet (TODO servlet) + log.debug("displaying hashdata inputs at " + hashDataURL); + ctx.showDocument(hashDataURL, "_blank"); + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java deleted file mode 100644 index e4567a6c..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package at.gv.egiz.bku.online.applet; - -import java.net.URL; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.signedinfo.ReferenceType; -import java.awt.Desktop; - -/** - * - * @author Clemens Orthacker - */ -public class ExternalDisplaySignRequestHandler extends SignRequestHandler { - - private static final Log log = LogFactory.getLog(ExternalDisplaySignRequestHandler.class); - -// AppletContext ctx; - protected URL hashDataURL; - protected Desktop desktop; - - public ExternalDisplaySignRequestHandler(URL hashDataURL) { -// this.ctx = ctx; - this.hashDataURL = hashDataURL; - if (Desktop.isDesktopSupported()) { - desktop = Desktop.getDesktop(); - } - } - - @Override - public void displayHashDataInputs(List signedReferences) throws Exception { - //TODO pass reference Id's to servlet (TODO servlet) - log.debug("displaying hashdata inputs at " + hashDataURL); -// ctx.showDocument(hashDataURL, "_blank"); - if (desktop == null) { - log.error("Failed to open default browser: Desktop API not available (libgnome installed?)"); - } else { - if (!desktop.isSupported(Desktop.Action.BROWSE)) { - log.error("Failed to open default browser: The system provides the Desktop API, but does not support the BROWSE action"); - } else { - Desktop.getDesktop().browse(hashDataURL.toURI()); - } - } - } - -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java new file mode 100644 index 00000000..1f0eda90 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java @@ -0,0 +1,221 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.impl.ByteArrayHashDataInput; +import at.gv.egiz.stal.service.GetHashDataInputFault; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.awt.Dimension; +import java.security.DigestException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author Clemens Orthacker + */ +public class JDialogHashDataDisplay extends SignRequestHandler { + + private static final Log log = LogFactory.getLog(JDialogHashDataDisplay.class); + protected STALPortType stalPort; + protected String sessId; +// protected HashDataViewer viewer; + + public JDialogHashDataDisplay(STALPortType stalPort, String sessId, Dimension viewerSize, Locale locale) { + if (stalPort == null || sessId == null) { + throw new NullPointerException("STAL port must not be null"); + } + this.sessId = sessId; + this.stalPort = stalPort; +// this.viewer = new HashDataViewer(viewerSize, locale); + } + + @Override + public void displayHashDataInputs(List signedReferences) throws DigestException, Exception { + + List hdi = getHashDataInput(signedReferences); + final List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); + + if (verifiedHashDataInputs.size() > 1) { + gui.showHashDataInputDialog(verifiedHashDataInputs, false, this, "ok"); + } else if (verifiedHashDataInputs.size() == 1) { + gui.showHashDataInputDialog(verifiedHashDataInputs, true, this, "ok"); +// SwingUtilities.invokeLater(new Runnable() { +// +// @Override +// public void run() { +// viewer.displayHashData(verifiedHashDataInputs.get(0)); +// } +// }); + + } else { + log.error("No hashdata input to display"); + } + + } + + /** + * Get all hashdata inputs that contain an ID attribute and no Type attribute. + * @param signedReferences + * @return + * @throws at.gv.egiz.stal.service.GetHashDataInputFault + */ + private List getHashDataInput(List signedReferences) throws GetHashDataInputFault, Exception { + GetHashDataInputType request = new GetHashDataInputType(); + request.setSessionId(sessId); + +// HashMap idSignedRefMap = new HashMap(); + for (ReferenceType signedRef : signedReferences) { + //don't get Manifest, QualifyingProperties, ... + if (signedRef.getType() == null) { + String signedRefId = signedRef.getId(); + if (signedRefId != null) { + if (log.isTraceEnabled()) { + log.trace("requesting hashdata input for reference " + signedRefId); + } +// idSignedRefMap.put(signedRefId, signedRef); + GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); + ref.setID(signedRefId); + request.getReference().add(ref); + + } else { + throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); + } + } + } + + if (log.isDebugEnabled()) { + log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); + } + GetHashDataInputResponseType response = stalPort.getHashDataInput(request); + return response.getReference(); + } + + /** + * Verifies all signed references and returns STAL HashDataInputs + * @param signedReferences + * @param hashDataInputs + * @return + * @throws java.security.DigestException + * @throws java.security.NoSuchAlgorithmException + * @throws Exception if no hashdata input is provided for a signed reference + */ + private List verifyHashDataInput(List signedReferences, List hashDataInputs) throws DigestException, NoSuchAlgorithmException, Exception { + + ArrayList verifiedHashDataInputs = new ArrayList(); + + //hashdata inputs returned from service +// HashMap idRefMap = new HashMap(); +// for (GetHashDataInputResponseType.Reference hashDataInput : hashDataInputs) { +// String id = hashDataInput.getID(); +// byte[] hdi = hashDataInput.getValue(); +// if (hdi == null) { +// throw new Exception("Did not receive hashdata input for reference " + id); +// } +// idRefMap.put(id, hashDataInput); +// } + + for (ReferenceType signedRef : signedReferences) { + if (signedRef.getType() == null) { + log.info("Verifying digest for signed reference " + signedRef.getId()); + + String signedRefId = signedRef.getId(); + byte[] signedDigest = signedRef.getDigestValue(); + String signedDigestAlg = null; + if (signedRef.getDigestMethod() != null) { + signedDigestAlg = signedRef.getDigestMethod().getAlgorithm(); + } else { + throw new NoSuchAlgorithmException("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); + } + + GetHashDataInputResponseType.Reference hashDataInput = null; //idRefMap.get(signedRefId); + for (GetHashDataInputResponseType.Reference hdi : hashDataInputs) { + if (signedRefId.equals(hdi.getID())) { + hashDataInput = hdi; + } + } + if (hashDataInput == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); + } + + byte[] hdi = hashDataInput.getValue(); + String mimeType = hashDataInput.getMimeType(); + String encoding = hashDataInput.getEncoding(); + + if (hdi == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " provided by service"); + } + if (log.isDebugEnabled()) { + log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); + } + + byte[] hashDataInputDigest = digest(hdi, signedDigestAlg); + + if (log.isDebugEnabled()) { + log.debug("Comparing digest values... "); + } + log.warn("DISABLED DIGEST VERIFICATION FOR DEBUGGING"); +// if (!Arrays.equals(hashDataInputDigest, signedDigest)) { +// log.error("Bad digest value for reference " + signedRefId); +// throw new DigestException("Bad digest value for reference " + signedRefId); +// } + + verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); + } + } + + return verifiedHashDataInputs; + } + + //TODO + private byte[] digest(byte[] hashDataInput, String mdAlg) throws NoSuchAlgorithmException { + if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) { + mdAlg = "SHA-1"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) { + mdAlg = "SHA-256"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha224".equals(mdAlg)) { + mdAlg = "SHA-224"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#sha224".equals(mdAlg)) { + mdAlg = "SHA-224"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) { + mdAlg = "SHA-384"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) { + mdAlg = "SHA-512"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) { + mdAlg = "MD2"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) { + mdAlg = "MD5"; + } else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) { + mdAlg = "RipeMD-160"; + } else { + throw new NoSuchAlgorithmException("Failed to verify digest value: unsupported digest algorithm " + mdAlg); + } + + MessageDigest md = MessageDigest.getInstance(mdAlg); + return md.digest(hashDataInput); + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java deleted file mode 100644 index 014065f2..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package at.gv.egiz.bku.online.applet; - -import java.security.DigestException; -import java.security.MessageDigest; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.HashDataInput; -import at.gv.egiz.stal.impl.ByteArrayHashDataInput; -import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.types.GetHashDataInputType; -import at.gv.egiz.stal.signedinfo.DigestMethodType; -import at.gv.egiz.stal.signedinfo.ReferenceType; - -/** - * @author clemens - */ -public class WebServiceSignRequestHandler extends SignRequestHandler { - - private static final Log log = LogFactory.getLog(WebServiceSignRequestHandler.class); - STALPortType stalPort; - String sessId; - - public WebServiceSignRequestHandler(STALPortType stalPort, String sessId) { - if (stalPort == null || sessId == null) { - throw new NullPointerException("STAL port must not be null"); - } - this.sessId = sessId; - this.stalPort = stalPort; - } - - @Override - public void displayHashDataInputs(List signedReferences) throws Exception { - - GetHashDataInputType request = new GetHashDataInputType(); - request.setSessionId(sessId); - - HashMap idSignedRefMap = new HashMap(); - for (ReferenceType signedRef : signedReferences) { - //don't get Manifest, QualifyingProperties, ... - if (signedRef.getType() == null) { - String signedRefId = signedRef.getId(); - if (signedRefId != null) { - if (log.isTraceEnabled()) { - log.trace("requesting hashdata input for reference " + signedRefId); - } - idSignedRefMap.put(signedRefId, signedRef); - GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); - ref.setID(signedRefId); - request.getReference().add(ref); - - } else { - throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); - } - } - } - - if (log.isDebugEnabled()) { - log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); - } - GetHashDataInputResponseType response = stalPort.getHashDataInput(request); - ArrayList hashDataInputs = new ArrayList(); - - //hashdata inputs returned from service - HashMap idRefMap = new HashMap(); - for (GetHashDataInputResponseType.Reference reference : response.getReference()) { - String id = reference.getID(); - byte[] hdi = reference.getValue(); - if (hdi == null) { - throw new Exception("Did not receive hashdata input for reference " + id); - } - idRefMap.put(id, reference); - } - - for (String signedRefId : idSignedRefMap.keySet()) { - log.info("validating hashdata input for reference " + signedRefId); - - GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId); - if (reference == null) { - throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); - } - -// } -// -// for (GetHashDataInputResponseType.Reference reference : response.getReference()) { -// -// String id = reference.getID(); - byte[] hdi = reference.getValue(); - String mimeType = reference.getMimeType(); - String encoding = reference.getEncoding(); - - if (hdi == null) { - throw new Exception("No hashdata input provided for reference " + signedRefId); - } - if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); - } - - ReferenceType dsigRef = idSignedRefMap.get(signedRefId); - DigestMethodType dm = dsigRef.getDigestMethod(); - - if (dm == null) { - throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); - } - String mdAlg = dm.getAlgorithm(); - if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) - mdAlg = "SHA-1"; - else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) - mdAlg = "SHA-256"; - else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg)) - mdAlg = "SHA-224"; - else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg)) - mdAlg = "SHA-224"; - else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) - mdAlg = "SHA-384"; - else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) - mdAlg = "SHA-512"; - else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) - mdAlg = "MD2"; - else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) - mdAlg = "MD5"; - else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) - mdAlg = "RipeMD-160"; - else { - throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg); - } - MessageDigest md = MessageDigest.getInstance(mdAlg); - byte[] hdiDigest = md.digest(hdi); - if (log.isDebugEnabled()) - log.debug("Comparing digest values... "); - if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) { - log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue())); - throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue())); - } - hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); - } - - gui.showHashDataInputDialog(hashDataInputs, this, "ok"); - } -} diff --git a/BKUApplet/src/main/resources/simplelog.properties b/BKUApplet/src/main/resources/simplelog.properties index d62508cf..51be76a8 100644 --- a/BKUApplet/src/main/resources/simplelog.properties +++ b/BKUApplet/src/main/resources/simplelog.properties @@ -15,7 +15,7 @@ # Logging detail level, # Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). -org.apache.commons.logging.simplelog.defaultlog=debug +org.apache.commons.logging.simplelog.defaultlog=trace # Logs the Log instance used org.apache.commons.logging.simplelog.showlogname=true #Logs the class name with package(or Path) diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 5aec1998..1ba88e47 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -20,11 +20,11 @@ - + - + -- cgit v1.2.3 From 9662ac90b6aa84bc54543d3c8670ba6c8e42bbac Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 13 Nov 2008 18:24:57 +0000 Subject: FRAME HashDataDisplay FRAME Help git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@165 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 6 +- .../bku/online/applet/AppletHashDataDisplay.java | 217 ++++++++++++-------- .../egiz/bku/online/applet/AppletHelpListener.java | 45 ----- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 6 +- .../bku/online/applet/BrowserHelpListener.java | 45 +++++ .../bku/online/applet/DefaultHelpListener.java | 77 +++++++ .../bku/online/applet/JDialogHashDataDisplay.java | 221 --------------------- 7 files changed, 263 insertions(+), 354 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 8e88c012..db88c037 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -195,7 +195,8 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - addRequestHandler(SignRequest.class, new AppletHashDataDisplay(stalPort, sessionId)); + AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId, AppletHashDataDisplay.DISPLAY.applet); + addRequestHandler(SignRequest.class, handler); } else if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); @@ -203,7 +204,8 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } else { //BKUApplet.HASHDATA_DISPLAY_FRAME log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - addRequestHandler(SignRequest.class, new JDialogHashDataDisplay(stalPort, sessionId, new Dimension(400, 300), locale)); + AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId, AppletHashDataDisplay.DISPLAY.frame); + addRequestHandler(SignRequest.class, handler); } } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java index b77485d9..29a60f1d 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.gui.BKUGUIFacade; import java.security.DigestException; import java.security.MessageDigest; import java.util.ArrayList; @@ -30,39 +30,69 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.smccstal.SignRequestHandler; import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.impl.ByteArrayHashDataInput; +import at.gv.egiz.stal.service.GetHashDataInputFault; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; import at.gv.egiz.stal.service.types.GetHashDataInputType; import at.gv.egiz.stal.signedinfo.DigestMethodType; import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.security.NoSuchAlgorithmException; /** - * A SignRequesthandler displaying hashdata inputs in the applet - * (only plaintext data is displayed, other hashdata inputs may be saved to disk). + * A SignRequesthandler that obtains hashdata inputs from a STAL webservice and + * displays these either within the applet or in a separate frame. + * The internal viewer displays plaintext data only, other mimetypes can be saved to disk. + * The standalone (frame) viewer displays all mimetypes. + * + * (This class depends on STALService and therefore is not part of BKUCommonGUI.) * * @author Clemens Orthacker */ public class AppletHashDataDisplay extends SignRequestHandler { + public static enum DISPLAY { + applet, frame + } private static final Log log = LogFactory.getLog(AppletHashDataDisplay.class); - STALPortType stalPort; - String sessId; + protected STALPortType stalPort; + protected String sessId; + protected DISPLAY display; - public AppletHashDataDisplay(STALPortType stalPort, String sessId) { + public AppletHashDataDisplay(STALPortType stalPort, String sessId, DISPLAY display) { if (stalPort == null || sessId == null) { throw new NullPointerException("STAL port must not be null"); } this.sessId = sessId; this.stalPort = stalPort; + this.display = display; } @Override - public void displayHashDataInputs(List signedReferences) throws Exception { - + public void displayHashDataInputs(List signedReferences) throws DigestException, Exception { + + List hdi = getHashDataInput(signedReferences); + List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); + + if (verifiedHashDataInputs.size() > 1) { + gui.showHashDataInputDialog(verifiedHashDataInputs, false, this, "ok"); + } else if (verifiedHashDataInputs.size() == 1) { + gui.showHashDataInputDialog(verifiedHashDataInputs, display==DISPLAY.frame, this, "ok"); + } else { + throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); + } + } + + /** + * Get all hashdata inputs that contain an ID attribute but no Type attribute. + * @param signedReferences + * @return + * @throws at.gv.egiz.stal.service.GetHashDataInputFault + */ + private List getHashDataInput(List signedReferences) throws GetHashDataInputFault, Exception { GetHashDataInputType request = new GetHashDataInputType(); request.setSessionId(sessId); - HashMap idSignedRefMap = new HashMap(); +// HashMap idSignedRefMap = new HashMap(); for (ReferenceType signedRef : signedReferences) { //don't get Manifest, QualifyingProperties, ... if (signedRef.getType() == null) { @@ -71,97 +101,116 @@ public class AppletHashDataDisplay extends SignRequestHandler { if (log.isTraceEnabled()) { log.trace("requesting hashdata input for reference " + signedRefId); } - idSignedRefMap.put(signedRefId, signedRef); +// idSignedRefMap.put(signedRefId, signedRef); GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); ref.setID(signedRefId); request.getReference().add(ref); } else { - throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); + throw new Exception("Cannot resolve signature data for dsig:Reference without Id attribute"); } } } if (log.isDebugEnabled()) { - log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); + log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); } GetHashDataInputResponseType response = stalPort.getHashDataInput(request); - ArrayList hashDataInputs = new ArrayList(); - - //hashdata inputs returned from service - HashMap idRefMap = new HashMap(); - for (GetHashDataInputResponseType.Reference reference : response.getReference()) { - String id = reference.getID(); - byte[] hdi = reference.getValue(); - if (hdi == null) { - throw new Exception("Did not receive hashdata input for reference " + id); + return response.getReference(); + } + + /** + * Verifies all signed references and returns STAL HashDataInputs + * @param signedReferences + * @param hashDataInputs + * @return + * @throws java.security.DigestException + * @throws java.security.NoSuchAlgorithmException + * @throws Exception if no hashdata input is provided for a signed reference + */ + private List verifyHashDataInput(List signedReferences, List hashDataInputs) throws DigestException, NoSuchAlgorithmException, Exception { + + ArrayList verifiedHashDataInputs = new ArrayList(); + + for (ReferenceType signedRef : signedReferences) { + if (signedRef.getType() == null) { + log.info("Verifying digest for signed reference " + signedRef.getId()); + + String signedRefId = signedRef.getId(); + byte[] signedDigest = signedRef.getDigestValue(); + String signedDigestAlg = null; + if (signedRef.getDigestMethod() != null) { + signedDigestAlg = signedRef.getDigestMethod().getAlgorithm(); + } else { + throw new NoSuchAlgorithmException("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); + } + + // usually, there is just one item here + GetHashDataInputResponseType.Reference hashDataInput = null; + for (GetHashDataInputResponseType.Reference hdi : hashDataInputs) { + if (signedRefId.equals(hdi.getID())) { + hashDataInput = hdi; + break; + } + } + if (hashDataInput == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); + } + + byte[] hdi = hashDataInput.getValue(); + String mimeType = hashDataInput.getMimeType(); + String encoding = hashDataInput.getEncoding(); + + if (hdi == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " provided by service"); + } + if (log.isDebugEnabled()) { + log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); + } + + byte[] hashDataInputDigest = digest(hdi, signedDigestAlg); + + if (log.isDebugEnabled()) { + log.debug("Comparing digest values... "); + } +// log.warn("***************** DISABLED HASHDATA VERIFICATION"); + if (!Arrays.equals(hashDataInputDigest, signedDigest)) { + log.error("Bad digest value for reference " + signedRefId); + throw new DigestException("Bad digest value for reference " + signedRefId); + } + + verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); } - idRefMap.put(id, reference); } - for (String signedRefId : idSignedRefMap.keySet()) { - log.info("validating hashdata input for reference " + signedRefId); - - GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId); - if (reference == null) { - throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); - } - -// } -// -// for (GetHashDataInputResponseType.Reference reference : response.getReference()) { -// -// String id = reference.getID(); - byte[] hdi = reference.getValue(); - String mimeType = reference.getMimeType(); - String encoding = reference.getEncoding(); - - if (hdi == null) { - throw new Exception("No hashdata input provided for reference " + signedRefId); - } - if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); - } + return verifiedHashDataInputs; + } - ReferenceType dsigRef = idSignedRefMap.get(signedRefId); - DigestMethodType dm = dsigRef.getDigestMethod(); - - if (dm == null) { - throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); - } - String mdAlg = dm.getAlgorithm(); - if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) - mdAlg = "SHA-1"; - else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) - mdAlg = "SHA-256"; - else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg)) - mdAlg = "SHA-224"; - else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg)) - mdAlg = "SHA-224"; - else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) - mdAlg = "SHA-384"; - else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) - mdAlg = "SHA-512"; - else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) - mdAlg = "MD2"; - else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) - mdAlg = "MD5"; - else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) - mdAlg = "RipeMD-160"; - else { - throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg); - } - MessageDigest md = MessageDigest.getInstance(mdAlg); - byte[] hdiDigest = md.digest(hdi); - if (log.isDebugEnabled()) - log.debug("Comparing digest values... "); - if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) { - log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue())); - throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue())); - } - hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); + //TODO + private byte[] digest(byte[] hashDataInput, String mdAlg) throws NoSuchAlgorithmException { + if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) { + mdAlg = "SHA-1"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) { + mdAlg = "SHA-256"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha224".equals(mdAlg)) { + mdAlg = "SHA-224"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#sha224".equals(mdAlg)) { + mdAlg = "SHA-224"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) { + mdAlg = "SHA-384"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) { + mdAlg = "SHA-512"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#md2".equals(mdAlg)) { + mdAlg = "MD2"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) { + mdAlg = "MD5"; + } else if ("http://www.w3.org/2001/04/xmlenc#ripemd160".equals(mdAlg)) { + mdAlg = "RipeMD-160"; + } else { + throw new NoSuchAlgorithmException("Failed to verify digest value: unsupported digest algorithm " + mdAlg); } - - gui.showHashDataInputDialog(hashDataInputs, false, this, "ok"); + + MessageDigest md = MessageDigest.getInstance(mdAlg); + return md.digest(hashDataInput); } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java deleted file mode 100644 index 5d199872..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package at.gv.egiz.bku.online.applet; - -import at.gv.egiz.bku.gui.AbstractHelpListener; -import java.applet.AppletContext; -import java.net.URL; -import java.util.Locale; - -/** - * - * @author Clemens Orthacker - */ -public class AppletHelpListener extends AbstractHelpListener { - - protected AppletContext ctx; - - public AppletHelpListener(AppletContext ctx, URL helpURL, Locale locale) { - super(helpURL, locale); - if (ctx == null) { - throw new RuntimeException("no applet context provided"); - } - this.ctx = ctx; - } - - @Override - public void showDocument(URL helpDocument) throws Exception { - ctx.showDocument(helpDocument, "_blank"); - } -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 9d640dee..b4407b22 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -16,6 +16,7 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.gui.AbstractHelpListener; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; @@ -85,10 +86,11 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { String locale = getAppletParameter(LOCALE_PARAM_KEY); String guiStyle = getAppletParameter(GUI_STYLE); URL backgroundImgURL = null; - AppletHelpListener helpListener = null; + AbstractHelpListener helpListener = null; try { URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); - helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale()); +// helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale()); + helpListener = new DefaultHelpListener(helpURL, getLocale()); } catch (MalformedURLException ex) { log.warn("failed to load help URL, disabling help: " + ex.getMessage()); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java new file mode 100644 index 00000000..265acca0 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java @@ -0,0 +1,45 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.gui.AbstractHelpListener; +import java.applet.AppletContext; +import java.net.URL; +import java.util.Locale; + +/** + * + * @author Clemens Orthacker + */ +public class BrowserHelpListener extends AbstractHelpListener { + + protected AppletContext ctx; + + public BrowserHelpListener(AppletContext ctx, URL helpURL, Locale locale) { + super(helpURL, locale); + if (ctx == null) { + throw new RuntimeException("no applet context provided"); + } + this.ctx = ctx; + } + + @Override + public void showDocument(URL helpDocument, String helpTopic) throws Exception { + ctx.showDocument(helpDocument, "_blank"); + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java new file mode 100644 index 00000000..9876ef7e --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java @@ -0,0 +1,77 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.gui.AbstractHelpListener; +import at.gv.egiz.bku.gui.ViewerDialog; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.util.Locale; +import javax.swing.SwingUtilities; + +/** + * This class depends on BKU utils, and therefore is not part of BKUCommonGUI + * + * @author Clemens Orthacker + */ +public class DefaultHelpListener extends AbstractHelpListener { + + public DefaultHelpListener(URL helpURL, Locale locale) { + super(helpURL, locale); + } + + @Override + public void showDocument(URL helpURL, final String helpTopic) throws Exception { + log.debug("open connection " + helpURL); + URLConnection conn = helpURL.openConnection(); + + log.debug("show help document " + conn.getContentType()); // + ";" + conn.getContentEncoding()); + +// Charset cs; +// if (conn.getContentEncoding() == null) { +// cs = Charset.forName("UTF-8"); +// } else { +// try { +// cs = Charset.forName(conn.getContentEncoding()); +// } catch (Exception ex) { +// log.debug("charset " + conn.getContentEncoding() + " not supported, assuming UTF-8: " + ex.getMessage()); +// cs = Charset.forName("UTF-8"); +// } +// } + +// InputStreamReader isr = new InputStreamReader(conn.getInputStream(), cs); +// final Reader content = new BufferedReader(isr); + final InputStream content = conn.getInputStream(); + final String mimeType = conn.getContentType(); + + log.debug("schedule help dialog"); + + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + + log.debug("show help dialog"); + + ViewerDialog.showHelp(null, helpTopic, content, mimeType, messages); + + } + }); +// gui.showHelpDialog(helpDocument.getStream(), mimetype, encoding); + } +} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java deleted file mode 100644 index 1f0eda90..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package at.gv.egiz.bku.online.applet; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.HashDataInput; -import at.gv.egiz.stal.impl.ByteArrayHashDataInput; -import at.gv.egiz.stal.service.GetHashDataInputFault; -import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.types.GetHashDataInputType; -import at.gv.egiz.stal.signedinfo.ReferenceType; -import java.awt.Dimension; -import java.security.DigestException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * - * @author Clemens Orthacker - */ -public class JDialogHashDataDisplay extends SignRequestHandler { - - private static final Log log = LogFactory.getLog(JDialogHashDataDisplay.class); - protected STALPortType stalPort; - protected String sessId; -// protected HashDataViewer viewer; - - public JDialogHashDataDisplay(STALPortType stalPort, String sessId, Dimension viewerSize, Locale locale) { - if (stalPort == null || sessId == null) { - throw new NullPointerException("STAL port must not be null"); - } - this.sessId = sessId; - this.stalPort = stalPort; -// this.viewer = new HashDataViewer(viewerSize, locale); - } - - @Override - public void displayHashDataInputs(List signedReferences) throws DigestException, Exception { - - List hdi = getHashDataInput(signedReferences); - final List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); - - if (verifiedHashDataInputs.size() > 1) { - gui.showHashDataInputDialog(verifiedHashDataInputs, false, this, "ok"); - } else if (verifiedHashDataInputs.size() == 1) { - gui.showHashDataInputDialog(verifiedHashDataInputs, true, this, "ok"); -// SwingUtilities.invokeLater(new Runnable() { -// -// @Override -// public void run() { -// viewer.displayHashData(verifiedHashDataInputs.get(0)); -// } -// }); - - } else { - log.error("No hashdata input to display"); - } - - } - - /** - * Get all hashdata inputs that contain an ID attribute and no Type attribute. - * @param signedReferences - * @return - * @throws at.gv.egiz.stal.service.GetHashDataInputFault - */ - private List getHashDataInput(List signedReferences) throws GetHashDataInputFault, Exception { - GetHashDataInputType request = new GetHashDataInputType(); - request.setSessionId(sessId); - -// HashMap idSignedRefMap = new HashMap(); - for (ReferenceType signedRef : signedReferences) { - //don't get Manifest, QualifyingProperties, ... - if (signedRef.getType() == null) { - String signedRefId = signedRef.getId(); - if (signedRefId != null) { - if (log.isTraceEnabled()) { - log.trace("requesting hashdata input for reference " + signedRefId); - } -// idSignedRefMap.put(signedRefId, signedRef); - GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); - ref.setID(signedRefId); - request.getReference().add(ref); - - } else { - throw new Exception("Cannot resolve HashDataInput for reference without Id attribute"); - } - } - } - - if (log.isDebugEnabled()) { - log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); - } - GetHashDataInputResponseType response = stalPort.getHashDataInput(request); - return response.getReference(); - } - - /** - * Verifies all signed references and returns STAL HashDataInputs - * @param signedReferences - * @param hashDataInputs - * @return - * @throws java.security.DigestException - * @throws java.security.NoSuchAlgorithmException - * @throws Exception if no hashdata input is provided for a signed reference - */ - private List verifyHashDataInput(List signedReferences, List hashDataInputs) throws DigestException, NoSuchAlgorithmException, Exception { - - ArrayList verifiedHashDataInputs = new ArrayList(); - - //hashdata inputs returned from service -// HashMap idRefMap = new HashMap(); -// for (GetHashDataInputResponseType.Reference hashDataInput : hashDataInputs) { -// String id = hashDataInput.getID(); -// byte[] hdi = hashDataInput.getValue(); -// if (hdi == null) { -// throw new Exception("Did not receive hashdata input for reference " + id); -// } -// idRefMap.put(id, hashDataInput); -// } - - for (ReferenceType signedRef : signedReferences) { - if (signedRef.getType() == null) { - log.info("Verifying digest for signed reference " + signedRef.getId()); - - String signedRefId = signedRef.getId(); - byte[] signedDigest = signedRef.getDigestValue(); - String signedDigestAlg = null; - if (signedRef.getDigestMethod() != null) { - signedDigestAlg = signedRef.getDigestMethod().getAlgorithm(); - } else { - throw new NoSuchAlgorithmException("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); - } - - GetHashDataInputResponseType.Reference hashDataInput = null; //idRefMap.get(signedRefId); - for (GetHashDataInputResponseType.Reference hdi : hashDataInputs) { - if (signedRefId.equals(hdi.getID())) { - hashDataInput = hdi; - } - } - if (hashDataInput == null) { - throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); - } - - byte[] hdi = hashDataInput.getValue(); - String mimeType = hashDataInput.getMimeType(); - String encoding = hashDataInput.getEncoding(); - - if (hdi == null) { - throw new Exception("No hashdata input for reference " + signedRefId + " provided by service"); - } - if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); - } - - byte[] hashDataInputDigest = digest(hdi, signedDigestAlg); - - if (log.isDebugEnabled()) { - log.debug("Comparing digest values... "); - } - log.warn("DISABLED DIGEST VERIFICATION FOR DEBUGGING"); -// if (!Arrays.equals(hashDataInputDigest, signedDigest)) { -// log.error("Bad digest value for reference " + signedRefId); -// throw new DigestException("Bad digest value for reference " + signedRefId); -// } - - verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); - } - } - - return verifiedHashDataInputs; - } - - //TODO - private byte[] digest(byte[] hashDataInput, String mdAlg) throws NoSuchAlgorithmException { - if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) { - mdAlg = "SHA-1"; - } else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) { - mdAlg = "SHA-256"; - } else if ("http://www.w3.org/2001/04/xmlenc#sha224".equals(mdAlg)) { - mdAlg = "SHA-224"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#sha224".equals(mdAlg)) { - mdAlg = "SHA-224"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) { - mdAlg = "SHA-384"; - } else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) { - mdAlg = "SHA-512"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) { - mdAlg = "MD2"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) { - mdAlg = "MD5"; - } else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) { - mdAlg = "RipeMD-160"; - } else { - throw new NoSuchAlgorithmException("Failed to verify digest value: unsupported digest algorithm " + mdAlg); - } - - MessageDigest md = MessageDigest.getInstance(mdAlg); - return md.digest(hashDataInput); - } -} -- cgit v1.2.3 From fef61ddc786960015c6fc416d4ad2d5d0f2048d1 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 13 Nov 2008 20:56:23 +0000 Subject: bugfix openwindow blocked bugfix helpTopic always hashdataviewer git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@168 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 2 +- .../bku/online/applet/DefaultHelpListener.java | 38 +++++----------------- 2 files changed, 9 insertions(+), 31 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index b4407b22..4b49c5d5 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -90,7 +90,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { try { URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); // helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale()); - helpListener = new DefaultHelpListener(helpURL, getLocale()); + helpListener = new DefaultHelpListener(getAppletContext(), helpURL, getLocale()); } catch (MalformedURLException ex) { log.warn("failed to load help URL, disabling help: " + ex.getMessage()); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java index 9876ef7e..6eec5665 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java @@ -16,49 +16,28 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.gui.HelpViewer; import at.gv.egiz.bku.gui.AbstractHelpListener; -import at.gv.egiz.bku.gui.ViewerDialog; -import java.io.InputStream; +import java.applet.AppletContext; import java.net.URL; -import java.net.URLConnection; import java.util.Locale; import javax.swing.SwingUtilities; /** - * This class depends on BKU utils, and therefore is not part of BKUCommonGUI * * @author Clemens Orthacker */ public class DefaultHelpListener extends AbstractHelpListener { - public DefaultHelpListener(URL helpURL, Locale locale) { + protected AppletContext ctx; + + public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) { super(helpURL, locale); + this.ctx = ctx; } @Override - public void showDocument(URL helpURL, final String helpTopic) throws Exception { - log.debug("open connection " + helpURL); - URLConnection conn = helpURL.openConnection(); - - log.debug("show help document " + conn.getContentType()); // + ";" + conn.getContentEncoding()); - -// Charset cs; -// if (conn.getContentEncoding() == null) { -// cs = Charset.forName("UTF-8"); -// } else { -// try { -// cs = Charset.forName(conn.getContentEncoding()); -// } catch (Exception ex) { -// log.debug("charset " + conn.getContentEncoding() + " not supported, assuming UTF-8: " + ex.getMessage()); -// cs = Charset.forName("UTF-8"); -// } -// } - -// InputStreamReader isr = new InputStreamReader(conn.getInputStream(), cs); -// final Reader content = new BufferedReader(isr); - final InputStream content = conn.getInputStream(); - final String mimeType = conn.getContentType(); - + public void showDocument(final URL helpURL, final String helpTopic) throws Exception { log.debug("schedule help dialog"); SwingUtilities.invokeLater(new Runnable() { @@ -68,10 +47,9 @@ public class DefaultHelpListener extends AbstractHelpListener { log.debug("show help dialog"); - ViewerDialog.showHelp(null, helpTopic, content, mimeType, messages); + HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages); } }); -// gui.showHelpDialog(helpDocument.getStream(), mimetype, encoding); } } -- cgit v1.2.3 From f09efb78459c7cd49ca4e28d92f170833e7ee32d Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Nov 2008 16:30:28 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@172 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 1 - .../at/gv/egiz/bku/online/applet/BKUApplet.java | 5 +- .../bku/online/applet/DefaultHelpListener.java | 55 ---------------------- BKUApplet/src/test/resources/appletTest.html | 4 +- 4 files changed, 5 insertions(+), 60 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index db88c037..f862360b 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -31,7 +31,6 @@ import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.util.STALTranslator; import java.applet.AppletContext; -import java.awt.Dimension; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 4b49c5d5..7963768e 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -16,6 +16,7 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.gui.DefaultHelpListener; import at.gv.egiz.bku.gui.AbstractHelpListener; import java.net.MalformedURLException; import java.net.URL; @@ -92,12 +93,12 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { // helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale()); helpListener = new DefaultHelpListener(getAppletContext(), helpURL, getLocale()); } catch (MalformedURLException ex) { - log.warn("failed to load help URL, disabling help: " + ex.getMessage()); + log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help"); } try { backgroundImgURL = getURLParameter(BACKGROUND_PARAM); } catch (MalformedURLException ex) { - log.info("failed to load applet background image, using default: " + ex.getMessage()); + log.warn("failed to load applet background image: " + ex.getMessage() + ", using default"); } if (locale != null) { diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java deleted file mode 100644 index 6eec5665..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package at.gv.egiz.bku.online.applet; - -import at.gv.egiz.bku.gui.HelpViewer; -import at.gv.egiz.bku.gui.AbstractHelpListener; -import java.applet.AppletContext; -import java.net.URL; -import java.util.Locale; -import javax.swing.SwingUtilities; - -/** - * - * @author Clemens Orthacker - */ -public class DefaultHelpListener extends AbstractHelpListener { - - protected AppletContext ctx; - - public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) { - super(helpURL, locale); - this.ctx = ctx; - } - - @Override - public void showDocument(final URL helpURL, final String helpTopic) throws Exception { - log.debug("schedule help dialog"); - - SwingUtilities.invokeLater(new Runnable() { - - @Override - public void run() { - - log.debug("show help dialog"); - - HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages); - - } - }); - } -} diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 1ba88e47..eaf6376d 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -21,9 +21,9 @@ archive="../BKUApplet-1.0-SNAPSHOT.jar, ../test-libs/commons-logging-1.1.1.jar , ../test-libs/iaik_jce_me4se-3.04.jar" width=300 height=200> - + - + -- cgit v1.2.3 From e77343708ec9b74aed7256d72982e4fce4be80d8 Mon Sep 17 00:00:00 2001 From: wbauer Date: Sat, 15 Nov 2008 10:34:45 +0000 Subject: Release 1.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@175 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index a20a613d..eaaa5820 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -3,13 +3,13 @@ bku at.gv.egiz - 1.0-SNAPSHOT + 1.0 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0-SNAPSHOT + 1.0 @@ -116,27 +116,27 @@ at.gv.egiz smcc - 1.0-SNAPSHOT + 1.0 at.gv.egiz STAL - 1.0-SNAPSHOT + 1.0 at.gv.egiz STALService - 1.0-SNAPSHOT + 1.0 at.gv.egiz smccSTAL - 1.0-SNAPSHOT + 1.0 at.gv.egiz BKUCommonGUI - 1.0-SNAPSHOT + 1.0 commons-logging -- cgit v1.2.3 From 28e81afd92a6568ff78736b72c5257a86c0b9b91 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 18 Nov 2008 08:03:35 +0000 Subject: GUI refactoring 1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@177 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 13 ++++++------ .../bku/online/applet/AppletHashDataDisplay.java | 24 +++++++++++++--------- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 6 +++--- BKUApplet/src/test/resources/appletTest.html | 3 ++- 4 files changed, 26 insertions(+), 20 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index f862360b..b2f9f89c 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -192,18 +192,19 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { private void registerSignRequestHandler() throws MalformedURLException { String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); - if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { - log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId, AppletHashDataDisplay.DISPLAY.applet); - addRequestHandler(SignRequest.class, handler); - } else if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { +// if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { +// log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); +// AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId, AppletHashDataDisplay.DISPLAY.applet); +// addRequestHandler(SignRequest.class, handler); +// } else + if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); addRequestHandler(SignRequest.class, new BrowserHashDataDisplay(ctx, hashDataURL)); } else { //BKUApplet.HASHDATA_DISPLAY_FRAME log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId, AppletHashDataDisplay.DISPLAY.frame); + AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId); addRequestHandler(SignRequest.class, handler); } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java index 29a60f1d..ba502906 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java @@ -50,33 +50,32 @@ import java.security.NoSuchAlgorithmException; */ public class AppletHashDataDisplay extends SignRequestHandler { - public static enum DISPLAY { - applet, frame - } private static final Log log = LogFactory.getLog(AppletHashDataDisplay.class); protected STALPortType stalPort; protected String sessId; - protected DISPLAY display; - public AppletHashDataDisplay(STALPortType stalPort, String sessId, DISPLAY display) { + public AppletHashDataDisplay(STALPortType stalPort, String sessId) { if (stalPort == null || sessId == null) { throw new NullPointerException("STAL port must not be null"); } this.sessId = sessId; this.stalPort = stalPort; - this.display = display; } + /** + * TODO don't throw exceptions + * @param signedReferences + * @throws java.security.DigestException + * @throws java.lang.Exception + */ @Override public void displayHashDataInputs(List signedReferences) throws DigestException, Exception { List hdi = getHashDataInput(signedReferences); List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); - if (verifiedHashDataInputs.size() > 1) { - gui.showHashDataInputDialog(verifiedHashDataInputs, false, this, "ok"); - } else if (verifiedHashDataInputs.size() == 1) { - gui.showHashDataInputDialog(verifiedHashDataInputs, display==DISPLAY.frame, this, "ok"); + if (verifiedHashDataInputs.size() > 0) { + gui.showHashDataInputDialog(verifiedHashDataInputs, this, "ok"); } else { throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); } @@ -111,6 +110,11 @@ public class AppletHashDataDisplay extends SignRequestHandler { } } } + + if (request.getReference().size() < 1) { + log.error("No signature data (apart from any QualifyingProperties or a Manifest) for session " + sessId); + throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); + } if (log.isDebugEnabled()) { log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 7963768e..5b45c8e1 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -53,7 +53,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { public static final String BACKGROUND_PARAM = "Background"; public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; - public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; +// public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; public static final String HASHDATA_DISPLAY_BROWSER = "browser"; public static final String HASHDATA_DISPLAY_FRAME = "frame"; @@ -106,8 +106,8 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { } log.debug("setting locale to " + getLocale()); - BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle); - gui.init(getContentPane(), getLocale(), backgroundImgURL, helpListener); + BKUGUIFacade gui = BKUGUIFactory.createGUI(getContentPane(), getLocale(), guiStyle, backgroundImgURL, helpListener); +// gui.init(getContentPane(), getLocale(), BKUGUIFacade.Style.advanced, backgroundImgURL, helpListener); worker = new AppletBKUWorker(gui, getAppletContext(), this); } diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index eaf6376d..8204d0eb 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -21,7 +21,8 @@ archive="../BKUApplet-1.0-SNAPSHOT.jar, ../test-libs/commons-logging-1.1.1.jar , ../test-libs/iaik_jce_me4se-3.04.jar" width=300 height=200> - + + -- cgit v1.2.3 From 6d2cd68c8adff8c27a6a3a18711ea44a2e7bfe30 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 18 Nov 2008 18:00:44 +0000 Subject: GUI refactoring 2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@178 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../bku/online/applet/AppletHashDataDisplay.java | 2 +- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 46 +++++++++++++--------- .../bku/online/applet/BrowserHelpListener.java | 45 --------------------- 3 files changed, 29 insertions(+), 64 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java index ba502906..7be40d65 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java @@ -75,7 +75,7 @@ public class AppletHashDataDisplay extends SignRequestHandler { List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); if (verifiedHashDataInputs.size() > 0) { - gui.showHashDataInputDialog(verifiedHashDataInputs, this, "ok"); + gui.showHashDataInputDialog(verifiedHashDataInputs, this, "hashDataDone"); } else { throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 5b45c8e1..d0eed607 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -43,14 +43,13 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { * Applet parameter keys */ public static final String GUI_STYLE = "GuiStyle"; - public final static String LOCALE_PARAM_KEY = "Locale"; - public final static String LOGO_URL_KEY = "LogoURL"; + public final static String LOCALE = "Locale"; public final static String WSDL_URL = "WSDL_URL"; public static final String HASHDATA_DISPLAY = "HashDataDisplay"; public final static String HASHDATA_URL = "HashDataURL"; public final static String HELP_URL = "HelpURL"; public final static String SESSION_ID = "SessionID"; - public static final String BACKGROUND_PARAM = "Background"; + public static final String BACKGROUND_IMG = "Background"; public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; // public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; @@ -76,6 +75,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { /** * Factory method to create and wire HelpListener, GUI and BKUWorker. + * (Config via applet parameters as constants BKUApplet.*) */ @Override public void init() { @@ -84,30 +84,40 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); - String locale = getAppletParameter(LOCALE_PARAM_KEY); - String guiStyle = getAppletParameter(GUI_STYLE); + String locale = getAppletParameter(LOCALE); + if (locale != null) { + this.setLocale(new Locale(locale)); + } + log.debug("setting locale to " + getLocale()); + + BKUGUIFacade.Style guiStyle; + if ("advanced".equals(getAppletParameter(GUI_STYLE))) { + guiStyle = BKUGUIFacade.Style.advanced; + } else { + guiStyle = BKUGUIFacade.Style.simple; + } + URL backgroundImgURL = null; + try { + backgroundImgURL = getURLParameter(BACKGROUND_IMG); + } catch (MalformedURLException ex) { + log.warn("failed to load applet background image: " + ex.getMessage() + ", using default"); + } + AbstractHelpListener helpListener = null; try { - URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); + URL helpURL = getURLParameter(HELP_URL); // helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale()); helpListener = new DefaultHelpListener(getAppletContext(), helpURL, getLocale()); } catch (MalformedURLException ex) { log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help"); } - try { - backgroundImgURL = getURLParameter(BACKGROUND_PARAM); - } catch (MalformedURLException ex) { - log.warn("failed to load applet background image: " + ex.getMessage() + ", using default"); - } - if (locale != null) { - this.setLocale(new Locale(locale)); - } - log.debug("setting locale to " + getLocale()); - - BKUGUIFacade gui = BKUGUIFactory.createGUI(getContentPane(), getLocale(), guiStyle, backgroundImgURL, helpListener); -// gui.init(getContentPane(), getLocale(), BKUGUIFacade.Style.advanced, backgroundImgURL, helpListener); + BKUGUIFacade gui = BKUGUIFactory.createGUI(getContentPane(), + getLocale(), + guiStyle, + backgroundImgURL, + helpListener); worker = new AppletBKUWorker(gui, getAppletContext(), this); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java deleted file mode 100644 index 265acca0..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHelpListener.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package at.gv.egiz.bku.online.applet; - -import at.gv.egiz.bku.gui.AbstractHelpListener; -import java.applet.AppletContext; -import java.net.URL; -import java.util.Locale; - -/** - * - * @author Clemens Orthacker - */ -public class BrowserHelpListener extends AbstractHelpListener { - - protected AppletContext ctx; - - public BrowserHelpListener(AppletContext ctx, URL helpURL, Locale locale) { - super(helpURL, locale); - if (ctx == null) { - throw new RuntimeException("no applet context provided"); - } - this.ctx = ctx; - } - - @Override - public void showDocument(URL helpDocument, String helpTopic) throws Exception { - ctx.showDocument(helpDocument, "_blank"); - } -} -- cgit v1.2.3 From bc81c317e254fa617fc24c8129b743ac74aad470 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 19 Nov 2008 11:49:55 +0000 Subject: GUI feature complete git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@180 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/hs_err_pid32072.log | 453 --------------------------- BKUApplet/src/test/resources/appletTest.html | 2 +- 2 files changed, 1 insertion(+), 454 deletions(-) delete mode 100644 BKUApplet/hs_err_pid32072.log (limited to 'BKUApplet') diff --git a/BKUApplet/hs_err_pid32072.log b/BKUApplet/hs_err_pid32072.log deleted file mode 100644 index cf86d1c5..00000000 --- a/BKUApplet/hs_err_pid32072.log +++ /dev/null @@ -1,453 +0,0 @@ -# -# An unexpected error has been detected by Java Runtime Environment: -# -# SIGBUS (0x7) at pc=0xb7bcbc53, pid=32072, tid=3033660304 -# -# Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode, sharing linux-x86) -# Problematic frame: -# C [libzip.so+0xbc53] -# -# If you would like to submit a bug report, please visit: -# http://java.sun.com/webapps/bugreport/crash.jsp -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- T H R E A D --------------- - -Current thread (0xb4faa400): JavaThread "Thread-2" [_thread_in_native, id=32091, stack(0xb4ccf000,0xb4d20000)] - -siginfo:si_signo=SIGBUS: si_errno=0, si_code=2 (BUS_ADRERR), si_addr=0xb5804fc0 - -Registers: -EAX=0x080576a8, EBX=0xb7bd07bc, ECX=0xb5803000, EDX=0x0002d000 -ESP=0xb4d1dc10, EBP=0xb4d1dc38, ESI=0xb5804fa3, EDI=0x0839b310 -EIP=0xb7bcbc53, CR2=0xb5804fc0, EFLAGS=0x00210286 - -Top of Stack: (sp=0xb4d1dc10) -0xb4d1dc10: 00000030 b4fa9370 b4fa9378 b4fa9764 -0xb4d1dc20: 08057568 08057568 b7bcbc0b b7bd07bc -0xb4d1dc30: 0828f3cc 00000000 b4d1dc68 b7bcc00b -0xb4d1dc40: 080576a8 0828f3cc 00000000 00000000 -0xb4d1dc50: b4faa400 00000004 87c67713 b7bd07bc -0xb4d1dc60: b4d1dcb0 b4faa4f4 b4d1e0d8 b7bc31b9 -0xb4d1dc70: 080576a8 b4d1dcb0 00000025 00000025 -0xb4d1dc80: b4d1dcb0 6c706d69 49554765 2e303124 - -Instructions: (pc=0xb7bcbc53) -0xb7bcbc43: 8b 70 04 8b 45 08 8b 48 10 8b 50 1c 01 ce 29 d6 -0xb7bcbc53: 0f b6 46 1d 0f b6 56 1c c1 e0 08 09 c2 89 55 f0 - -Stack: [0xb4ccf000,0xb4d20000], sp=0xb4d1dc10, free space=315k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libzip.so+0xbc53] -C [libzip.so+0xc00b] ZIP_GetEntry+0x10b -C [libzip.so+0x31b9] Java_java_util_zip_ZipFile_getEntry+0xc9 -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -J sun.misc.URLClassPath$JarLoader.getResource(Ljava/lang/String;Z)Lsun/misc/Resource; -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::StubRoutines (1) -V [libjvm.so+0x21c5cd] -V [libjvm.so+0x310748] -V [libjvm.so+0x21c460] -V [libjvm.so+0x272313] -C [libjava.so+0xaa5c] Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2+0x3c -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::StubRoutines (1) -V [libjvm.so+0x21c5cd] -V [libjvm.so+0x310748] -V [libjvm.so+0x21c0f1] -V [libjvm.so+0x21c1da] -V [libjvm.so+0x375867] -V [libjvm.so+0x374305] -V [libjvm.so+0x373377] -V [libjvm.so+0x373082] -V [libjvm.so+0x1bc043] -V [libjvm.so+0x20c8e6] -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::StubRoutines (1) -V [libjvm.so+0x21c5cd] -V [libjvm.so+0x310748] -V [libjvm.so+0x21bee0] -V [libjvm.so+0x21bf6d] -V [libjvm.so+0x28c175] -V [libjvm.so+0x391f8d] -V [libjvm.so+0x3113f9] -C [libpthread.so.0+0x54fb] - -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -J sun.misc.URLClassPath$JarLoader.getResource(Ljava/lang/String;Z)Lsun/misc/Resource; -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::StubRoutines (1) -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::StubRoutines (1) -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::Interpreter -v ~BufferBlob::StubRoutines (1) - ---------------- P R O C E S S --------------- - -Java Threads: ( => current thread ) - 0xb5702400 JavaThread "Thread-3" [_thread_blocked, id=32217, stack(0xb4c7e000,0xb4ccf000)] -=>0xb4faa400 JavaThread "Thread-2" [_thread_in_native, id=32091, stack(0xb4ccf000,0xb4d20000)] - 0x0828e400 JavaThread "AWT-EventQueue-1" [_thread_blocked, id=32089, stack(0xb4eaf000,0xb4f00000)] - 0xb57b9400 JavaThread "TimerQueue" daemon [_thread_blocked, id=32088, stack(0xb4dd5000,0xb4e26000)] - 0xb4f8a400 JavaThread "DestroyJavaVM" [_thread_blocked, id=32073, stack(0xb7c43000,0xb7c94000)] - 0xb57a1400 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=32086, stack(0xb507f000,0xb50d0000)] - 0xb57a0800 JavaThread "AWT-Shutdown" [_thread_blocked, id=32085, stack(0xb50d0000,0xb5121000)] - 0xb5792000 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=32082, stack(0xb520c000,0xb525d000)] - 0xb5751000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=32081, stack(0xb5285000,0xb52d6000)] - 0xb5700c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=32079, stack(0xb5823000,0xb5874000)] - 0x0808c000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=32078, stack(0xb5874000,0xb58f5000)] - 0x0808ac00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=32077, stack(0xb58f5000,0xb5946000)] - 0x08081c00 JavaThread "Finalizer" daemon [_thread_blocked, id=32076, stack(0xb598c000,0xb59dd000)] - 0x08080c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=32075, stack(0xb59dd000,0xb5a2e000)] - -Other Threads: - 0x0807f400 VMThread [stack: 0xb5a2e000,0xb5aaf000] [id=32074] - 0xb570a400 WatcherThread [stack: 0xb567f000,0xb5700000] [id=32080] - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap - def new generation total 960K, used 512K [0x8bfe0000, 0x8c0e0000, 0x8c4c0000) - eden space 896K, 50% used [0x8bfe0000, 0x8c050378, 0x8c0c0000) - from space 64K, 100% used [0x8c0d0000, 0x8c0e0000, 0x8c0e0000) - to space 64K, 0% used [0x8c0c0000, 0x8c0c0000, 0x8c0d0000) - tenured generation total 4096K, used 3837K [0x8c4c0000, 0x8c8c0000, 0x8ffe0000) - the space 4096K, 93% used [0x8c4c0000, 0x8c87f6a0, 0x8c87f800, 0x8c8c0000) - compacting perm gen total 12288K, used 6940K [0x8ffe0000, 0x90be0000, 0x93fe0000) - the space 12288K, 56% used [0x8ffe0000, 0x906a7308, 0x906a7400, 0x90be0000) - ro space 8192K, 73% used [0x93fe0000, 0x945c34a0, 0x945c3600, 0x947e0000) - rw space 12288K, 58% used [0x947e0000, 0x94ed8668, 0x94ed8800, 0x953e0000) - -Dynamic libraries: -06000000-0641b000 r-xp 00000000 08:02 1085428 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/libjvm.so -0641b000-06435000 rwxp 0041a000 08:02 1085428 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/libjvm.so -06435000-06855000 rwxp 06435000 00:00 0 -08048000-08052000 r-xp 00000000 08:02 1085534 /usr/lib/jvm/java-6-sun-1.6.0.06/bin/appletviewer -08052000-08053000 rwxp 00009000 08:02 1085534 /usr/lib/jvm/java-6-sun-1.6.0.06/bin/appletviewer -08053000-083f5000 rwxp 08053000 00:00 0 [heap] -8bfe0000-8c0e0000 rwxp 8bfe0000 00:00 0 -8c0e0000-8c4c0000 rwxp 8c0e0000 00:00 0 -8c4c0000-8c8c0000 rwxp 8c4c0000 00:00 0 -8c8c0000-8ffe0000 rwxp 8c8c0000 00:00 0 -8ffe0000-90be0000 rwxp 8ffe0000 00:00 0 -90be0000-93fe0000 rwxp 90be0000 00:00 0 -93fe0000-945c4000 r-xs 00001000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa -945c4000-947e0000 rwxp 945c4000 00:00 0 -947e0000-94ed9000 rwxp 005e5000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa -94ed9000-953e0000 rwxp 94ed9000 00:00 0 -953e0000-954b9000 rwxp 00cde000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa -954b9000-957e0000 rwxp 954b9000 00:00 0 -957e0000-957e4000 r-xs 00db7000 08:02 1081430 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client/classes.jsa -957e4000-95be0000 rwxp 957e4000 00:00 0 -b4c7e000-b4c81000 ---p b4c7e000 00:00 0 -b4c81000-b4ccf000 rwxp b4c81000 00:00 0 -b4ccf000-b4cd2000 ---p b4ccf000 00:00 0 -b4cd2000-b4d20000 rwxp b4cd2000 00:00 0 -b4d20000-b4d23000 r-xs 00000000 08:02 3560016 /var/cache/fontconfig/5e10083637a12ecd1bff191eb66bfa2f-x86.cache-2 -b4d23000-b4d29000 r-xs 00000000 08:02 3560014 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-x86.cache-2 -b4d29000-b4d2c000 r-xs 00000000 08:02 3560019 /var/cache/fontconfig/e383d7ea5fbe662a33d9b44caf393297-x86.cache-2 -b4d2c000-b4d31000 r-xs 00000000 08:02 3560011 /var/cache/fontconfig/bddabcf04192498a6a74911686fc6962-x86.cache-2 -b4d31000-b4d34000 r-xs 00000000 08:02 3556212 /var/cache/fontconfig/a46337af8a0b4c9b317ad981ec3bdf87-x86.cache-2 -b4d34000-b4d35000 r-xs 00000000 08:02 3560013 /var/cache/fontconfig/fd9505950c048a77dc4b710eb6a628ed-x86.cache-2 -b4d35000-b4d37000 r-xs 00000000 08:02 3560021 /var/cache/fontconfig/ddc79d3ea06a7c6ffa86ede85f3bb5df-x86.cache-2 -b4d37000-b4d38000 r-xs 00000000 08:02 3560164 /var/cache/fontconfig/e3fa16a14183b06aa45b3e009278fd14-x86.cache-2 -b4d38000-b4d39000 r-xs 00000000 08:02 3560125 /var/cache/fontconfig/e7071f4a29fa870f4323321c154eba04-x86.cache-2 -b4d39000-b4d3a000 r-xs 00000000 08:02 3560023 /var/cache/fontconfig/a2ab74764b07279e7c36ddb1d302cf26-x86.cache-2 -b4d3a000-b4d3e000 r-xs 00000000 08:02 3560003 /var/cache/fontconfig/921a30a17f0be15c70ac14043cb7a739-x86.cache-2 -b4d3e000-b4d3f000 r-xs 00000000 08:02 3560018 /var/cache/fontconfig/c69f04ab05004e31a6d5e715764f16d8-x86.cache-2 -b4d3f000-b4d40000 r-xs 00000000 08:02 3560008 /var/cache/fontconfig/4c73fe0c47614734b17d736dbde7580a-x86.cache-2 -b4d40000-b4d42000 r-xs 00000000 08:02 3560007 /var/cache/fontconfig/646addb8444faa74ee138aa00ab0b6a0-x86.cache-2 -b4d42000-b4d45000 r-xs 00000000 08:02 3560006 /var/cache/fontconfig/a755afe4a08bf5b97852ceb7400b47bc-x86.cache-2 -b4d45000-b4d47000 r-xs 00000000 08:02 3560015 /var/cache/fontconfig/20bd79ad97094406f7d1b9654bfbd926-x86.cache-2 -b4d47000-b4d49000 r-xs 00000000 08:02 3560009 /var/cache/fontconfig/9c0624108b9a2ae8552f664125be8356-x86.cache-2 -b4d49000-b4d50000 r-xs 00000000 08:02 3560004 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-x86.cache-2 -b4d50000-b4d53000 r-xs 00000000 08:02 3560012 /var/cache/fontconfig/de156ccd2eddbdc19d37a45b8b2aac9c-x86.cache-2 -b4d53000-b4d55000 r-xs 00000000 08:02 3556204 /var/cache/fontconfig/da1bd5ca8443ffe22927a23ce431d198-x86.cache-2 -b4d55000-b4d5d000 r-xs 00000000 08:02 3560169 /var/cache/fontconfig/e3de0de479f42330eadf588a55fb5bf4-x86.cache-2 -b4d5d000-b4d65000 r-xs 00000000 08:02 2409868 /var/cache/fontconfig/0f34bcd4b6ee430af32735b75db7f02b-x86.cache-2 -b4d65000-b4d66000 r-xs 00000000 08:02 3560126 /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-x86.cache-2 -b4d66000-b4d88000 r-xs 00000000 08:02 1392718 /var/cache/fontconfig/365b55f210c0a22e9a19e35191240f32-x86.cache-2 -b4d88000-b4d8a000 r-xs 00000000 08:02 3560017 /var/cache/fontconfig/2c5ba8142dffc8bf0377700342b8ca1a-x86.cache-2 -b4d8a000-b4d8d000 r-xs 00000000 08:02 3560022 /var/cache/fontconfig/de9486f0b47a4d768a594cb4198cb1c6-x86.cache-2 -b4d8d000-b4d94000 r-xs 00000000 08:02 3556202 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-x86.cache-2 -b4d94000-b4d99000 r-xs 00000000 08:02 3558093 /var/cache/fontconfig/105b9c7e6f0a4f82d8c9b6e39c52c6f9-x86.cache-2 -b4d99000-b4d9c000 r-xs 00000000 08:02 3560677 /var/cache/fontconfig/6386b86020ecc1ef9690bb720a13964f-x86.cache-2 -b4d9c000-b4da7000 r-xs 00000000 08:02 3556115 /var/cache/fontconfig/089dead882dea3570ffc31a9898cfb69-x86.cache-2 -b4da7000-b4db4000 r-xs 00000000 08:02 2409873 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 -b4dd5000-b4dd8000 ---p b4dd5000 00:00 0 -b4dd8000-b4e26000 rwxp b4dd8000 00:00 0 -b4e3b000-b4e46000 rwxs 00000000 00:09 1831534605 /SYSV00000000 (deleted) -b4e46000-b4e47000 r--s 0000f000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e47000-b4e48000 r--s 0000e000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e48000-b4e49000 r--s 0000d000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e49000-b4e4a000 r--s 0000c000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e4a000-b4e4b000 r--s 0000b000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e4b000-b4e4c000 r--s 0000a000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e4c000-b4e4d000 r--s 00009000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e4d000-b4e4e000 r--s 00008000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e4e000-b4e4f000 r--s 00007000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e4f000-b4e50000 r--s 00006000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e50000-b4e51000 r--s 00005000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e51000-b4e52000 r--s 00004000 00:11 751021 /var/run/pcscd/pcscd.pub -b4e52000-b4e5a000 r-xp 00000000 08:02 901283 /usr/lib/libpcsclite.so.1.0.0 -b4e5a000-b4e5b000 rwxp 00008000 08:02 901283 /usr/lib/libpcsclite.so.1.0.0 -b4e5b000-b4e5d000 r-xp 00000000 08:02 1085449 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libj2pcsc.so -b4e5d000-b4e5e000 rwxp 00001000 08:02 1085449 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libj2pcsc.so -b4e5e000-b4e61000 rwxp b4e5e000 00:00 0 -b4e61000-b4eaf000 rwxp b4e61000 00:00 0 -b4eaf000-b4eb2000 ---p b4eaf000 00:00 0 -b4eb2000-b4fd2000 rwxp b4eb2000 00:00 0 -b4fd2000-b5000000 ---p b4fd2000 00:00 0 -b5000000-b5001000 r--s 00003000 00:11 751021 /var/run/pcscd/pcscd.pub -b5001000-b5004000 r-xs 00027000 08:02 1086682 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/ext/sunjce_provider.jar -b5004000-b5036000 rwxp b5004000 00:00 0 -b5036000-b503a000 r-xs 00000000 08:02 3555788 /var/cache/fontconfig/4a195c91033ef4528a35b4a1ac51414e-x86.cache-2 -b503a000-b5048000 r-xs 00000000 08:02 3557818 /var/cache/fontconfig/865f88548240fee46819705c6468c165-x86.cache-2 -b5048000-b504f000 r-xs 00110000 08:02 1065527 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/resources.jar -b504f000-b5077000 rwxp b504f000 00:00 0 -b5077000-b507e000 r-xp 00000000 08:02 1085443 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnio.so -b507e000-b507f000 rwxp 00006000 08:02 1085443 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnio.so -b507f000-b5082000 ---p b507f000 00:00 0 -b5082000-b50d0000 rwxp b5082000 00:00 0 -b50d0000-b50d3000 ---p b50d0000 00:00 0 -b50d3000-b5121000 rwxp b50d3000 00:00 0 -b5121000-b5124000 r-xs 00000000 08:02 3560016 /var/cache/fontconfig/5e10083637a12ecd1bff191eb66bfa2f-x86.cache-2 -b5124000-b512a000 r-xs 00000000 08:02 3560014 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-x86.cache-2 -b512a000-b512d000 r-xs 00000000 08:02 3560019 /var/cache/fontconfig/e383d7ea5fbe662a33d9b44caf393297-x86.cache-2 -b512d000-b5132000 r-xs 00000000 08:02 3560011 /var/cache/fontconfig/bddabcf04192498a6a74911686fc6962-x86.cache-2 -b5132000-b5135000 r-xs 00000000 08:02 3556212 /var/cache/fontconfig/a46337af8a0b4c9b317ad981ec3bdf87-x86.cache-2 -b5135000-b5136000 r-xs 00000000 08:02 3560013 /var/cache/fontconfig/fd9505950c048a77dc4b710eb6a628ed-x86.cache-2 -b5136000-b5138000 r-xs 00000000 08:02 3560021 /var/cache/fontconfig/ddc79d3ea06a7c6ffa86ede85f3bb5df-x86.cache-2 -b5138000-b5139000 r-xs 00000000 08:02 3560164 /var/cache/fontconfig/e3fa16a14183b06aa45b3e009278fd14-x86.cache-2 -b5139000-b513a000 r-xs 00000000 08:02 3560125 /var/cache/fontconfig/e7071f4a29fa870f4323321c154eba04-x86.cache-2 -b513a000-b513b000 r-xs 00000000 08:02 3560023 /var/cache/fontconfig/a2ab74764b07279e7c36ddb1d302cf26-x86.cache-2 -b513b000-b513f000 r-xs 00000000 08:02 3560003 /var/cache/fontconfig/921a30a17f0be15c70ac14043cb7a739-x86.cache-2 -b513f000-b5140000 r-xs 00000000 08:02 3560018 /var/cache/fontconfig/c69f04ab05004e31a6d5e715764f16d8-x86.cache-2 -b5140000-b5141000 r-xs 00000000 08:02 3560008 /var/cache/fontconfig/4c73fe0c47614734b17d736dbde7580a-x86.cache-2 -b5141000-b5143000 r-xs 00000000 08:02 3560007 /var/cache/fontconfig/646addb8444faa74ee138aa00ab0b6a0-x86.cache-2 -b5143000-b5146000 r-xs 00000000 08:02 3560006 /var/cache/fontconfig/a755afe4a08bf5b97852ceb7400b47bc-x86.cache-2 -b5146000-b5148000 r-xs 00000000 08:02 3560015 /var/cache/fontconfig/20bd79ad97094406f7d1b9654bfbd926-x86.cache-2 -b5148000-b514a000 r-xs 00000000 08:02 3560009 /var/cache/fontconfig/9c0624108b9a2ae8552f664125be8356-x86.cache-2 -b514a000-b5151000 r-xs 00000000 08:02 3560004 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-x86.cache-2 -b5151000-b5154000 r-xs 00000000 08:02 3560012 /var/cache/fontconfig/de156ccd2eddbdc19d37a45b8b2aac9c-x86.cache-2 -b5154000-b5156000 r-xs 00000000 08:02 3556204 /var/cache/fontconfig/da1bd5ca8443ffe22927a23ce431d198-x86.cache-2 -b5156000-b515e000 r-xs 00000000 08:02 3560169 /var/cache/fontconfig/e3de0de479f42330eadf588a55fb5bf4-x86.cache-2 -b515e000-b5166000 r-xs 00000000 08:02 2409868 /var/cache/fontconfig/0f34bcd4b6ee430af32735b75db7f02b-x86.cache-2 -b5166000-b5167000 r-xs 00000000 08:02 3560126 /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-x86.cache-2 -b5167000-b5189000 r-xs 00000000 08:02 1392718 /var/cache/fontconfig/365b55f210c0a22e9a19e35191240f32-x86.cache-2 -b5189000-b518b000 r-xs 00000000 08:02 3560017 /var/cache/fontconfig/2c5ba8142dffc8bf0377700342b8ca1a-x86.cache-2 -b518b000-b518e000 r-xs 00000000 08:02 3560022 /var/cache/fontconfig/de9486f0b47a4d768a594cb4198cb1c6-x86.cache-2 -b518e000-b5195000 r-xs 00000000 08:02 3556202 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-x86.cache-2 -b5195000-b519a000 r-xs 00000000 08:02 3558093 /var/cache/fontconfig/105b9c7e6f0a4f82d8c9b6e39c52c6f9-x86.cache-2 -b519a000-b519d000 r-xs 00000000 08:02 3560677 /var/cache/fontconfig/6386b86020ecc1ef9690bb720a13964f-x86.cache-2 -b519d000-b51a8000 r-xs 00000000 08:02 3556115 /var/cache/fontconfig/089dead882dea3570ffc31a9898cfb69-x86.cache-2 -b51a8000-b51b5000 r-xs 00000000 08:02 2409873 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 -b51b5000-b51bb000 r-xs 00091000 08:02 1065704 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/jsse.jar -b51bb000-b51be000 rwxp b51bb000 00:00 0 -b51be000-b520c000 rwxp b51be000 00:00 0 -b520c000-b520f000 ---p b520c000 00:00 0 -b520f000-b525d000 rwxp b520f000 00:00 0 -b525d000-b5264000 r-xp 00000000 08:02 1343649 /usr/lib/libXrender.so.1.3.0 -b5264000-b5265000 rwxp 00007000 08:02 1343649 /usr/lib/libXrender.so.1.3.0 -b5265000-b526d000 r-xp 00000000 08:02 1343710 /usr/lib/libXcursor.so.1.0.2 -b526d000-b526e000 rwxp 00007000 08:02 1343710 /usr/lib/libXcursor.so.1.0.2 -b526e000-b526f000 r--s 00002000 00:11 751021 /var/run/pcscd/pcscd.pub -b526f000-b5271000 r-xs 00017000 08:02 4065150 /home/clemens/workspace/mocca/BKUApplet/target/test-libs/iaik_jce_me4se-3.04.jar -b5271000-b5284000 r-xp 00000000 08:02 1085442 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnet.so -b5284000-b5285000 rwxp 00013000 08:02 1085442 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libnet.so -b5285000-b5288000 ---p b5285000 00:00 0 -b5288000-b52d6000 rwxp b5288000 00:00 0 -b52d6000-b5354000 r-xp 00000000 08:02 1085586 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libfontmanager.so -b5354000-b535e000 rwxp 0007e000 08:02 1085586 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libfontmanager.so -b535e000-b5363000 rwxp b535e000 00:00 0 -b5363000-b536a000 r-xp 00000000 08:02 1343653 /usr/lib/libXi.so.6.0.0 -b536a000-b536b000 rwxp 00006000 08:02 1343653 /usr/lib/libXi.so.6.0.0 -b536b000-b5378000 r-xp 00000000 08:02 902010 /usr/lib/libXext.so.6.4.0 -b5378000-b5379000 rwxp 0000d000 08:02 902010 /usr/lib/libXext.so.6.4.0 -b5379000-b53ba000 r-xp 00000000 08:02 1085581 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/xawt/libmawt.so -b53ba000-b53bd000 rwxp 00040000 08:02 1085581 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/xawt/libmawt.so -b53bd000-b5438000 r-xp 00000000 08:02 1085578 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libawt.so -b5438000-b543f000 rwxp 0007b000 08:02 1085578 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libawt.so -b543f000-b5463000 rwxp b543f000 00:00 0 -b5463000-b54c2000 r-xs 00b89000 08:02 1085573 /usr/lib/jvm/java-6-sun-1.6.0.06/lib/tools.jar -b54c2000-b54f4000 rwxp b54c2000 00:00 0 -b54f4000-b567f000 r-xs 02df0000 08:02 1065570 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/rt.jar -b567f000-b5680000 ---p b567f000 00:00 0 -b5680000-b5800000 rwxp b5680000 00:00 0 -b5800000-b5801000 r--s 00001000 00:11 751021 /var/run/pcscd/pcscd.pub -b5801000-b5803000 r-xs 0000d000 08:02 4065123 /home/clemens/workspace/mocca/BKUApplet/target/test-libs/commons-logging-1.1.1.jar -b5803000-b5807000 r-xs 0002d000 08:02 4050367 /home/clemens/workspace/mocca/BKUApplet/target/BKUApplet-1.0-SNAPSHOT.jar -b5807000-b580b000 r-xp 00000000 08:02 1343688 /usr/lib/libXtst.so.6.1.0 -b580b000-b580c000 rwxp 00003000 08:02 1343688 /usr/lib/libXtst.so.6.1.0 -b580c000-b5810000 r-xp 00000000 08:02 905383 /usr/lib/libXfixes.so.3.1.0 -b5810000-b5811000 rwxp 00003000 08:02 905383 /usr/lib/libXfixes.so.3.1.0 -b5811000-b5815000 r-xs 00000000 08:02 3555788 /var/cache/fontconfig/4a195c91033ef4528a35b4a1ac51414e-x86.cache-2 -b5815000-b5823000 r-xs 00000000 08:02 3557818 /var/cache/fontconfig/865f88548240fee46819705c6468c165-x86.cache-2 -b5823000-b5826000 ---p b5823000 00:00 0 -b5826000-b5874000 rwxp b5826000 00:00 0 -b5874000-b5877000 ---p b5874000 00:00 0 -b5877000-b58f5000 rwxp b5877000 00:00 0 -b58f5000-b58f8000 ---p b58f5000 00:00 0 -b58f8000-b5946000 rwxp b58f8000 00:00 0 -b5946000-b594d000 r-xs 00000000 08:02 912666 /usr/lib/gconv/gconv-modules.cache -b594d000-b598c000 r-xp 00000000 08:02 2162962 /usr/lib/locale/de_AT.utf8/LC_CTYPE -b598c000-b598f000 ---p b598c000 00:00 0 -b598f000-b59dd000 rwxp b598f000 00:00 0 -b59dd000-b59e0000 ---p b59dd000 00:00 0 -b59e0000-b5a2e000 rwxp b59e0000 00:00 0 -b5a2e000-b5a2f000 ---p b5a2e000 00:00 0 -b5a2f000-b5abd000 rwxp b5a2f000 00:00 0 -b5abd000-b5ad7000 rwxp b5abd000 00:00 0 -b5ad7000-b5ada000 rwxp b5ad7000 00:00 0 -b5ada000-b5af5000 rwxp b5ada000 00:00 0 -b5af5000-b5af6000 rwxp b5af5000 00:00 0 -b5af6000-b5af7000 rwxp b5af6000 00:00 0 -b5af7000-b5afa000 rwxp b5af7000 00:00 0 -b5afa000-b5b15000 rwxp b5afa000 00:00 0 -b5b15000-b5b1b000 rwxp b5b15000 00:00 0 -b5b1b000-b5b35000 rwxp b5b1b000 00:00 0 -b5b35000-b5b46000 rwxp b5b35000 00:00 0 -b5b46000-b5bc0000 rwxp b5b46000 00:00 0 -b5bc0000-b5d10000 rwxp b5bc0000 00:00 0 -b5d10000-b7bc0000 rwxp b5d10000 00:00 0 -b7bc0000-b7bcf000 r-xp 00000000 08:02 1085437 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libzip.so -b7bcf000-b7bd1000 rwxp 0000e000 08:02 1085437 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libzip.so -b7bd1000-b7bf4000 r-xp 00000000 08:02 1085434 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libjava.so -b7bf4000-b7bf6000 rwxp 00023000 08:02 1085434 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libjava.so -b7bf6000-b7bff000 r-xp 00000000 08:02 2785878 /lib/tls/i686/cmov/libnss_files-2.7.so -b7bff000-b7c01000 rwxp 00008000 08:02 2785878 /lib/tls/i686/cmov/libnss_files-2.7.so -b7c01000-b7c09000 r-xp 00000000 08:02 2785986 /lib/tls/i686/cmov/libnss_nis-2.7.so -b7c09000-b7c0b000 rwxp 00007000 08:02 2785986 /lib/tls/i686/cmov/libnss_nis-2.7.so -b7c0b000-b7c1f000 r-xp 00000000 08:02 2785874 /lib/tls/i686/cmov/libnsl-2.7.so -b7c1f000-b7c21000 rwxp 00013000 08:02 2785874 /lib/tls/i686/cmov/libnsl-2.7.so -b7c21000-b7c23000 rwxp b7c21000 00:00 0 -b7c23000-b7c24000 r--s 00000000 00:11 751021 /var/run/pcscd/pcscd.pub -b7c24000-b7c25000 r-xs 00000000 08:02 3556750 /var/cache/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-x86.cache-2 -b7c25000-b7c26000 r-xs 00000000 08:02 3556750 /var/cache/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-x86.cache-2 -b7c26000-b7c31000 r-xp 00000000 08:02 1085433 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libverify.so -b7c31000-b7c32000 rwxp 0000b000 08:02 1085433 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/libverify.so -b7c32000-b7c3a000 rwxs 00000000 08:02 1328188 /tmp/hsperfdata_clemens/32072 -b7c3a000-b7c41000 r-xp 00000000 08:02 2786023 /lib/tls/i686/cmov/librt-2.7.so -b7c41000-b7c43000 rwxp 00006000 08:02 2786023 /lib/tls/i686/cmov/librt-2.7.so -b7c43000-b7c46000 ---p b7c43000 00:00 0 -b7c46000-b7c94000 rwxp b7c46000 00:00 0 -b7c94000-b7cb7000 r-xp 00000000 08:02 2785871 /lib/tls/i686/cmov/libm-2.7.so -b7cb7000-b7cb9000 rwxp 00023000 08:02 2785871 /lib/tls/i686/cmov/libm-2.7.so -b7cb9000-b7cba000 rwxp b7cb9000 00:00 0 -b7cba000-b7cbe000 r-xp 00000000 08:02 905230 /usr/lib/libXdmcp.so.6.0.0 -b7cbe000-b7cbf000 rwxp 00003000 08:02 905230 /usr/lib/libXdmcp.so.6.0.0 -b7cbf000-b7cc1000 r-xp 00000000 08:02 901311 /usr/lib/libXau.so.6.0.0 -b7cc1000-b7cc2000 rwxp 00001000 08:02 901311 /usr/lib/libXau.so.6.0.0 -b7cc2000-b7cd9000 r-xp 00000000 08:02 901194 /usr/lib/libxcb.so.1.0.0 -b7cd9000-b7cda000 rwxp 00016000 08:02 901194 /usr/lib/libxcb.so.1.0.0 -b7cda000-b7cdb000 rwxp b7cda000 00:00 0 -b7cdb000-b7cdc000 r-xp 00000000 08:02 901196 /usr/lib/libxcb-xlib.so.0.0.0 -b7cdc000-b7cdd000 rwxp 00000000 08:02 901196 /usr/lib/libxcb-xlib.so.0.0.0 -b7cdd000-b7e26000 r-xp 00000000 08:02 2785863 /lib/tls/i686/cmov/libc-2.7.so -b7e26000-b7e27000 r-xp 00149000 08:02 2785863 /lib/tls/i686/cmov/libc-2.7.so -b7e27000-b7e29000 rwxp 0014a000 08:02 2785863 /lib/tls/i686/cmov/libc-2.7.so -b7e29000-b7e2c000 rwxp b7e29000 00:00 0 -b7e2c000-b7e2e000 r-xp 00000000 08:02 2785869 /lib/tls/i686/cmov/libdl-2.7.so -b7e2e000-b7e30000 rwxp 00001000 08:02 2785869 /lib/tls/i686/cmov/libdl-2.7.so -b7e30000-b7e37000 r-xp 00000000 08:02 1085436 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/jli/libjli.so -b7e37000-b7e39000 rwxp 00006000 08:02 1085436 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/jli/libjli.so -b7e39000-b7f1d000 r-xp 00000000 08:02 901308 /usr/lib/libX11.so.6.2.0 -b7f1d000-b7f20000 rwxp 000e4000 08:02 901308 /usr/lib/libX11.so.6.2.0 -b7f20000-b7f21000 rwxp b7f20000 00:00 0 -b7f21000-b7f35000 r-xp 00000000 08:02 2786020 /lib/tls/i686/cmov/libpthread-2.7.so -b7f35000-b7f37000 rwxp 00013000 08:02 2786020 /lib/tls/i686/cmov/libpthread-2.7.so -b7f37000-b7f3e000 rwxp b7f37000 00:00 0 -b7f3e000-b7f45000 r-xp 00000000 08:02 2785875 /lib/tls/i686/cmov/libnss_compat-2.7.so -b7f45000-b7f47000 rwxp 00006000 08:02 2785875 /lib/tls/i686/cmov/libnss_compat-2.7.so -b7f47000-b7f4d000 r-xp 00000000 08:02 1085422 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/native_threads/libhpi.so -b7f4d000-b7f4e000 rwxp 00006000 08:02 1085422 /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/native_threads/libhpi.so -b7f4e000-b7f4f000 rwxp b7f4e000 00:00 0 -b7f4f000-b7f50000 r-xp b7f4f000 00:00 0 -b7f50000-b7f52000 rwxp b7f50000 00:00 0 -b7f52000-b7f53000 r-xp b7f52000 00:00 0 [vdso] -b7f53000-b7f6d000 r-xp 00000000 08:02 2786582 /lib/ld-2.7.so -b7f6d000-b7f6f000 rwxp 00019000 08:02 2786582 /lib/ld-2.7.so -bfaac000-bfac1000 rwxp bffeb000 00:00 0 [stack] - -VM Arguments: -jvm_args: -Dapplication.home=/usr/lib/jvm/java-6-sun-1.6.0.06 -java_command: sun.applet.Main target/test-classes/appletTest.html -Launcher Type: SUN_STANDARD - -Environment Variables: -JAVA_HOME=/usr/lib/jvm/java-6-sun -PATH=/home/clemens/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games -LD_LIBRARY_PATH=/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.06/jre/../lib/i386 -SHELL=/bin/bash -DISPLAY=:0 - -Signal Handlers: -SIGSEGV: [libjvm.so+0x3be710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGBUS: [libjvm.so+0x3be710], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGFPE: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGPIPE: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGXFSZ: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGILL: [libjvm.so+0x30f810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000 -SIGUSR2: [libjvm.so+0x311850], sa_mask[0]=0x00000000, sa_flags=0x10000004 -SIGHUP: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGINT: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGTERM: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 -SIGQUIT: [libjvm.so+0x3115f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004 - - ---------------- S Y S T E M --------------- - -OS:lenny/sid - -uname:Linux 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 -libc:glibc 2.7 NPTL 2.7 -rlimit: STACK 8192k, CORE 0k, NPROC 16381, NOFILE 1024, AS infinity -load average:0.84 0.39 0.22 - -CPU:total 2 (1 cores per cpu, 2 threads per core) family 15 model 4 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht - -Memory: 4k page, physical 2075432k(62584k free), swap 1542200k(1502244k free) - -vm_info: Java HotSpot(TM) Client VM (10.0-b22) for linux-x86 JRE (1.6.0_06-b02), built on Mar 25 2008 00:39:19 by "java_re" with gcc 3.2.1-7a (J2SE release) - -time: Thu Oct 9 12:01:31 2008 -elapsed time: 55 seconds - diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 8204d0eb..2570e021 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -18,7 +18,7 @@
-- cgit v1.2.3 From d8901c075f9deb663e0edd640672ed620ffb4610 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 19 Nov 2008 16:14:57 +0000 Subject: GUI bugfixes and cleanup git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@181 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/test/resources/appletTest.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 2570e021..cc7c2bd7 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -20,7 +20,8 @@ - + + -- cgit v1.2.3 From 11c83e13e032738ee927f22196dc9ca43589a8a4 Mon Sep 17 00:00:00 2001 From: mcentner Date: Mon, 24 Nov 2008 14:11:39 +0000 Subject: Version set to 1.0.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@193 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index eaaa5820..10cfa53a 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -3,13 +3,13 @@ bku at.gv.egiz - 1.0 + 1.0.0-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0 + 1.0.0-SNAPSHOT @@ -116,27 +116,27 @@ at.gv.egiz smcc - 1.0 + 1.0.0-SNAPSHOT at.gv.egiz STAL - 1.0 + 1.0.0-SNAPSHOT at.gv.egiz STALService - 1.0 + 1.0.0-SNAPSHOT at.gv.egiz smccSTAL - 1.0 + 1.0.0-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0 + 1.0.0-SNAPSHOT commons-logging -- cgit v1.2.3 From 322cca2c8fe57b7ca7ee1d4766ef31833e6825d7 Mon Sep 17 00:00:00 2001 From: mcentner Date: Mon, 24 Nov 2008 15:48:51 +0000 Subject: Changed maven-dependency plugin configuration for copy- and unpack-resources to support goal 'package'. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@195 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 10cfa53a..d7d74b5e 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -18,11 +18,13 @@ unpack - unpack + unpack-dependencies + at.gv.egiz + true ${project.build.outputDirectory} - META-INF\/ + META-INF\/ -- cgit v1.2.3 From 0177d75af235f00063e8b0866106002237a41d05 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 24 Nov 2008 17:33:08 +0000 Subject: cleanup git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@199 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java | 5 ----- 1 file changed, 5 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index b2f9f89c..03e4b7c9 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -192,11 +192,6 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { private void registerSignRequestHandler() throws MalformedURLException { String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); -// if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) { -// log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); -// AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId, AppletHashDataDisplay.DISPLAY.applet); -// addRequestHandler(SignRequest.class, handler); -// } else if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); -- cgit v1.2.3 From b1209c3cf4a3447b8dd1320a5b068bf205797980 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 07:47:42 +0000 Subject: [maven-release-plugin] prepare release mocca-1.0.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@201 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 295 +++++++++++++++++++++++++++--------------------------- 1 file changed, 147 insertions(+), 148 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index d7d74b5e..6f900ad3 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -1,148 +1,147 @@ - - - - bku - at.gv.egiz - 1.0.0-SNAPSHOT - - 4.0.0 - at.gv.egiz - BKUApplet - BKU Applet - 1.0.0-SNAPSHOT - - - - maven-dependency-plugin - - - unpack - - unpack-dependencies - - - at.gv.egiz - true - ${project.build.outputDirectory} - META-INF\/ - - - - - maven-jar-plugin - - - - sign - - - - - - false - false - - false - true - - - test-applet signer - ./keystore.ks - storepass - keypass - true - - - - maven-dependency-plugin - - - copytestlibs - - copy - - - - - commons-logging - commons-logging - - - iaik - iaik_jce_me4se - - - ${project.build.directory}/test-libs - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - - - at.gv.egiz - smcc - 1.0.0-SNAPSHOT - - - at.gv.egiz - STAL - 1.0.0-SNAPSHOT - - - at.gv.egiz - STALService - 1.0.0-SNAPSHOT - - - at.gv.egiz - smccSTAL - 1.0.0-SNAPSHOT - - - at.gv.egiz - BKUCommonGUI - 1.0.0-SNAPSHOT - - - commons-logging - commons-logging - - - + + + bku + at.gv.egiz + 1.0.1 + + 4.0.0 + at.gv.egiz + BKUApplet + BKU Applet + 1.0.1 + + + + maven-dependency-plugin + + + unpack + + unpack-dependencies + + + at.gv.egiz + true + ${project.build.outputDirectory} + META-INF\/ + + + + + maven-jar-plugin + + + + sign + + + + + + false + false + + false + true + + + test-applet signer + ./keystore.ks + storepass + keypass + true + + + + maven-dependency-plugin + + + copytestlibs + + copy + + + + + commons-logging + commons-logging + + + iaik + iaik_jce_me4se + + + ${project.build.directory}/test-libs + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + at.gv.egiz + smcc + 1.0.1 + + + at.gv.egiz + STAL + 1.0.1 + + + at.gv.egiz + STALService + 1.0.1 + + + at.gv.egiz + smccSTAL + 1.0.1 + + + at.gv.egiz + BKUCommonGUI + 1.0.1 + + + commons-logging + commons-logging + + + \ No newline at end of file -- cgit v1.2.3 From 86962d8745b41a6cdb9fd95496176e698c0f6a9c Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 07:47:48 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@203 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 6f900ad3..1d880919 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.1 + 1.0.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.1 + 1.0.1-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz STAL - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz STALService - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz smccSTAL - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.1 + 1.0.1-SNAPSHOT commons-logging -- cgit v1.2.3 From c9ff6be4c89bfcb643c70fdb46e3a6425911b61f Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 08:10:11 +0000 Subject: [maven-release-plugin] prepare release mocca-1.0.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@205 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 1d880919..49159c5e 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.1-SNAPSHOT + 1.0.2 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.1-SNAPSHOT + 1.0.2 @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.1-SNAPSHOT + 1.0.2 at.gv.egiz STAL - 1.0.1-SNAPSHOT + 1.0.2 at.gv.egiz STALService - 1.0.1-SNAPSHOT + 1.0.2 at.gv.egiz smccSTAL - 1.0.1-SNAPSHOT + 1.0.2 at.gv.egiz BKUCommonGUI - 1.0.1-SNAPSHOT + 1.0.2 commons-logging -- cgit v1.2.3 From 38e77cff0a5cba8016dd3f9197647f7a82678880 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 08:10:17 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@207 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 49159c5e..8947daa0 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.2 + 1.0.2-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.2 + 1.0.2-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz STAL - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz STALService - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz smccSTAL - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.2 + 1.0.2-SNAPSHOT commons-logging -- cgit v1.2.3 From 4455f67be95f84ba0da82a90f0df47ddd4711937 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 08:15:32 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.0.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@208 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 8947daa0..1d880919 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.2-SNAPSHOT + 1.0.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.2-SNAPSHOT + 1.0.1-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.2-SNAPSHOT + 1.0.1-SNAPSHOT at.gv.egiz STAL - 1.0.2-SNAPSHOT + 1.0.1-SNAPSHOT at.gv.egiz STALService - 1.0.2-SNAPSHOT + 1.0.1-SNAPSHOT at.gv.egiz smccSTAL - 1.0.2-SNAPSHOT + 1.0.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.2-SNAPSHOT + 1.0.1-SNAPSHOT commons-logging -- cgit v1.2.3 From 4353cad73d83ac86184b2242f889701c76c0c2b7 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 08:24:03 +0000 Subject: [maven-release-plugin] prepare release mocca-1.0.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@211 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 1d880919..6f900ad3 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.1-SNAPSHOT + 1.0.1 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.1-SNAPSHOT + 1.0.1 @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz STAL - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz STALService - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz smccSTAL - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz BKUCommonGUI - 1.0.1-SNAPSHOT + 1.0.1 commons-logging -- cgit v1.2.3 From 11953efc834fbb06f14c30d9f1783e2b4b941f7b Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 08:29:39 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.0.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@214 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 6f900ad3..1d880919 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.1 + 1.0.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.1 + 1.0.1-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz STAL - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz STALService - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz smccSTAL - 1.0.1 + 1.0.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.1 + 1.0.1-SNAPSHOT commons-logging -- cgit v1.2.3 From 4421289feed2da8d81ed438d9e5d9a0be503cec1 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 08:31:24 +0000 Subject: [maven-release-plugin] prepare release mocca-1.0.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@215 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 1d880919..6f900ad3 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.1-SNAPSHOT + 1.0.1 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.1-SNAPSHOT + 1.0.1 @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz STAL - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz STALService - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz smccSTAL - 1.0.1-SNAPSHOT + 1.0.1 at.gv.egiz BKUCommonGUI - 1.0.1-SNAPSHOT + 1.0.1 commons-logging -- cgit v1.2.3 From b2d68a5fb093999cb42192bea77da8d8414bdb7b Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 25 Nov 2008 08:31:29 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@217 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 6f900ad3..8947daa0 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.1 + 1.0.2-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.1 + 1.0.2-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.1 + 1.0.2-SNAPSHOT at.gv.egiz STAL - 1.0.1 + 1.0.2-SNAPSHOT at.gv.egiz STALService - 1.0.1 + 1.0.2-SNAPSHOT at.gv.egiz smccSTAL - 1.0.1 + 1.0.2-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.1 + 1.0.2-SNAPSHOT commons-logging -- cgit v1.2.3 From 42963d2004d09b183afe289c80fbcdb14b574e1a Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Nov 2008 15:20:49 +0000 Subject: applet codebase update git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@219 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/test/resources/appletTest.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index cc7c2bd7..b3f68a91 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -18,10 +18,10 @@
- + -- cgit v1.2.3 From b7a21dac485edf28d6201ab210d7263cf052e21f Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 1 Dec 2008 12:39:54 +0000 Subject: cleanup git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@226 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index d0eed607..d0f6d489 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -75,7 +75,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { /** * Factory method to create and wire HelpListener, GUI and BKUWorker. - * (Config via applet parameters as constants BKUApplet.*) + * (Config via applet parameters, see BKUApplet.* constants) */ @Override public void init() { @@ -83,7 +83,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { log.debug("Called init()"); HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); - + String locale = getAppletParameter(LOCALE); if (locale != null) { this.setLocale(new Locale(locale)); -- cgit v1.2.3 From 77a19e106e4128c21dd2d1270fdc8d930e415247 Mon Sep 17 00:00:00 2001 From: wbauer Date: Thu, 18 Dec 2008 08:58:39 +0000 Subject: Fixed BUG #366, changed applet name in BKUOnline to have no version number git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@253 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 59 ++++-- .../online/applet/InternalSSLSocketFactory.java | 235 +++++++++++---------- 2 files changed, 155 insertions(+), 139 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 03e4b7c9..9fc21df8 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -38,7 +38,7 @@ import java.util.List; import javax.xml.namespace.QName; /** - * + * * @author Clemens Orthacker */ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { @@ -48,7 +48,8 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { protected String sessionId; protected STALPortType stalPort; - public AppletBKUWorker(BKUGUIFacade gui, AppletContext ctx, AppletParameterProvider paramProvider) { + public AppletBKUWorker(BKUGUIFacade gui, AppletContext ctx, + AppletParameterProvider paramProvider) { super(gui); if (ctx == null) { throw new NullPointerException("Applet context not provided"); @@ -76,7 +77,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { actionCommandList.clear(); actionCommandList.add("ok"); gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, - new Object[]{e.getMessage()}); + new Object[] { e.getMessage() }); try { waitForAction(); } catch (InterruptedException e1) { @@ -92,8 +93,10 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); do { - List requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); - List stalRequests = STALTranslator.translateRequests(requests); + List requests = nextRequestResp + .getInfoboxReadRequestOrSignRequestOrQuitRequest(); + List stalRequests = STALTranslator + .translateRequests(requests); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Received "); @@ -142,64 +145,76 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } if (!finished) { - log.info("Not finished yet (BKUWorker: " + this + "), sending responses"); + log.info("Not finished yet (BKUWorker: " + this + + "), sending responses"); GetNextRequestType nextRequest = of.createGetNextRequestType(); nextRequest.setSessionId(sessionId); - nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); + nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse() + .addAll(responses); nextRequestResp = stalPort.getNextRequest(nextRequest); } } while (!finished); log.info("Done " + Thread.currentThread().getName()); } catch (Exception ex) { log.error(ex.getMessage(), ex); - gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[]{ex.getMessage()}); + gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] { ex + .getMessage() }); try { waitForAction(); } catch (InterruptedException e) { log.error(e); } - } - if (signatureCard != null) { - signatureCard.disconnect(false); + if (signatureCard != null) { + signatureCard.disconnect(false); + } } sendRedirect(); } protected void sendRedirect() { try { - URL redirectURL = params.getURLParameter(BKUApplet.REDIRECT_URL, sessionId); - String redirectTarget = params.getAppletParameter(BKUApplet.REDIRECT_TARGET); + URL redirectURL = params.getURLParameter(BKUApplet.REDIRECT_URL, + sessionId); + String redirectTarget = params + .getAppletParameter(BKUApplet.REDIRECT_TARGET); if (redirectTarget == null) { log.info("Done. Redirecting to " + redirectURL + " ..."); ctx.showDocument(redirectURL); } else { - log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); + log.info("Done. Redirecting to " + redirectURL + " (target=" + + redirectTarget + ") ..."); ctx.showDocument(redirectURL, redirectTarget); } } catch (MalformedURLException ex) { log.warn("Failed to redirect: " + ex.getMessage(), ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) + // gui.showErrorDialog(errorMsg, okListener, actionCommand) } } private STALPortType getSTALPort() throws MalformedURLException { URL wsdlURL = params.getURLParameter(BKUApplet.WSDL_URL); log.debug("STAL WSDL at " + wsdlURL); - QName endpointName = new QName(BKUApplet.STAL_WSDL_NS, BKUApplet.STAL_SERVICE); + QName endpointName = new QName(BKUApplet.STAL_WSDL_NS, + BKUApplet.STAL_SERVICE); STALService stal = new STALService(wsdlURL, endpointName); return stal.getSTALPort(); } private void registerSignRequestHandler() throws MalformedURLException { - String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); + String hashDataDisplayStyle = params + .getAppletParameter(BKUApplet.HASHDATA_DISPLAY); if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { - URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId); + URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, + sessionId); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); - addRequestHandler(SignRequest.class, new BrowserHashDataDisplay(ctx, hashDataURL)); + addRequestHandler(SignRequest.class, new BrowserHashDataDisplay(ctx, + hashDataURL)); } else { - //BKUApplet.HASHDATA_DISPLAY_FRAME - log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, sessionId); + // BKUApplet.HASHDATA_DISPLAY_FRAME + log.debug("register SignRequestHandler for STAL port " + + BKUApplet.WSDL_URL); + AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, + sessionId); addRequestHandler(SignRequest.class, handler); } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java index c3417d63..a02e56eb 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java @@ -36,121 +36,122 @@ import org.apache.commons.logging.LogFactory; public class InternalSSLSocketFactory extends SSLSocketFactory { - private final static String GOV_DOMAIN = ".gv.at"; - - private static InternalSSLSocketFactory instance = new InternalSSLSocketFactory(); - - private final static Log log = LogFactory - .getLog(InternalSSLSocketFactory.class); - - private SSLSocket sslSocket; - - private SSLSocketFactory proxy; - - private InternalSSLSocketFactory() { - proxy = HttpsURLConnection.getDefaultSSLSocketFactory(); - } - - public static InternalSSLSocketFactory getInstance() { - return instance; - } - - @Override - public Socket createSocket() throws IOException { - sslSocket = (SSLSocket) proxy.createSocket(); - return sslSocket; - } - - @Override - public Socket createSocket(String arg0, int arg1) throws IOException, - UnknownHostException { - sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1); - - return sslSocket; - } - - @Override - public Socket createSocket(InetAddress arg0, int arg1) throws IOException { - sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1); - return sslSocket; - } - - @Override - public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3) - throws IOException, UnknownHostException { - sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); - return sslSocket; - } - - @Override - public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2, - int arg3) throws IOException { - sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); - return sslSocket; - } - - @Override - public Socket createSocket(Socket arg0, String arg1, int arg2, boolean arg3) - throws IOException { - sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); - return sslSocket; - } - - @Override - public String[] getDefaultCipherSuites() { - return proxy.getDefaultCipherSuites(); - } - - @Override - public String[] getSupportedCipherSuites() { - return proxy.getSupportedCipherSuites(); - } - - public boolean isEgovAgency() { - log.info("Checking if server is egov agency"); - if (sslSocket != null) { - try { - X509Certificate cert = (X509Certificate) sslSocket.getSession() - .getPeerCertificates()[0]; - log.info("Server cert: " + cert); - return isGovAgency(cert); - } catch (SSLPeerUnverifiedException e) { - log.error(e); - return false; - } - } - log.info("Not a SSL connection"); - return false; - } - - public static boolean isGovAgency(X509Certificate cert) { - String[] rdns = (cert.getSubjectX500Principal().getName()).split(","); - for (String rdn : rdns) { - if (rdn.startsWith("CN=")) { - String dns = rdn.split("=")[1]; - if (dns.endsWith(GOV_DOMAIN)) { - return true; - } - } - } - try { - Collection> sanList = cert.getSubjectAlternativeNames(); - if (sanList != null) { - for (List san : sanList) { - if ((Integer) san.get(0) == 2) { - String dns = (String) san.get(1); - if (dns.endsWith(GOV_DOMAIN)) { - return true; - } - } - } - } - } catch (CertificateParsingException e) { - log.error(e); - } - if (cert.getExtensionValue("1.2.40.0.10.1.1.1") != null) { - return true; - } - return false; - } + private final static String GOV_DOMAIN = ".gv.at"; + + private static InternalSSLSocketFactory instance = new InternalSSLSocketFactory(); + + private final static Log log = LogFactory + .getLog(InternalSSLSocketFactory.class); + + private SSLSocket sslSocket; + + private SSLSocketFactory proxy; + + private InternalSSLSocketFactory() { + proxy = HttpsURLConnection.getDefaultSSLSocketFactory(); + } + + public static InternalSSLSocketFactory getInstance() { + return instance; + } + + @Override + public Socket createSocket() throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(); + return sslSocket; + } + + @Override + public Socket createSocket(String arg0, int arg1) throws IOException, + UnknownHostException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1); + + return sslSocket; + } + + @Override + public Socket createSocket(InetAddress arg0, int arg1) throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1); + return sslSocket; + } + + @Override + public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3) + throws IOException, UnknownHostException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); + return sslSocket; + } + + @Override + public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2, + int arg3) throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); + return sslSocket; + } + + @Override + public Socket createSocket(Socket arg0, String arg1, int arg2, boolean arg3) + throws IOException { + sslSocket = (SSLSocket) proxy.createSocket(arg0, arg1, arg2, arg3); + return sslSocket; + } + + @Override + public String[] getDefaultCipherSuites() { + return proxy.getDefaultCipherSuites(); + } + + @Override + public String[] getSupportedCipherSuites() { + return proxy.getSupportedCipherSuites(); + } + + public boolean isEgovAgency() { + log.info("Checking if server is egov agency"); + if (sslSocket != null) { + try { + X509Certificate cert = (X509Certificate) sslSocket.getSession() + .getPeerCertificates()[0]; + log.info("Server cert: " + cert); + return isGovAgency(cert); + } catch (SSLPeerUnverifiedException e) { + log.error(e); + return false; + } + } + log.info("Not a SSL connection"); + return false; + } + + public static boolean isGovAgency(X509Certificate cert) { + String[] rdns = (cert.getSubjectX500Principal().getName()).split(","); + for (String rdn : rdns) { + if (rdn.startsWith("CN=")) { + String dns = rdn.split("=")[1]; + if (dns.endsWith(GOV_DOMAIN)) { + return true; + } + } + } + try { + Collection> sanList = cert.getSubjectAlternativeNames(); + if (sanList != null) { + for (List san : sanList) { + if ((Integer) san.get(0) == 2) { + String dns = (String) san.get(1); + if (dns.endsWith(GOV_DOMAIN)) { + return true; + } + } + } + } + } catch (CertificateParsingException e) { + log.error(e); + } + if ((cert.getExtensionValue("1.2.40.0.10.1.1.1") != null) + || (cert.getExtensionValue("1.2.40.0.10.1.1.2") != null)) { + return true; + } + return false; + } } -- cgit v1.2.3 From 9676c9eb710bf10ecb4812043fedacd2f6e6278c Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 20 Jan 2009 14:24:43 +0000 Subject: prepare for stal service extension git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@269 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 67 +++++++++++----------- .../at/gv/egiz/stal/client/STALServiceTest.java | 6 +- 2 files changed, 37 insertions(+), 36 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 9fc21df8..3903bf10 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -35,6 +35,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; +import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; /** @@ -47,9 +48,10 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { protected AppletParameterProvider params; protected String sessionId; protected STALPortType stalPort; + private ObjectFactory stalObjFactory = new ObjectFactory(); public AppletBKUWorker(BKUGUIFacade gui, AppletContext ctx, - AppletParameterProvider paramProvider) { + AppletParameterProvider paramProvider) { super(gui); if (ctx == null) { throw new NullPointerException("Applet context not provided"); @@ -77,7 +79,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { actionCommandList.clear(); actionCommandList.add("ok"); gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, - new Object[] { e.getMessage() }); + new Object[]{e.getMessage()}); try { waitForAction(); } catch (InterruptedException e1) { @@ -89,14 +91,17 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { try { registerSignRequestHandler(); - ObjectFactory of = new ObjectFactory(); - GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); do { - List requests = nextRequestResp - .getInfoboxReadRequestOrSignRequestOrQuitRequest(); - List stalRequests = STALTranslator - .translateRequests(requests); + List> requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); + + // (rather use validator) + if (requests.size() == 0) { + log.error("Received empty NextRequestResponse: no STAL requests to handle. (STAL-X requests might not have gotten unmarshalled)"); + throw new Exception("No STAL requests to handle."); + } + + List stalRequests = STALTranslator.translateRequests(requests); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Received "); @@ -117,13 +122,13 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { String domainId = r.getDomainIdentifier(); if ("IdentityLink".equals(infoboxId) && domainId == null) { if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { - handle = false; + handle = false; } } } } - List responses; + List> responses; if (handle) { List stalResponses = handleRequest(stalRequests); if (log.isInfoEnabled()) { @@ -137,28 +142,26 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } responses = STALTranslator.fromSTAL(stalResponses); } else { - responses = new ArrayList(1); - ErrorResponseType err = of.createErrorResponseType(); + log.error("Insufficient rights to execute command InfoboxReadRequest for Infobox IdentityLink, return Error 6002"); + responses = new ArrayList>(1); + ErrorResponseType err = stalObjFactory.createErrorResponseType(); err.setErrorCode(6002); // err.setErrorMessage(); - responses.add(err); + responses.add(stalObjFactory.createGetNextRequestTypeErrorResponse(err)); } if (!finished) { - log.info("Not finished yet (BKUWorker: " + this - + "), sending responses"); - GetNextRequestType nextRequest = of.createGetNextRequestType(); + log.info("Not finished yet (BKUWorker: " + this + "), sending responses"); + GetNextRequestType nextRequest = stalObjFactory.createGetNextRequestType(); nextRequest.setSessionId(sessionId); - nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse() - .addAll(responses); + nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); nextRequestResp = stalPort.getNextRequest(nextRequest); } } while (!finished); log.info("Done " + Thread.currentThread().getName()); } catch (Exception ex) { log.error(ex.getMessage(), ex); - gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] { ex - .getMessage() }); + gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[]{ex.getMessage()}); try { waitForAction(); } catch (InterruptedException e) { @@ -174,20 +177,18 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { protected void sendRedirect() { try { URL redirectURL = params.getURLParameter(BKUApplet.REDIRECT_URL, - sessionId); - String redirectTarget = params - .getAppletParameter(BKUApplet.REDIRECT_TARGET); + sessionId); + String redirectTarget = params.getAppletParameter(BKUApplet.REDIRECT_TARGET); if (redirectTarget == null) { log.info("Done. Redirecting to " + redirectURL + " ..."); ctx.showDocument(redirectURL); } else { - log.info("Done. Redirecting to " + redirectURL + " (target=" - + redirectTarget + ") ..."); + log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); ctx.showDocument(redirectURL, redirectTarget); } } catch (MalformedURLException ex) { log.warn("Failed to redirect: " + ex.getMessage(), ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) + // gui.showErrorDialog(errorMsg, okListener, actionCommand) } } @@ -195,26 +196,24 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { URL wsdlURL = params.getURLParameter(BKUApplet.WSDL_URL); log.debug("STAL WSDL at " + wsdlURL); QName endpointName = new QName(BKUApplet.STAL_WSDL_NS, - BKUApplet.STAL_SERVICE); + BKUApplet.STAL_SERVICE); STALService stal = new STALService(wsdlURL, endpointName); return stal.getSTALPort(); } private void registerSignRequestHandler() throws MalformedURLException { - String hashDataDisplayStyle = params - .getAppletParameter(BKUApplet.HASHDATA_DISPLAY); + String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, - sessionId); + sessionId); log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); addRequestHandler(SignRequest.class, new BrowserHashDataDisplay(ctx, - hashDataURL)); + hashDataURL)); } else { // BKUApplet.HASHDATA_DISPLAY_FRAME - log.debug("register SignRequestHandler for STAL port " - + BKUApplet.WSDL_URL); + log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, - sessionId); + sessionId); addRequestHandler(SignRequest.class, handler); } } diff --git a/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java index 63da8225..74017c22 100644 --- a/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java +++ b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java @@ -41,6 +41,7 @@ import at.gv.egiz.stal.service.types.GetNextRequestResponseType; import at.gv.egiz.stal.service.types.GetNextRequestType; import at.gv.egiz.stal.service.types.InfoboxReadRequestType; import at.gv.egiz.stal.service.types.RequestType; +import javax.xml.bind.JAXBElement; /** * @@ -51,7 +52,7 @@ public class STALServiceTest { // @Test public void callSTAL() { try { - URL endpointURL = new URL("http://localhost:8080/bkuonline/stal?wsdl"); + URL endpointURL = new URL("http://localhost:3495/bkuonline/stal?wsdl"); QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", "STALService"); STALService stal = new STALService(endpointURL, endpointName); // stal = new STALService(); @@ -63,7 +64,8 @@ public class STALServiceTest { GetNextRequestResponseType nrResp = port.getNextRequest(nrReq); assertNotNull(nrResp); System.out.println("got response: " + nrResp.getInfoboxReadRequestOrSignRequestOrQuitRequest().size()); - for (RequestType stalReq : nrResp.getInfoboxReadRequestOrSignRequestOrQuitRequest()) { + for (JAXBElement stalReqElt : nrResp.getInfoboxReadRequestOrSignRequestOrQuitRequest()) { + RequestType stalReq = stalReqElt.getValue(); if (stalReq instanceof InfoboxReadRequestType) { String ibid = ((InfoboxReadRequestType) stalReq).getInfoboxIdentifier(); String did = ((InfoboxReadRequestType) stalReq).getDomainIdentifier(); -- cgit v1.2.3 From 4618f05e6a202ef2d502c78a4bd0dc13b9c0aea2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 20 Jan 2009 16:38:30 +0000 Subject: [maven-release-plugin] prepare release bku-1.0.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@273 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 8947daa0..49159c5e 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.2-SNAPSHOT + 1.0.2 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.2-SNAPSHOT + 1.0.2 @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz STAL - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz STALService - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz smccSTAL - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz BKUCommonGUI - 1.0.2-SNAPSHOT + 1.0.2 commons-logging -- cgit v1.2.3 From ce598ba5142ff7673085dd90865f9323d69574be Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 20 Jan 2009 16:56:08 +0000 Subject: [maven-release-plugin] rollback the release of bku-1.0.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@274 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 49159c5e..8947daa0 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.2 + 1.0.2-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.2 + 1.0.2-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz STAL - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz STALService - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz smccSTAL - 1.0.2 + 1.0.2-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.2 + 1.0.2-SNAPSHOT commons-logging -- cgit v1.2.3 From 3f673f19aa8c4aec3d40d98731de289cbb7e79c6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 20 Jan 2009 17:01:02 +0000 Subject: [maven-release-plugin] prepare release mocca-1.0.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@275 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 8947daa0..49159c5e 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.2-SNAPSHOT + 1.0.2 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.2-SNAPSHOT + 1.0.2 @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz STAL - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz STALService - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz smccSTAL - 1.0.2-SNAPSHOT + 1.0.2 at.gv.egiz BKUCommonGUI - 1.0.2-SNAPSHOT + 1.0.2 commons-logging -- cgit v1.2.3 From ce977ee25ede5535beaf72bd0555c0984d5741bf Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 20 Jan 2009 17:01:18 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@277 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 49159c5e..303a44ff 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.2 + 1.0.3-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.2 + 1.0.3-SNAPSHOT at.gv.egiz STAL - 1.0.2 + 1.0.3-SNAPSHOT at.gv.egiz STALService - 1.0.2 + 1.0.3-SNAPSHOT at.gv.egiz smccSTAL - 1.0.2 + 1.0.3-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.2 + 1.0.3-SNAPSHOT commons-logging -- cgit v1.2.3 From b06ecc665c64c3e16a3beac5712d607b35d988d8 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 21 Jan 2009 13:28:18 +0000 Subject: [maven-release-plugin] prepare release mocca-1.0.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@279 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 303a44ff..3212798d 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.3-SNAPSHOT + 1.0.3 @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.3-SNAPSHOT + 1.0.3 at.gv.egiz STAL - 1.0.3-SNAPSHOT + 1.0.3 at.gv.egiz STALService - 1.0.3-SNAPSHOT + 1.0.3 at.gv.egiz smccSTAL - 1.0.3-SNAPSHOT + 1.0.3 at.gv.egiz BKUCommonGUI - 1.0.3-SNAPSHOT + 1.0.3 commons-logging -- cgit v1.2.3 From 5a4d7efb69c4b44e78f3e8e797e88fc2b5f4f668 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 21 Jan 2009 13:28:34 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@281 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 3212798d..f0ee7255 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.3 + 1.0.4-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.3 + 1.0.4-SNAPSHOT @@ -117,27 +117,27 @@ at.gv.egiz smcc - 1.0.3 + 1.0.4-SNAPSHOT at.gv.egiz STAL - 1.0.3 + 1.0.4-SNAPSHOT at.gv.egiz STALService - 1.0.3 + 1.0.4-SNAPSHOT at.gv.egiz smccSTAL - 1.0.3 + 1.0.4-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.3 + 1.0.4-SNAPSHOT commons-logging -- cgit v1.2.3 From 212bbffc24ccc1cd909cabdc9650491dd221cd60 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 22 Jan 2009 13:21:50 +0000 Subject: STALTranslator git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@283 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 7 - .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 204 ++++++++++++--------- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 2 +- BKUApplet/src/test/resources/appletTest.html | 2 +- 4 files changed, 120 insertions(+), 95 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index f0ee7255..4491ff3a 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -104,13 +104,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - true - - diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 3903bf10..3b6d007a 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -23,13 +23,14 @@ import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; +import at.gv.egiz.stal.service.translator.STALTranslator; +import at.gv.egiz.stal.service.translator.TranslationException; import at.gv.egiz.stal.service.types.ErrorResponseType; import at.gv.egiz.stal.service.types.GetNextRequestResponseType; import at.gv.egiz.stal.service.types.GetNextRequestType; import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; -import at.gv.egiz.stal.util.STALTranslator; import java.applet.AppletContext; import java.net.MalformedURLException; import java.net.URL; @@ -37,6 +38,7 @@ import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; +import javax.xml.ws.WebServiceException; /** * @@ -49,6 +51,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { protected String sessionId; protected STALPortType stalPort; private ObjectFactory stalObjFactory = new ObjectFactory(); + private STALTranslator translator = new STALTranslator(); public AppletBKUWorker(BKUGUIFacade gui, AppletContext ctx, AppletParameterProvider paramProvider) { @@ -72,108 +75,147 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { @Override public void run() { gui.showWelcomeDialog(); + try { stalPort = getSTALPort(); - } catch (Exception e) { - log.fatal("Failed to get STAL web-service port: " + e.getMessage(), e); - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, - new Object[]{e.getMessage()}); - try { - waitForAction(); - } catch (InterruptedException e1) { - log.error(e1); - } - return; - } - try { - registerSignRequestHandler(); + registerSignRequestHandler(stalPort, sessionId); GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); + do { - List> requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); + List> requests; + List> responses = new ArrayList>(); - // (rather use validator) - if (requests.size() == 0) { - log.error("Received empty NextRequestResponse: no STAL requests to handle. (STAL-X requests might not have gotten unmarshalled)"); - throw new Exception("No STAL requests to handle."); - } + try { + requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); + responses.clear(); - List stalRequests = STALTranslator.translateRequests(requests); + // (rather use validator) + if (requests.size() == 0) { + log.error("Received empty NextRequestResponse: no STAL requests to handle. (STAL-X requests might not have gotten unmarshalled)"); + throw new RuntimeException("No STAL requests to handle."); + } - if (log.isInfoEnabled()) { - StringBuilder sb = new StringBuilder("Received "); - sb.append(stalRequests.size()); - sb.append(" STAL requests: "); - for (STALRequest r : stalRequests) { - sb.append(r.getClass()); - sb.append(' '); + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder("Received "); + sb.append(requests.size()); + sb.append(" requests: "); + for (JAXBElement r : requests) { + sb.append(r.getValue().getClass()); + sb.append(' '); + } + log.info(sb.toString()); } - log.info(sb.toString()); - } - boolean handle = true; - for (STALRequest request : stalRequests) { - if (request instanceof at.gv.egiz.stal.InfoboxReadRequest) { - at.gv.egiz.stal.InfoboxReadRequest r = (at.gv.egiz.stal.InfoboxReadRequest) request; - String infoboxId = r.getInfoboxIdentifier(); - String domainId = r.getDomainIdentifier(); - if ("IdentityLink".equals(infoboxId) && domainId == null) { - if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { - handle = false; - } + List stalRequests = new ArrayList(); + for (JAXBElement req : requests) { + try { + stalRequests.add(translator.translate(req)); + } catch (TranslationException ex) { + log.error("Received unknown request from server STAL: " + ex.getMessage()); + throw new RuntimeException(ex); } } - } - List> responses; - if (handle) { + checkPermission(stalRequests); + List stalResponses = handleRequest(stalRequests); - if (log.isInfoEnabled()) { - StringBuilder sb = new StringBuilder(stalResponses.size()); - sb.append(" STAL responses: "); - for (STALResponse r : stalResponses) { - sb.append(r.getClass()); - sb.append(' '); + for (STALResponse stalResponse : stalResponses) { + try { + responses.add(translator.translate(stalResponse)); + } catch (TranslationException ex) { + log.error("Received unknown response from STAL: " + ex.getMessage()); + throw new RuntimeException(ex); } - log.info(sb.toString()); } - responses = STALTranslator.fromSTAL(stalResponses); - } else { - log.error("Insufficient rights to execute command InfoboxReadRequest for Infobox IdentityLink, return Error 6002"); - responses = new ArrayList>(1); + + } catch (RuntimeException ex) { + // return ErrorResponse to server, which displays error page + log.error(ex.getMessage()); + Throwable cause = ex.getCause(); ErrorResponseType err = stalObjFactory.createErrorResponseType(); - err.setErrorCode(6002); - // err.setErrorMessage(); + if (cause != null) { + log.error("caused by: " + cause.getMessage()); + if (cause instanceof SecurityException) { + err.setErrorCode(6002); + } else { + err.setErrorCode(4000); + } + } else { + err.setErrorCode(4000); + } + responses.clear(); responses.add(stalObjFactory.createGetNextRequestTypeErrorResponse(err)); - } - if (!finished) { - log.info("Not finished yet (BKUWorker: " + this + "), sending responses"); - GetNextRequestType nextRequest = stalObjFactory.createGetNextRequestType(); - nextRequest.setSessionId(sessionId); - nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); - nextRequestResp = stalPort.getNextRequest(nextRequest); + } finally { + if (!finished) { + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder("Sending "); + sb.append(responses.size()); + sb.append(" responses: "); + for (JAXBElement r : responses) { + sb.append(r.getValue().getClass()); + sb.append(' '); + } + log.info(sb.toString()); + } + GetNextRequestType nextRequest = stalObjFactory.createGetNextRequestType(); + nextRequest.setSessionId(sessionId); + nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); + nextRequestResp = stalPort.getNextRequest(nextRequest); + } } + + } while (!finished); log.info("Done " + Thread.currentThread().getName()); + + } catch (WebServiceException ex) { + log.fatal("communication error with server STAL: " + ex.getMessage(), ex); + showErrorDialog(BKUGUIFacade.ERR_SERVICE_UNREACHABLE, ex); + } catch (MalformedURLException ex) { + log.fatal(ex.getMessage(), ex); + showErrorDialog(BKUGUIFacade.ERR_CONFIG, ex); } catch (Exception ex) { log.error(ex.getMessage(), ex); - gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[]{ex.getMessage()}); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } + showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, ex); + } finally { if (signatureCard != null) { signatureCard.disconnect(false); } } + sendRedirect(); } + private void checkPermission(List stalRequests) { + for (STALRequest request : stalRequests) { + if (request instanceof at.gv.egiz.stal.InfoboxReadRequest) { + at.gv.egiz.stal.InfoboxReadRequest r = (at.gv.egiz.stal.InfoboxReadRequest) request; + String infoboxId = r.getInfoboxIdentifier(); + String domainId = r.getDomainIdentifier(); + if ("IdentityLink".equals(infoboxId) && domainId == null) { + if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { + throw new RuntimeException(new SecurityException("Insufficient rights to execute command InfoboxReadRequest for Infobox IdentityLink")); + } + } + } + } + } + + private void showErrorDialog(String err_code, Exception ex) { + actionCommandList.clear(); + actionCommandList.add("ok"); + gui.showErrorDialog(err_code, + new Object[]{ex.getMessage()}, this, "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + } + protected void sendRedirect() { try { URL redirectURL = params.getURLParameter(BKUApplet.REDIRECT_URL, @@ -201,20 +243,10 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { return stal.getSTALPort(); } - private void registerSignRequestHandler() throws MalformedURLException { - String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY); - if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) { - URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, - sessionId); - log.debug("register SignRequestHandler for HashDataURL " + hashDataURL); - addRequestHandler(SignRequest.class, new BrowserHashDataDisplay(ctx, - hashDataURL)); - } else { - // BKUApplet.HASHDATA_DISPLAY_FRAME - log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL); - AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, - sessionId); - addRequestHandler(SignRequest.class, handler); - } + private void registerSignRequestHandler(STALPortType stalPort, String sessionId) { + log.debug("register SignRequestHandler (resolve hashdata via STAL Webservice)"); + AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, + sessionId); + addRequestHandler(SignRequest.class, handler); } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index d0f6d489..41dae3ba 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -53,7 +53,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; // public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; - public static final String HASHDATA_DISPLAY_BROWSER = "browser"; +// public static final String HASHDATA_DISPLAY_BROWSER = "browser"; public static final String HASHDATA_DISPLAY_FRAME = "frame"; /** diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index b3f68a91..2bf9ba0c 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -18,7 +18,7 @@
-- cgit v1.2.3 From 2d66c2f9ea2efd596287ad1be61e89d5bc1f1da9 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 22 Jan 2009 13:48:33 +0000 Subject: STALTranslator git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@284 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 3b6d007a..6ac892ec 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -133,16 +133,14 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } catch (RuntimeException ex) { // return ErrorResponse to server, which displays error page log.error(ex.getMessage()); - Throwable cause = ex.getCause(); ErrorResponseType err = stalObjFactory.createErrorResponseType(); - if (cause != null) { - log.error("caused by: " + cause.getMessage()); - if (cause instanceof SecurityException) { - err.setErrorCode(6002); - } else { - err.setErrorCode(4000); - } + if (ex instanceof SecurityException) { + err.setErrorCode(6002); } else { + Throwable cause = ex.getCause(); + if (cause != null) { + log.error("caused by: " + cause.getMessage()); + } err.setErrorCode(4000); } responses.clear(); @@ -189,6 +187,11 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { sendRedirect(); } + /** + * throws RuntimeException if requests contain InfoboxReadRequest for IdentityLink + * and STAL Service Endpoint is no e-Gov agency + * @param stalRequests + */ private void checkPermission(List stalRequests) { for (STALRequest request : stalRequests) { if (request instanceof at.gv.egiz.stal.InfoboxReadRequest) { @@ -197,7 +200,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { String domainId = r.getDomainIdentifier(); if ("IdentityLink".equals(infoboxId) && domainId == null) { if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { - throw new RuntimeException(new SecurityException("Insufficient rights to execute command InfoboxReadRequest for Infobox IdentityLink")); + throw new SecurityException("Insufficient rights to execute command InfoboxReadRequest for Infobox IdentityLink"); } } } -- cgit v1.2.3 From 9ef5d25ffec1c26ccf76ad46131e33a861335da1 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 23 Jan 2009 13:45:39 +0000 Subject: tiny applet git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@286 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 5 ++++- BKUApplet/src/test/resources/appletTest.html | 12 +++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 41dae3ba..5e60ed3e 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -91,8 +91,11 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { log.debug("setting locale to " + getLocale()); BKUGUIFacade.Style guiStyle; - if ("advanced".equals(getAppletParameter(GUI_STYLE))) { + String guiStyleParam = getAppletParameter(GUI_STYLE); + if ("advanced".equals(guiStyleParam)) { guiStyle = BKUGUIFacade.Style.advanced; + } else if ("tiny".equals(guiStyleParam)) { + guiStyle = BKUGUIFacade.Style.tiny; } else { guiStyle = BKUGUIFacade.Style.simple; } diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 2bf9ba0c..c8bd99d3 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -19,15 +19,13 @@
- - + width=152 height=145> + + - - + + - - -- cgit v1.2.3 From bd34234d256ef1f81c6daba2de33ed68ccc790f1 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 23 Jan 2009 14:04:04 +0000 Subject: [maven-release-plugin] prepare release mocca-1.0.4-fon git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@287 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 4491ff3a..cfae6716 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.4-SNAPSHOT + 1.0.4 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.4-SNAPSHOT + 1.0.4 @@ -110,27 +110,27 @@ at.gv.egiz smcc - 1.0.4-SNAPSHOT + 1.0.4 at.gv.egiz STAL - 1.0.4-SNAPSHOT + 1.0.4 at.gv.egiz STALService - 1.0.4-SNAPSHOT + 1.0.4 at.gv.egiz smccSTAL - 1.0.4-SNAPSHOT + 1.0.4 at.gv.egiz BKUCommonGUI - 1.0.4-SNAPSHOT + 1.0.4 commons-logging -- cgit v1.2.3 From eeacc400e7186429ebea0f718b076d8b9861c58e Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 23 Jan 2009 14:05:18 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@289 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index cfae6716..3b115399 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.4 + 1.0.5-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.4 + 1.0.5-SNAPSHOT @@ -110,27 +110,27 @@ at.gv.egiz smcc - 1.0.4 + 1.0.5-SNAPSHOT at.gv.egiz STAL - 1.0.4 + 1.0.5-SNAPSHOT at.gv.egiz STALService - 1.0.4 + 1.0.5-SNAPSHOT at.gv.egiz smccSTAL - 1.0.4 + 1.0.5-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.0.4 + 1.0.5-SNAPSHOT commons-logging -- cgit v1.2.3 From 54aa4703e3d66c5b1a63b8d925fd4c9c1766687c Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 28 Jan 2009 19:40:11 +0000 Subject: activation git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@291 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 74 ++++---------- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 74 +++----------- .../bku/online/applet/AppletParameterProvider.java | 57 ----------- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 106 ++++++++++++++------- BKUApplet/src/test/resources/appletTest.html | 2 +- 5 files changed, 103 insertions(+), 210 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 3b115399..da5dbc6f 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -23,35 +23,23 @@ at.gv.egiz true ${project.build.outputDirectory} - META-INF\/ + META-INF\/ + + + + + copy_testapplet + + copy-dependencies + + + ${project.build.directory}/test-classes + at.gv.egiz,commons-logging,iaik + commons-logging,iaik_jce_me4se + true + @@ -80,30 +68,6 @@ true - - maven-dependency-plugin - - - copytestlibs - - copy - - - - - commons-logging - commons-logging - - - iaik - iaik_jce_me4se - - - ${project.build.directory}/test-libs - - - - @@ -132,9 +96,5 @@ BKUCommonGUI 1.0.5-SNAPSHOT - - commons-logging - commons-logging - \ No newline at end of file diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 6ac892ec..388f045f 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -22,7 +22,6 @@ import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.STALService; import at.gv.egiz.stal.service.translator.STALTranslator; import at.gv.egiz.stal.service.translator.TranslationException; import at.gv.egiz.stal.service.types.ErrorResponseType; @@ -31,13 +30,10 @@ import at.gv.egiz.stal.service.types.GetNextRequestType; import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; -import java.applet.AppletContext; import java.net.MalformedURLException; -import java.net.URL; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; -import javax.xml.namespace.QName; import javax.xml.ws.WebServiceException; /** @@ -46,29 +42,19 @@ import javax.xml.ws.WebServiceException; */ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { - protected AppletContext ctx; - protected AppletParameterProvider params; + protected BKUApplet applet; protected String sessionId; - protected STALPortType stalPort; + private ObjectFactory stalObjFactory = new ObjectFactory(); - private STALTranslator translator = new STALTranslator(); - public AppletBKUWorker(BKUGUIFacade gui, AppletContext ctx, - AppletParameterProvider paramProvider) { + public AppletBKUWorker(BKUApplet applet, BKUGUIFacade gui) { super(gui); - if (ctx == null) { - throw new NullPointerException("Applet context not provided"); - } - if (paramProvider == null) { - throw new NullPointerException("No applet parameters provided"); - } - this.ctx = ctx; - this.params = paramProvider; - - sessionId = params.getAppletParameter(BKUApplet.SESSION_ID); + this.applet = applet; + + sessionId = applet.getParameter(BKUApplet.SESSION_ID); if (sessionId == null) { sessionId = "TestSession"; - log.info("using dummy sessionId " + sessionId); + log.warn("using dummy sessionId " + sessionId); } } @@ -77,9 +63,11 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { gui.showWelcomeDialog(); try { - stalPort = getSTALPort(); + STALPortType stalPort = applet.getSTALPort(); + STALTranslator stalTranslator = applet.getSTALTranslator(); - registerSignRequestHandler(stalPort, sessionId); + addRequestHandler(SignRequest.class, + new AppletHashDataDisplay(stalPort, sessionId)); GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); @@ -111,7 +99,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { List stalRequests = new ArrayList(); for (JAXBElement req : requests) { try { - stalRequests.add(translator.translate(req)); + stalRequests.add(stalTranslator.translate(req)); } catch (TranslationException ex) { log.error("Received unknown request from server STAL: " + ex.getMessage()); throw new RuntimeException(ex); @@ -123,7 +111,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { List stalResponses = handleRequest(stalRequests); for (STALResponse stalResponse : stalResponses) { try { - responses.add(translator.translate(stalResponse)); + responses.add(stalTranslator.translate(stalResponse)); } catch (TranslationException ex) { log.error("Received unknown response from STAL: " + ex.getMessage()); throw new RuntimeException(ex); @@ -184,7 +172,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } } - sendRedirect(); + applet.sendRedirect(sessionId); } /** @@ -218,38 +206,4 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { log.error(e); } } - - protected void sendRedirect() { - try { - URL redirectURL = params.getURLParameter(BKUApplet.REDIRECT_URL, - sessionId); - String redirectTarget = params.getAppletParameter(BKUApplet.REDIRECT_TARGET); - if (redirectTarget == null) { - log.info("Done. Redirecting to " + redirectURL + " ..."); - ctx.showDocument(redirectURL); - } else { - log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); - ctx.showDocument(redirectURL, redirectTarget); - } - } catch (MalformedURLException ex) { - log.warn("Failed to redirect: " + ex.getMessage(), ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) - } - } - - private STALPortType getSTALPort() throws MalformedURLException { - URL wsdlURL = params.getURLParameter(BKUApplet.WSDL_URL); - log.debug("STAL WSDL at " + wsdlURL); - QName endpointName = new QName(BKUApplet.STAL_WSDL_NS, - BKUApplet.STAL_SERVICE); - STALService stal = new STALService(wsdlURL, endpointName); - return stal.getSTALPort(); - } - - private void registerSignRequestHandler(STALPortType stalPort, String sessionId) { - log.debug("register SignRequestHandler (resolve hashdata via STAL Webservice)"); - AppletHashDataDisplay handler = new AppletHashDataDisplay(stalPort, - sessionId); - addRequestHandler(SignRequest.class, handler); - } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java deleted file mode 100644 index 42e2d6ff..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletParameterProvider.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package at.gv.egiz.bku.online.applet; - -import java.net.MalformedURLException; -import java.net.URL; - -/** - * - * @author Clemens Orthacker - */ -public interface AppletParameterProvider { - - /** - * Applet configuration parameters - * - * @param paramKey - * @return null if no parameter is provided for the given key - */ - String getAppletParameter(String paramKey); - - /** - * Get applet configuration parameter as (absolute) URL - * - * @param paramKey - * @return a URL - * @throws MalformedURLException if configured URL is invalid - * or no parameter is provided for the given key - */ - URL getURLParameter(String paramKey) throws MalformedURLException; - - /** - * Get applet configuration parameter as (absolute) URL - * - * @param paramKey - * @param sessionId adds the jsessionid to the URL - * @return a URL - * @throws MalformedURLException if configured URL is invalid - * or no parameter is provided for the given key - */ - URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException; -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 5e60ed3e..d4b2018d 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -16,8 +16,10 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.gui.BKUGUIFacade.Style; import at.gv.egiz.bku.gui.DefaultHelpListener; import at.gv.egiz.bku.gui.AbstractHelpListener; +import at.gv.egiz.stal.service.translator.STALTranslator; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; @@ -30,15 +32,18 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIFactory; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.STALService; +import java.awt.Container; +import javax.xml.namespace.QName; /** * Note: all swing code is executed by the event dispatch thread (see * BKUGUIFacade) */ -public class BKUApplet extends JApplet implements AppletParameterProvider { +public class BKUApplet extends JApplet { private static Log log = LogFactory.getLog(BKUApplet.class); - /** * Applet parameter keys */ @@ -55,18 +60,15 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { // public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; // public static final String HASHDATA_DISPLAY_BROWSER = "browser"; public static final String HASHDATA_DISPLAY_FRAME = "frame"; - /** * STAL WSDL namespace and service name */ public static final String STAL_WSDL_NS = "http://www.egiz.gv.at/wsdl/stal"; public static final String STAL_SERVICE = "STALService"; - /** * Dummy session id, used if no sessionId parameter is provided */ protected static final String TEST_SESSION_ID = "TestSession"; - /** * STAL */ @@ -81,17 +83,17 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { public void init() { log.info("Welcome to MOCCA"); log.debug("Called init()"); - + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); - String locale = getAppletParameter(LOCALE); + String locale = getParameter(LOCALE); if (locale != null) { this.setLocale(new Locale(locale)); } - log.debug("setting locale to " + getLocale()); + log.debug("setting locale: " + getLocale()); BKUGUIFacade.Style guiStyle; - String guiStyleParam = getAppletParameter(GUI_STYLE); + String guiStyleParam = getParameter(GUI_STYLE); if ("advanced".equals(guiStyleParam)) { guiStyle = BKUGUIFacade.Style.advanced; } else if ("tiny".equals(guiStyleParam)) { @@ -99,30 +101,33 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { } else { guiStyle = BKUGUIFacade.Style.simple; } - + log.debug("setting gui-style: " + guiStyle); + URL backgroundImgURL = null; try { - backgroundImgURL = getURLParameter(BACKGROUND_IMG); + backgroundImgURL = getURLParameter(BACKGROUND_IMG, null); + log.debug("setting background: " + backgroundImgURL); } catch (MalformedURLException ex) { log.warn("failed to load applet background image: " + ex.getMessage() + ", using default"); } - + AbstractHelpListener helpListener = null; try { - URL helpURL = getURLParameter(HELP_URL); -// helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale()); - helpListener = new DefaultHelpListener(getAppletContext(), helpURL, getLocale()); + helpListener = new DefaultHelpListener(getAppletContext(), + getURLParameter(HELP_URL, null), getLocale()); + if (log.isDebugEnabled()) { + log.debug("setting helpURL: " + getURLParameter(HELP_URL, null)); + } } catch (MalformedURLException ex) { log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help"); } - - BKUGUIFacade gui = BKUGUIFactory.createGUI(getContentPane(), - getLocale(), - guiStyle, - backgroundImgURL, + + BKUGUIFacade gui = createGUI(getContentPane(), getLocale(), + guiStyle, + backgroundImgURL, helpListener); - worker = new AppletBKUWorker(gui, getAppletContext(), this); + worker = new AppletBKUWorker(this, gui); } @Override @@ -145,15 +150,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { log.debug("Called destroy()"); } - @Override - public String getAppletParameter(String paramKey) { - String param = getParameter(paramKey); - log.info("applet parameter: " + paramKey + ": " + param); - return param; - } - - @Override - public URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { + protected URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { String urlParam = getParameter(paramKey); if (urlParam != null) { URL codebase = getCodeBase(); @@ -173,15 +170,54 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { } catch (MalformedURLException ex) { log.error("applet paremeter " + urlParam + " is not a valid URL: " + ex.getMessage()); throw ex; - } + } } else { log.error("applet paremeter " + urlParam + " not set"); throw new MalformedURLException(urlParam + " not set"); } } - - @Override - public URL getURLParameter(String paramKey) throws MalformedURLException { - return getURLParameter(paramKey, null); + + /** + * provides a means to for subclasses to inject a different GUI + */ + protected BKUGUIFacade createGUI(Container contentPane, + Locale locale, + Style guiStyle, + URL backgroundImgURL, + AbstractHelpListener helpListener) { + return BKUGUIFactory.createGUI(contentPane, + locale, + guiStyle, + backgroundImgURL, + helpListener); + } + + protected STALPortType getSTALPort() throws MalformedURLException { + URL wsdlURL = getURLParameter(WSDL_URL, null); + log.debug("setting STAL WSDL: " + wsdlURL); + QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE); + STALService stal = new STALService(wsdlURL, endpointName); + return stal.getSTALPort(); + } + + protected STALTranslator getSTALTranslator() { + return new STALTranslator(); + } + + protected void sendRedirect(String sessionId) { + try { + URL redirectURL = getURLParameter(REDIRECT_URL, sessionId); + String redirectTarget = getParameter(REDIRECT_TARGET); + if (redirectTarget == null) { + log.info("Done. Redirecting to " + redirectURL + " ..."); + getAppletContext().showDocument(redirectURL); + } else { + log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); + getAppletContext().showDocument(redirectURL, redirectTarget); + } + } catch (MalformedURLException ex) { + log.warn("Failed to redirect: " + ex.getMessage(), ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) + } } } diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index c8bd99d3..4a768f91 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -18,7 +18,7 @@
-- cgit v1.2.3 From 754cb731b2d5f4888815c16c530fc3674264a4f2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 11 Feb 2009 19:59:02 +0000 Subject: make applet better extensible (override BKUWorker,...) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@294 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 4 +- .../bku/online/applet/AppletHashDataDisplay.java | 3 - .../at/gv/egiz/bku/online/applet/BKUApplet.java | 122 +++++++++++++-------- .../bku/online/applet/BrowserHashDataDisplay.java | 52 --------- 4 files changed, 79 insertions(+), 102 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 388f045f..5a57ef18 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -165,7 +165,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { showErrorDialog(BKUGUIFacade.ERR_CONFIG, ex); } catch (Exception ex) { log.error(ex.getMessage(), ex); - showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, ex); + showErrorDialog(BKUGUIFacade.ERR_UNKNOWN_WITH_PARAM, ex); } finally { if (signatureCard != null) { signatureCard.disconnect(false); @@ -195,7 +195,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } } - private void showErrorDialog(String err_code, Exception ex) { + protected void showErrorDialog(String err_code, Exception ex) { actionCommandList.clear(); actionCommandList.add("ok"); gui.showErrorDialog(err_code, diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java index 7be40d65..2ed9aa5b 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java @@ -16,12 +16,10 @@ */ package at.gv.egiz.bku.online.applet; -import at.gv.egiz.bku.gui.BKUGUIFacade; import java.security.DigestException; import java.security.MessageDigest; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.List; import org.apache.commons.logging.Log; @@ -34,7 +32,6 @@ import at.gv.egiz.stal.service.GetHashDataInputFault; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; import at.gv.egiz.stal.service.types.GetHashDataInputType; -import at.gv.egiz.stal.signedinfo.DigestMethodType; import at.gv.egiz.stal.signedinfo.ReferenceType; import java.security.NoSuchAlgorithmException; diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index d4b2018d..a4337bbd 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -31,7 +31,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.gui.BKUGUIFacade; -import at.gv.egiz.bku.gui.BKUGUIFactory; +import at.gv.egiz.bku.gui.BKUGUIImpl; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; import java.awt.Container; @@ -57,8 +57,6 @@ public class BKUApplet extends JApplet { public static final String BACKGROUND_IMG = "Background"; public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; -// public static final String HASHDATA_DISPLAY_INTERNAL = "internal"; -// public static final String HASHDATA_DISPLAY_BROWSER = "browser"; public static final String HASHDATA_DISPLAY_FRAME = "frame"; /** * STAL WSDL namespace and service name @@ -69,6 +67,14 @@ public class BKUApplet extends JApplet { * Dummy session id, used if no sessionId parameter is provided */ protected static final String TEST_SESSION_ID = "TestSession"; + + static { + if (log.isTraceEnabled()) { + log.trace("enabling webservice communication dump"); + System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true"); + } + } + /** * STAL */ @@ -82,7 +88,7 @@ public class BKUApplet extends JApplet { @Override public void init() { log.info("Welcome to MOCCA"); - log.debug("Called init()"); + log.trace("Called init()"); HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); @@ -127,19 +133,19 @@ public class BKUApplet extends JApplet { backgroundImgURL, helpListener); - worker = new AppletBKUWorker(this, gui); + worker = createBKUWorker(this, gui); } @Override public void start() { - log.debug("Called start()"); + log.trace("Called start()"); workerThread = new Thread(worker); workerThread.start(); } @Override public void stop() { - log.debug("Called stop()"); + log.trace("Called stop()"); if ((workerThread != null) && (workerThread.isAlive())) { workerThread.interrupt(); } @@ -147,52 +153,36 @@ public class BKUApplet extends JApplet { @Override public void destroy() { - log.debug("Called destroy()"); + log.trace("Called destroy()"); } - protected URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { - String urlParam = getParameter(paramKey); - if (urlParam != null) { - URL codebase = getCodeBase(); - try { - URL url; - if (codebase.getProtocol().equalsIgnoreCase("file")) { - // for debugging in appletrunner - url = new URL(urlParam); - } else { - if (sessionId != null) { - urlParam = urlParam + ";jsessionid=" + sessionId; - } - url = new URL(codebase, urlParam); - } - log.info("applet parameter " + url); - return url; - } catch (MalformedURLException ex) { - log.error("applet paremeter " + urlParam + " is not a valid URL: " + ex.getMessage()); - throw ex; - } - } else { - log.error("applet paremeter " + urlParam + " not set"); - throw new MalformedURLException(urlParam + " not set"); - } - } - - /** - * provides a means to for subclasses to inject a different GUI - */ + ///////////////////////////////////////////////////////////////////////////// + // factory methods for subclasses to inject different components + ///////////////////////////////////////////////////////////////////////////// + protected BKUGUIFacade createGUI(Container contentPane, Locale locale, Style guiStyle, URL backgroundImgURL, AbstractHelpListener helpListener) { - return BKUGUIFactory.createGUI(contentPane, - locale, - guiStyle, - backgroundImgURL, - helpListener); + return new BKUGUIImpl(contentPane, locale, guiStyle, backgroundImgURL, helpListener); + } + + protected AppletBKUWorker createBKUWorker(BKUApplet applet, BKUGUIFacade gui) { + return new AppletBKUWorker(applet, gui); } - protected STALPortType getSTALPort() throws MalformedURLException { + + ///////////////////////////////////////////////////////////////////////////// + // callback for BKUWorker to allow extension + ///////////////////////////////////////////////////////////////////////////// + + /** + * Callback for BKUWorker to allow extension + * @return + * @throws java.net.MalformedURLException + */ + public STALPortType getSTALPort() throws MalformedURLException { URL wsdlURL = getURLParameter(WSDL_URL, null); log.debug("setting STAL WSDL: " + wsdlURL); QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE); @@ -200,10 +190,21 @@ public class BKUApplet extends JApplet { return stal.getSTALPort(); } - protected STALTranslator getSTALTranslator() { + /** + * Callback for BKUWorker to allow extension + * (TODO STALPort could know its STALTranslator) + * @return + * @throws java.net.MalformedURLException + */ + public STALTranslator getSTALTranslator() { return new STALTranslator(); } + /** + * Callback for BKUWorker to keep applet context out of BKUWorker + * @return + * @throws java.net.MalformedURLException + */ protected void sendRedirect(String sessionId) { try { URL redirectURL = getURLParameter(REDIRECT_URL, sessionId); @@ -220,4 +221,35 @@ public class BKUApplet extends JApplet { // gui.showErrorDialog(errorMsg, okListener, actionCommand) } } + + + ///////////////////////////////////////////////////////////////////////////// + // utility methods + ///////////////////////////////////////////////////////////////////////////// + + protected URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { + String urlParam = getParameter(paramKey); + if (urlParam != null) { + URL codebase = getCodeBase(); + try { + URL url; + if (codebase.getProtocol().equalsIgnoreCase("file")) { + // for debugging in appletrunner + url = new URL(urlParam); + } else { + if (sessionId != null) { + urlParam = urlParam + ";jsessionid=" + sessionId; + } + url = new URL(codebase, urlParam); + } + return url; + } catch (MalformedURLException ex) { + log.error("applet paremeter " + urlParam + " is not a valid URL: " + ex.getMessage()); + throw ex; + } + } else { + log.error("applet paremeter " + urlParam + " not set"); + throw new MalformedURLException(urlParam + " not set"); + } + } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java deleted file mode 100644 index c30921da..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package at.gv.egiz.bku.online.applet; - -import java.net.URL; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.signedinfo.ReferenceType; -import java.applet.AppletContext; - -/** - * - * @author Clemens Orthacker - */ -public class BrowserHashDataDisplay extends SignRequestHandler { - - private static final Log log = LogFactory.getLog(BrowserHashDataDisplay.class); - - protected AppletContext ctx; - protected URL hashDataURL; - - public BrowserHashDataDisplay(AppletContext ctx, URL hashDataURL) { - this.ctx = ctx; - this.hashDataURL = hashDataURL; - } - - @Override - public void displayHashDataInputs(List signedReferences) throws Exception { - //TODO pass reference Id's to servlet (TODO servlet) - log.debug("displaying hashdata inputs at " + hashDataURL); - ctx.showDocument(hashDataURL, "_blank"); - } -} -- cgit v1.2.3 From 6576428966f1e3d688269a407b072fb01f9f7647 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 26 Feb 2009 19:39:00 +0000 Subject: 1.1 candidate (activation) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@309 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 5a57ef18..8c1bd2bd 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -195,11 +195,16 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } } + /** + * + * @param err_code + * @param ex if not null, the message will be appended as parameter to the error message + */ protected void showErrorDialog(String err_code, Exception ex) { actionCommandList.clear(); actionCommandList.add("ok"); - gui.showErrorDialog(err_code, - new Object[]{ex.getMessage()}, this, "ok"); + Object[] params = (ex != null) ? new Object[] { ex.getMessage() } : null; + gui.showErrorDialog(err_code, params, this, "ok"); try { waitForAction(); } catch (InterruptedException e) { -- cgit v1.2.3 From 7cc403b3ce468e82a57811336def347cb6c9025e Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 10 Mar 2009 13:36:34 +0000 Subject: do not return errorResponse on interrupt git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@319 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 8c1bd2bd..eb6cf30b 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -126,8 +126,9 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { err.setErrorCode(6002); } else { Throwable cause = ex.getCause(); - if (cause != null) { - log.error("caused by: " + cause.getMessage()); + if (cause != null && cause instanceof InterruptedException) { + log.info("do not return error response, client might want to resume session"); + finished = true; } err.setErrorCode(4000); } @@ -155,7 +156,7 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { } while (!finished); - log.info("Done " + Thread.currentThread().getName()); + log.info("Finished " + Thread.currentThread().getName()); } catch (WebServiceException ex) { log.fatal("communication error with server STAL: " + ex.getMessage(), ex); -- cgit v1.2.3 From 2a1df5e58e44f8d77f34eb80df74e8c0d27caceb Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 18 Mar 2009 22:27:28 +0000 Subject: 1.1-rc5 (pinProviderFactories, gui refactoring, signatureCard, secureViewer) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@322 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 5 +- .../bku/online/applet/AppletHashDataDisplay.java | 217 -------------------- .../egiz/bku/online/applet/AppletSecureViewer.java | 221 +++++++++++++++++++++ 3 files changed, 224 insertions(+), 219 deletions(-) delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index eb6cf30b..9b9735f6 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -60,14 +60,15 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { @Override public void run() { - gui.showWelcomeDialog(); + gui.showMessageDialog(BKUGUIFacade.TITLE_WELCOME, + BKUGUIFacade.MESSAGE_WELCOME); try { STALPortType stalPort = applet.getSTALPort(); STALTranslator stalTranslator = applet.getSTALTranslator(); addRequestHandler(SignRequest.class, - new AppletHashDataDisplay(stalPort, sessionId)); + new AppletSecureViewer(stalPort, sessionId)); GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java deleted file mode 100644 index 2ed9aa5b..00000000 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright 2008 Federal Chancellery Austria and - * Graz University of Technology - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package at.gv.egiz.bku.online.applet; - -import java.security.DigestException; -import java.security.MessageDigest; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; -import at.gv.egiz.stal.HashDataInput; -import at.gv.egiz.stal.impl.ByteArrayHashDataInput; -import at.gv.egiz.stal.service.GetHashDataInputFault; -import at.gv.egiz.stal.service.STALPortType; -import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.types.GetHashDataInputType; -import at.gv.egiz.stal.signedinfo.ReferenceType; -import java.security.NoSuchAlgorithmException; - -/** - * A SignRequesthandler that obtains hashdata inputs from a STAL webservice and - * displays these either within the applet or in a separate frame. - * The internal viewer displays plaintext data only, other mimetypes can be saved to disk. - * The standalone (frame) viewer displays all mimetypes. - * - * (This class depends on STALService and therefore is not part of BKUCommonGUI.) - * - * @author Clemens Orthacker - */ -public class AppletHashDataDisplay extends SignRequestHandler { - - private static final Log log = LogFactory.getLog(AppletHashDataDisplay.class); - protected STALPortType stalPort; - protected String sessId; - - public AppletHashDataDisplay(STALPortType stalPort, String sessId) { - if (stalPort == null || sessId == null) { - throw new NullPointerException("STAL port must not be null"); - } - this.sessId = sessId; - this.stalPort = stalPort; - } - - /** - * TODO don't throw exceptions - * @param signedReferences - * @throws java.security.DigestException - * @throws java.lang.Exception - */ - @Override - public void displayHashDataInputs(List signedReferences) throws DigestException, Exception { - - List hdi = getHashDataInput(signedReferences); - List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); - - if (verifiedHashDataInputs.size() > 0) { - gui.showHashDataInputDialog(verifiedHashDataInputs, this, "hashDataDone"); - } else { - throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); - } - } - - /** - * Get all hashdata inputs that contain an ID attribute but no Type attribute. - * @param signedReferences - * @return - * @throws at.gv.egiz.stal.service.GetHashDataInputFault - */ - private List getHashDataInput(List signedReferences) throws GetHashDataInputFault, Exception { - GetHashDataInputType request = new GetHashDataInputType(); - request.setSessionId(sessId); - -// HashMap idSignedRefMap = new HashMap(); - for (ReferenceType signedRef : signedReferences) { - //don't get Manifest, QualifyingProperties, ... - if (signedRef.getType() == null) { - String signedRefId = signedRef.getId(); - if (signedRefId != null) { - if (log.isTraceEnabled()) { - log.trace("requesting hashdata input for reference " + signedRefId); - } -// idSignedRefMap.put(signedRefId, signedRef); - GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); - ref.setID(signedRefId); - request.getReference().add(ref); - - } else { - throw new Exception("Cannot resolve signature data for dsig:Reference without Id attribute"); - } - } - } - - if (request.getReference().size() < 1) { - log.error("No signature data (apart from any QualifyingProperties or a Manifest) for session " + sessId); - throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); - } - - if (log.isDebugEnabled()) { - log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); - } - GetHashDataInputResponseType response = stalPort.getHashDataInput(request); - return response.getReference(); - } - - /** - * Verifies all signed references and returns STAL HashDataInputs - * @param signedReferences - * @param hashDataInputs - * @return - * @throws java.security.DigestException - * @throws java.security.NoSuchAlgorithmException - * @throws Exception if no hashdata input is provided for a signed reference - */ - private List verifyHashDataInput(List signedReferences, List hashDataInputs) throws DigestException, NoSuchAlgorithmException, Exception { - - ArrayList verifiedHashDataInputs = new ArrayList(); - - for (ReferenceType signedRef : signedReferences) { - if (signedRef.getType() == null) { - log.info("Verifying digest for signed reference " + signedRef.getId()); - - String signedRefId = signedRef.getId(); - byte[] signedDigest = signedRef.getDigestValue(); - String signedDigestAlg = null; - if (signedRef.getDigestMethod() != null) { - signedDigestAlg = signedRef.getDigestMethod().getAlgorithm(); - } else { - throw new NoSuchAlgorithmException("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); - } - - // usually, there is just one item here - GetHashDataInputResponseType.Reference hashDataInput = null; - for (GetHashDataInputResponseType.Reference hdi : hashDataInputs) { - if (signedRefId.equals(hdi.getID())) { - hashDataInput = hdi; - break; - } - } - if (hashDataInput == null) { - throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); - } - - byte[] hdi = hashDataInput.getValue(); - String mimeType = hashDataInput.getMimeType(); - String encoding = hashDataInput.getEncoding(); - - if (hdi == null) { - throw new Exception("No hashdata input for reference " + signedRefId + " provided by service"); - } - if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); - } - - byte[] hashDataInputDigest = digest(hdi, signedDigestAlg); - - if (log.isDebugEnabled()) { - log.debug("Comparing digest values... "); - } -// log.warn("***************** DISABLED HASHDATA VERIFICATION"); - if (!Arrays.equals(hashDataInputDigest, signedDigest)) { - log.error("Bad digest value for reference " + signedRefId); - throw new DigestException("Bad digest value for reference " + signedRefId); - } - - verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); - } - } - - return verifiedHashDataInputs; - } - - //TODO - private byte[] digest(byte[] hashDataInput, String mdAlg) throws NoSuchAlgorithmException { - if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) { - mdAlg = "SHA-1"; - } else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) { - mdAlg = "SHA-256"; - } else if ("http://www.w3.org/2001/04/xmlenc#sha224".equals(mdAlg)) { - mdAlg = "SHA-224"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#sha224".equals(mdAlg)) { - mdAlg = "SHA-224"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) { - mdAlg = "SHA-384"; - } else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) { - mdAlg = "SHA-512"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#md2".equals(mdAlg)) { - mdAlg = "MD2"; - } else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) { - mdAlg = "MD5"; - } else if ("http://www.w3.org/2001/04/xmlenc#ripemd160".equals(mdAlg)) { - mdAlg = "RipeMD-160"; - } else { - throw new NoSuchAlgorithmException("Failed to verify digest value: unsupported digest algorithm " + mdAlg); - } - - MessageDigest md = MessageDigest.getInstance(mdAlg); - return md.digest(hashDataInput); - } -} diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java new file mode 100644 index 00000000..e2551e2d --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java @@ -0,0 +1,221 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package at.gv.egiz.bku.online.applet; + +import at.gv.egiz.bku.smccstal.SecureViewer; +import java.security.DigestException; +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import at.gv.egiz.bku.smccstal.SignRequestHandler; +import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.impl.ByteArrayHashDataInput; +import at.gv.egiz.stal.service.GetHashDataInputFault; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.signedinfo.ReferenceType; +import java.security.NoSuchAlgorithmException; + +/** + * A SignRequesthandler that obtains hashdata inputs from a STAL webservice and + * displays these either within the applet or in a separate frame. + * The internal viewer displays plaintext data only, other mimetypes can be saved to disk. + * The standalone (frame) viewer displays all mimetypes. + * + * (This class depends on STALService and therefore is not part of BKUCommonGUI.) + * + * @author Clemens Orthacker + */ +public class AppletSecureViewer extends SignRequestHandler { + + private static final Log log = LogFactory.getLog(AppletSecureViewer.class); + protected STALPortType stalPort; + protected String sessId; + + public AppletSecureViewer(STALPortType stalPort, String sessId) { + if (stalPort == null || sessId == null) { + throw new NullPointerException("STAL port must not be null"); + } + this.sessId = sessId; + this.stalPort = stalPort; + } + + /** + * TODO don't throw exceptions + * @param signedReferences + * @throws java.security.DigestException + * @throws java.lang.Exception + */ + @Override + public void displayDataToBeSigned(List signedReferences) + throws DigestException, Exception { + + List hdi = getHashDataInput(signedReferences); + List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); + + if (verifiedHashDataInputs.size() > 0) { + gui.showSecureViewer(verifiedHashDataInputs, this, "hashDataDone"); + } else { + throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); + } + } + + /** + * Get all hashdata inputs that contain an ID attribute but no Type attribute. + * @param signedReferences + * @return + * @throws at.gv.egiz.stal.service.GetHashDataInputFault + */ + private List getHashDataInput(List signedReferences) + throws GetHashDataInputFault, Exception { + GetHashDataInputType request = new GetHashDataInputType(); + request.setSessionId(sessId); + +// HashMap idSignedRefMap = new HashMap(); + for (ReferenceType signedRef : signedReferences) { + //don't get Manifest, QualifyingProperties, ... + if (signedRef.getType() == null) { + String signedRefId = signedRef.getId(); + if (signedRefId != null) { + if (log.isTraceEnabled()) { + log.trace("requesting hashdata input for reference " + signedRefId); + } +// idSignedRefMap.put(signedRefId, signedRef); + GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference(); + ref.setID(signedRefId); + request.getReference().add(ref); + + } else { + throw new Exception("Cannot resolve signature data for dsig:Reference without Id attribute"); + } + } + } + + if (request.getReference().size() < 1) { + log.error("No signature data (apart from any QualifyingProperties or a Manifest) for session " + sessId); + throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); + } + + if (log.isDebugEnabled()) { + log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId); + } + GetHashDataInputResponseType response = stalPort.getHashDataInput(request); + return response.getReference(); + } + + /** + * Verifies all signed references and returns STAL HashDataInputs + * @param signedReferences + * @param hashDataInputs + * @return + * @throws java.security.DigestException + * @throws java.security.NoSuchAlgorithmException + * @throws Exception if no hashdata input is provided for a signed reference + */ + private List verifyHashDataInput(List signedReferences, List hashDataInputs) + throws DigestException, NoSuchAlgorithmException, Exception { + + ArrayList verifiedHashDataInputs = new ArrayList(); + + for (ReferenceType signedRef : signedReferences) { + if (signedRef.getType() == null) { + log.info("Verifying digest for signed reference " + signedRef.getId()); + + String signedRefId = signedRef.getId(); + byte[] signedDigest = signedRef.getDigestValue(); + String signedDigestAlg = null; + if (signedRef.getDigestMethod() != null) { + signedDigestAlg = signedRef.getDigestMethod().getAlgorithm(); + } else { + throw new NoSuchAlgorithmException("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm"); + } + + // usually, there is just one item here + GetHashDataInputResponseType.Reference hashDataInput = null; + for (GetHashDataInputResponseType.Reference hdi : hashDataInputs) { + if (signedRefId.equals(hdi.getID())) { + hashDataInput = hdi; + break; + } + } + if (hashDataInput == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " returned by service"); + } + + byte[] hdi = hashDataInput.getValue(); + String mimeType = hashDataInput.getMimeType(); + String encoding = hashDataInput.getEncoding(); + + if (hdi == null) { + throw new Exception("No hashdata input for reference " + signedRefId + " provided by service"); + } + if (log.isDebugEnabled()) { + log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); + } + + byte[] hashDataInputDigest = digest(hdi, signedDigestAlg); + + if (log.isDebugEnabled()) { + log.debug("Comparing digest values... "); + } +// log.warn("***************** DISABLED HASHDATA VERIFICATION"); + if (!Arrays.equals(hashDataInputDigest, signedDigest)) { + log.error("Bad digest value for reference " + signedRefId); + throw new DigestException("Bad digest value for reference " + signedRefId); + } + + verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); + } + } + + return verifiedHashDataInputs; + } + + //TODO + private byte[] digest(byte[] hashDataInput, String mdAlg) throws NoSuchAlgorithmException { + if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) { + mdAlg = "SHA-1"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) { + mdAlg = "SHA-256"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha224".equals(mdAlg)) { + mdAlg = "SHA-224"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#sha224".equals(mdAlg)) { + mdAlg = "SHA-224"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) { + mdAlg = "SHA-384"; + } else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) { + mdAlg = "SHA-512"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#md2".equals(mdAlg)) { + mdAlg = "MD2"; + } else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) { + mdAlg = "MD5"; + } else if ("http://www.w3.org/2001/04/xmlenc#ripemd160".equals(mdAlg)) { + mdAlg = "RipeMD-160"; + } else { + throw new NoSuchAlgorithmException("Failed to verify digest value: unsupported digest algorithm " + mdAlg); + } + + MessageDigest md = MessageDigest.getInstance(mdAlg); + return md.digest(hashDataInput); + } +} -- cgit v1.2.3 From 616e06910051528674165319a1d6d161dff5859c Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 27 Mar 2009 17:33:11 +0000 Subject: 1.1-RC6 (pinpad, pinmgmt, secureviewer) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@323 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 5 +- .../egiz/bku/online/applet/AppletSecureViewer.java | 79 +++++++++++++--------- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 10 ++- 3 files changed, 59 insertions(+), 35 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index 9b9735f6..e8d8976d 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -18,6 +18,7 @@ package at.gv.egiz.bku.online.applet; import at.gv.egiz.bku.smccstal.AbstractBKUWorker; import at.gv.egiz.bku.gui.BKUGUIFacade; +import at.gv.egiz.bku.smccstal.SignRequestHandler; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; @@ -67,8 +68,10 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { STALPortType stalPort = applet.getSTALPort(); STALTranslator stalTranslator = applet.getSTALTranslator(); + AppletSecureViewer secureViewer = + new AppletSecureViewer(gui, stalPort, sessionId); addRequestHandler(SignRequest.class, - new AppletSecureViewer(stalPort, sessionId)); + new SignRequestHandler(secureViewer)); GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java index e2551e2d..929cecb1 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java @@ -16,17 +16,8 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.smccstal.SecureViewer; -import java.security.DigestException; -import java.security.MessageDigest; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import at.gv.egiz.bku.smccstal.SignRequestHandler; import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.impl.ByteArrayHashDataInput; import at.gv.egiz.stal.service.GetHashDataInputFault; @@ -34,49 +25,73 @@ import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; import at.gv.egiz.stal.service.types.GetHashDataInputType; import at.gv.egiz.stal.signedinfo.ReferenceType; +import at.gv.egiz.stal.signedinfo.SignedInfoType; +import java.awt.event.ActionListener; +import java.security.DigestException; +import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** - * A SignRequesthandler that obtains hashdata inputs from a STAL webservice and - * displays these either within the applet or in a separate frame. - * The internal viewer displays plaintext data only, other mimetypes can be saved to disk. - * The standalone (frame) viewer displays all mimetypes. - * - * (This class depends on STALService and therefore is not part of BKUCommonGUI.) - * + * * @author Clemens Orthacker */ -public class AppletSecureViewer extends SignRequestHandler { +public class AppletSecureViewer implements SecureViewer { private static final Log log = LogFactory.getLog(AppletSecureViewer.class); + + protected BKUGUIFacade gui; protected STALPortType stalPort; protected String sessId; + protected List verifiedDataToBeSigned; - public AppletSecureViewer(STALPortType stalPort, String sessId) { - if (stalPort == null || sessId == null) { + public AppletSecureViewer(BKUGUIFacade gui, STALPortType stalPort, + String sessId) { + if (gui == null) { + throw new NullPointerException("GUI must not be null"); + } + if (stalPort == null) { throw new NullPointerException("STAL port must not be null"); } - this.sessId = sessId; + if (sessId == null) { + throw new NullPointerException("session id must not be null"); + } + this.gui = gui; this.stalPort = stalPort; + this.sessId = sessId; } /** - * TODO don't throw exceptions + * retrieves the data to be signed for * @param signedReferences + * @param okListener + * @param okCommand + * @param cancelListener + * @param cancelCommand * @throws java.security.DigestException * @throws java.lang.Exception */ @Override - public void displayDataToBeSigned(List signedReferences) + public void displayDataToBeSigned(SignedInfoType signedInfo, + ActionListener okListener, String okCommand) throws DigestException, Exception { - - List hdi = getHashDataInput(signedReferences); - List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi); - - if (verifiedHashDataInputs.size() > 0) { - gui.showSecureViewer(verifiedHashDataInputs, this, "hashDataDone"); + + if (verifiedDataToBeSigned == null) { + log.info("retrieve data to be signed for dsig:SignedInfo " + + signedInfo.getId()); + List hdi = + getHashDataInput(signedInfo.getReference()); + verifiedDataToBeSigned = verifyHashDataInput(signedInfo.getReference(), + hdi); + } + if (verifiedDataToBeSigned.size() > 0) { + gui.showSecureViewer(verifiedDataToBeSigned, okListener, okCommand); } else { - throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); + throw new Exception("No data to be signed (apart from any QualifyingProperties or a Manifest)"); } } @@ -110,7 +125,7 @@ public class AppletSecureViewer extends SignRequestHandler { } } } - + if (request.getReference().size() < 1) { log.error("No signature data (apart from any QualifyingProperties or a Manifest) for session " + sessId); throw new Exception("No signature data (apart from any QualifyingProperties or a Manifest)"); @@ -187,7 +202,7 @@ public class AppletSecureViewer extends SignRequestHandler { verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); } } - + return verifiedHashDataInputs; } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index a4337bbd..0ddb6dc6 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -34,6 +34,7 @@ import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIImpl; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; +import java.applet.AppletContext; import java.awt.Container; import javax.xml.namespace.QName; @@ -207,14 +208,19 @@ public class BKUApplet extends JApplet { */ protected void sendRedirect(String sessionId) { try { + AppletContext ctx = getAppletContext(); + if (ctx == null) { + log.error("no applet context (applet might already have been destroyed)"); + return; + } URL redirectURL = getURLParameter(REDIRECT_URL, sessionId); String redirectTarget = getParameter(REDIRECT_TARGET); if (redirectTarget == null) { log.info("Done. Redirecting to " + redirectURL + " ..."); - getAppletContext().showDocument(redirectURL); + ctx.showDocument(redirectURL); } else { log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); - getAppletContext().showDocument(redirectURL, redirectTarget); + ctx.showDocument(redirectURL, redirectTarget); } } catch (MalformedURLException ex) { log.warn("Failed to redirect: " + ex.getMessage(), ex); -- cgit v1.2.3 From 1a75d2ae8fa57011166110754fed3ab082a52302 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 7 Apr 2009 09:09:21 +0000 Subject: [maven-release-plugin] prepare release mocca-1.1.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@329 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index da5dbc6f..a0777ee6 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.5-SNAPSHOT + 1.1.0 @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz STAL - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz STALService - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz smccSTAL - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz BKUCommonGUI - 1.0.5-SNAPSHOT + 1.1.0 \ No newline at end of file -- cgit v1.2.3 From 47bc6ce0d569d7bff1bab891c2f6ce66cd2a544e Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 7 Apr 2009 09:13:32 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@331 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index a0777ee6..020ac7e2 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.0 + 1.1.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.0 + 1.1.1-SNAPSHOT @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.0 + 1.1.1-SNAPSHOT at.gv.egiz STAL - 1.1.0 + 1.1.1-SNAPSHOT at.gv.egiz STALService - 1.1.0 + 1.1.1-SNAPSHOT at.gv.egiz smccSTAL - 1.1.0 + 1.1.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.1.0 + 1.1.1-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 1ad17f951032d8b33c351d95d2f336c98d040d4d Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 15:01:52 +0000 Subject: [maven-release-plugin] prepare release mocca-1.1.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@340 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 020ac7e2..cff0e483 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1-SNAPSHOT + 1.1.1 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1-SNAPSHOT + 1.1.1 @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STALService - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz smccSTAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz BKUCommonGUI - 1.1.1-SNAPSHOT + 1.1.1 \ No newline at end of file -- cgit v1.2.3 From 3b5c56568c01f6f012888ce958df8e6d8f5fb18f Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 15:30:31 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.1.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@343 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index cff0e483..020ac7e2 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1 + 1.1.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1 + 1.1.1-SNAPSHOT @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz STAL - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz STALService - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz smccSTAL - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.1.1 + 1.1.1-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 9a04c66553e1f7a088407176299bb3acbb463e5a Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 15:41:17 +0000 Subject: [maven-release-plugin] prepare release mocca-1.1.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@344 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 020ac7e2..cff0e483 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1-SNAPSHOT + 1.1.1 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1-SNAPSHOT + 1.1.1 @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STALService - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz smccSTAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz BKUCommonGUI - 1.1.1-SNAPSHOT + 1.1.1 \ No newline at end of file -- cgit v1.2.3 From 0843cee3fde9b3c81410e219e311e8e03aa9afcd Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 15:51:45 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.1.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@345 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index cff0e483..020ac7e2 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1 + 1.1.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1 + 1.1.1-SNAPSHOT @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz STAL - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz STALService - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz smccSTAL - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.1.1 + 1.1.1-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 64efe970e2b053b8d058f5230c5bf8e2fb4666d5 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 15:57:58 +0000 Subject: [maven-release-plugin] prepare release mocca-1.1.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@346 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 020ac7e2..cff0e483 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1-SNAPSHOT + 1.1.1 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1-SNAPSHOT + 1.1.1 @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STALService - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz smccSTAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz BKUCommonGUI - 1.1.1-SNAPSHOT + 1.1.1 \ No newline at end of file -- cgit v1.2.3 From bbd9833a9ae0cbbc350eb4db8a001849bb6637ac Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 16:00:46 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.1.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@347 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index cff0e483..020ac7e2 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1 + 1.1.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1 + 1.1.1-SNAPSHOT @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz STAL - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz STALService - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz smccSTAL - 1.1.1 + 1.1.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.1.1 + 1.1.1-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 420e23a4e9f105defc502e8ec351e1e313a6b225 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 16:03:29 +0000 Subject: [maven-release-plugin] prepare release mocca-1.1.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@348 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 020ac7e2..cff0e483 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1-SNAPSHOT + 1.1.1 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1-SNAPSHOT + 1.1.1 @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz STALService - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz smccSTAL - 1.1.1-SNAPSHOT + 1.1.1 at.gv.egiz BKUCommonGUI - 1.1.1-SNAPSHOT + 1.1.1 \ No newline at end of file -- cgit v1.2.3 From 0ee51852335b820c51b7270df31c116a0826f9c7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 20 Apr 2009 16:03:48 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@350 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index cff0e483..d879b274 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.1 + 1.1.2-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.1 + 1.1.2-SNAPSHOT @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.1 + 1.1.2-SNAPSHOT at.gv.egiz STAL - 1.1.1 + 1.1.2-SNAPSHOT at.gv.egiz STALService - 1.1.1 + 1.1.2-SNAPSHOT at.gv.egiz smccSTAL - 1.1.1 + 1.1.2-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.1.1 + 1.1.2-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 8c4be63080981cc85e1c1584f046dfd6035968c0 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 1 Jul 2009 15:05:23 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@385 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index d879b274..5365846d 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.1.2-SNAPSHOT + 1.2.0 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.1.2-SNAPSHOT + 1.2.0 @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.1.2-SNAPSHOT + 1.2.0 at.gv.egiz STAL - 1.1.2-SNAPSHOT + 1.2.0 at.gv.egiz STALService - 1.1.2-SNAPSHOT + 1.2.0 at.gv.egiz smccSTAL - 1.1.2-SNAPSHOT + 1.2.0 at.gv.egiz BKUCommonGUI - 1.1.2-SNAPSHOT + 1.2.0 \ No newline at end of file -- cgit v1.2.3 From d23cff9c8f01f7fff85c183fd3b482b173bb3108 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 1 Jul 2009 15:07:04 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@387 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 5365846d..32438d0f 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.0 + 1.2.1-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.0 + 1.2.1-SNAPSHOT @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.2.0 + 1.2.1-SNAPSHOT at.gv.egiz STAL - 1.2.0 + 1.2.1-SNAPSHOT at.gv.egiz STALService - 1.2.0 + 1.2.1-SNAPSHOT at.gv.egiz smccSTAL - 1.2.0 + 1.2.1-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.0 + 1.2.1-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 2dd863b4b2ccd75a8e0202053239ba14f452bda4 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 9 Jul 2009 12:06:13 +0000 Subject: log default locale git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@401 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 1 + 1 file changed, 1 insertion(+) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 0ddb6dc6..43bc2dae 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -97,6 +97,7 @@ public class BKUApplet extends JApplet { if (locale != null) { this.setLocale(new Locale(locale)); } + log.trace("default locale: " + Locale.getDefault()); log.debug("setting locale: " + getLocale()); BKUGUIFacade.Style guiStyle; -- cgit v1.2.3 From 5bff0a3288bd2b5e1f1030c6e47430735cd09463 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 9 Jul 2009 16:34:07 +0000 Subject: [#393] loading of default background fails git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@407 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 43bc2dae..95ac3553 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -116,7 +116,7 @@ public class BKUApplet extends JApplet { backgroundImgURL = getURLParameter(BACKGROUND_IMG, null); log.debug("setting background: " + backgroundImgURL); } catch (MalformedURLException ex) { - log.warn("failed to load applet background image: " + ex.getMessage() + ", using default"); + log.warn("cannot load applet background image: " + ex.getMessage()); } AbstractHelpListener helpListener = null; @@ -236,7 +236,7 @@ public class BKUApplet extends JApplet { protected URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { String urlParam = getParameter(paramKey); - if (urlParam != null) { + if (urlParam != null && !"".equals(urlParam)) { URL codebase = getCodeBase(); try { URL url; -- cgit v1.2.3 From 78c11c6bc3ffecf26a12981b6975a473479855a4 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 13 Aug 2009 09:14:42 +0000 Subject: pkcs#11 sign BKUApplet git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@421 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 32438d0f..a12ffdbc 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -45,6 +45,7 @@ maven-jar-plugin + org.apache.maven.plugins @@ -63,6 +64,8 @@ test-applet signer ./keystore.ks + storepass keypass true @@ -70,6 +73,27 @@ + + + pkcs11-sign + + + + maven-jar-plugin + org.apache.maven.plugins + 2.2-mocca + + NONE + PKCS11 + iaik.pkcs.pkcs11.provider.IAIKPkcs11 + a-sit + + + + + + + at.gv.egiz -- cgit v1.2.3 From fa928f387d17cb9658dd6f488c619cfcceab9801 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 13:05:44 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.1 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@440 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index a12ffdbc..571b06de 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.1-SNAPSHOT + 1.2.1 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.1-SNAPSHOT + 1.2.1 @@ -87,7 +87,7 @@ PKCS11 iaik.pkcs.pkcs11.provider.IAIKPkcs11 a-sit - + @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.1-SNAPSHOT + 1.2.1 at.gv.egiz STAL - 1.2.1-SNAPSHOT + 1.2.1 at.gv.egiz STALService - 1.2.1-SNAPSHOT + 1.2.1 at.gv.egiz smccSTAL - 1.2.1-SNAPSHOT + 1.2.1 at.gv.egiz BKUCommonGUI - 1.2.1-SNAPSHOT + 1.2.1 \ No newline at end of file -- cgit v1.2.3 From a4e2fb04ca7e5e2bf2352c0881bb686cb83aaf74 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 14 Aug 2009 13:06:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@442 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 571b06de..42416322 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.1 + 1.2.2-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.1 + 1.2.2-SNAPSHOT @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.1 + 1.2.2-SNAPSHOT at.gv.egiz STAL - 1.2.1 + 1.2.2-SNAPSHOT at.gv.egiz STALService - 1.2.1 + 1.2.2-SNAPSHOT at.gv.egiz smccSTAL - 1.2.1 + 1.2.2-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.1 + 1.2.2-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 22001c93bca360d1b15c252cb22d2a4147ff350d Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 16:24:55 +0000 Subject: [#430] Activation/PIN-management in MOCCA Web Start - new Modules: smccSTALExt, BKUGuiExt in order not to depend on BKUAppletExt in BKULocal - provide stal-request handler de-registration in abstractSMCCSTAL git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@448 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/META-INF/MANIFEST.MF | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 BKUApplet/src/main/java/META-INF/MANIFEST.MF (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/META-INF/MANIFEST.MF b/BKUApplet/src/main/java/META-INF/MANIFEST.MF deleted file mode 100644 index 5e949512..00000000 --- a/BKUApplet/src/main/java/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - -- cgit v1.2.3 From b05ed4a6269f13602077047689c1a2e69f99bd4e Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 16:44:17 +0000 Subject: pkcs11-pass property git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@450 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 42416322..4f78e211 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -87,7 +87,7 @@ PKCS11 iaik.pkcs.pkcs11.provider.IAIKPkcs11 a-sit - + ${pkcs11-pass} -- cgit v1.2.3 From ac6d2a37ee43ddc48cc0a1e40371366607624db7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:08:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@453 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 4f78e211..828a98a7 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT -- cgit v1.2.3 From ada7c53ce1c19ba26b988e43da51a1a99d584b14 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:10:52 +0000 Subject: [maven-release-plugin] rollback the release of mocca-1.2.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@454 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 828a98a7..4f78e211 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.3-SNAPSHOT + 1.2.2-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.3-SNAPSHOT + 1.2.2-SNAPSHOT -- cgit v1.2.3 From e676ab1e361aff7ff7417f8f6e93ad176ef6cb60 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:27:08 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.2 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@455 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 4f78e211..fb90f314 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.2-SNAPSHOT + 1.2.2 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.2-SNAPSHOT + 1.2.2 @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.2-SNAPSHOT + 1.2.2 at.gv.egiz STAL - 1.2.2-SNAPSHOT + 1.2.2 at.gv.egiz STALService - 1.2.2-SNAPSHOT + 1.2.2 at.gv.egiz smccSTAL - 1.2.2-SNAPSHOT + 1.2.2 at.gv.egiz BKUCommonGUI - 1.2.2-SNAPSHOT + 1.2.2 \ No newline at end of file -- cgit v1.2.3 From 1102477bc94590a21eaf3bcbd50baa0b6ed13529 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 20 Aug 2009 17:32:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@458 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index fb90f314..01bd4bc1 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.2 + 1.2.3-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.2 + 1.2.3-SNAPSHOT @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.2 + 1.2.3-SNAPSHOT at.gv.egiz STAL - 1.2.2 + 1.2.3-SNAPSHOT at.gv.egiz STALService - 1.2.2 + 1.2.3-SNAPSHOT at.gv.egiz smccSTAL - 1.2.2 + 1.2.3-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.2 + 1.2.3-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 45bae5a2d8b414ccb3ed4421eeee867b2a6e88b7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:31:49 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@467 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 01bd4bc1..c08c45ab 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.3-SNAPSHOT + 1.2.3 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.3-SNAPSHOT + 1.2.3 @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.3-SNAPSHOT + 1.2.3 at.gv.egiz STAL - 1.2.3-SNAPSHOT + 1.2.3 at.gv.egiz STALService - 1.2.3-SNAPSHOT + 1.2.3 at.gv.egiz smccSTAL - 1.2.3-SNAPSHOT + 1.2.3 at.gv.egiz BKUCommonGUI - 1.2.3-SNAPSHOT + 1.2.3 \ No newline at end of file -- cgit v1.2.3 From 1f0a54980e6b3f60c3b3d935f22537ceba179100 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 21 Aug 2009 16:32:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@469 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index c08c45ab..0844dc95 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.3 + 1.2.4-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.3 + 1.2.4-SNAPSHOT @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.3 + 1.2.4-SNAPSHOT at.gv.egiz STAL - 1.2.3 + 1.2.4-SNAPSHOT at.gv.egiz STALService - 1.2.3 + 1.2.4-SNAPSHOT at.gv.egiz smccSTAL - 1.2.3 + 1.2.4-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.3 + 1.2.4-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 6d515d832b0c0828a63d0b68d7823054543761ff Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:32:15 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.4 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@479 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 0844dc95..78b7c809 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.4-SNAPSHOT + 1.2.4 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.4-SNAPSHOT + 1.2.4 @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.4-SNAPSHOT + 1.2.4 at.gv.egiz STAL - 1.2.4-SNAPSHOT + 1.2.4 at.gv.egiz STALService - 1.2.4-SNAPSHOT + 1.2.4 at.gv.egiz smccSTAL - 1.2.4-SNAPSHOT + 1.2.4 at.gv.egiz BKUCommonGUI - 1.2.4-SNAPSHOT + 1.2.4 \ No newline at end of file -- cgit v1.2.3 From 5eb05982f2e98f56569b4ea07b1961e3eed617d7 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Aug 2009 20:32:33 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@481 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 78b7c809..8ce0c37f 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.4 + 1.2.5-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.4 + 1.2.5-SNAPSHOT @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.4 + 1.2.5-SNAPSHOT at.gv.egiz STAL - 1.2.4 + 1.2.5-SNAPSHOT at.gv.egiz STALService - 1.2.4 + 1.2.5-SNAPSHOT at.gv.egiz smccSTAL - 1.2.4 + 1.2.5-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.4 + 1.2.5-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 44ee3259546bdcfbdc54563aa2766cce3f5cd704 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 20:13:07 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@488 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 8ce0c37f..4ee665ce 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.5-SNAPSHOT + 1.2.5 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.5-SNAPSHOT + 1.2.5 @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.5-SNAPSHOT + 1.2.5 at.gv.egiz STAL - 1.2.5-SNAPSHOT + 1.2.5 at.gv.egiz STALService - 1.2.5-SNAPSHOT + 1.2.5 at.gv.egiz smccSTAL - 1.2.5-SNAPSHOT + 1.2.5 at.gv.egiz BKUCommonGUI - 1.2.5-SNAPSHOT + 1.2.5 \ No newline at end of file -- cgit v1.2.3 From 68ebb57a05d44b25b886749719e7bd9997b0bd11 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 28 Aug 2009 20:16:01 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@490 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 4ee665ce..334ed694 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.5 + 1.2.6-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.5 + 1.2.6-SNAPSHOT @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.5 + 1.2.6-SNAPSHOT at.gv.egiz STAL - 1.2.5 + 1.2.6-SNAPSHOT at.gv.egiz STALService - 1.2.5 + 1.2.6-SNAPSHOT at.gv.egiz smccSTAL - 1.2.5 + 1.2.6-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.5 + 1.2.6-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 3ca1928f20603069058bf89dce1a47599d064091 Mon Sep 17 00:00:00 2001 From: mcentner Date: Tue, 8 Sep 2009 15:55:46 +0000 Subject: Fixed Bug [#467] Border between Background image and border. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@505 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 45 ++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 95ac3553..94673266 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -26,6 +26,7 @@ import java.util.Locale; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; +import javax.swing.JPanel; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -35,6 +36,7 @@ import at.gv.egiz.bku.gui.BKUGUIImpl; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; import java.applet.AppletContext; +import java.awt.Color; import java.awt.Container; import javax.xml.namespace.QName; @@ -44,6 +46,8 @@ import javax.xml.namespace.QName; */ public class BKUApplet extends JApplet { + private static final long serialVersionUID = 1L; + private static Log log = LogFactory.getLog(BKUApplet.class); /** * Applet parameter keys @@ -56,6 +60,7 @@ public class BKUApplet extends JApplet { public final static String HELP_URL = "HelpURL"; public final static String SESSION_ID = "SessionID"; public static final String BACKGROUND_IMG = "Background"; + public static final String BACKGROUND_COLOR = "BackgroundColor"; public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; public static final String HASHDATA_DISPLAY_FRAME = "frame"; @@ -82,6 +87,23 @@ public class BKUApplet extends JApplet { protected AppletBKUWorker worker; protected Thread workerThread; + /* (non-Javadoc) + * @see java.applet.Applet#getParameterInfo() + */ + @Override + public String[][] getParameterInfo() { + return new String[][] { + {WSDL_URL, "url", "URL of the WSDL of the MOCCA server side STAL"}, + {REDIRECT_URL, "url", "URL to redirect the browser to when finished"}, + {REDIRECT_TARGET, "frame target", "name of the target frame for redirection when finished"}, + {LOCALE, "locale", "locale for UI localization (optional, default: system default)"}, + {GUI_STYLE, "simple, advanced, tiny", "GUI style (optional, default: simple)"}, + {BACKGROUND_COLOR, "#hhhhhh", "background color, e.g. '#333333' (optional, default: look and feel dependend)"}, + {BACKGROUND_IMG, "url", "URL of a background image for the GUI (optional, default: no image)"}, + {HELP_URL, "url", "URL for locating help files, e.g. '../help/' (no help provided if missing)"} + }; + } + /** * Factory method to create and wire HelpListener, GUI and BKUWorker. * (Config via applet parameters, see BKUApplet.* constants) @@ -130,7 +152,24 @@ public class BKUApplet extends JApplet { log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help"); } - BKUGUIFacade gui = createGUI(getContentPane(), getLocale(), + // Note: We need a panel in order to be able to set the background properly. + // Setting the background without a panel has side effects with the + // different java plugins. + JPanel contentPanel = new JPanel(); + getContentPane().add(contentPanel); + + String backgroundColor = getParameter(BACKGROUND_COLOR); + if (backgroundColor != null && backgroundColor.startsWith("#")) { + try { + Color color = new Color(Integer.parseInt(backgroundColor.substring(1), 16)); + log.debug("setting background color to " + color); + contentPanel.setBackground(color); + } catch (NumberFormatException e) { + log.debug("failed to set background color '" + backgroundColor + "'"); + } + } + + BKUGUIFacade gui = createGUI(contentPanel, getLocale(), guiStyle, backgroundImgURL, helpListener); @@ -255,8 +294,8 @@ public class BKUApplet extends JApplet { throw ex; } } else { - log.error("applet paremeter " + urlParam + " not set"); - throw new MalformedURLException(urlParam + " not set"); + log.error("applet paremeter " + paramKey + " not set"); + throw new MalformedURLException(paramKey + " not set"); } } } -- cgit v1.2.3 From 025657248e87001b91a5eb90cdc24fb20bc2c62b Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 9 Sep 2009 07:54:21 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.6 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@506 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 334ed694..32805763 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.6-SNAPSHOT + 1.2.6 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.6-SNAPSHOT + 1.2.6 @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.6-SNAPSHOT + 1.2.6 at.gv.egiz STAL - 1.2.6-SNAPSHOT + 1.2.6 at.gv.egiz STALService - 1.2.6-SNAPSHOT + 1.2.6 at.gv.egiz smccSTAL - 1.2.6-SNAPSHOT + 1.2.6 at.gv.egiz BKUCommonGUI - 1.2.6-SNAPSHOT + 1.2.6 \ No newline at end of file -- cgit v1.2.3 From ce450c6eee4977040072b5f51a91183c15846b1a Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 9 Sep 2009 07:54:58 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@508 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 32805763..547c4098 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.6 + 1.2.7-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.6 + 1.2.7-SNAPSHOT @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.6 + 1.2.7-SNAPSHOT at.gv.egiz STAL - 1.2.6 + 1.2.7-SNAPSHOT at.gv.egiz STALService - 1.2.6 + 1.2.7-SNAPSHOT at.gv.egiz smccSTAL - 1.2.6 + 1.2.7-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.6 + 1.2.7-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 390f6aab59c3fb7a9250d087dc9aec77b6bd865b Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 2 Oct 2009 17:56:27 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.7 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@519 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 547c4098..c30d451c 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.7-SNAPSHOT + 1.2.7 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.7-SNAPSHOT + 1.2.7 @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.7-SNAPSHOT + 1.2.7 at.gv.egiz STAL - 1.2.7-SNAPSHOT + 1.2.7 at.gv.egiz STALService - 1.2.7-SNAPSHOT + 1.2.7 at.gv.egiz smccSTAL - 1.2.7-SNAPSHOT + 1.2.7 at.gv.egiz BKUCommonGUI - 1.2.7-SNAPSHOT + 1.2.7 \ No newline at end of file -- cgit v1.2.3 From a47eafbbc567163f0319b066f65eaa7d2d9226c2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 2 Oct 2009 17:56:38 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@521 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index c30d451c..397c5670 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.7 + 1.2.8-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.7 + 1.2.8-SNAPSHOT @@ -98,27 +98,27 @@ at.gv.egiz smcc - 1.2.7 + 1.2.8-SNAPSHOT at.gv.egiz STAL - 1.2.7 + 1.2.8-SNAPSHOT at.gv.egiz STALService - 1.2.7 + 1.2.8-SNAPSHOT at.gv.egiz smccSTAL - 1.2.7 + 1.2.8-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.7 + 1.2.8-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 68fcf98895e0a1a8072c5a0541a08ae0f599a239 Mon Sep 17 00:00:00 2001 From: tzefferer Date: Fri, 16 Oct 2009 09:53:37 +0000 Subject: Keyboard accessibility for Online-BKU git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@526 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletBKUWorker.java | 5 + .../at/gv/egiz/bku/online/applet/BKUApplet.java | 541 +++++++++++---------- 2 files changed, 292 insertions(+), 254 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java index e8d8976d..d5f8dd69 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java @@ -216,4 +216,9 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable { log.error(e); } } + + public void getFocusFromBrowser() { + + gui.getFocusFromBrowser(); + } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 94673266..6346b7f4 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -19,6 +19,7 @@ package at.gv.egiz.bku.online.applet; import at.gv.egiz.bku.gui.BKUGUIFacade.Style; import at.gv.egiz.bku.gui.DefaultHelpListener; import at.gv.egiz.bku.gui.AbstractHelpListener; +import at.gv.egiz.bku.gui.SwitchFocusListener; import at.gv.egiz.stal.service.translator.STALTranslator; import java.net.MalformedURLException; import java.net.URL; @@ -38,264 +39,296 @@ import at.gv.egiz.stal.service.STALService; import java.applet.AppletContext; import java.awt.Color; import java.awt.Container; + import javax.xml.namespace.QName; /** * Note: all swing code is executed by the event dispatch thread (see * BKUGUIFacade) */ -public class BKUApplet extends JApplet { - - private static final long serialVersionUID = 1L; - - private static Log log = LogFactory.getLog(BKUApplet.class); - /** - * Applet parameter keys - */ - public static final String GUI_STYLE = "GuiStyle"; - public final static String LOCALE = "Locale"; - public final static String WSDL_URL = "WSDL_URL"; - public static final String HASHDATA_DISPLAY = "HashDataDisplay"; - public final static String HASHDATA_URL = "HashDataURL"; - public final static String HELP_URL = "HelpURL"; - public final static String SESSION_ID = "SessionID"; - public static final String BACKGROUND_IMG = "Background"; - public static final String BACKGROUND_COLOR = "BackgroundColor"; - public static final String REDIRECT_URL = "RedirectURL"; - public static final String REDIRECT_TARGET = "RedirectTarget"; - public static final String HASHDATA_DISPLAY_FRAME = "frame"; - /** - * STAL WSDL namespace and service name - */ - public static final String STAL_WSDL_NS = "http://www.egiz.gv.at/wsdl/stal"; - public static final String STAL_SERVICE = "STALService"; - /** - * Dummy session id, used if no sessionId parameter is provided - */ - protected static final String TEST_SESSION_ID = "TestSession"; - - static { - if (log.isTraceEnabled()) { - log.trace("enabling webservice communication dump"); - System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true"); - } - } - - /** - * STAL - */ - protected AppletBKUWorker worker; - protected Thread workerThread; - - /* (non-Javadoc) - * @see java.applet.Applet#getParameterInfo() - */ - @Override - public String[][] getParameterInfo() { - return new String[][] { - {WSDL_URL, "url", "URL of the WSDL of the MOCCA server side STAL"}, - {REDIRECT_URL, "url", "URL to redirect the browser to when finished"}, - {REDIRECT_TARGET, "frame target", "name of the target frame for redirection when finished"}, - {LOCALE, "locale", "locale for UI localization (optional, default: system default)"}, - {GUI_STYLE, "simple, advanced, tiny", "GUI style (optional, default: simple)"}, - {BACKGROUND_COLOR, "#hhhhhh", "background color, e.g. '#333333' (optional, default: look and feel dependend)"}, - {BACKGROUND_IMG, "url", "URL of a background image for the GUI (optional, default: no image)"}, - {HELP_URL, "url", "URL for locating help files, e.g. '../help/' (no help provided if missing)"} - }; - } - - /** - * Factory method to create and wire HelpListener, GUI and BKUWorker. - * (Config via applet parameters, see BKUApplet.* constants) - */ - @Override - public void init() { - log.info("Welcome to MOCCA"); - log.trace("Called init()"); - - HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); - - String locale = getParameter(LOCALE); - if (locale != null) { - this.setLocale(new Locale(locale)); - } - log.trace("default locale: " + Locale.getDefault()); - log.debug("setting locale: " + getLocale()); - - BKUGUIFacade.Style guiStyle; - String guiStyleParam = getParameter(GUI_STYLE); - if ("advanced".equals(guiStyleParam)) { - guiStyle = BKUGUIFacade.Style.advanced; - } else if ("tiny".equals(guiStyleParam)) { - guiStyle = BKUGUIFacade.Style.tiny; - } else { - guiStyle = BKUGUIFacade.Style.simple; - } - log.debug("setting gui-style: " + guiStyle); - - URL backgroundImgURL = null; - try { - backgroundImgURL = getURLParameter(BACKGROUND_IMG, null); - log.debug("setting background: " + backgroundImgURL); - } catch (MalformedURLException ex) { - log.warn("cannot load applet background image: " + ex.getMessage()); - } - - AbstractHelpListener helpListener = null; - try { - helpListener = new DefaultHelpListener(getAppletContext(), - getURLParameter(HELP_URL, null), getLocale()); - if (log.isDebugEnabled()) { - log.debug("setting helpURL: " + getURLParameter(HELP_URL, null)); - } - } catch (MalformedURLException ex) { - log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help"); - } - - // Note: We need a panel in order to be able to set the background properly. - // Setting the background without a panel has side effects with the - // different java plugins. - JPanel contentPanel = new JPanel(); - getContentPane().add(contentPanel); - - String backgroundColor = getParameter(BACKGROUND_COLOR); - if (backgroundColor != null && backgroundColor.startsWith("#")) { - try { - Color color = new Color(Integer.parseInt(backgroundColor.substring(1), 16)); - log.debug("setting background color to " + color); - contentPanel.setBackground(color); - } catch (NumberFormatException e) { - log.debug("failed to set background color '" + backgroundColor + "'"); - } - } - - BKUGUIFacade gui = createGUI(contentPanel, getLocale(), - guiStyle, - backgroundImgURL, - helpListener); - - worker = createBKUWorker(this, gui); - } - - @Override - public void start() { - log.trace("Called start()"); - workerThread = new Thread(worker); - workerThread.start(); - } - - @Override - public void stop() { - log.trace("Called stop()"); - if ((workerThread != null) && (workerThread.isAlive())) { - workerThread.interrupt(); - } - } - - @Override - public void destroy() { - log.trace("Called destroy()"); - } - - ///////////////////////////////////////////////////////////////////////////// - // factory methods for subclasses to inject different components - ///////////////////////////////////////////////////////////////////////////// - - protected BKUGUIFacade createGUI(Container contentPane, - Locale locale, - Style guiStyle, - URL backgroundImgURL, - AbstractHelpListener helpListener) { - return new BKUGUIImpl(contentPane, locale, guiStyle, backgroundImgURL, helpListener); - } - - protected AppletBKUWorker createBKUWorker(BKUApplet applet, BKUGUIFacade gui) { - return new AppletBKUWorker(applet, gui); - } - - - ///////////////////////////////////////////////////////////////////////////// - // callback for BKUWorker to allow extension - ///////////////////////////////////////////////////////////////////////////// - - /** - * Callback for BKUWorker to allow extension - * @return - * @throws java.net.MalformedURLException - */ - public STALPortType getSTALPort() throws MalformedURLException { - URL wsdlURL = getURLParameter(WSDL_URL, null); - log.debug("setting STAL WSDL: " + wsdlURL); - QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE); - STALService stal = new STALService(wsdlURL, endpointName); - return stal.getSTALPort(); - } - - /** - * Callback for BKUWorker to allow extension - * (TODO STALPort could know its STALTranslator) - * @return - * @throws java.net.MalformedURLException - */ - public STALTranslator getSTALTranslator() { - return new STALTranslator(); - } - - /** - * Callback for BKUWorker to keep applet context out of BKUWorker - * @return - * @throws java.net.MalformedURLException - */ - protected void sendRedirect(String sessionId) { - try { - AppletContext ctx = getAppletContext(); - if (ctx == null) { - log.error("no applet context (applet might already have been destroyed)"); - return; - } - URL redirectURL = getURLParameter(REDIRECT_URL, sessionId); - String redirectTarget = getParameter(REDIRECT_TARGET); - if (redirectTarget == null) { - log.info("Done. Redirecting to " + redirectURL + " ..."); - ctx.showDocument(redirectURL); - } else { - log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); - ctx.showDocument(redirectURL, redirectTarget); - } - } catch (MalformedURLException ex) { - log.warn("Failed to redirect: " + ex.getMessage(), ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) - } - } - - - ///////////////////////////////////////////////////////////////////////////// - // utility methods - ///////////////////////////////////////////////////////////////////////////// - - protected URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { - String urlParam = getParameter(paramKey); - if (urlParam != null && !"".equals(urlParam)) { - URL codebase = getCodeBase(); - try { - URL url; - if (codebase.getProtocol().equalsIgnoreCase("file")) { - // for debugging in appletrunner - url = new URL(urlParam); - } else { - if (sessionId != null) { - urlParam = urlParam + ";jsessionid=" + sessionId; - } - url = new URL(codebase, urlParam); - } - return url; - } catch (MalformedURLException ex) { - log.error("applet paremeter " + urlParam + " is not a valid URL: " + ex.getMessage()); - throw ex; - } - } else { - log.error("applet paremeter " + paramKey + " not set"); - throw new MalformedURLException(paramKey + " not set"); - } - } +public class BKUApplet extends JApplet { + + private static final long serialVersionUID = 1L; + + private static Log log = LogFactory.getLog(BKUApplet.class); + /** + * Applet parameter keys + */ + public static final String GUI_STYLE = "GuiStyle"; + public final static String LOCALE = "Locale"; + public final static String WSDL_URL = "WSDL_URL"; + public static final String HASHDATA_DISPLAY = "HashDataDisplay"; + public final static String HASHDATA_URL = "HashDataURL"; + public final static String HELP_URL = "HelpURL"; + public final static String SESSION_ID = "SessionID"; + public static final String BACKGROUND_IMG = "Background"; + public static final String BACKGROUND_COLOR = "BackgroundColor"; + public static final String REDIRECT_URL = "RedirectURL"; + public static final String REDIRECT_TARGET = "RedirectTarget"; + public static final String HASHDATA_DISPLAY_FRAME = "frame"; + /** + * STAL WSDL namespace and service name + */ + public static final String STAL_WSDL_NS = "http://www.egiz.gv.at/wsdl/stal"; + public static final String STAL_SERVICE = "STALService"; + /** + * Dummy session id, used if no sessionId parameter is provided + */ + protected static final String TEST_SESSION_ID = "TestSession"; + + static { + if (log.isTraceEnabled()) { + log.trace("enabling webservice communication dump"); + System + .setProperty( + "com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", + "true"); + } + } + + /** + * STAL + */ + protected AppletBKUWorker worker; + protected Thread workerThread; + + /* + * (non-Javadoc) + * + * @see java.applet.Applet#getParameterInfo() + */ + @Override + public String[][] getParameterInfo() { + return new String[][] { + { WSDL_URL, "url", + "URL of the WSDL of the MOCCA server side STAL" }, + { REDIRECT_URL, "url", + "URL to redirect the browser to when finished" }, + { REDIRECT_TARGET, "frame target", + "name of the target frame for redirection when finished" }, + { LOCALE, "locale", + "locale for UI localization (optional, default: system default)" }, + { GUI_STYLE, "simple, advanced, tiny", + "GUI style (optional, default: simple)" }, + { BACKGROUND_COLOR, "#hhhhhh", + "background color, e.g. '#333333' (optional, default: look and feel dependend)" }, + { BACKGROUND_IMG, "url", + "URL of a background image for the GUI (optional, default: no image)" }, + { HELP_URL, "url", + "URL for locating help files, e.g. '../help/' (no help provided if missing)" } }; + } + + /** + * Factory method to create and wire HelpListener, GUI and BKUWorker. + * (Config via applet parameters, see BKUApplet.* constants) + */ + @Override + public void init() { + log.info("Welcome to MOCCA"); + log.trace("Called init()"); + + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory + .getInstance()); + + String locale = getParameter(LOCALE); + if (locale != null) { + this.setLocale(new Locale(locale)); + } + log.trace("default locale: " + Locale.getDefault()); + log.debug("setting locale: " + getLocale()); + + BKUGUIFacade.Style guiStyle; + String guiStyleParam = getParameter(GUI_STYLE); + if ("advanced".equals(guiStyleParam)) { + guiStyle = BKUGUIFacade.Style.advanced; + } else if ("tiny".equals(guiStyleParam)) { + guiStyle = BKUGUIFacade.Style.tiny; + } else { + guiStyle = BKUGUIFacade.Style.simple; + } + log.debug("setting gui-style: " + guiStyle); + + URL backgroundImgURL = null; + try { + backgroundImgURL = getURLParameter(BACKGROUND_IMG, null); + log.debug("setting background: " + backgroundImgURL); + } catch (MalformedURLException ex) { + log.warn("cannot load applet background image: " + ex.getMessage()); + } + + AbstractHelpListener helpListener = null; + try { + helpListener = new DefaultHelpListener(getAppletContext(), + getURLParameter(HELP_URL, null), getLocale()); + if (log.isDebugEnabled()) { + log + .debug("setting helpURL: " + + getURLParameter(HELP_URL, null)); + } + } catch (MalformedURLException ex) { + log.warn("failed to load help URL: " + ex.getMessage() + + ", disabling help"); + } + + SwitchFocusListener switchFocusListener = new SwitchFocusListener( + getAppletContext(), "focusToBrowser()"); + + // Note: We need a panel in order to be able to set the background + // properly. + // Setting the background without a panel has side effects with the + // different java plugins. + JPanel contentPanel = new JPanel(); + getContentPane().add(contentPanel); + + String backgroundColor = getParameter(BACKGROUND_COLOR); + if (backgroundColor != null && backgroundColor.startsWith("#")) { + try { + Color color = new Color(Integer.parseInt(backgroundColor + .substring(1), 16)); + log.debug("setting background color to " + color); + contentPanel.setBackground(color); + } catch (NumberFormatException e) { + log.debug("failed to set background color '" + backgroundColor + + "'"); + } + } + + BKUGUIFacade gui = createGUI(contentPanel, getLocale(), guiStyle, + backgroundImgURL, helpListener, switchFocusListener); + + worker = createBKUWorker(this, gui); + } + + @Override + public void start() { + log.trace("Called start()"); + workerThread = new Thread(worker); + workerThread.start(); + } + + @Override + public void stop() { + log.trace("Called stop()"); + if ((workerThread != null) && (workerThread.isAlive())) { + workerThread.interrupt(); + } + } + + @Override + public void destroy() { + log.trace("Called destroy()"); + } + + // /////////////////////////////////////////////////////////////////////////// + // factory methods for subclasses to inject different components + // /////////////////////////////////////////////////////////////////////////// + + protected BKUGUIFacade createGUI(Container contentPane, Locale locale, + Style guiStyle, URL backgroundImgURL, + AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + return new BKUGUIImpl(contentPane, locale, guiStyle, backgroundImgURL, + helpListener, switchFocusListener); + } + + protected AppletBKUWorker createBKUWorker(BKUApplet applet, BKUGUIFacade gui) { + return new AppletBKUWorker(applet, gui); + } + + // /////////////////////////////////////////////////////////////////////////// + // callback for BKUWorker to allow extension + // /////////////////////////////////////////////////////////////////////////// + + /** + * Callback for BKUWorker to allow extension + * + * @return + * @throws java.net.MalformedURLException + */ + public STALPortType getSTALPort() throws MalformedURLException { + URL wsdlURL = getURLParameter(WSDL_URL, null); + log.debug("setting STAL WSDL: " + wsdlURL); + QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE); + STALService stal = new STALService(wsdlURL, endpointName); + return stal.getSTALPort(); + } + + /** + * Callback for BKUWorker to allow extension (TODO STALPort could know its + * STALTranslator) + * + * @return + * @throws java.net.MalformedURLException + */ + public STALTranslator getSTALTranslator() { + return new STALTranslator(); + } + + /** + * Callback for BKUWorker to keep applet context out of BKUWorker + * + * @return + * @throws java.net.MalformedURLException + */ + protected void sendRedirect(String sessionId) { + try { + AppletContext ctx = getAppletContext(); + if (ctx == null) { + log + .error("no applet context (applet might already have been destroyed)"); + return; + } + URL redirectURL = getURLParameter(REDIRECT_URL, sessionId); + String redirectTarget = getParameter(REDIRECT_TARGET); + if (redirectTarget == null) { + log.info("Done. Redirecting to " + redirectURL + " ..."); + ctx.showDocument(redirectURL); + } else { + log.info("Done. Redirecting to " + redirectURL + " (target=" + + redirectTarget + ") ..."); + ctx.showDocument(redirectURL, redirectTarget); + } + } catch (MalformedURLException ex) { + log.warn("Failed to redirect: " + ex.getMessage(), ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) + } + } + + public void getFocusFromBrowser() { + + worker.getFocusFromBrowser(); + } + + // /////////////////////////////////////////////////////////////////////////// + // utility methods + // /////////////////////////////////////////////////////////////////////////// + + protected URL getURLParameter(String paramKey, String sessionId) + throws MalformedURLException { + String urlParam = getParameter(paramKey); + if (urlParam != null && !"".equals(urlParam)) { + URL codebase = getCodeBase(); + try { + URL url; + if (codebase.getProtocol().equalsIgnoreCase("file")) { + // for debugging in appletrunner + url = new URL(urlParam); + } else { + if (sessionId != null) { + urlParam = urlParam + ";jsessionid=" + sessionId; + } + url = new URL(codebase, urlParam); + } + return url; + } catch (MalformedURLException ex) { + log.error("applet paremeter " + urlParam + + " is not a valid URL: " + ex.getMessage()); + throw ex; + } + } else { + log.error("applet paremeter " + paramKey + " not set"); + throw new MalformedURLException(paramKey + " not set"); + } + } + } -- cgit v1.2.3 From 83e8c95ea7d257166d350a59bfd81e9833ec14fd Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 5 Nov 2009 19:05:14 +0000 Subject: [#484] European Language support git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@535 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 1 + .../at/gv/egiz/bku/online/applet/BKUApplet.java | 572 +++++++++++---------- .../bku/online/applet/viewer/URLFontLoader.java | 82 +++ BKUApplet/src/test/resources/appletTest.html | 35 +- 4 files changed, 390 insertions(+), 300 deletions(-) create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 397c5670..4172517b 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -21,6 +21,7 @@ at.gv.egiz + true ${project.build.outputDirectory} META-INF\/ diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 6346b7f4..7a15f7a5 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -16,6 +16,7 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.online.applet.viewer.URLFontLoader; import at.gv.egiz.bku.gui.BKUGUIFacade.Style; import at.gv.egiz.bku.gui.DefaultHelpListener; import at.gv.egiz.bku.gui.AbstractHelpListener; @@ -25,6 +26,8 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; import javax.swing.JPanel; @@ -34,6 +37,7 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIImpl; +import at.gv.egiz.bku.gui.viewer.FontProvider; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; import java.applet.AppletContext; @@ -46,289 +50,287 @@ import javax.xml.namespace.QName; * Note: all swing code is executed by the event dispatch thread (see * BKUGUIFacade) */ -public class BKUApplet extends JApplet { - - private static final long serialVersionUID = 1L; - - private static Log log = LogFactory.getLog(BKUApplet.class); - /** - * Applet parameter keys - */ - public static final String GUI_STYLE = "GuiStyle"; - public final static String LOCALE = "Locale"; - public final static String WSDL_URL = "WSDL_URL"; - public static final String HASHDATA_DISPLAY = "HashDataDisplay"; - public final static String HASHDATA_URL = "HashDataURL"; - public final static String HELP_URL = "HelpURL"; - public final static String SESSION_ID = "SessionID"; - public static final String BACKGROUND_IMG = "Background"; - public static final String BACKGROUND_COLOR = "BackgroundColor"; - public static final String REDIRECT_URL = "RedirectURL"; - public static final String REDIRECT_TARGET = "RedirectTarget"; - public static final String HASHDATA_DISPLAY_FRAME = "frame"; - /** - * STAL WSDL namespace and service name - */ - public static final String STAL_WSDL_NS = "http://www.egiz.gv.at/wsdl/stal"; - public static final String STAL_SERVICE = "STALService"; - /** - * Dummy session id, used if no sessionId parameter is provided - */ - protected static final String TEST_SESSION_ID = "TestSession"; - - static { - if (log.isTraceEnabled()) { - log.trace("enabling webservice communication dump"); - System - .setProperty( - "com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", - "true"); - } - } - - /** - * STAL - */ - protected AppletBKUWorker worker; - protected Thread workerThread; - - /* - * (non-Javadoc) - * - * @see java.applet.Applet#getParameterInfo() - */ - @Override - public String[][] getParameterInfo() { - return new String[][] { - { WSDL_URL, "url", - "URL of the WSDL of the MOCCA server side STAL" }, - { REDIRECT_URL, "url", - "URL to redirect the browser to when finished" }, - { REDIRECT_TARGET, "frame target", - "name of the target frame for redirection when finished" }, - { LOCALE, "locale", - "locale for UI localization (optional, default: system default)" }, - { GUI_STYLE, "simple, advanced, tiny", - "GUI style (optional, default: simple)" }, - { BACKGROUND_COLOR, "#hhhhhh", - "background color, e.g. '#333333' (optional, default: look and feel dependend)" }, - { BACKGROUND_IMG, "url", - "URL of a background image for the GUI (optional, default: no image)" }, - { HELP_URL, "url", - "URL for locating help files, e.g. '../help/' (no help provided if missing)" } }; - } - - /** - * Factory method to create and wire HelpListener, GUI and BKUWorker. - * (Config via applet parameters, see BKUApplet.* constants) - */ - @Override - public void init() { - log.info("Welcome to MOCCA"); - log.trace("Called init()"); - - HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory - .getInstance()); - - String locale = getParameter(LOCALE); - if (locale != null) { - this.setLocale(new Locale(locale)); - } - log.trace("default locale: " + Locale.getDefault()); - log.debug("setting locale: " + getLocale()); - - BKUGUIFacade.Style guiStyle; - String guiStyleParam = getParameter(GUI_STYLE); - if ("advanced".equals(guiStyleParam)) { - guiStyle = BKUGUIFacade.Style.advanced; - } else if ("tiny".equals(guiStyleParam)) { - guiStyle = BKUGUIFacade.Style.tiny; - } else { - guiStyle = BKUGUIFacade.Style.simple; - } - log.debug("setting gui-style: " + guiStyle); - - URL backgroundImgURL = null; - try { - backgroundImgURL = getURLParameter(BACKGROUND_IMG, null); - log.debug("setting background: " + backgroundImgURL); - } catch (MalformedURLException ex) { - log.warn("cannot load applet background image: " + ex.getMessage()); - } - - AbstractHelpListener helpListener = null; - try { - helpListener = new DefaultHelpListener(getAppletContext(), - getURLParameter(HELP_URL, null), getLocale()); - if (log.isDebugEnabled()) { - log - .debug("setting helpURL: " - + getURLParameter(HELP_URL, null)); - } - } catch (MalformedURLException ex) { - log.warn("failed to load help URL: " + ex.getMessage() - + ", disabling help"); - } - - SwitchFocusListener switchFocusListener = new SwitchFocusListener( - getAppletContext(), "focusToBrowser()"); - - // Note: We need a panel in order to be able to set the background - // properly. - // Setting the background without a panel has side effects with the - // different java plugins. - JPanel contentPanel = new JPanel(); - getContentPane().add(contentPanel); - - String backgroundColor = getParameter(BACKGROUND_COLOR); - if (backgroundColor != null && backgroundColor.startsWith("#")) { - try { - Color color = new Color(Integer.parseInt(backgroundColor - .substring(1), 16)); - log.debug("setting background color to " + color); - contentPanel.setBackground(color); - } catch (NumberFormatException e) { - log.debug("failed to set background color '" + backgroundColor - + "'"); - } - } - - BKUGUIFacade gui = createGUI(contentPanel, getLocale(), guiStyle, - backgroundImgURL, helpListener, switchFocusListener); - - worker = createBKUWorker(this, gui); - } - - @Override - public void start() { - log.trace("Called start()"); - workerThread = new Thread(worker); - workerThread.start(); - } - - @Override - public void stop() { - log.trace("Called stop()"); - if ((workerThread != null) && (workerThread.isAlive())) { - workerThread.interrupt(); - } - } - - @Override - public void destroy() { - log.trace("Called destroy()"); - } - - // /////////////////////////////////////////////////////////////////////////// - // factory methods for subclasses to inject different components - // /////////////////////////////////////////////////////////////////////////// - - protected BKUGUIFacade createGUI(Container contentPane, Locale locale, - Style guiStyle, URL backgroundImgURL, - AbstractHelpListener helpListener, - SwitchFocusListener switchFocusListener) { - return new BKUGUIImpl(contentPane, locale, guiStyle, backgroundImgURL, - helpListener, switchFocusListener); - } - - protected AppletBKUWorker createBKUWorker(BKUApplet applet, BKUGUIFacade gui) { - return new AppletBKUWorker(applet, gui); - } - - // /////////////////////////////////////////////////////////////////////////// - // callback for BKUWorker to allow extension - // /////////////////////////////////////////////////////////////////////////// - - /** - * Callback for BKUWorker to allow extension - * - * @return - * @throws java.net.MalformedURLException - */ - public STALPortType getSTALPort() throws MalformedURLException { - URL wsdlURL = getURLParameter(WSDL_URL, null); - log.debug("setting STAL WSDL: " + wsdlURL); - QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE); - STALService stal = new STALService(wsdlURL, endpointName); - return stal.getSTALPort(); - } - - /** - * Callback for BKUWorker to allow extension (TODO STALPort could know its - * STALTranslator) - * - * @return - * @throws java.net.MalformedURLException - */ - public STALTranslator getSTALTranslator() { - return new STALTranslator(); - } - - /** - * Callback for BKUWorker to keep applet context out of BKUWorker - * - * @return - * @throws java.net.MalformedURLException - */ - protected void sendRedirect(String sessionId) { - try { - AppletContext ctx = getAppletContext(); - if (ctx == null) { - log - .error("no applet context (applet might already have been destroyed)"); - return; - } - URL redirectURL = getURLParameter(REDIRECT_URL, sessionId); - String redirectTarget = getParameter(REDIRECT_TARGET); - if (redirectTarget == null) { - log.info("Done. Redirecting to " + redirectURL + " ..."); - ctx.showDocument(redirectURL); - } else { - log.info("Done. Redirecting to " + redirectURL + " (target=" - + redirectTarget + ") ..."); - ctx.showDocument(redirectURL, redirectTarget); - } - } catch (MalformedURLException ex) { - log.warn("Failed to redirect: " + ex.getMessage(), ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) - } - } - - public void getFocusFromBrowser() { - - worker.getFocusFromBrowser(); - } - - // /////////////////////////////////////////////////////////////////////////// - // utility methods - // /////////////////////////////////////////////////////////////////////////// - - protected URL getURLParameter(String paramKey, String sessionId) - throws MalformedURLException { - String urlParam = getParameter(paramKey); - if (urlParam != null && !"".equals(urlParam)) { - URL codebase = getCodeBase(); - try { - URL url; - if (codebase.getProtocol().equalsIgnoreCase("file")) { - // for debugging in appletrunner - url = new URL(urlParam); - } else { - if (sessionId != null) { - urlParam = urlParam + ";jsessionid=" + sessionId; - } - url = new URL(codebase, urlParam); - } - return url; - } catch (MalformedURLException ex) { - log.error("applet paremeter " + urlParam - + " is not a valid URL: " + ex.getMessage()); - throw ex; - } - } else { - log.error("applet paremeter " + paramKey + " not set"); - throw new MalformedURLException(paramKey + " not set"); - } - } - +public class BKUApplet extends JApplet { + + private static final long serialVersionUID = 1L; + private static Log log = LogFactory.getLog(BKUApplet.class); + /** + * Applet parameter keys + */ + public static final String GUI_STYLE = "GuiStyle"; + public final static String LOCALE = "Locale"; + public final static String WSDL_URL = "WSDL_URL"; + public static final String HASHDATA_DISPLAY = "HashDataDisplay"; + public final static String HASHDATA_URL = "HashDataURL"; + public final static String HELP_URL = "HelpURL"; + public final static String SESSION_ID = "SessionID"; + public static final String BACKGROUND_IMG = "Background"; + public static final String BACKGROUND_COLOR = "BackgroundColor"; + public static final String REDIRECT_URL = "RedirectURL"; + public static final String REDIRECT_TARGET = "RedirectTarget"; + public static final String HASHDATA_DISPLAY_FRAME = "frame"; + /** + * STAL WSDL namespace and service name + */ + public static final String STAL_WSDL_NS = "http://www.egiz.gv.at/wsdl/stal"; + public static final String STAL_SERVICE = "STALService"; + /** + * Dummy session id, used if no sessionId parameter is provided + */ + protected static final String TEST_SESSION_ID = "TestSession"; + + static { + if (log.isTraceEnabled()) { + log.trace("enabling webservice communication dump"); + System.setProperty( + "com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", + "true"); + } + } + /** + * STAL + */ + protected AppletBKUWorker worker; + protected Thread workerThread; + + /* + * (non-Javadoc) + * + * @see java.applet.Applet#getParameterInfo() + */ + @Override + public String[][] getParameterInfo() { + return new String[][]{ + {WSDL_URL, "url", + "URL of the WSDL of the MOCCA server side STAL"}, + {REDIRECT_URL, "url", + "URL to redirect the browser to when finished"}, + {REDIRECT_TARGET, "frame target", + "name of the target frame for redirection when finished"}, + {LOCALE, "locale", + "locale for UI localization (optional, default: system default)"}, + {GUI_STYLE, "simple, advanced, tiny", + "GUI style (optional, default: simple)"}, + {BACKGROUND_COLOR, "#hhhhhh", + "background color, e.g. '#333333' (optional, default: look and feel dependend)"}, + {BACKGROUND_IMG, "url", + "URL of a background image for the GUI (optional, default: no image)"}, + {HELP_URL, "url", + "URL for locating help files, e.g. '../help/' (no help provided if missing)"}}; + } + + /** + * Factory method to create and wire HelpListener, GUI and BKUWorker. + * (Config via applet parameters, see BKUApplet.* constants) + */ + @Override + public void init() { + log.info("Welcome to MOCCA"); + log.trace("Called init()"); + showStatus("Initializing MOCCA applet"); + + HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance()); + + String locale = getParameter(LOCALE); + if (locale != null) { + this.setLocale(new Locale(locale)); + } + log.trace("default locale: " + Locale.getDefault()); + log.debug("setting locale: " + getLocale()); + + BKUGUIFacade.Style guiStyle; + String guiStyleParam = getParameter(GUI_STYLE); + if ("advanced".equals(guiStyleParam)) { + guiStyle = BKUGUIFacade.Style.advanced; + } else if ("tiny".equals(guiStyleParam)) { + guiStyle = BKUGUIFacade.Style.tiny; + } else { + guiStyle = BKUGUIFacade.Style.simple; + } + log.debug("setting gui-style: " + guiStyle); + + URL backgroundImgURL = null; + try { + backgroundImgURL = getURLParameter(BACKGROUND_IMG, null); + log.debug("setting background: " + backgroundImgURL); + } catch (MalformedURLException ex) { + log.warn("cannot load applet background image: " + ex.getMessage()); + } + + AbstractHelpListener helpListener = null; + try { + helpListener = new DefaultHelpListener(getAppletContext(), + getURLParameter(HELP_URL, null), getLocale()); + if (log.isDebugEnabled()) { + log.debug("setting helpURL: " + getURLParameter(HELP_URL, null)); + } + } catch (MalformedURLException ex) { + log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help"); + } + + SwitchFocusListener switchFocusListener = new SwitchFocusListener( + getAppletContext(), "focusToBrowser()"); + + // Note: We need a panel in order to be able to set the background + // properly. + // Setting the background without a panel has side effects with the + // different java plugins. + JPanel contentPanel = new JPanel(); + getContentPane().add(contentPanel); + + String backgroundColor = getParameter(BACKGROUND_COLOR); + if (backgroundColor != null && backgroundColor.startsWith("#")) { + try { + Color color = new Color(Integer.parseInt(backgroundColor.substring(1), 16)); + log.debug("setting background color to " + color); + contentPanel.setBackground(color); + } catch (NumberFormatException e) { + log.debug("failed to set background color '" + backgroundColor + "'"); + } + } + + try { + URLFontLoader fontProvider = new URLFontLoader(getCodeBase()); + fontProvider.loadInBackground(); + BKUGUIFacade gui = createGUI(contentPanel, getLocale(), guiStyle, + backgroundImgURL, fontProvider, helpListener, switchFocusListener); + + worker = createBKUWorker(this, gui); + } catch (MalformedURLException ex) { + log.fatal("failed to load font provider URL", ex); + System.err.println("invalid font provider URL " + ex.getMessage()); + } + } + + @Override + public void start() { + log.trace("Called start()"); + if (worker != null) { + showStatus("Starting MOCCA applet"); + workerThread = new Thread(worker); + workerThread.start(); + } else { + log.debug("cannot start uninitialzed MOCCA applet"); + } + } + + @Override + public void stop() { + log.trace("Called stop()"); + showStatus("Stopping MOCCA applet"); + if ((workerThread != null) && (workerThread.isAlive())) { + workerThread.interrupt(); + } + } + + @Override + public void destroy() { + log.trace("Called destroy()"); + } + + // /////////////////////////////////////////////////////////////////////////// + // factory methods for subclasses to inject different components + // /////////////////////////////////////////////////////////////////////////// + protected BKUGUIFacade createGUI(Container contentPane, Locale locale, + Style guiStyle, URL backgroundImgURL, + FontProvider fontProvider, AbstractHelpListener helpListener, + SwitchFocusListener switchFocusListener) { + return new BKUGUIImpl(contentPane, locale, guiStyle, backgroundImgURL, + fontProvider, helpListener, switchFocusListener); + } + + protected AppletBKUWorker createBKUWorker(BKUApplet applet, BKUGUIFacade gui) { + return new AppletBKUWorker(applet, gui); + } + + // /////////////////////////////////////////////////////////////////////////// + // callback for BKUWorker to allow extension + // /////////////////////////////////////////////////////////////////////////// + /** + * Callback for BKUWorker to allow extension + * + * @return + * @throws java.net.MalformedURLException + */ + public STALPortType getSTALPort() throws MalformedURLException { + URL wsdlURL = getURLParameter(WSDL_URL, null); + log.debug("setting STAL WSDL: " + wsdlURL); + QName endpointName = new QName(STAL_WSDL_NS, STAL_SERVICE); + STALService stal = new STALService(wsdlURL, endpointName); + return stal.getSTALPort(); + } + + /** + * Callback for BKUWorker to allow extension (TODO STALPort could know its + * STALTranslator) + * + * @return + * @throws java.net.MalformedURLException + */ + public STALTranslator getSTALTranslator() { + return new STALTranslator(); + } + + /** + * Callback for BKUWorker to keep applet context out of BKUWorker + * + * @return + * @throws java.net.MalformedURLException + */ + protected void sendRedirect(String sessionId) { + try { + AppletContext ctx = getAppletContext(); + if (ctx == null) { + log.error("no applet context (applet might already have been destroyed)"); + return; + } + URL redirectURL = getURLParameter(REDIRECT_URL, sessionId); + String redirectTarget = getParameter(REDIRECT_TARGET); + if (redirectTarget == null) { + log.info("Done. Redirecting to " + redirectURL + " ..."); + ctx.showDocument(redirectURL); + } else { + log.info("Done. Redirecting to " + redirectURL + " (target=" + redirectTarget + ") ..."); + ctx.showDocument(redirectURL, redirectTarget); + } + } catch (MalformedURLException ex) { + log.warn("Failed to redirect: " + ex.getMessage(), ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) + } + } + + public void getFocusFromBrowser() { + + worker.getFocusFromBrowser(); + } + + // /////////////////////////////////////////////////////////////////////////// + // utility methods + // /////////////////////////////////////////////////////////////////////////// + protected URL getURLParameter(String paramKey, String sessionId) + throws MalformedURLException { + String urlParam = getParameter(paramKey); + if (urlParam != null && !"".equals(urlParam)) { + URL codebase = getCodeBase(); + try { + URL url; + if (codebase.getProtocol().equalsIgnoreCase("file")) { + // for debugging in appletrunner + url = new URL(urlParam); + } else { + if (sessionId != null) { + urlParam = urlParam + ";jsessionid=" + sessionId; + } + url = new URL(codebase, urlParam); + } + return url; + } catch (MalformedURLException ex) { + log.error("applet paremeter " + urlParam + " is not a valid URL: " + ex.getMessage()); + throw ex; + } + } else { + log.error("applet paremeter " + paramKey + " not set"); + throw new MalformedURLException(paramKey + " not set"); + } + } } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java new file mode 100644 index 00000000..f914aed7 --- /dev/null +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java @@ -0,0 +1,82 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package at.gv.egiz.bku.online.applet.viewer; + +import at.gv.egiz.bku.gui.viewer.FontProviderException; +import at.gv.egiz.bku.gui.viewer.FontProvider; +import java.awt.Font; +import java.awt.FontFormatException; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.concurrent.ExecutionException; +import javax.swing.SwingWorker; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author Clemens Orthacker + */ +public class URLFontLoader extends SwingWorker implements FontProvider { + + protected static final Log log = LogFactory.getLog(URLFontLoader.class); + protected URL fontURL; + protected Font font; + + public URLFontLoader(URL codebase) throws MalformedURLException { + this.fontURL = new URL(codebase, SANSMONO_FONT_RESOURCE); + if (log.isDebugEnabled()) { + log.debug(Thread.currentThread() + " setting font load URL: " + fontURL); + } + } + + public void loadInBackground() { + if (log.isDebugEnabled()) { + log.debug(Thread.currentThread() + " scheduling font loading in background: " + fontURL); + } + this.execute(); + } + + @Override + protected Font doInBackground() throws MalformedURLException, FontFormatException, IOException { + if (log.isDebugEnabled()) { + log.debug(Thread.currentThread() + " loading font in background..."); + } + return Font.createFont(Font.TRUETYPE_FONT, fontURL.openStream()); + } + + /** + * waits for loadInBackground to finish + * @return the font loaded in loadInbackground + * @throws Exception + */ + @Override + public Font getFont() throws FontProviderException { + log.debug(Thread.currentThread() + " get font"); + try { + return get(); + } catch (InterruptedException ex) { + log.error("font loader interrupted"); +// Thread.currentThread().interrupt(); + throw new FontProviderException("font loader interrupted", ex); + } catch (ExecutionException ex) { + log.error("failed to load font", ex.getCause()); + throw new FontProviderException("failed to load font", ex.getCause()); + } + } +} diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 4a768f91..d1a0f6e2 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -15,20 +15,25 @@ limitations under the License. --> + + + MOCCA Applet + + -
- - - - - - - - - - -
+ + + + + + + + + + + + - \ No newline at end of file + -- cgit v1.2.3 From 5bb4d11327fcfe0fdc4234eeb02f4b09d108109e Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 9 Nov 2009 17:05:57 +0000 Subject: applet version BKUFonts .project git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@536 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 19 ++++++++++++ .../at/gv/egiz/bku/online/applet/BKUApplet.java | 35 +++++++++++++++++----- BKUApplet/src/test/resources/appletTest.html | 5 ++-- BKUApplet/src/test/resources/appletviewer.policy | 3 ++ 4 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 BKUApplet/src/test/resources/appletviewer.policy (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 4172517b..8f72b7d0 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -44,6 +44,22 @@
+ + org.codehaus.mojo + maven-buildnumber-plugin + + + validate + + create + + + + + false + false + + maven-jar-plugin org.apache.maven.plugins @@ -62,6 +78,9 @@ false true + + ${project.version}-r${buildNumber} + test-applet signer ./keystore.ks diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 7a15f7a5..2094e55c 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -22,12 +22,14 @@ import at.gv.egiz.bku.gui.DefaultHelpListener; import at.gv.egiz.bku.gui.AbstractHelpListener; import at.gv.egiz.bku.gui.SwitchFocusListener; import at.gv.egiz.stal.service.translator.STALTranslator; + +import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.jar.Attributes; +import java.util.jar.Manifest; import javax.net.ssl.HttpsURLConnection; import javax.swing.JApplet; import javax.swing.JPanel; @@ -79,14 +81,30 @@ public class BKUApplet extends JApplet { */ protected static final String TEST_SESSION_ID = "TestSession"; + public static final String VERSION; + public static final String UNKNOWN_VERSION = "UNKNOWN"; + static { - if (log.isTraceEnabled()) { - log.trace("enabling webservice communication dump"); - System.setProperty( - "com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", - "true"); + String tmp = UNKNOWN_VERSION; + try { + String BKUAppletJar = BKUApplet.class.getProtectionDomain().getCodeSource().getLocation().toString(); + URL manifestURL = new URL("jar:" + BKUAppletJar + "!/META-INF/MANIFEST.MF"); + if (log.isTraceEnabled()) { + log.trace("read version information from " + manifestURL); + } + Manifest manifest = new Manifest(manifestURL.openStream()); + Attributes atts = manifest.getMainAttributes(); + if (atts != null) { + tmp = atts.getValue("Implementation-Build"); + } + } catch (IOException ex) { + log.error("failed to read version", ex); + } finally { + VERSION = tmp; + log.debug("BKU Applet " + VERSION); } } + /** * STAL */ @@ -119,13 +137,14 @@ public class BKUApplet extends JApplet { "URL for locating help files, e.g. '../help/' (no help provided if missing)"}}; } + /** * Factory method to create and wire HelpListener, GUI and BKUWorker. * (Config via applet parameters, see BKUApplet.* constants) */ @Override public void init() { - log.info("Welcome to MOCCA"); + log.info("Welcome to MOCCA " + VERSION); log.trace("Called init()"); showStatus("Initializing MOCCA applet"); diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index d1a0f6e2..85834763 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -21,6 +21,7 @@ +

Run applet test with appletviewer -J-Djava.security.policy=appletviewer.policy appletTest.html

@@ -29,10 +30,10 @@ - + - + diff --git a/BKUApplet/src/test/resources/appletviewer.policy b/BKUApplet/src/test/resources/appletviewer.policy new file mode 100644 index 00000000..c26e27b7 --- /dev/null +++ b/BKUApplet/src/test/resources/appletviewer.policy @@ -0,0 +1,3 @@ +grant { + permission java.security.AllPermission; +}; \ No newline at end of file -- cgit v1.2.3 From caca721368d8c24559b1cd5ea2018884b4874f6b Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 10 Nov 2009 15:30:16 +0000 Subject: Removed switchFocusListener due to problem with viewer/help dialogs on Firefox/Mac git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@539 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 5 +---- .../java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 2094e55c..895fdbb5 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -187,9 +187,6 @@ public class BKUApplet extends JApplet { log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help"); } - SwitchFocusListener switchFocusListener = new SwitchFocusListener( - getAppletContext(), "focusToBrowser()"); - // Note: We need a panel in order to be able to set the background // properly. // Setting the background without a panel has side effects with the @@ -212,7 +209,7 @@ public class BKUApplet extends JApplet { URLFontLoader fontProvider = new URLFontLoader(getCodeBase()); fontProvider.loadInBackground(); BKUGUIFacade gui = createGUI(contentPanel, getLocale(), guiStyle, - backgroundImgURL, fontProvider, helpListener, switchFocusListener); + backgroundImgURL, fontProvider, helpListener, null); worker = createBKUWorker(this, gui); } catch (MalformedURLException ex) { diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java index f914aed7..49615887 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/viewer/URLFontLoader.java @@ -41,13 +41,13 @@ public class URLFontLoader extends SwingWorker implements FontProv public URLFontLoader(URL codebase) throws MalformedURLException { this.fontURL = new URL(codebase, SANSMONO_FONT_RESOURCE); if (log.isDebugEnabled()) { - log.debug(Thread.currentThread() + " setting font load URL: " + fontURL); + log.debug("[" + Thread.currentThread().getName() + "] setting font load URL: " + fontURL); } } public void loadInBackground() { if (log.isDebugEnabled()) { - log.debug(Thread.currentThread() + " scheduling font loading in background: " + fontURL); + log.debug("[" + Thread.currentThread().getName() + "] scheduling font loading in background: " + fontURL); } this.execute(); } @@ -55,7 +55,7 @@ public class URLFontLoader extends SwingWorker implements FontProv @Override protected Font doInBackground() throws MalformedURLException, FontFormatException, IOException { if (log.isDebugEnabled()) { - log.debug(Thread.currentThread() + " loading font in background..."); + log.debug("[" + Thread.currentThread().getName() + "] loading font in background..."); } return Font.createFont(Font.TRUETYPE_FONT, fontURL.openStream()); } @@ -67,7 +67,7 @@ public class URLFontLoader extends SwingWorker implements FontProv */ @Override public Font getFont() throws FontProviderException { - log.debug(Thread.currentThread() + " get font"); + log.debug("[" + Thread.currentThread().getName() + "] get font (EDT?)"); try { return get(); } catch (InterruptedException ex) { -- cgit v1.2.3 From 68651bf67987905980734f5c2199f337a232f427 Mon Sep 17 00:00:00 2001 From: mcentner Date: Thu, 12 Nov 2009 20:48:57 +0000 Subject: Added support for enforcing a PIN length in a CHANGE REFERENCE DATA to match the recommended PIN length via Applet parameter. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@541 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 895fdbb5..85612d6e 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -21,6 +21,7 @@ import at.gv.egiz.bku.gui.BKUGUIFacade.Style; import at.gv.egiz.bku.gui.DefaultHelpListener; import at.gv.egiz.bku.gui.AbstractHelpListener; import at.gv.egiz.bku.gui.SwitchFocusListener; +import at.gv.egiz.smcc.SignatureCardFactory; import at.gv.egiz.stal.service.translator.STALTranslator; import java.io.IOException; @@ -71,6 +72,7 @@ public class BKUApplet extends JApplet { public static final String REDIRECT_URL = "RedirectURL"; public static final String REDIRECT_TARGET = "RedirectTarget"; public static final String HASHDATA_DISPLAY_FRAME = "frame"; + public static final String ENFORCE_RECOMMENDED_PIN_LENGTH = "EnforceRecommendedPINLength"; /** * STAL WSDL namespace and service name */ @@ -157,6 +159,11 @@ public class BKUApplet extends JApplet { log.trace("default locale: " + Locale.getDefault()); log.debug("setting locale: " + getLocale()); + if (Boolean.parseBoolean(getParameter(ENFORCE_RECOMMENDED_PIN_LENGTH))) { + SignatureCardFactory.ENFORCE_RECOMMENDED_PIN_LENGTH = true; + log.debug("enforce recommended pin length = " + SignatureCardFactory.ENFORCE_RECOMMENDED_PIN_LENGTH); + } + BKUGUIFacade.Style guiStyle; String guiStyleParam = getParameter(GUI_STYLE); if ("advanced".equals(guiStyleParam)) { -- cgit v1.2.3 From b7dd29046e232e4d42623655efc28965cce942b8 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 13 Nov 2009 15:13:21 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@546 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/online/applet/AppletSecureViewer.java | 4 ++-- BKUApplet/src/test/resources/DejaVuLGCSansMono.ttf | Bin 0 -> 282704 bytes BKUApplet/src/test/resources/appletTest.html | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 BKUApplet/src/test/resources/DejaVuLGCSansMono.ttf (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java index 929cecb1..2e0cb331 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java @@ -185,13 +185,13 @@ public class AppletSecureViewer implements SecureViewer { throw new Exception("No hashdata input for reference " + signedRefId + " provided by service"); } if (log.isDebugEnabled()) { - log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")"); + log.debug("Digesting reference " + signedRefId + " (" + mimeType + ";" + encoding + ")"); } byte[] hashDataInputDigest = digest(hdi, signedDigestAlg); if (log.isDebugEnabled()) { - log.debug("Comparing digest values... "); + log.debug("Comparing digest to claimed digest value for reference " + signedRefId); } // log.warn("***************** DISABLED HASHDATA VERIFICATION"); if (!Arrays.equals(hashDataInputDigest, signedDigest)) { diff --git a/BKUApplet/src/test/resources/DejaVuLGCSansMono.ttf b/BKUApplet/src/test/resources/DejaVuLGCSansMono.ttf new file mode 100644 index 00000000..21647753 Binary files /dev/null and b/BKUApplet/src/test/resources/DejaVuLGCSansMono.ttf differ diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html index 85834763..22495a32 100644 --- a/BKUApplet/src/test/resources/appletTest.html +++ b/BKUApplet/src/test/resources/appletTest.html @@ -21,7 +21,7 @@ -

Run applet test with appletviewer -J-Djava.security.policy=appletviewer.policy appletTest.html

+

Run applet test with appletviewer (-J-d32) -J-Djava.security.policy=appletviewer.policy appletTest.html

@@ -30,8 +30,8 @@ - - + + -- cgit v1.2.3 From 04f0881563fdbecd8223627a7752e27690cc99c2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Fri, 13 Nov 2009 16:18:32 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.8 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@549 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 8f72b7d0..e8806dae 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.8-SNAPSHOT + 1.2.8 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.8-SNAPSHOT + 1.2.8 @@ -118,27 +118,27 @@ at.gv.egiz smcc - 1.2.8-SNAPSHOT + 1.2.8 at.gv.egiz STAL - 1.2.8-SNAPSHOT + 1.2.8 at.gv.egiz STALService - 1.2.8-SNAPSHOT + 1.2.8 at.gv.egiz smccSTAL - 1.2.8-SNAPSHOT + 1.2.8 at.gv.egiz BKUCommonGUI - 1.2.8-SNAPSHOT + 1.2.8 \ No newline at end of file -- cgit v1.2.3 From 8814f7675055585933d8dae365cf3a95906fac05 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 18 Nov 2009 17:04:48 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@551 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index e8806dae..0c6768aa 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.8 + 1.2.9-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.8 + 1.2.9-SNAPSHOT @@ -118,27 +118,27 @@ at.gv.egiz smcc - 1.2.8 + 1.2.9-SNAPSHOT at.gv.egiz STAL - 1.2.8 + 1.2.9-SNAPSHOT at.gv.egiz STALService - 1.2.8 + 1.2.9-SNAPSHOT at.gv.egiz smccSTAL - 1.2.8 + 1.2.9-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.8 + 1.2.9-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 5af9b75dccc1b52d1382fe0f2df30affd509f5b9 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 24 Nov 2009 18:48:00 +0000 Subject: Filenames derived from reference URI git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@553 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java index 2e0cb331..c67699af 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletSecureViewer.java @@ -180,6 +180,7 @@ public class AppletSecureViewer implements SecureViewer { byte[] hdi = hashDataInput.getValue(); String mimeType = hashDataInput.getMimeType(); String encoding = hashDataInput.getEncoding(); + String filename = hashDataInput.getFilename(); if (hdi == null) { throw new Exception("No hashdata input for reference " + signedRefId + " provided by service"); @@ -199,7 +200,7 @@ public class AppletSecureViewer implements SecureViewer { throw new DigestException("Bad digest value for reference " + signedRefId); } - verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding)); + verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding, filename)); } } -- cgit v1.2.3 From ceeaeb1790d1ed1ef9565f7c47e8bf247a83f28c Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 2 Dec 2009 09:19:40 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.9 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@558 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 0c6768aa..3bafd8c9 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.9-SNAPSHOT + 1.2.9 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.9-SNAPSHOT + 1.2.9 @@ -118,27 +118,27 @@ at.gv.egiz smcc - 1.2.9-SNAPSHOT + 1.2.9 at.gv.egiz STAL - 1.2.9-SNAPSHOT + 1.2.9 at.gv.egiz STALService - 1.2.9-SNAPSHOT + 1.2.9 at.gv.egiz smccSTAL - 1.2.9-SNAPSHOT + 1.2.9 at.gv.egiz BKUCommonGUI - 1.2.9-SNAPSHOT + 1.2.9 \ No newline at end of file -- cgit v1.2.3 From f03ce51929e344a92d04aeb4bba473ae47a913b2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 2 Dec 2009 09:23:50 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@560 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 3bafd8c9..402aea02 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.9 + 1.2.10-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.9 + 1.2.10-SNAPSHOT @@ -118,27 +118,27 @@ at.gv.egiz smcc - 1.2.9 + 1.2.10-SNAPSHOT at.gv.egiz STAL - 1.2.9 + 1.2.10-SNAPSHOT at.gv.egiz STALService - 1.2.9 + 1.2.10-SNAPSHOT at.gv.egiz smccSTAL - 1.2.9 + 1.2.10-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.9 + 1.2.10-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From dbffe94889d61a98733103b43ed30e53cdefd6ac Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 5 Jan 2010 12:18:12 +0000 Subject: [maven-release-plugin] prepare release mocca-1.2.10 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@567 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 402aea02..aaeb5907 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.10-SNAPSHOT + 1.2.10 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.10-SNAPSHOT + 1.2.10 @@ -118,27 +118,27 @@ at.gv.egiz smcc - 1.2.10-SNAPSHOT + 1.2.10 at.gv.egiz STAL - 1.2.10-SNAPSHOT + 1.2.10 at.gv.egiz STALService - 1.2.10-SNAPSHOT + 1.2.10 at.gv.egiz smccSTAL - 1.2.10-SNAPSHOT + 1.2.10 at.gv.egiz BKUCommonGUI - 1.2.10-SNAPSHOT + 1.2.10 \ No newline at end of file -- cgit v1.2.3 From 73065b1be0f839c09e8ca481a20f398167404ce4 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 5 Jan 2010 12:21:05 +0000 Subject: [maven-release-plugin] prepare for next development iteration git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@569 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index aaeb5907..199f8128 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.10 + 1.2.11-SNAPSHOT 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.10 + 1.2.11-SNAPSHOT @@ -118,27 +118,27 @@ at.gv.egiz smcc - 1.2.10 + 1.2.11-SNAPSHOT at.gv.egiz STAL - 1.2.10 + 1.2.11-SNAPSHOT at.gv.egiz STALService - 1.2.10 + 1.2.11-SNAPSHOT at.gv.egiz smccSTAL - 1.2.10 + 1.2.11-SNAPSHOT at.gv.egiz BKUCommonGUI - 1.2.10 + 1.2.11-SNAPSHOT \ No newline at end of file -- cgit v1.2.3 From 3eaf40f3d8d9393857c13d95a678f2b161b75613 Mon Sep 17 00:00:00 2001 From: clemenso Date: Mon, 18 Jan 2010 15:42:48 +0000 Subject: ignore case in guiStyle param git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@575 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 85612d6e..2fa4889a 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -166,9 +166,9 @@ public class BKUApplet extends JApplet { BKUGUIFacade.Style guiStyle; String guiStyleParam = getParameter(GUI_STYLE); - if ("advanced".equals(guiStyleParam)) { + if ("advanced".equalsIgnoreCase(guiStyleParam)) { guiStyle = BKUGUIFacade.Style.advanced; - } else if ("tiny".equals(guiStyleParam)) { + } else if ("tiny".equalsIgnoreCase(guiStyleParam)) { guiStyle = BKUGUIFacade.Style.tiny; } else { guiStyle = BKUGUIFacade.Style.simple; -- cgit v1.2.3 From 773a478924b43429f9a891a84a42b3d2e67a8d08 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 19 Jan 2010 15:49:22 +0000 Subject: DON'T make BKUCertificates a -SNAPSHOT version! applet log git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@585 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/src/main/resources/simplelog.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BKUApplet') diff --git a/BKUApplet/src/main/resources/simplelog.properties b/BKUApplet/src/main/resources/simplelog.properties index 51be76a8..d62508cf 100644 --- a/BKUApplet/src/main/resources/simplelog.properties +++ b/BKUApplet/src/main/resources/simplelog.properties @@ -15,7 +15,7 @@ # Logging detail level, # Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). -org.apache.commons.logging.simplelog.defaultlog=trace +org.apache.commons.logging.simplelog.defaultlog=debug # Logs the Log instance used org.apache.commons.logging.simplelog.showlogname=true #Logs the class name with package(or Path) -- cgit v1.2.3 From b2d6b1c93152bf94d25e992815d97d2322941de6 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 19 Jan 2010 16:07:11 +0000 Subject: [maven-release-plugin] copy for tag mocca-1.2.11 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/tags/mocca-1.2.11@587 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'BKUApplet') diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index 199f8128..35707336 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.2.11-SNAPSHOT + 1.2.11 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.2.11-SNAPSHOT + 1.2.11 @@ -118,27 +118,27 @@ at.gv.egiz smcc - 1.2.11-SNAPSHOT + 1.2.11 at.gv.egiz STAL - 1.2.11-SNAPSHOT + 1.2.11 at.gv.egiz STALService - 1.2.11-SNAPSHOT + 1.2.11 at.gv.egiz smccSTAL - 1.2.11-SNAPSHOT + 1.2.11 at.gv.egiz BKUCommonGUI - 1.2.11-SNAPSHOT + 1.2.11 \ No newline at end of file -- cgit v1.2.3