+# -------- 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. \
+
+
+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
+ }
+
+}
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
new file mode 100644
index 00000000..bd579c51
--- /dev/null
+++ b/BKUCommonGUI/pom.xml
@@ -0,0 +1,33 @@
+
+
+
+ bku
+ at.gv.egiz
+ 1.0-SNAPSHOT
+
+ 4.0.0
+ at.gv.egiz
+ BKUCommonGUI
+ BKU Common GUI
+ 1.0-SNAPSHOT
+
+
+
+ at.gv.egiz
+ smcc
+ 1.0-SNAPSHOT
+
+
+
+
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/java/META-INF/MANIFEST.MF b/BKUCommonGUI/src/main/java/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..5e949512
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
new file mode 100644
index 00000000..87b4eab4
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -0,0 +1,909 @@
+/*
+* 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.gui;
+
+import at.gv.egiz.smcc.PINSpec;
+import java.awt.Color;
+import java.awt.Container;
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.LayoutStyle;
+import javax.swing.SwingUtilities;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.PlainDocument;
+
+/**
+ *
+ * @author clemens
+ */
+public class BKUGUI implements BKUGUIFacade {
+
+ public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
+ public static final String LOGO_RESOURCE = "/images/logo.png";
+
+ public static final int MAIN_PANEL_WIDTH = 100;
+// public static final int MAIN_PANEL_HEIGHT = 20;
+ public static final int PREF_SIZE_PINFIELD = 118;
+ public static final Color ERROR_COLOR = Color.RED;
+ public static final Color HYPERLINK_COLOR = Color.BLUE;
+
+ private static final String TITLE_WELCOME = "title.welcome";
+ private static final String TITLE_INSERTCARD = "title.insertcard";
+ private static final String TITLE_CARD_NOT_SUPPORTED = "title.cardnotsupported";
+ private static final String TITLE_CARDPIN = "title.cardpin";
+ private static final String TITLE_SIGN = "title.sign";
+ private static final String TITLE_ERROR = "title.error";
+ private static final String TITLE_RETRY = "title.retry";
+ private static final String WINDOWTITLE_SAVE = "windowtitle.save";
+
+ private static final String MESSAGE_WAIT="message.wait";
+ private static final String MESSAGE_INSERTCARD="message.insertcard";
+ private static final String MESSAGE_HASHDATALINK="message.hashdatalink";
+ private static final String MESSAGE_RETRIES="message.retries";
+ private static final String LABEL_PIN="label.pin";
+ private static final String LABEL_PINSIZE="label.pinsize";
+// private static final String LABEL_CARDPINSIZE="label.cardpinsize";
+// private static final String LABEL_SIGNPIN="label.signpin";
+// private static final String LABEL_SIGNPINSIZE="label.signpinsize";
+ private static final String BUTTON_OK = "button.ok";
+ private static final String BUTTON_CANCEL = "button.cancel";
+ private static final String BUTTON_SIGN = "button.sign";
+
+ private static final String MIMETYPE_DESC_XML = "mimetype.desc.xml";
+ private static final String MIMETYPE_DESC_TXT = "mimetype.desc.txt";
+ private static final String MIMETYPE_DESC_PDF = "mimetype.desc.pdf";
+ private static final String MIMETYPE_DESC_BIN = "mimetype.desc.bin";
+ private static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
+
+ protected Container contentPane;
+ protected ResourceBundle messages;
+
+ /** left and right side main panels */
+ protected JPanel iconPanel;
+ protected JPanel contentPanel;
+ /** right side content panels and layouts */
+ protected JPanel headerPanel;
+ protected JPanel mainPanel;
+ protected JPanel buttonPanel;
+ /** right side fixed labels */
+ protected JLabel titleLabel;
+ /** remember the pinfield to return to worker */
+ protected JPasswordField pinField;
+
+ /**
+ * @param contentPane
+ * @param localeString may be null
+ */
+ @Override
+ public void init(final Container contentPane, String localeString) {
+
+ if (localeString != null) {
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, new Locale(localeString));
+ } else {
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
+ }
+
+ this.contentPane = contentPane;
+
+ try {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+
+ public void run() {
+
+ initIconPanel();
+ initContentPanel();
+
+ GroupLayout layout = new GroupLayout(contentPane);
+ contentPane.setLayout(layout);
+ layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(iconPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
+ layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(iconPanel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
+ }
+ });
+ } catch (Exception ex) {
+ throw new RuntimeException("Failed to init GUI: " + ex.getMessage());
+ }
+ }
+
+ protected void initIconPanel() {
+ iconPanel = new JPanel();
+ JLabel iconLabel = new JLabel();
+ iconLabel.setIcon(new ImageIcon(getClass().getResource(LOGO_RESOURCE))); // NOI18N
+
+ GroupLayout iconPanelLayout = new GroupLayout(iconPanel);
+ iconPanel.setLayout(iconPanelLayout);
+ iconPanelLayout.setHorizontalGroup(
+ iconPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(iconPanelLayout.createSequentialGroup().addContainerGap().addComponent(iconLabel).addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
+ iconPanelLayout.setVerticalGroup(
+ iconPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(iconPanelLayout.createSequentialGroup().addContainerGap().addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, 105, GroupLayout.PREFERRED_SIZE).addContainerGap(41, Short.MAX_VALUE)));
+ }
+
+ protected void initContentPanel() {
+
+ contentPanel = new JPanel();
+
+ headerPanel = new JPanel();
+ mainPanel = new JPanel();
+ buttonPanel = new JPanel();
+
+// headerPanel.setBorder(new TitledBorder("header"));
+// mainPanel.setBorder(new TitledBorder("main"));
+// buttonPanel.setBorder(new TitledBorder("button"));
+
+ titleLabel = new JLabel();
+ titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
+ java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
+// titleLabel.setForeground(defaultForground);
+
+ GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
+ headerPanel.setLayout(headerPanelLayout);
+
+ headerPanelLayout.setHorizontalGroup(
+ headerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(titleLabel, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE));
+ headerPanelLayout.setVerticalGroup(
+ headerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(titleLabel));
+
+// mainPanel.setPreferredSize(new Dimension(MAIN_PANEL_WIDTH, MAIN_PANEL_HEIGHT));
+
+ GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
+ contentPanel.setLayout(contentPanelLayout);
+ contentPanelLayout.setHorizontalGroup(
+ contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(contentPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(headerPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(mainPanel, GroupLayout.DEFAULT_SIZE, MAIN_PANEL_WIDTH, Short.MAX_VALUE)
+ .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));
+ contentPanelLayout.setVerticalGroup(
+ contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(contentPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(mainPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) //79, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addContainerGap()));
+ }
+
+ @Override
+ public void showLoginDialog(ActionListener loginListener, String actionCommand) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ titleLabel.setText(messages.getString(TITLE_ERROR));
+// titleLabel.setForeground(defaultForground);
+
+ JLabel waitMsgLabel = new JLabel();
+ waitMsgLabel.setFont(waitMsgLabel.getFont().deriveFont(waitMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ waitMsgLabel.setText("LoginDialog not supported yet.");
+ waitMsgLabel.setForeground(ERROR_COLOR);
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(waitMsgLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(waitMsgLabel));
+
+ contentPanel.validate();
+ }
+ });
+ }
+
+ @Override
+ public void showWelcomeDialog() {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ titleLabel.setText(messages.getString(TITLE_WELCOME));
+// titleLabel.setForeground(defaultForground);
+
+ JLabel waitMsgLabel = new JLabel();
+ waitMsgLabel.setFont(waitMsgLabel.getFont().deriveFont(waitMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ waitMsgLabel.setText(messages.getString(MESSAGE_WAIT));
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(waitMsgLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(waitMsgLabel));
+
+ contentPanel.validate();
+
+ }
+ });
+ }
+
+ @Override
+ public void showInsertCardDialog(final ActionListener cancelListener, final String cancelCommand) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ titleLabel.setText(messages.getString(TITLE_INSERTCARD));
+// titleLabel.setForeground(defaultForground);
+
+ JButton cancelButton = new JButton();
+ cancelButton.setFont(cancelButton.getFont());
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.addActionListener(cancelListener);
+ cancelButton.setActionCommand(cancelCommand);
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
+ .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(cancelButton)
+ .addContainerGap()));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(cancelButton));
+
+ contentPanel.validate();
+ }
+ });
+ }
+
+ @Override
+ public void showCardNotSupportedDialog(final ActionListener cancelListener, final String cancelCommand) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+// titleLabel.setForeground(defaultForground);
+
+ JButton cancelButton = new JButton();
+ cancelButton.setFont(cancelButton.getFont());
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.addActionListener(cancelListener);
+ cancelButton.setActionCommand(cancelCommand);
+
+ JLabel errorMsgLabel = new JLabel();
+ errorMsgLabel.setFont(errorMsgLabel.getFont().deriveFont(errorMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ errorMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel));
+
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
+ .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(cancelButton)
+ .addContainerGap()));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(cancelButton));
+
+ contentPanel.validate();
+ }
+ });
+ }
+
+ private void showCardPINDialog(final PINSpec pinSpec, final int numRetries, final ActionListener okListener, final String okCommand, final ActionListener cancelListener, final String cancelCommand) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ if (numRetries < 0) {
+ String cardpinTitle = messages.getString(TITLE_CARDPIN);
+ titleLabel.setText(MessageFormat.format(cardpinTitle, new Object[] {pinSpec.getLocalizedName()}));
+ } else {
+ titleLabel.setText(messages.getString(TITLE_RETRY));
+ }
+
+ JButton cancelButton = new JButton();
+ cancelButton.setFont(cancelButton.getFont());
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+
+ JButton okButton = new JButton();
+ okButton.setEnabled(false);
+ okButton.setFont(okButton.getFont());
+ okButton.setText(messages.getString(BUTTON_OK));
+ okButton.setActionCommand(okCommand);
+ okButton.addActionListener(okListener);
+
+ JLabel cardPinLabel = new JLabel();
+ cardPinLabel.setFont(cardPinLabel.getFont().deriveFont(cardPinLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ String pinLabel = messages.getString(LABEL_PIN);
+ cardPinLabel.setText(MessageFormat.format(pinLabel, new Object[] {pinSpec.getLocalizedName()}));
+
+// JPasswordField cardPINField = new JPasswordField();
+ pinField = new JPasswordField();
+ pinField.setText("");
+ pinField.setDocument(new PINDocument(pinSpec, okButton));
+ pinField.setActionCommand(okCommand);
+ pinField.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (pinField.getPassword().length >= pinSpec.getMinLength()) {
+ okListener.actionPerformed(e);
+ }
+ }
+ });
+
+ JLabel infoLabel = new JLabel();
+ if (numRetries < 0) {
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinSize = String.valueOf(pinSpec.getMinLength());
+ if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
+ pinSize += "-" + pinSpec.getMaxLength();
+ }
+ infoLabel.setText(MessageFormat.format(pinsizePattern, new Object[] {pinSize}));
+ } else {
+ infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[] {String.valueOf(numRetries)}));
+ infoLabel.setForeground(ERROR_COLOR);
+ }
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+// GroupLayout.ParallelGroup mainGroup = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+// mainGroup.addComponent(pinSizeLabel) //, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)
+// .addComponent(pinField, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup() // .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ // .addComponent(hashDataLabel)
+ // .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) //RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) //TRAILING)
+ .addComponent(infoLabel) //, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)
+ .addComponent(pinField, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)) //))
+ .addContainerGap()));
+
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addContainerGap() // .addComponent(hashDataLabel).addGap(14, 14, 14)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) //, false)
+ .addComponent(cardPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
+ .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(infoLabel).addGap(cardPinLabel.getFont().getSize()))); //10, 10, 10)));
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
+ .addContainerGap(15, Short.MAX_VALUE)
+ .addComponent(okButton)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelButton).addContainerGap()));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(okButton).addComponent(cancelButton)));
+
+ pinField.requestFocusInWindow();
+ contentPanel.validate();
+
+ }
+ });
+ }
+
+ @Override
+ public void showCardPINDialog(PINSpec pinSpec, ActionListener okListener, String okCommand, ActionListener cancelListener, String cancelCommand) {
+ showCardPINDialog(pinSpec, -1, okListener, okCommand, cancelListener, cancelCommand);
+ }
+
+ @Override
+ public void showCardPINRetryDialog(PINSpec pinSpec, int numRetries, ActionListener okListener, String okCommand, ActionListener cancelListener, String cancelCommand) {
+ showCardPINDialog(pinSpec, numRetries, okListener, okCommand, cancelListener, cancelCommand);
+ }
+
+ @Override
+ public void showSignaturePINDialog(PINSpec pinSpec, ActionListener signListener, String signCommand, ActionListener cancelListener, String cancelCommand, ActionListener hashdataListener, String hashdataCommand) {
+ showSignaturePINDialog(pinSpec, -1, signListener, signCommand, cancelListener, cancelCommand, hashdataListener, hashdataCommand);
+ }
+
+ @Override
+ public void showSignaturePINRetryDialog(PINSpec pinSpec, int numRetries, ActionListener okListener, String okCommand, ActionListener cancelListener, String cancelCommand, ActionListener hashdataListener, String hashdataCommand) {
+ showSignaturePINDialog(pinSpec, numRetries, okListener, okCommand, cancelListener, cancelCommand, hashdataListener, hashdataCommand);
+ }
+
+
+
+ private void showSignaturePINDialog(final PINSpec pinSpec, final int numRetries, final ActionListener signListener, final String signCommand, final ActionListener cancelListener, final String cancelCommand, final ActionListener hashdataListener, final String hashdataCommand) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ if (numRetries < 0) {
+ titleLabel.setText(messages.getString(TITLE_SIGN));
+ } else {
+ titleLabel.setText(messages.getString(TITLE_RETRY));
+ }
+
+ JButton cancelButton = new JButton();
+ cancelButton.setFont(cancelButton.getFont());
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+
+ JButton signButton = new JButton();
+ signButton.setEnabled(false);
+ signButton.setFont(signButton.getFont());
+ signButton.setText(messages.getString(BUTTON_SIGN));
+ signButton.setActionCommand(signCommand);
+ signButton.addActionListener(signListener);
+
+ JLabel signPinLabel = new JLabel();
+ signPinLabel.setFont(signPinLabel.getFont().deriveFont(signPinLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ String pinLabel = messages.getString(LABEL_PIN);
+ signPinLabel.setText(MessageFormat.format(pinLabel, new Object[] {pinSpec.getLocalizedName()}));
+
+ pinField = new JPasswordField();
+ pinField.setText("");
+ pinField.setDocument(new PINDocument(pinSpec, signButton));
+ pinField.setActionCommand(signCommand);
+ pinField.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (pinField.getPassword().length >= pinSpec.getMinLength()) {
+ signListener.actionPerformed(e);
+ }
+ }
+ });
+
+ //pinsize or error label
+ JLabel infoLabel = new JLabel();
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ if (numRetries < 0) {
+ String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinSize = String.valueOf(pinSpec.getMinLength());
+ if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
+ pinSize += "-" + pinSpec.getMaxLength();
+ }
+ infoLabel.setText(MessageFormat.format(pinsizePattern, new Object[] {pinSize}));
+ } else {
+ infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[] {String.valueOf(numRetries)}));
+ infoLabel.setForeground(ERROR_COLOR);
+ }
+
+ JLabel hashDataLabel = new JLabel();
+ hashDataLabel.setFont(hashDataLabel.getFont().deriveFont(hashDataLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ hashDataLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
+ hashDataLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ hashDataLabel.setForeground(HYPERLINK_COLOR);
+ hashDataLabel.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent me) {
+ ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
+ hashdataListener.actionPerformed(e);
+ }
+ });
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(hashDataLabel).addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup().addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(infoLabel) //, GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
+ .addComponent(pinField, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)))).addContainerGap()));
+
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addComponent(hashDataLabel).addGap(hashDataLabel.getFont().getSize()) //14, 14, 14)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE, false).addComponent(signPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
+ .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(infoLabel).addGap(signPinLabel.getFont().getSize()))); //10, 10, 10)));
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup().addContainerGap(15, Short.MAX_VALUE).addComponent(signButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(cancelButton).addContainerGap()));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(signButton).addComponent(cancelButton)));
+
+ pinField.requestFocusInWindow();
+ contentPanel.validate();
+
+ }
+
+// private ParallelGroup createMainGroup(GroupLayout mainPanelLayout, JLabel hashDataLabel, JLabel signPinLabel, JLabel pinSizeLabel, JLabel errorLabel) {
+// ParallelGroup mainGroup = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+// mainGroup.addComponent(hashDataLabel);
+// if (errorLabel != null) {
+// mainGroup.addComponent(errorLabel);
+// }
+// mainGroup.addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+// .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
+// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+// .addComponent(pinSizeLabel)
+// .addComponent(pinField, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)));
+// return mainGroup;
+// }
+
+// private GroupLayout.SequentialGroup createVerticalMainGroup(GroupLayout mainPanelLayout, JLabel hashDataLabel, JLabel signPinLabel, JLabel pinSizeLabel, JLabel errorLabel) {
+// GroupLayout.SequentialGroup mainGroup = mainPanelLayout.createSequentialGroup();
+// mainGroup.addComponent(hashDataLabel)
+// .addGap(hashDataLabel.getFont().getSize()); //14, 14, 14)
+//
+// if (errorLabel != null) {
+// mainGroup.addComponent(errorLabel)
+// .addGap(errorLabel.getFont().getSize());
+// }
+// mainGroup.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE, false)
+// .addComponent(signPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
+// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
+// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+// .addComponent(pinSizeLabel)
+// .addGap(signPinLabel.getFont().getSize());
+//
+// return mainGroup;
+//// mainPanelLayout.createSequentialGroup()
+//// .addComponent(hashDataLabel)
+//// .addGap(hashDataLabel.getFont().getSize()) //14, 14, 14)
+//// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE, false)
+//// .addComponent(signPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
+//// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
+//// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+//// .addComponent(pinSizeLabel)
+//// .addGap(signPinLabel.getFont().getSize())
+////
+////
+// }
+ });
+ }
+
+ @Override
+ public void showErrorDialog(final String errorMsg, final ActionListener okListener, final String okCommand) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ titleLabel.setText(messages.getString(TITLE_ERROR));
+// titleLabel.setForeground(defaultForground);
+
+ JLabel errorMsgLabel = new JLabel();
+ errorMsgLabel.setFont(errorMsgLabel.getFont().deriveFont(errorMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ errorMsgLabel.setText("" + errorMsg + "");
+ errorMsgLabel.setForeground(ERROR_COLOR);
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel));
+
+ JButton okButton = new JButton();
+ okButton.setFont(okButton.getFont());
+ okButton.setText(messages.getString(BUTTON_OK));
+ okButton.setActionCommand(okCommand);
+ okButton.addActionListener(okListener);
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
+ .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(okButton)
+ .addContainerGap()));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(okButton));
+
+ contentPanel.validate();
+ }
+ });
+ }
+
+ @Override
+ public void showErrorDialog(final String errorMsg) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ titleLabel.setText(messages.getString(TITLE_ERROR));
+// titleLabel.setForeground(defaultForground);
+
+ JLabel errorMsgLabel = new JLabel();
+ errorMsgLabel.setFont(errorMsgLabel.getFont().deriveFont(errorMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ errorMsgLabel.setText("" + errorMsg + "");
+ errorMsgLabel.setForeground(ERROR_COLOR);
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel));
+
+ contentPanel.validate();
+ }
+ });
+ }
+
+ @Override
+ public void showHashDataInputDialog(final List signedReferences, final ActionListener okListener, final String okCommand) {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+
+ if (signedReferences != null && signedReferences.size() == 1) {
+ FileOutputStream fos = null;
+ try {
+ HashDataInput signedRef = signedReferences.get(0);
+ final String mimeType = signedRef.getMimeType();
+ String dir = System.getProperty("user.home");
+ JFileChooser fileDialog = new JFileChooser(dir);
+ fileDialog.setFileSelectionMode(JFileChooser.FILES_ONLY);
+ fileDialog.setMultiSelectionEnabled(false);
+ fileDialog.setDialogTitle(messages.getString(WINDOWTITLE_SAVE));
+ fileDialog.setDialogType(JFileChooser.SAVE_DIALOG);
+ fileDialog.setFileHidingEnabled(true);
+ MimeFilter mimeFilter = new MimeFilter(mimeType);
+ fileDialog.setFileFilter(mimeFilter);
+ String filename = messages.getString(SAVE_HASHDATAINPUT_PREFIX) + mimeFilter.getExtension();
+ fileDialog.setSelectedFile(new File(dir, filename));
+ switch (fileDialog.showSaveDialog(contentPane)) {
+ case JFileChooser.APPROVE_OPTION:
+ File f = fileDialog.getSelectedFile();
+// if (f.exists()) {
+// //TODO
+// }
+
+ fos = new FileOutputStream(f);
+ BufferedOutputStream bos = new BufferedOutputStream(fos);
+ InputStream hdi = signedRef.getHashDataInput();
+ int b;
+ while ((b = hdi.read()) != -1) {
+ bos.write(b);
+ }
+ bos.flush();
+ bos.close();
+ }
+ } catch (IOException ex) {
+ showErrorDialog("Failed to write signed reference to file: " + ex.getMessage(), null, null);
+ ex.printStackTrace();
+ } finally {
+ try {
+ fos.close();
+ } catch (IOException ex) {}
+ }
+ } else {
+ mainPanel.removeAll();
+ buttonPanel.removeAll();
+
+ titleLabel.setText(messages.getString(TITLE_ERROR));
+ // titleLabel.setForeground(defaultForground);
+
+ JLabel errorMsgLabel = new JLabel();
+ errorMsgLabel.setFont(errorMsgLabel.getFont().deriveFont(errorMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ errorMsgLabel.setText("HashDataInputDialog not supported yet.");
+ errorMsgLabel.setForeground(ERROR_COLOR);
+
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorMsgLabel));
+
+ JButton okButton = new JButton();
+ okButton.setFont(okButton.getFont());
+ okButton.setText(messages.getString(BUTTON_OK));
+ okButton.setActionCommand(okCommand);
+ okButton.addActionListener(okListener);
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
+ .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(okButton)
+ .addContainerGap()));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(okButton));
+
+ contentPanel.validate();
+ }
+ }
+ });
+ }
+
+ @Override
+ public char[] getPin() {
+ if (pinField != null)
+ return pinField.getPassword();
+ return null;
+ }
+
+ class PINDocument extends PlainDocument {
+
+ private PINSpec pinSpec;
+ private Pattern pinPattern;
+ private JButton enterButton;
+
+ public PINDocument(PINSpec pinSpec, JButton enterButton) {
+ this.pinSpec = pinSpec;
+ if (pinSpec.getRexepPattern() != null) {
+ pinPattern = Pattern.compile(pinSpec.getRexepPattern());
+ } else {
+ pinPattern = Pattern.compile(".");
+ }
+ this.enterButton = enterButton;
+ }
+
+ @Override
+ public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
+ if (pinSpec.getMaxLength() >= (getLength() + str.length())) {
+ boolean matches = true;
+ for (int i = 0; i < str.length(); i++) {
+ Matcher m = pinPattern.matcher(str.substring(i, i+1));
+ if (!m.matches()) {
+ matches = false;
+ }
+ }
+ if (matches) {
+ super.insertString(offs, str, a);
+ }
+ }
+ enterButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ }
+
+ @Override
+ public void remove(int offs, int len) throws BadLocationException {
+ super.remove(offs, len);
+ enterButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ }
+ }
+
+ class MimeFilter extends FileFilter {
+
+ protected String mimeType;
+
+ public MimeFilter(String mimeType) {
+ this.mimeType = mimeType;
+ }
+
+ @Override
+ public boolean accept(File f) {
+
+ if (f.isDirectory()) {
+ return true;
+ } else if ("text/xml".equals(mimeType)) {
+ return "xml".equals(getExtension(f));
+ } else if ("text/plain".equals(mimeType)) {
+ return "txt".equals(getExtension(f));
+ } else if ("application/pdf".equals(mimeType)) {
+ return "pdf".equals(getExtension(f));
+ } else {
+ return "bin".equals(getExtension(f));
+ }
+ }
+
+ private String getExtension(File f) {
+ String ext = null;
+ String s = f.getName();
+ int i = s.lastIndexOf('.');
+
+ if (i > 0 && i < s.length() - 1) {
+ ext = s.substring(i+1).toLowerCase();
+ }
+ return ext;
+ }
+
+ @Override
+ public String getDescription() {
+ if ("text/xml".equals(mimeType)) {
+ return messages.getString(MIMETYPE_DESC_XML);
+ } else if ("text/plain".equals(mimeType)) {
+ return messages.getString(MIMETYPE_DESC_TXT);
+ } else if ("application/pdf".equals(mimeType)) {
+ return messages.getString(MIMETYPE_DESC_PDF);
+ } else {
+ return messages.getString(MIMETYPE_DESC_BIN);
+ }
+ }
+
+ public String getExtension() {
+ if ("text/xml".equals(mimeType)) {
+ return ".xml";
+ } else if ("text/plain".equals(mimeType)) {
+ return ".txt";
+ } else if ("application/pdf".equals(mimeType)) {
+ return ".pdf";
+ } else {
+ return ".bin";
+ }
+ }
+ }
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
new file mode 100644
index 00000000..3766e905
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -0,0 +1,66 @@
+/*
+* 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.gui;
+
+//import at.gv.egiz.smcc.PINSpec;
+import at.gv.egiz.smcc.PINSpec;
+import java.awt.Container;
+import java.awt.event.ActionListener;
+import java.util.List;
+import javax.swing.JPasswordField;
+
+/**
+ *
+ * @author clemens
+ */
+public interface BKUGUIFacade {
+
+ public void init(Container contentPane, String localeString);
+
+ public void showWelcomeDialog();
+
+ /**
+ * MOA-ID only
+ * @param loginListener
+ */
+ public void showLoginDialog(ActionListener loginListener, String actionCommand);
+
+ public void showInsertCardDialog(ActionListener cancelListener, String actionCommand);
+
+ public void showCardNotSupportedDialog(ActionListener cancelListener, String actionCommand);
+
+ public void showCardPINDialog(PINSpec pinSpec, ActionListener okListener, String okCommand, ActionListener cancelListener, String cancelCommand);
+
+ public void showCardPINRetryDialog(PINSpec pinSpec, int numRetries, ActionListener okListener, String okCommand, ActionListener cancelListener, String cancelCommand);
+
+ public void showSignaturePINDialog(PINSpec pinSpec, ActionListener signListener, String signCommand, ActionListener cancelListener, String cancelCommand, ActionListener hashdataListener, String hashdataCommand);
+
+ public void showSignaturePINRetryDialog(PINSpec pinSpec, int numRetries, ActionListener okListener, String okCommand, ActionListener cancelListener, String cancelCommand, ActionListener hashdataListener, String hashdataCommand);
+
+ public char[] getPin();
+
+ public void showHashDataInputDialog(List signedReferences, ActionListener okListener, String actionCommand);
+
+ public void showErrorDialog(String errorMsg, ActionListener okListener, String actionCommand);
+
+ public void showErrorDialog(String errorMsg);
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
new file mode 100644
index 00000000..478b949b
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
@@ -0,0 +1,32 @@
+/*
+* 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.gui;
+
+public class BKUGUIFactory {
+ private static BKUGUIFactory instance = new BKUGUIFactory();
+
+ private BKUGUIFactory() {
+ }
+
+ protected BKUGUIFacade createNewGUI() {
+ return new BKUGUI();
+ }
+
+ public static BKUGUIFacade createGUI() {
+ return instance.createNewGUI();
+ }
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataInput.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataInput.java
new file mode 100644
index 00000000..d916e81c
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataInput.java
@@ -0,0 +1,36 @@
+/*
+* 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.gui;
+
+import java.io.InputStream;
+
+/**
+ *
+ * @author clemens
+ */
+public interface HashDataInput {
+
+ public InputStream getHashDataInput();
+
+ public String getMimeType();
+
+}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
new file mode 100644
index 00000000..62c5a670
--- /dev/null
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -0,0 +1,39 @@
+# 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.
+title.welcome=Willkommen
+title.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
+title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
+title.cardpin={0} eingeben
+title.sign=Signatur erstellen
+title.error=Ein Fehler trat auf
+title.retry=Falscher PIN
+windowtitle.save=Signaturdaten speichern
+message.wait=Bitte warten...
+message.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken.
+message.hashdatalink=Signaturdaten anzeigen...
+message.retries=Noch {0} Versuche
+label.pin={0}:
+label.pinsize=({0} stellig)
+button.ok=OK
+button.cancel=Abbrechen
+button.sign=Signieren
+mimetype.desc.xml=XML-Dateien (*.xml)
+mimetype.desc.txt=Textdateien (*.txt)
+mimetype.desc.pdf=Adobe PDF-Dateien (*.pdf)
+mimetype.desc.bin=Bin\u00E4rdateien (*.bin)
+save.hashdatainput.prefix=Signaturdaten
diff --git a/BKUCommonGUI/src/main/resources/images/logo.png b/BKUCommonGUI/src/main/resources/images/logo.png
new file mode 100644
index 00000000..eee4be4f
Binary files /dev/null and b/BKUCommonGUI/src/main/resources/images/logo.png differ
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
new file mode 100644
index 00000000..4dc1f8b3
--- /dev/null
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
@@ -0,0 +1,53 @@
+/*
+* 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.gui;
+
+import javax.swing.JFrame;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+/**
+ *
+ * @author clemens
+ */
+public class BKUGUITest {
+
+ @Ignore
+ public void testBKUGUI() {
+ JFrame testFrame = new JFrame("BKUGUITest");
+ BKUGUI gui = new BKUGUI();
+ gui.init(testFrame.getContentPane(), null);
+ BKUGUIWorker worker = new BKUGUIWorker();
+ worker.init(gui);
+ testFrame.pack();
+ testFrame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ testFrame.setVisible(true);
+ new Thread(worker).start();
+
+ while(true) ;
+ }
+
+ @Test
+ public void dummyTest() {
+ }
+}
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
new file mode 100644
index 00000000..50771216
--- /dev/null
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -0,0 +1,136 @@
+/*
+* 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.gui;
+
+import at.gv.egiz.smcc.PINSpec;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Collections;
+
+/**
+ *
+ * @author clemens
+ */
+public class BKUGUIWorker implements Runnable {
+
+ BKUGUIFacade gui;
+
+ public void init(BKUGUIFacade gui) {
+ this.gui = gui;
+ }
+
+ @Override
+ public void run() {
+ try {
+
+ final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Signatur-PIN");
+
+
+ final ActionListener cancelListener = new ActionListener() {
+
+ public void actionPerformed(ActionEvent e) {
+ System.out.println("CANCEL EVENT OCCURED: " + e);
+ }
+ };
+ ActionListener okListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ System.out.println("OK EVENT OCCURED: " + e);
+ }
+ };
+ final ActionListener signListener = new ActionListener() {
+
+ public void actionPerformed(ActionEvent e) {
+ System.out.println("SIGN EVENT OCCURED: " + e);
+ }
+ };
+ ActionListener hashdataListener = new ActionListener() {
+
+ public void actionPerformed(ActionEvent e) {
+ System.out.println("HASHDATA EVENT OCCURED: " + e);
+ ActionListener returnListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", null, "hashdata");
+ }
+ };
+ HashDataInput signedRef = new HashDataInput() {
+
+ @Override
+ public InputStream getHashDataInput() {
+ return new ByteArrayInputStream("HashDataInput_002".getBytes());
+ }
+
+ @Override
+ public String getMimeType() {
+ return "text/xml";
+ }
+ };
+ gui.showHashDataInputDialog(Collections.singletonList(signedRef), returnListener, "return");
+ }
+ };
+
+
+
+// gui.showWelcomeDialog();
+//
+// Thread.sleep(2000);
+
+ gui.showInsertCardDialog(cancelListener, "cancel");
+
+ Thread.sleep(2000);
+
+ gui.showCardNotSupportedDialog(cancelListener, "cancel");
+
+ Thread.sleep(2000);
+
+// PINSpec cardPinSpec = new PINSpec(4, 4, "[0-9]", "Karten-PIN");
+//
+// gui.showCardPINDialog(cardPinSpec, okListener, "ok", cancelListener, "cancel");
+//
+// Thread.sleep(2000);
+//
+
+// gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
+//
+// Thread.sleep(2000);
+//
+// gui.showSignaturePINRetryDialog(signPinSpec, 2, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
+//
+// Thread.sleep(2000);
+////
+// gui.showErrorDialog("Testfehler occured", null, null);
+//
+// Thread.sleep(2000);
+//
+// gui.showErrorDialog("Testfehler occured");
+
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+ }
+}
diff --git a/BKULocal/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch b/BKULocal/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch
new file mode 100644
index 00000000..8ad2c6e2
--- /dev/null
+++ b/BKULocal/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
new file mode 100644
index 00000000..3f77752a
--- /dev/null
+++ b/BKULocal/pom.xml
@@ -0,0 +1,79 @@
+
+
+
+ bku
+ at.gv.egiz
+ 1.0-SNAPSHOT
+
+ 4.0.0
+ at.gv.egiz
+ BKULocal
+ war
+ BKU Local
+ 1.0-SNAPSHOT
+
+
+
+ at.gv.egiz
+ STAL
+ 1.0-SNAPSHOT
+
+
+ at.gv.egiz
+ bkucommon
+ 1.0-SNAPSHOT
+
+
+ at.gv.egiz
+ smcc
+ 1.0-SNAPSHOT
+
+
+ at.gv.egiz
+ smccSTAL
+ 1.0-SNAPSHOT
+
+
+ org.springframework
+ spring-core
+ 2.5.5
+
+
+ javax.servlet
+ servlet-api
+ 2.5
+ provided
+
+
+ org.springframework
+ spring-web
+ 2.5.5
+
+
+ commons-configuration
+ commons-configuration
+ 1.5
+
+
+ commons-logging
+ commons-logging
+
+
+ org.springframework
+ spring-support
+ 2.0.8
+
+
+ opensymphony
+ quartz
+ 1.5.0
+
+
+ org.springframework
+ spring-tx
+ 2.5.5
+
+
+
\ No newline at end of file
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/conf/ConfigurationUpdater.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/conf/ConfigurationUpdater.java
new file mode 100644
index 00000000..3214f4bc
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/conf/ConfigurationUpdater.java
@@ -0,0 +1,44 @@
+/*
+* 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.local.conf;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+
+public class ConfigurationUpdater extends QuartzJobBean {
+ private static Log log = LogFactory.getLog(ConfigurationUpdater.class);
+ private Configurator config;
+
+ @Override
+ protected void executeInternal(JobExecutionContext arg0)
+ throws JobExecutionException {
+ log.trace("Checking config update");
+ config.checkUpdate();
+ }
+
+ public Configurator getConfig() {
+ return config;
+ }
+
+ public void setConfig(Configurator config) {
+ this.config = config;
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/conf/Configurator.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/conf/Configurator.java
new file mode 100644
index 00000000..e9510101
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/conf/Configurator.java
@@ -0,0 +1,274 @@
+/*
+* 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.local.conf;
+
+import iaik.security.ecc.provider.ECCProvider;
+import iaik.xml.crypto.XSecProvider;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.security.KeyStore;
+import java.security.Provider;
+import java.security.Security;
+import java.security.cert.CertStore;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CollectionCertStoreParameters;
+import java.security.cert.PKIXBuilderParameters;
+import java.security.cert.X509CertSelector;
+import java.security.cert.X509Certificate;
+import java.util.Enumeration;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.net.ssl.CertPathTrustManagerParameters;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.ManagerFactoryParameters;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.slcommands.impl.xsect.STALProvider;
+import at.gv.egiz.smcc.SWCard;
+import at.gv.egiz.smcc.util.SMCCHelper;
+
+public class Configurator {
+ private Log log = LogFactory.getLog(Configurator.class);
+ private XMLConfiguration baseConfig;
+ private XMLConfiguration specialConfig;
+ private boolean autoSave = false;
+
+ public Configurator() {
+ super();
+ init();
+ configure();
+ }
+
+ private void init() {
+ log.debug("Initializing configuration");
+
+ baseConfig = new XMLConfiguration();
+ try {
+ baseConfig.load(getClass().getClassLoader().getResourceAsStream(
+ "./at/gv/egiz/bku/local/baseconfig.xml"));
+ log.debug("Successfully loaded base configuration");
+ } catch (ConfigurationException e) {
+ log.error("Cannot load base configuration", e);
+ }
+ autoSave = baseConfig.getBoolean("OverrideConfigurationFile[@autosave]");
+ try {
+ specialConfig = new XMLConfiguration();
+ specialConfig.setFileName(baseConfig
+ .getString("OverrideConfigurationFile"));
+ specialConfig.load();
+ } catch (Exception e) {
+ log.debug("Cannot get special configuration at: "
+ + baseConfig.getString("OverrideConfigurationFile") + ": " + e);
+ log.debug("Creating new special configuration");
+ try {
+ specialConfig = new XMLConfiguration(baseConfig);
+ specialConfig.setFileName(baseConfig
+ .getString("OverrideConfigurationFile"));
+ specialConfig.save();
+ } catch (ConfigurationException e1) {
+ log.error("Cannot load defaults " + e1);
+ }
+ }
+ specialConfig.setReloadingStrategy(new FileChangedReloadingStrategy());
+ specialConfig.setAutoSave(autoSave);
+ }
+
+ protected void configUrlConnections() {
+ HttpsURLConnection.setFollowRedirects(false);
+ HttpURLConnection.setFollowRedirects(false);
+ }
+
+ protected KeyStore loadKeyStore(String fileName, String type, String password) {
+ KeyStore ks = null;
+ try {
+ ks = KeyStore.getInstance(type);
+ InputStream is = new FileInputStream(fileName);
+ if (is == null) {
+ log.warn("Cannot load keystore from: " + fileName);
+ }
+ ks.load(is, password.toCharArray());
+ for (Enumeration alias = ks.aliases(); alias.hasMoreElements();) {
+ log.debug("Found keystore alias: " + alias.nextElement());
+ }
+ } catch (Exception e) {
+ log.error("Cannot config keystore", e);
+ return null;
+ }
+ return ks;
+ }
+
+ protected void configSSL() {
+ String trustStoreName = specialConfig.getString("SSL.trustStoreFile");
+ String trustStoreType = specialConfig.getString("SSL.trustStoreType");
+ String trustStorePass = specialConfig.getString("SSL.trustStorePass");
+ String certStoreDirectory = specialConfig
+ .getString("SSL.certStoreDirectory");
+ String keyStoreName = specialConfig.getString("SSL.keyStoreFile");
+ String keyStoreType = specialConfig.getString("SSL.keyStoreType");
+ String keyStorePass = specialConfig.getString("SSL.keyStorePass");
+
+ String caIncludeDir = specialConfig.getString("SSL.caIncludeDirectory");
+
+ KeyStore trustStore = loadKeyStore(trustStoreName, trustStoreType,
+ trustStorePass);
+ KeyStore keyStore = null;
+ if (keyStoreName != null) {
+ keyStore = loadKeyStore(keyStoreName, keyStoreType, keyStorePass);
+ }
+
+ try {
+ PKIXBuilderParameters pkixParams = new PKIXBuilderParameters(trustStore,
+ new X509CertSelector());
+
+ if (certStoreDirectory != null) {
+ File dir = new File(certStoreDirectory);
+ if (dir.isDirectory()) {
+ List certCollection = new LinkedList();
+ CertificateFactory cf = CertificateFactory.getInstance("X.509");
+ for (File f : dir.listFiles()) {
+ log.debug("adding " + f.getName());
+ certCollection.add((X509Certificate) cf
+ .generateCertificate(new FileInputStream(f)));
+ }
+ CollectionCertStoreParameters csp = new CollectionCertStoreParameters(
+ certCollection);
+ CertStore cs = CertStore.getInstance("Collection", csp);
+ pkixParams.addCertStore(cs);
+ log.debug("Added collection certstore");
+ } else {
+ log.error("CertstoreDirectory " + certStoreDirectory
+ + " is not a directory");
+ }
+ }
+
+ if (caIncludeDir != null) {
+ File dir = new File(caIncludeDir);
+ if (dir.exists() && dir.isDirectory()) {
+ CertificateFactory cf = CertificateFactory.getInstance("X.509");
+ try {
+ for (File f : dir.listFiles()) {
+ FileInputStream fis = new FileInputStream(f);
+ X509Certificate cert = (X509Certificate) cf
+ .generateCertificate(fis);
+ fis.close();
+ log.debug("Adding trusted cert " + cert.getSubjectDN());
+ trustStore.setCertificateEntry(cert.getSubjectDN().getName(),
+ cert);
+ f.delete();
+ }
+ } finally {
+ trustStore.store(new FileOutputStream(trustStoreName),
+ trustStorePass.toCharArray());
+ }
+ }
+ }
+
+ pkixParams.setRevocationEnabled(specialConfig
+ .getBoolean("SSL.revocation"));
+ if (specialConfig.getBoolean("SSL.revocation")) {
+ System.setProperty("com.sun.security.enableCRLDP ", "true");
+ Security.setProperty("ocsp.enable", "true");
+ }
+ System.setProperty("com.sun.security.enableAIAcaIssuers", "true");
+ log.debug("Setting revocation check to: "
+ + pkixParams.isRevocationEnabled());
+ ManagerFactoryParameters trustParams = new CertPathTrustManagerParameters(
+ pkixParams);
+ TrustManagerFactory trustFab = TrustManagerFactory.getInstance("PKIX");
+ trustFab.init(trustParams);
+
+ KeyManager[] km = null;
+ SSLContext sslCtx = SSLContext.getInstance(specialConfig
+ .getString("SSL.sslProtocol"));
+ if (keyStore != null) {
+ KeyManagerFactory keyFab = KeyManagerFactory.getInstance("SunX509");
+ keyFab.init(keyStore, keyStorePass.toCharArray());
+ km = keyFab.getKeyManagers();
+ }
+ sslCtx.init(km, trustFab.getTrustManagers(), null);
+ HttpsURLConnection.setDefaultSSLSocketFactory(sslCtx.getSocketFactory());
+ log.info("Successfully configured ssl");
+ } catch (Exception e) {
+ log.debug("Cannot init ssl", e);
+ }
+ }
+
+ protected void configureProviders() {
+ log.debug("Registering security providers");
+ ECCProvider.addAsProvider(false);
+ Security.addProvider(new STALProvider());
+ XSecProvider.addAsProvider(false);
+ StringBuffer sb = new StringBuffer();
+ sb.append("Following providers are now registered: ");
+ int i = 1;
+ for (Provider prov : Security.getProviders()) {
+ sb.append((i++) + ". : " + prov);
+ }
+ log.debug("Configured provider" + sb.toString());
+ }
+
+ protected void configureBKU() {
+ if (specialConfig.containsKey("BKU.useSWCard")) {
+ boolean useSWCard = specialConfig.getBoolean("BKU.useSWCard");
+ log.info("Setting SW Card to: "+useSWCard);
+ SMCCHelper.setUseSWCard(useSWCard);
+ }
+ if (specialConfig.containsKey("BKU.SWCardDirectory")) {
+ //SWCard.
+ }
+ }
+
+ public void configure() {
+ configureProviders();
+ configSSL();
+ configUrlConnections();
+ configureBKU();
+
+ }
+
+ public void checkUpdate() {
+ if (specialConfig.getReloadingStrategy().reloadingRequired()) {
+ log.info("Reloading configuration: " + specialConfig.getFileName());
+ specialConfig.setAutoSave(false);
+ specialConfig.clear();
+ try {
+ specialConfig.load();
+ } catch (ConfigurationException e) {
+ log.fatal(e);
+ }
+ specialConfig.setAutoSave(specialConfig
+ .getBoolean("OverrideConfigurationFile[@autosave]"));
+ configure();
+ specialConfig.getReloadingStrategy().reloadingPerformed();
+ }
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/PINDialog.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/PINDialog.java
new file mode 100644
index 00000000..5bc6bab5
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/PINDialog.java
@@ -0,0 +1,214 @@
+/*
+* 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.local.stal;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.swing.JButton;
+import javax.swing.JPasswordField;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.PlainDocument;
+
+import at.gv.egiz.smcc.PINSpec;
+
+public class PINDialog extends javax.swing.JDialog implements ActionListener {
+
+ // Variables declaration - do not modify
+ private javax.swing.JButton okButton;
+ private javax.swing.JButton cancelButton;
+ private javax.swing.JLabel label;
+ private javax.swing.JPasswordField password;
+ // End of variables declaration
+
+ private PINSpec pinSpec;
+ private String pinString;
+ private boolean finished = false;
+
+ class PinDocument extends PlainDocument {
+ private Pattern pattern;
+
+ public PinDocument() {
+ pattern = Pattern.compile(pinSpec.getRexepPattern());
+ }
+
+ public void insertString(int offs, String str, AttributeSet a)
+ throws BadLocationException {
+ if (pinSpec.getMaxLength() >= (getLength() + str.length())) {
+ Matcher matcher = pattern.matcher(str);
+ if (matcher.matches()) {
+ super.insertString(offs, str, a);
+ }
+ }
+ okButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ }
+
+ @Override
+ public void remove(int offs, int len) throws BadLocationException {
+ super.remove(offs, len);
+ okButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ }
+ }
+
+ public PINDialog() {
+ }
+
+ private synchronized void finished(boolean ok) {
+ if (ok) {
+ pinString = password.getText();
+ } else {
+ pinString = null;
+ }
+ finished = true;
+ notifyAll();
+ }
+
+ public synchronized void waitFinished() {
+ while (!finished) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public String getPIN() {
+ return pinString;
+ }
+
+ /** Creates new form NewJDialog */
+ public PINDialog(java.awt.Frame parent, boolean modal, PINSpec pinSpec,
+ int retries) {
+ super(parent, modal);
+ this.pinSpec = pinSpec;
+ initComponents();
+ }
+
+ private void initComponents() {
+ okButton = new javax.swing.JButton();
+ cancelButton = new javax.swing.JButton();
+ password = new javax.swing.JPasswordField();
+ label = new javax.swing.JLabel();
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ setTitle("PIN Dialog"); // NOI18N
+ setName("Form"); // NOI18N
+
+ okButton.setText("OK"); // NOI18N
+ okButton.setName("okButton"); // NOI18N
+ okButton.setEnabled(false);
+ okButton.addActionListener(this);
+
+ cancelButton.setText("Cancel"); // NOI18N
+ cancelButton.setName("cancelButton"); // NOI18N
+ cancelButton.addActionListener(this);
+
+ password.setText(""); // NOI18N
+ password.setName("password"); // NOI18N
+ password.addActionListener(this);
+ password.setDocument(new PinDocument());
+
+ label.setText("PIN: "); // NOI18N
+ label.setName("jLabel1"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
+ getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ layout.createSequentialGroup().addContainerGap().addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ layout.createSequentialGroup().addComponent(label,
+ javax.swing.GroupLayout.PREFERRED_SIZE, 61,
+ javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(
+ javax.swing.LayoutStyle.ComponentPlacement.RELATED,
+ javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(password,
+ javax.swing.GroupLayout.PREFERRED_SIZE, 127,
+ javax.swing.GroupLayout.PREFERRED_SIZE)).addGroup(
+ javax.swing.GroupLayout.Alignment.TRAILING,
+ layout.createSequentialGroup().addComponent(cancelButton)
+ .addPreferredGap(
+ javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(okButton))).addContainerGap()));
+ layout.setVerticalGroup(layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ layout.createSequentialGroup().addContainerGap().addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.BASELINE).addComponent(label,
+ javax.swing.GroupLayout.PREFERRED_SIZE, 33,
+ javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(password,
+ javax.swing.GroupLayout.PREFERRED_SIZE,
+ javax.swing.GroupLayout.DEFAULT_SIZE,
+ javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(
+ javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14,
+ Short.MAX_VALUE).addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.BASELINE).addComponent(
+ okButton).addComponent(cancelButton)).addContainerGap()));
+
+ pack();
+ }
+
+ /**
+ * @param args
+ * the command line arguments
+ */
+ public static void main(String args[]) {
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ PINDialog dialog = new PINDialog(new javax.swing.JFrame(), true,
+ new PINSpec(1, 5, "[0-9]*", "Hansi"), 10);
+ dialog.setResizable(false);
+ dialog.addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent e) {
+ System.exit(0);
+ }
+ });
+ dialog.setVisible(true);
+ }
+ });
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (e.getSource() instanceof JButton) {
+ JButton pressed = (JButton) e.getSource();
+ if (pressed.getName().equals("okButton")) {
+ finished(true);
+ } else if (pressed.getName().equals("cancelButton")) {
+ finished(false);
+ }
+ } else if (e.getSource() instanceof JPasswordField) {
+ JPasswordField pwf = (JPasswordField) e.getSource();
+ if (pwf.getName().equals("password")) {
+ if (password.getPassword().length >= pinSpec.getMinLength()) {
+ finished(true);
+ }
+ }
+ }
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/QuitRequestHandler.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/QuitRequestHandler.java
new file mode 100644
index 00000000..5596b7bb
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/QuitRequestHandler.java
@@ -0,0 +1,41 @@
+/*
+* 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.local.stal;
+
+import at.gv.egiz.bku.smccstal.AbstractRequestHandler;
+import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler;
+import at.gv.egiz.stal.STALRequest;
+import at.gv.egiz.stal.STALResponse;
+
+public class QuitRequestHandler extends AbstractRequestHandler {
+
+ @Override
+ public STALResponse handleRequest(STALRequest request) {
+ return null;
+ }
+
+ @Override
+ public boolean requireCard() {
+ return false;
+ }
+
+ @Override
+ public SMCCSTALRequestHandler newInstance() {
+ return this;
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTAL.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTAL.java
new file mode 100644
index 00000000..26ec2aa8
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTAL.java
@@ -0,0 +1,95 @@
+/*
+* 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.local.stal;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Locale;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.gui.BKUGUIFacade;
+import at.gv.egiz.bku.local.ui.TrayIconDialog;
+import at.gv.egiz.bku.smccstal.AbstractRequestHandler;
+import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL;
+import at.gv.egiz.bku.smccstal.STALMessageConsumer;
+import at.gv.egiz.smcc.PINProvider;
+import at.gv.egiz.smcc.util.SMCCHelper;
+import at.gv.egiz.stal.QuitRequest;
+
+public class SMCCSTAL extends AbstractSMCCSTAL implements STALMessageConsumer {
+ private static Log log = LogFactory.getLog(SMCCSTAL.class);
+
+ protected PINProvider pinProvider = new SwingPINProvider();
+ protected SwingInsertCardDialog insertCard = new SwingInsertCardDialog();
+ private boolean canceled = false;
+
+ static {
+ addRequestHandler(QuitRequest.class, new QuitRequestHandler());
+ }
+
+ public SMCCSTAL() {
+ AbstractRequestHandler.setMessageConsumer(this);
+ }
+
+ /**
+ *
+ * @return if the user canceled
+ */
+ protected boolean waitForCard() {
+ canceled = false;
+ while ((smccHelper.getResultCode() != SMCCHelper.CARD_FOUND) && (!canceled)) {
+ insertCard.setVisible(true);
+ insertCard.setAlwaysOnTop(true);
+ insertCard.addCanceledListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ canceled = true;
+ }
+ });
+ try {
+ smccHelper.update(1000);
+ } catch (Exception ex) {
+ log.info(ex);
+ }
+ }
+ insertCard.setVisible(false);
+ signatureCard = smccHelper.getSignatureCard(locale);
+ return canceled;
+ }
+
+ @Override
+ public void setLocale(Locale locale) {
+ super.setLocale(locale);
+ if (pinProvider instanceof SwingPINProvider) {
+ ((SwingPINProvider) pinProvider).setLocale(locale);
+ }
+ }
+
+ @Override
+ public void consumeNewSTALMessage(String captionId, String messageId) {
+ TrayIconDialog.getInstance().displayInfo(captionId, messageId);
+ }
+
+ @Override
+ protected BKUGUIFacade getGUI() {
+ // TODO Auto-generated method stub
+ //FIXME
+ return null;
+ }
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
new file mode 100644
index 00000000..014d884a
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -0,0 +1,27 @@
+/*
+* 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.local.stal;
+
+import at.gv.egiz.stal.STAL;
+import at.gv.egiz.stal.STALFactory;
+
+public class SMCCSTALFactory implements STALFactory {
+ @Override
+ public STAL createSTAL() {
+ return new SMCCSTAL();
+ }
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingInsertCardDialog.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingInsertCardDialog.java
new file mode 100644
index 00000000..eb76f2f2
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingInsertCardDialog.java
@@ -0,0 +1,147 @@
+/*
+* 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.local.stal;
+
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Toolkit;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.swing.ImageIcon;
+import javax.swing.JDialog;
+
+import at.gv.egiz.bku.utils.StreamUtil;
+
+public class SwingInsertCardDialog extends JDialog {
+
+ private javax.swing.JButton cancelButton;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private Locale locale = Locale.getDefault();
+
+ public SwingInsertCardDialog() {
+ super((java.awt.Frame) null, false);
+ initComponents();
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ private void initComponents() {
+ ResourceBundle rb = ResourceBundle.getBundle(
+ "at/gv/egiz/bku/local/Userdialog", locale);
+ setTitle(rb.getString("Insert.Header"));
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ cancelButton = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
+ setName("Form"); // NOI18N
+ setUndecorated(true);
+
+ jLabel1.setFont(new Font("Tahoma", Font.BOLD, 14));
+ jLabel1.setText(rb.getString("Insert.Text")); // NOI18N
+ jLabel1.setName("text"); // NOI18N
+
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ InputStream is = getClass().getClassLoader().getResourceAsStream(
+ "at/gv/egiz/bku/local/logo.png");
+ try {
+ StreamUtil.copyStream(is, os);
+ jLabel2.setIcon(new ImageIcon(os.toByteArray())); // NOI18N
+ } catch (IOException e) {
+ jLabel2.setText("Chipperling image missing"); // NOI18N
+ }
+ jLabel2.setName("jLabel2"); // NOI18N
+ cancelButton.setText(rb.getString("Insert.Button.Cancel")); // NOI18N
+ cancelButton.setName("jButton1"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
+ getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ layout.createSequentialGroup().addContainerGap().addComponent(jLabel2)
+ .addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.TRAILING).addGroup(
+ layout.createSequentialGroup().addGap(35, 35, 35)
+ .addComponent(jLabel1,
+ javax.swing.GroupLayout.DEFAULT_SIZE,
+ javax.swing.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)).addGroup(
+ layout.createSequentialGroup().addPreferredGap(
+ javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelButton))).addGap(29, 29, 29)));
+ layout.setVerticalGroup(layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ javax.swing.GroupLayout.Alignment.TRAILING,
+ layout.createSequentialGroup().addContainerGap().addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.TRAILING).addComponent(
+ jLabel2).addGroup(
+ layout.createSequentialGroup().addComponent(jLabel1,
+ javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
+ .addGap(35, 35, 35).addComponent(cancelButton).addGap(9, 9,
+ 9))).addContainerGap()));
+
+ Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+ Dimension frameSize = getSize();
+ if (frameSize.height > screenSize.height) {
+ frameSize.height = screenSize.height;
+ }
+ if (frameSize.width > screenSize.width) {
+ frameSize.width = screenSize.width;
+ }
+ setLocation((screenSize.width - frameSize.width) / 2,
+ (screenSize.height - frameSize.height) / 2);
+ setUndecorated(false);
+ pack();
+ }
+
+ public void addCanceledListener(ActionListener al) {
+ cancelButton.addActionListener(al);
+ }
+
+ /**
+ * @param args
+ * the command line arguments
+ */
+ public static void main(String args[]) {
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ SwingInsertCardDialog dialog = new SwingInsertCardDialog();
+ dialog.addWindowListener(new java.awt.event.WindowAdapter() {
+ public void windowClosing(java.awt.event.WindowEvent e) {
+ System.exit(0);
+ }
+ });
+ //
+ }
+ });
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingPINProvider.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingPINProvider.java
new file mode 100644
index 00000000..7d36e68e
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingPINProvider.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.local.stal;
+
+import java.util.Locale;
+
+import at.gv.egiz.smcc.PINProvider;
+import at.gv.egiz.smcc.PINSpec;
+
+public class SwingPINProvider implements PINProvider {
+
+ private Locale locale = Locale.getDefault();
+ SwingPinDialog dialog;
+
+ public SwingPINProvider() {
+ this.locale = Locale.getDefault();
+
+ }
+
+ public Locale getLocale() {
+ return locale;
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ @Override
+ public String providePIN(PINSpec pinSpec, int retries) {
+ dialog = new SwingPinDialog(null, false);
+ dialog.setResizable(false);
+ dialog.setRetries(retries);
+ dialog.setPinSpec(pinSpec);
+ dialog.initComponents();
+ dialog.setVisible(true);
+ dialog.requestFocus();
+ dialog.setAlwaysOnTop(true);
+ dialog.waitFinished();
+ dialog.dispose();
+ return dialog.getPIN();
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingPinDialog.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingPinDialog.java
new file mode 100644
index 00000000..3e91972c
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SwingPinDialog.java
@@ -0,0 +1,265 @@
+/*
+* 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.local.stal;
+
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPasswordField;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.PlainDocument;
+
+import at.gv.egiz.bku.utils.StreamUtil;
+import at.gv.egiz.smcc.PINSpec;
+
+public class SwingPinDialog extends javax.swing.JDialog implements
+ ActionListener {
+
+ private javax.swing.JButton okButton;
+ private javax.swing.JButton cancelButton;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JPasswordField password;
+
+ private PINSpec pinSpec;
+ private String pinString;
+ private boolean finished = false;
+ private int retries = -1;
+ private Locale locale = Locale.getDefault();
+ private boolean setUp = false;
+
+ class PinDocument extends PlainDocument {
+ private Pattern pattern;
+
+ public PinDocument() {
+ if ((pinSpec != null) && (pinSpec.getRexepPattern() != null)) {
+ pattern = Pattern.compile(pinSpec.getRexepPattern());
+ } else {
+ pattern = Pattern.compile(".");
+ }
+ }
+
+ public void insertString(int offs, String str, AttributeSet a)
+ throws BadLocationException {
+ if (pinSpec.getMaxLength() >= (getLength() + str.length())) {
+ Matcher matcher = pattern.matcher(str);
+ if (matcher.matches()) {
+ super.insertString(offs, str, a);
+ }
+ }
+ okButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ }
+
+ @Override
+ public void remove(int offs, int len) throws BadLocationException {
+ super.remove(offs, len);
+ okButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ }
+ }
+
+ /**
+ * Make sure to call initComponents
+ *
+ * @param parent
+ * @param modal
+ */
+ public SwingPinDialog(java.awt.Frame parent, boolean modal) {
+ super(parent, modal);
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ public void setPinSpec(PINSpec pinSpec) {
+ this.pinSpec = pinSpec;
+ }
+
+ public void setRetries(int retries) {
+ this.retries = retries;
+ }
+
+ public void initComponents() {
+ ResourceBundle rb = ResourceBundle.getBundle(
+ "at/gv/egiz/bku/local/Userdialog", locale);
+ okButton = new javax.swing.JButton();
+ cancelButton = new javax.swing.JButton();
+ password = new javax.swing.JPasswordField();
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+
+ setTitle(rb.getString("Pin.Header"));
+ setName("Form");
+ setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
+
+ okButton.setText(rb.getString("Pin.Button.OK"));
+ okButton.setName("okButton");
+ okButton.setEnabled(false);
+ okButton.addActionListener(this);
+
+ cancelButton.setText(rb.getString("Pin.Button.Cancel"));
+ cancelButton.setName("cancelButton");
+ cancelButton.addActionListener(this);
+
+ password.setText("");
+ password.setDocument(new PinDocument());
+ password.setName("password");
+ password.addActionListener(this);
+ password.setDocument(new PinDocument());
+ password.setRequestFocusEnabled(true);
+ password.requestFocus();
+
+ jLabel1.setFont(new Font("Tahoma", Font.BOLD, 14));
+ String text = null;
+ Object[] args;
+ if (retries > 0) {
+ text = rb.getString("Pin.Text.Retries");
+ args = new Object[2];
+ args[0] = pinSpec.getLocalizedName();
+ args[1] = new Integer(retries);
+ } else {
+ text = rb.getString("Pin.Text.NoRetries");
+ args = new Object[1];
+ args[0] = pinSpec.getLocalizedName();
+ }
+ text = MessageFormat.format(text, args);
+ jLabel1.setText(text); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ InputStream is = getClass().getClassLoader().getResourceAsStream(
+ "at/gv/egiz/bku/local/logo.png");
+ try {
+ StreamUtil.copyStream(is, os);
+ jLabel2.setIcon(new ImageIcon(os.toByteArray())); // NOI18N
+ } catch (Exception e) {
+ jLabel2.setText("Chipperling image missing"); // NOI18N
+ }
+ jLabel2.setName("jLabel2"); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
+ getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ layout.createSequentialGroup().addContainerGap().addComponent(jLabel2)
+ .addGap(73, 73, 73).addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addComponent(
+ jLabel1).addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(password,
+ javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(
+ javax.swing.GroupLayout.Alignment.LEADING,
+ layout.createSequentialGroup().addComponent(
+ cancelButton).addGap(18, 18, 18).addComponent(
+ okButton)))).addContainerGap(31,
+ Short.MAX_VALUE)));
+ layout.setVerticalGroup(layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ layout.createSequentialGroup().addContainerGap().addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jLabel2).addGroup(
+ layout.createSequentialGroup().addPreferredGap(
+ javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel1,
+ javax.swing.GroupLayout.PREFERRED_SIZE, 33,
+ javax.swing.GroupLayout.PREFERRED_SIZE).addGap(18,
+ 18, 18).addComponent(password,
+ javax.swing.GroupLayout.PREFERRED_SIZE,
+ javax.swing.GroupLayout.DEFAULT_SIZE,
+ javax.swing.GroupLayout.PREFERRED_SIZE).addGap(20,
+ 20, 20).addGroup(
+ layout.createParallelGroup(
+ javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(cancelButton).addComponent(
+ okButton)))).addGap(36, 36, 36)));
+ Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+ Dimension frameSize = getSize();
+ if (frameSize.height > screenSize.height) {
+ frameSize.height = screenSize.height;
+ }
+ if (frameSize.width > screenSize.width) {
+ frameSize.width = screenSize.width;
+ }
+ setLocation((screenSize.width - frameSize.width) / 2,
+ (screenSize.height - frameSize.height) / 2);
+ setUndecorated(false);
+ pack();
+ }
+
+ public String getPIN() {
+ return pinString;
+ }
+
+ private synchronized void finished(boolean ok) {
+ if (ok) {
+ pinString = password.getText();
+ } else {
+ pinString = null;
+ }
+ finished = true;
+ notifyAll();
+ }
+
+ public synchronized void waitFinished() {
+ while (!finished) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (e.getSource() instanceof JButton) {
+ JButton pressed = (JButton) e.getSource();
+ if (pressed.getName().equals("okButton")) {
+ finished(true);
+ } else if (pressed.getName().equals("cancelButton")) {
+ finished(false);
+ }
+ } else if (e.getSource() instanceof JPasswordField) {
+ JPasswordField pwf = (JPasswordField) e.getSource();
+ if (pwf.getName().equals("password")) {
+ if (password.getPassword().length >= pinSpec.getMinLength()) {
+ finished(true);
+ }
+ }
+ }
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java
new file mode 100644
index 00000000..8529949d
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java
@@ -0,0 +1,100 @@
+/*
+* 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.local.webapp;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.web.HttpRequestHandler;
+
+import at.gv.egiz.bku.binding.BindingProcessorManager;
+import at.gv.egiz.bku.binding.HTTPBindingProcessor;
+import at.gv.egiz.bku.binding.HttpUtil;
+import at.gv.egiz.bku.utils.StreamUtil;
+import at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage;
+
+public abstract class BKURequestHandler extends HttpServlet {
+
+ public final static String ENCODING = "UTF-8";
+
+ protected Log log = LogFactory.getLog(BKURequestHandler.class);
+
+ protected abstract BindingProcessorManager getBindingProcessorManager();
+
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, java.io.IOException {
+ log.debug("Got new request");
+ String lang = req.getHeader("Accept-Language");
+ Locale locale = AcceptLanguage.getLocale(lang);
+ log.debug("Using locale: "+locale);
+ HTTPBindingProcessor bindingProcessor;
+ if (req.isSecure()) {
+ bindingProcessor = (HTTPBindingProcessor) getBindingProcessorManager()
+ .createBindingProcessor("https", null, locale);
+ } else {
+ bindingProcessor = (HTTPBindingProcessor) getBindingProcessorManager()
+ .createBindingProcessor("http", null, locale);
+ }
+ Map headerMap = new HashMap();
+ for (Enumeration headerName = req.getHeaderNames(); headerName
+ .hasMoreElements();) {
+ String header = headerName.nextElement();
+ if (header != null) {
+ headerMap.put(header, req.getHeader(header));
+ }
+ }
+ headerMap.put(HttpUtil.HTTP_HEADER_CONTENT_TYPE, req.getContentType()+";"+req.getCharacterEncoding());
+ bindingProcessor.setHTTPHeaders(headerMap);
+ bindingProcessor.consumeRequestStream(req.getInputStream());
+
+ // fixxme just for testing
+ bindingProcessor.run();
+ if (bindingProcessor.getRedirectURL() != null) {
+ resp.sendRedirect(bindingProcessor.getRedirectURL());
+ return;
+ }
+ resp.setStatus(bindingProcessor.getResponseCode());
+ for (Iterator it = bindingProcessor.getResponseHeaders().keySet()
+ .iterator(); it.hasNext();) {
+ String header = it.next();
+ resp.setHeader(header, bindingProcessor.getResponseHeaders().get(header));
+ }
+ resp.setContentType(bindingProcessor.getResultContentType());
+ resp.setCharacterEncoding(ENCODING);
+ bindingProcessor.writeResultTo(resp.getOutputStream(), ENCODING);
+ req.getInputStream().close();
+ resp.getOutputStream().flush();
+ resp.getOutputStream().close();
+ log.debug("Finished Request");
+ }
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, java.io.IOException {
+ doPost(req, resp);
+ }
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/SpringBKUServlet.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/SpringBKUServlet.java
new file mode 100644
index 00000000..c573e52f
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/SpringBKUServlet.java
@@ -0,0 +1,30 @@
+/*
+* 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.local.webapp;
+
+import at.gv.egiz.bku.binding.BindingProcessorManager;
+
+public class SpringBKUServlet extends BKURequestHandler {
+
+ public final static String BEAN_NAME="bindingProcessorManager";
+
+ @Override
+ protected BindingProcessorManager getBindingProcessorManager() {
+ return (BindingProcessorManager) getServletContext().getAttribute(BEAN_NAME);
+ }
+
+}
diff --git a/BKULocal/src/main/resources/at/gv/egiz/bku/local/Userdialog.properties b/BKULocal/src/main/resources/at/gv/egiz/bku/local/Userdialog.properties
new file mode 100644
index 00000000..9db6f100
--- /dev/null
+++ b/BKULocal/src/main/resources/at/gv/egiz/bku/local/Userdialog.properties
@@ -0,0 +1,27 @@
+# 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.
+
+#------- Insert Card Dialog -------#
+Insert.Header = Citizen Card Required
+Insert.Button.Cancel = Cancel
+Insert.Text = Please insert your Citizen Card!
+
+
+#------- PIN Dialog -------#
+Pin.Header = Please Enter PIN
+Pin.Button.OK = OK
+Pin.Button.Cancel = Cancel
+Pin.Text.Retries = Please enter {0}.
{1} retries left.
+Pin.Text.NoRetries = Please enter {0}.
\ No newline at end of file
diff --git a/BKULocal/src/main/resources/at/gv/egiz/bku/local/baseconfig.xml b/BKULocal/src/main/resources/at/gv/egiz/bku/local/baseconfig.xml
new file mode 100644
index 00000000..792bbccc
--- /dev/null
+++ b/BKULocal/src/main/resources/at/gv/egiz/bku/local/baseconfig.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+ ${sys:user.home}/.bku/conf/bkuconfig.xml
+
+
+ true
+ TLS
+
+
+
+
\ No newline at end of file
diff --git a/BKULocal/src/main/resources/at/gv/egiz/bku/local/logo.png b/BKULocal/src/main/resources/at/gv/egiz/bku/local/logo.png
new file mode 100644
index 00000000..eee4be4f
Binary files /dev/null and b/BKULocal/src/main/resources/at/gv/egiz/bku/local/logo.png differ
diff --git a/BKULocal/src/main/resources/at/gv/egiz/bku/local/truststore.jks b/BKULocal/src/main/resources/at/gv/egiz/bku/local/truststore.jks
new file mode 100644
index 00000000..c773f037
Binary files /dev/null and b/BKULocal/src/main/resources/at/gv/egiz/bku/local/truststore.jks differ
diff --git a/BKULocal/src/main/resources/log4j.properties b/BKULocal/src/main/resources/log4j.properties
new file mode 100644
index 00000000..49d763f8
--- /dev/null
+++ b/BKULocal/src/main/resources/log4j.properties
@@ -0,0 +1,31 @@
+# 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.
+
+# loglever DEBUG, appender STDOUT
+log4j.rootLogger=TRACE, STDOUT, file
+
+# STDOUT appender
+log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
+log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
+#log4j.appender.STDOUT.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n
+#log4j.appender.STDOUT.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+log4j.appender.STDOUT.layout.ConversionPattern=%-5p |%d | %t | %c %x- %m%n
+
+### FILE appender
+log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.file.datePattern='.'yyyy-MM-dd
+log4j.appender.file.File=${user.home}/.bku/logs/bku.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
\ No newline at end of file
diff --git a/BKULocal/src/main/webapp/META-INF/MANIFEST.MF b/BKULocal/src/main/webapp/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..5e949512
--- /dev/null
+++ b/BKULocal/src/main/webapp/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/BKULocal/src/main/webapp/WEB-INF/applicationContext.xml b/BKULocal/src/main/webapp/WEB-INF/applicationContext.xml
new file mode 100644
index 00000000..c0ffc927
--- /dev/null
+++ b/BKULocal/src/main/webapp/WEB-INF/applicationContext.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
\ No newline at end of file
diff --git a/BKULocal/src/main/webapp/WEB-INF/web.xml b/BKULocal/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 00000000..64f9a581
--- /dev/null
+++ b/BKULocal/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,57 @@
+
+
+
+
+ http-security-layer-request
+
+
+
+ contextConfigLocation
+ /WEB-INF/applicationContext.xml
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+
+
+
+ BKUServlet
+ at.gv.egiz.bku.local.webapp.SpringBKUServlet
+
+
+ BKUServlet
+ /http-security-layer-request
+
+
+ BKUServlet
+ /https-security-layer-request
+
+
+
+
+ index.html
+ index.htm
+ index.jsp
+ default.html
+ default.htm
+ default.jsp
+
+
\ No newline at end of file
diff --git a/BKULocal/src/test/java/ConfigTest.java b/BKULocal/src/test/java/ConfigTest.java
new file mode 100644
index 00000000..558d1c47
--- /dev/null
+++ b/BKULocal/src/test/java/ConfigTest.java
@@ -0,0 +1,49 @@
+/*
+* 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.
+*/
+import java.net.URL;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.ConfigurationFactory;
+import org.junit.Ignore;
+
+@Ignore
+public class ConfigTest {
+
+
+ private void testConfig() throws ConfigurationException {
+ ConfigurationFactory factory = new ConfigurationFactory();
+ URL configURL = getClass().getResource("/config.xml");
+ factory.setConfigurationURL(configURL);
+ Configuration config = factory.getConfiguration();
+ System.out.println("-------->: "+config.getInt("hans"));
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ ConfigTest ct = new ConfigTest();
+ try {
+ ct.testConfig();
+ } catch (ConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/BKULocal/src/test/java/JustASandbox.java b/BKULocal/src/test/java/JustASandbox.java
new file mode 100644
index 00000000..b151df92
--- /dev/null
+++ b/BKULocal/src/test/java/JustASandbox.java
@@ -0,0 +1,78 @@
+/*
+* 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.
+*/
+import java.io.ByteArrayOutputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.net.ssl.HttpsURLConnection;
+
+import org.junit.Ignore;
+
+import at.gv.egiz.bku.local.conf.Configurator;
+import at.gv.egiz.bku.local.stal.SMCCSTALFactory;
+import at.gv.egiz.bku.utils.StreamUtil;
+import at.gv.egiz.stal.InfoboxReadRequest;
+import at.gv.egiz.stal.STAL;
+import at.gv.egiz.stal.STALRequest;
+import at.gv.egiz.stal.STALResponse;
+import at.gv.egiz.stal.SignRequest;
+import at.gv.egiz.stal.SignResponse;
+
+@Ignore
+public class JustASandbox {
+
+ /**
+ * @param args
+ * @throws IOException
+ */
+ public static void main(String[] args) throws IOException {
+
+ Configurator cfg = new Configurator();
+ URL url = new URL("https://demo.egiz.gv.at");
+ HttpsURLConnection uc = (HttpsURLConnection) url.openConnection();
+ uc.connect();
+ System.exit(-1);
+
+ InfoboxReadRequest req = new InfoboxReadRequest();
+ req.setInfoboxIdentifier("SecureSignatureKeypair");
+
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ InputStream is = JustASandbox.class.getClassLoader().getResourceAsStream("at/gv/egiz/bku/local/stal/sigInfo.xml");
+ StreamUtil.copyStream(is, os);
+ SignRequest sr = new SignRequest();
+ sr.setSignedInfo(os.toByteArray());
+ sr.setKeyIdentifier("SecureSignatureKeypair"); //os.toByteArray(), "SecureSignatureKeypair", null);
+ STAL stal = (new SMCCSTALFactory()).createSTAL();
+
+ List reqList = new ArrayList(2);
+ reqList.add(req);
+ reqList.add(sr);
+
+ List resp = stal.handleRequest(reqList);
+ System.out.println(resp.get(0));
+ System.out.println(resp.get(1));
+ FileOutputStream fos = new FileOutputStream("c:/tmp/seq_now.der");
+ SignResponse sir = (SignResponse) resp.get(1);
+ fos.write(sir.getSignatureValue());
+ fos.close();
+ }
+
+}
diff --git a/BKULocal/src/test/java/at/gv/egiz/bku/local/stal/TestSignRequest.java b/BKULocal/src/test/java/at/gv/egiz/bku/local/stal/TestSignRequest.java
new file mode 100644
index 00000000..51e7ff7d
--- /dev/null
+++ b/BKULocal/src/test/java/at/gv/egiz/bku/local/stal/TestSignRequest.java
@@ -0,0 +1,55 @@
+/*
+* 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.local.stal;
+
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Ignore;
+
+import at.gv.egiz.bku.utils.StreamUtil;
+import at.gv.egiz.smcc.SignatureCard;
+import at.gv.egiz.stal.STALRequest;
+import at.gv.egiz.stal.SignRequest;
+
+@Ignore
+public class TestSignRequest {
+
+ public void test() throws Exception {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ StreamUtil.copyStream(getClass().getClassLoader().getResourceAsStream("at/gv/egiz/bku/local/stal/sigInfo.xml"), os);
+ byte[] signedInfo = os.toByteArray();
+ SignRequest sr = new SignRequest();
+ sr.setSignedInfo(signedInfo);
+ sr.setKeyIdentifier(SignatureCard.KeyboxName.SECURE_SIGNATURE_KEYPAIR.getKeyboxName());
+ List reqList = new ArrayList(1);
+ reqList.add(sr);
+ System.out.println((new SMCCSTALFactory()).createSTAL().handleRequest(reqList));
+ }
+
+ public static void main(String[] args) {
+ TestSignRequest tsr = new TestSignRequest();
+ try {
+ tsr.test();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/BKULocal/src/test/resources/at/gv/egiz/bku/local/stal/sigInfo.xml b/BKULocal/src/test/resources/at/gv/egiz/bku/local/stal/sigInfo.xml
new file mode 100644
index 00000000..623a78bc
--- /dev/null
+++ b/BKULocal/src/test/resources/at/gv/egiz/bku/local/stal/sigInfo.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Absender/in
+
+
Vorname
+
+
+
+
+
Familienname
+
+
+
+
+
+
Geburtsdatum
+
+
+
+
+
Geburtsort
+
+
+
+
+
E-Mail zur Kontaktaufnahme
+
+
+
+
+
Dieser Antrag ergeht an:
+
+
Adressat
+
+
+
+
+
Hauptwohnsitz des Antragsstellers (laut ZMR):
+
+
Strasse
+
+
+
+
+
Hausnummer
+
+
+
+ /
+
+ /
+
+
+
Postleitzahl
+
+
+
+
+
Ort
+
+
+
+
+
Staat
+
+
+
GPYZB80vaYfGObhjlfu4lLLpAHs=8DWtjO0ki1U/lxn+Y34We6GsfxU=
\ No newline at end of file
diff --git a/BKUOnline/catalog.xml b/BKUOnline/catalog.xml
new file mode 100644
index 00000000..38c98894
--- /dev/null
+++ b/BKUOnline/catalog.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/BKUOnline/nb-configuration.xml b/BKUOnline/nb-configuration.xml
new file mode 100644
index 00000000..4bfb3c58
--- /dev/null
+++ b/BKUOnline/nb-configuration.xml
@@ -0,0 +1,15 @@
+
+
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+
+
+
+
+ src/main/webapp/WEB-INF/applicationContext.xml
+
+
+
+
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
new file mode 100644
index 00000000..dacdbaf5
--- /dev/null
+++ b/BKUOnline/pom.xml
@@ -0,0 +1,120 @@
+
+
+
+ bku
+ at.gv.egiz
+ 1.0-SNAPSHOT
+
+ 4.0.0
+ at.gv.egiz
+ BKUOnline
+ war
+ BKU Online
+ 1.0-SNAPSHOT
+
+
+ at.gv.egiz
+ bkucommon
+ 1.0-SNAPSHOT
+
+
+ commons-logging
+ commons-logging
+
+
+ org.springframework
+ spring-core
+ 2.5.5
+
+
+ javax.servlet
+ servlet-api
+ 2.5
+ provided
+
+
+ org.springframework
+ spring-web
+ 2.5.5
+
+
+ at.gv.egiz
+ STALService
+ 1.0-SNAPSHOT
+ compile
+
+
+
+ com.sun.xml.ws
+
+ jaxws-rt
+ 2.1.4
+
+
+
+
+ Tomcat60
+
+
+
+
+ maven-dependency-plugin
+
+
+ copyapplet
+
+ copy
+
+
+
+
+ at.gv.egiz
+ BKUApplet
+ 1.0-SNAPSHOT
+
+
+ commons-logging
+ commons-logging
+
+
+ ${project.build.directory}/${project.build.finalName}/applet
+
+
+
+
+
+
+
+
diff --git a/BKUOnline/private/cache/retriever/catalog.xml b/BKUOnline/private/cache/retriever/catalog.xml
new file mode 100644
index 00000000..c40b0d50
--- /dev/null
+++ b/BKUOnline/private/cache/retriever/catalog.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BKUOnline/private/cache/retriever/java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd b/BKUOnline/private/cache/retriever/java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
new file mode 100644
index 00000000..f9a884c0
--- /dev/null
+++ b/BKUOnline/private/cache/retriever/java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
@@ -0,0 +1,362 @@
+
+
+
+ Schema for JAXB 2.0 binding declarations.
+
+
+
+Model group that represents a binding declaration. Each new binding
+declaration added to the jaxb namespace that is not restricted to
+globalBindings should be added as a child element to this model group.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Used to specify the version of the binding schema on the schema element for
+inline annotations or jaxb:bindings for external binding.
+
+
+
+
+Attributes used for property customization. The attribute group can be
+referenced either from the globalBindings declaration or from the
+property declaration. The following defaults are defined by the JAXB
+specification in global scope only. Thus they apply when the
+propertyAttributes group is referenced from the globalBindings declaration
+but not when referenced from the property declaration.
+ collectionType a class that implements java.util.List.
+ fixedAttributeAsConstantProperty false
+ enableFailFastCheck false
+ generateIsSetMethod false
+ optionalProperty wrapper
+ generateElementProperty false
+ attachmentRef default
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Customize XMLNames to Java id mapping
+
+
+
+
+
+
+
+
+
+ Customization values defined in global scope.
+
+
+
+
+
+ allows extension binding declarations to be specified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Customization values with schema scope
+
+
+
+
+
+
+
+
+ Customize interface and implementation class.
+
+
+
+
+
+ Java class name without package prefix.
+
+
+ Implementation class name including package prefix.
+
+
+ Default value derived from [jaxb:globalBindings]@generateValueClass.
+
+
+
+
+ Customize property.
+
+
+
+
+
+
+
+
+
+
+ Data type conversions; overriding builtins
+
+
+ name of the java type to which xml type is to be bound.
+
+
+ xml type to which java datatype has to be bound.Must be present when javaType is scoped to globalBindings
+
+
+
+
+
+If true, the parsMethod and printMethod must reference a method
+signtature that has a second parameter of type NamespaceContext.
+
+
+
+
+
+ Bind to a type safe enumeration class.
+
+
+
+
+
+
+
+
+
+
+ Enumeration member name in a type safe enumeration class.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+The name attribute for [baseType] enables more precise control over the actual base type for a JAXB property. This customization enables specifying a more general base type than the property's default base type. The name attribute value must be a fully qualified Java class name. Additionally, this Java class must be a super interface/class of the default Java base type for the property. When the default base type is a primitive type, consider the default Java base type to be the Java wrapper class of that primitive type.This customization is useful to enable simple type substitution for a JAXB property representing with too restrictive of a default base type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Treate underscore in XML Name to Java identifier mapping.
+
+
+
+
+
+
+
+XML types or types derived from them which have enumeration facet(s) which are be mapped to typesafeEnumClass by default. The following types cannot be specified in this list: "xsd:QName", "xsd:base64Binary", "xsd:hexBinary", "xsd:date", "xsd:time", "xsd:dateTime", "xsd:duration","xsd:gDay", "xsd:gMonth", "xsd:Year", "xsd:gMonthDay", "xsd:YearMonth", "xsd:ID", "xsd:IDREF", "xsd:NOTATION"
+
+
+
+
+ Used to customize how to handle name collisions.
+
+
+
+
+
+
+
+ Placeholder type to indicate Legal Java identifier.
+
+
+
+ Rule to transform an Xml name into another Xml name
+
+ prepend the string to QName.
+
+
+ Append the string to QName.
+
+
+
+ Allows transforming an xml name into another xml name. Use case UDDI 2.0 schema.
+
+
+ Mapping rule for type definitions.
+
+
+ Mapping rule for elements
+
+
+ Mapping rule for model group
+
+
+ Mapping rule for class names generated for an anonymous type.
+
+
+
+
+
+A binding compiler only processes this attribute when it occurs on an
+an instance of xs:schema element. The value of this attribute is a
+whitespace-separated list of namespace prefixes. The namespace bound
+to each of the prefixes is designated as a customization declaration
+namespace.
+
+
+
+
+
+
+Binding declaration(s) for a remote schema.
+If attribute node is set, the binding declaraions
+are associated with part of the remote schema
+designated by schemaLocation attribute. The node
+attribute identifies the node in the remote schema
+to associate the binding declaration(s) with.
+
+
+
+
+
+
+
+
+
+
+
+Location of the remote schema to associate binding declarations with.
+
+
+
+
+The value of the string is an XPATH 1.0 compliant string that
+resolves to a node in a remote schema to associate
+binding declarations with. The remote schema is specified
+by the schemaLocation attribute occuring in the current
+element or in a parent of this element.
+
+
+
+
+Used to indicate the version of binding declarations. Only valid on root level bindings element. Either this or "jaxb:version" attribute but not both may be specified.
+
+
+
+
+Used to indicate the version of binding declarations. Only valid on root level bindings element. Either this attribute or "version" attribute but not both may be specified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specify DOM API to bind to JAXB property to.
+
+
+
+
+ Disable MTOM/XOP encoding for this binary data. Annotation can be placed on a type defintion that derives from a W3C XSD binary data type or on an element that has a type that is or derives from a W3C XSD binary data type.
+
+
+
+
+
+
+
+
+
diff --git a/BKUOnline/private/cache/retriever/www.w3.org/2001/XMLSchema.xsd b/BKUOnline/private/cache/retriever/www.w3.org/2001/XMLSchema.xsd
new file mode 100644
index 00000000..2e9a2729
--- /dev/null
+++ b/BKUOnline/private/cache/retriever/www.w3.org/2001/XMLSchema.xsd
@@ -0,0 +1,2534 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]>
+
+
+
+ Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp
+ Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp
+
+
+
+
+
+ The schema corresponding to this document is normative,
+ with respect to the syntactic constraints it expresses in the
+ XML Schema language. The documentation (within <documentation> elements)
+ below, is not normative, but rather highlights important aspects of
+ the W3C Recommendation of which this is a part
+
+
+
+
+ The simpleType element and all of its members are defined
+ towards the end of this schema document
+
+
+
+
+
+ Get access to the xml: attribute groups for xml:lang
+ as declared on 'schema' and 'documentation' below
+
+
+
+
+
+
+
+ This type is extended by almost all schema types
+ to allow attributes from other namespaces to be
+ added to user schemas.
+
+
+
+
+
+
+
+
+
+
+
+
+ This type is extended by all types which allow annotation
+ other than <schema> itself
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This group is for the
+ elements which occur freely at the top level of schemas.
+ All of their types are based on the "annotated" type by extension.
+
+
+
+
+
+
+
+
+
+
+
+
+ This group is for the
+ elements which can self-redefine (see <redefine> below).
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {extension, restriction}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {extension, restriction, list, union}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for maxOccurs
+
+
+
+
+
+
+
+
+
+
+
+ for all particles
+
+
+
+
+
+
+ for element, group and attributeGroup,
+ which both define and reference
+
+
+
+
+
+
+
+ 'complexType' uses this
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This branch is short for
+ <complexContent>
+ <restriction base="xs:anyType">
+ ...
+ </restriction>
+ </complexContent>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Will be restricted to required or forbidden
+
+
+
+
+
+ Not allowed if simpleContent child is chosen.
+ May be overriden by setting on complexContent child.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice is added simply to
+ make this a valid restriction per the REC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overrides any setting on complexType parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice is added simply to
+ make this a valid restriction per the REC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No typeDefParticle group reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {substitution, extension,
+ restriction}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The element element can be used either
+ at the top level to define an element-type binding globally,
+ or within a content model to either reference a globally-defined
+ element or type or declare an element-type binding locally.
+ The ref form is not allowed at the top level.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group type for explicit groups, named top-level groups and
+ group references
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group type for the three kinds of group
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice with min/max is here to
+ avoid a pblm with the Elt:All/Choice/Seq
+ Particle derivation constraint
+
+
+
+
+
+
+
+
+
+ restricted max/min
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Only elements allowed inside
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ simple type for the value of the 'namespace' attr of
+ 'any' and 'anyAttribute'
+
+
+
+ Value is
+ ##any - - any non-conflicting WFXML/attribute at all
+
+ ##other - - any non-conflicting WFXML/attribute from
+ namespace other than targetNS
+
+ ##local - - any unqualified non-conflicting WFXML/attribute
+
+ one or - - any non-conflicting WFXML/attribute from
+ more URI the listed namespaces
+ references
+ (space separated)
+
+ ##targetNamespace or ##local may appear in the above list, to
+ refer to the targetNamespace of the enclosing
+ schema or an absent targetNamespace respectively
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A subset of XPath expressions for use
+in selectors
+ A utility type, not for public
+use
+
+
+
+ The following pattern is intended to allow XPath
+ expressions per the following EBNF:
+ Selector ::= Path ( '|' Path )*
+ Path ::= ('.//')? Step ( '/' Step )*
+ Step ::= '.' | NameTest
+ NameTest ::= QName | '*' | NCName ':' '*'
+ child:: is also allowed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A subset of XPath expressions for use
+in fields
+ A utility type, not for public
+use
+
+
+
+ The following pattern is intended to allow XPath
+ expressions per the same EBNF as for selector,
+ with the following change:
+ Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The three kinds of identity constraints, all with
+ type of or derived from 'keybase'.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ A public identifier, per ISO 8879
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ notations for use within XML Schema schemas
+
+
+
+
+
+
+
+
+ Not the real urType, but as close an approximation as we can
+ get in the XML representation
+
+
+
+
+
+
+
+
+
+ First the built-in primitive datatypes. These definitions are for
+ information only, the real built-in definitions are magic.
+
+
+
+ For each built-in datatype in this schema (both primitive and
+ derived) can be uniquely addressed via a URI constructed
+ as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype
+
+ For example, to address the int datatype, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int
+
+ Additionally, each facet definition element can be uniquely
+ addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the facet
+
+ For example, to address the maxInclusive facet, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#maxInclusive
+
+ Additionally, each facet usage in a built-in datatype definition
+ can be uniquely addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype, followed
+ by a period (".") followed by the name of the facet
+
+ For example, to address the usage of the maxInclusive facet in
+ the definition of int, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int.maxInclusive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NOTATION cannot be used directly in a schema; rather a type
+ must be derived from it by specifying at least one enumeration
+ facet whose value is the name of a NOTATION declared in the
+ schema.
+
+
+
+
+
+
+
+
+
+ Now the derived primitive types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern specifies the content of section 2.12 of XML 1.0e2
+ and RFC 3066 (Revised version of RFC 1766).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 7 from the XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 5 from the XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 4 from the Namespaces in XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #all or (possibly empty) subset of {restriction, union, list}
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Can be restricted to required or forbidden
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Required at the top level
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Forbidden when nested
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ We should use a substitution group for facets, but
+ that's ruled out because it would allow users to
+ add their own, which we're not ready for yet.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ base attribute and simpleType child are mutually
+ exclusive, but one or other is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ itemType attribute and simpleType child are mutually
+ exclusive, but one or other is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ memberTypes attribute must be non-empty or there must be
+ at least one simpleType child
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BKUOnline/src/main/custom-binding/stalservice-custom.xml b/BKUOnline/src/main/custom-binding/stalservice-custom.xml
new file mode 100644
index 00000000..384b04f7
--- /dev/null
+++ b/BKUOnline/src/main/custom-binding/stalservice-custom.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+
+ Fetch the next request.
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+ Fetch the signed references corresponding to the previous SignatureRequest.
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BKUOnline/src/main/custom-binding/staltypes-custom.xml b/BKUOnline/src/main/custom-binding/staltypes-custom.xml
new file mode 100644
index 00000000..2ea42082
--- /dev/null
+++ b/BKUOnline/src/main/custom-binding/staltypes-custom.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/conf/Configurator.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/conf/Configurator.java
new file mode 100644
index 00000000..0cb717c4
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/conf/Configurator.java
@@ -0,0 +1,69 @@
+/*
+* 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.conf;
+
+import iaik.security.ecc.provider.ECCProvider;
+import iaik.xml.crypto.XSecProvider;
+
+import java.net.HttpURLConnection;
+import java.security.Provider;
+import java.security.Security;
+
+import javax.net.ssl.HttpsURLConnection;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.slcommands.impl.xsect.STALProvider;
+
+/**
+ *
+ * TODO currently only the code to get started.
+ */
+public class Configurator {
+ private Log log = LogFactory.getLog(Configurator.class);
+
+ public Configurator() {
+ configure();
+ }
+
+ protected void configUrlConnections() {
+ HttpsURLConnection.setFollowRedirects(false);
+ HttpURLConnection.setFollowRedirects(false);
+ }
+
+ protected void configureProviders() {
+ log.debug("Registering security providers");
+ Security.addProvider(new STALProvider());
+ XSecProvider.addAsProvider(false);
+ Security.insertProviderAt(new ECCProvider(false), 1);
+ StringBuffer sb = new StringBuffer();
+ sb.append("Following providers are now registered: ");
+ int i = 1;
+ for (Provider prov : Security.getProviders()) {
+ sb.append((i++) + ". : " + prov);
+ }
+ log.debug("Configured provider" + sb.toString());
+ }
+
+ public void configure() {
+ configureProviders();
+ configUrlConnections();
+
+ }
+
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
new file mode 100644
index 00000000..53a7c164
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
@@ -0,0 +1,91 @@
+/*
+* 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.webapp;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.binding.HTTPBindingProcessor;
+import at.gv.egiz.bku.binding.HttpUtil;
+import at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage;
+
+/**
+ * Handles SL requests and instantiates BindingProcessors
+ *
+ */
+public class BKURequestHandler extends SpringBKUServlet {
+
+ public final static String REDIRECT_URL ="appletPage.jsp";
+
+ protected Log log = LogFactory.getLog(BKURequestHandler.class);
+
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, java.io.IOException {
+ log.debug("Got new request");
+ String lang = req.getHeader("Accept-Language");
+ Locale locale = AcceptLanguage.getLocale(lang);
+ log.debug("Using locale: "+locale);
+ HttpSession session = req.getSession();
+ if (session != null) {
+ session.invalidate();
+ }
+ String id = req.getSession(true).getId();
+ log.debug("Using session id: "+id);
+ HTTPBindingProcessor bindingProcessor;
+ if (req.isSecure()) {
+ bindingProcessor = (HTTPBindingProcessor) getBindingProcessorManager()
+ .createBindingProcessor("https", id, locale);
+ } else {
+ bindingProcessor = (HTTPBindingProcessor) getBindingProcessorManager()
+ .createBindingProcessor("http", id, locale);
+ }
+ Map headerMap = new HashMap();
+ for (Enumeration headerName = req.getHeaderNames(); headerName
+ .hasMoreElements();) {
+ String header = headerName.nextElement();
+ if (header != null) {
+ headerMap.put(header, req.getHeader(header));
+ }
+ }
+ String charset = req.getCharacterEncoding();
+ String contentType = req.getContentType();
+ if (charset != null) {
+ contentType += ";"+charset;
+ }
+ headerMap.put(HttpUtil.HTTP_HEADER_CONTENT_TYPE, contentType);
+ bindingProcessor.setHTTPHeaders(headerMap);
+ bindingProcessor.consumeRequestStream(req.getInputStream());
+ req.getInputStream().close();
+ getBindingProcessorManager().process(bindingProcessor);
+ resp.sendRedirect(REDIRECT_URL);
+ }
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, java.io.IOException {
+ doPost(req, resp);
+ }
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
new file mode 100644
index 00000000..6c1a4c3a
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
@@ -0,0 +1,120 @@
+/*
+* 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.webapp;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.binding.HTTPBindingProcessor;
+import at.gv.egiz.bku.binding.IdFactory;
+
+/**
+ * Delivers the result to the browser
+ *
+ */
+public class ResultServlet extends SpringBKUServlet {
+
+ private final static Log log = LogFactory.getLog(ResultServlet.class);
+
+ private String encoding = "UTF-8";
+ private String expiredPage = "./expiredError.jsp";
+
+ public ResultServlet() {
+ }
+
+ private void myInit() {
+ String enc = getServletContext().getInitParameter("responseEncoding");
+ if (enc != null) {
+ log.debug("Init default encoding to: "+enc);
+ encoding = enc;
+ }
+ String expP = getServletConfig().getInitParameter("expiredPage");
+ if (expP != null) {
+ log.debug("Init expired page to: "+expP);
+ expiredPage = expP;
+ }
+ }
+
+ @Override
+ public void init() throws ServletException {
+ super.init();
+ myInit();
+ }
+
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ myInit();
+ }
+
+
+
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ doGet(req, resp);
+ }
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, java.io.IOException {
+
+ HttpSession session = req.getSession(false);
+ if (session == null) {
+ resp.sendRedirect(expiredPage);
+ return;
+ }
+ String sessionId = session.getId();
+ if (sessionId == null) {
+ resp.sendRedirect(expiredPage);
+ return;
+ }
+ log.debug("Got a result request for session: " + sessionId);
+ HTTPBindingProcessor bp = (HTTPBindingProcessor) getBindingProcessorManager().getBindingProcessor(
+ IdFactory.getInstance().createId(sessionId));
+ if (bp == null) {
+ session.invalidate();
+ resp.sendRedirect(expiredPage);
+ return;
+ }
+
+ if (bp.getRedirectURL() != null) {
+ resp.sendRedirect(bp.getRedirectURL());
+ return;
+ }
+ resp.setStatus(bp.getResponseCode());
+ resp.setHeader("Cache-Control","no-store"); //HTTP 1.1
+ resp.setHeader("Pragma","no-cache"); //HTTP 1.0
+ resp.setDateHeader ("Expires", 0);
+ for (Iterator it = bp.getResponseHeaders().keySet()
+ .iterator(); it.hasNext();) {
+ String header = it.next();
+ resp.setHeader(header, bp.getResponseHeaders().get(header));
+ }
+ resp.setContentType(bp.getResultContentType());
+ resp.setCharacterEncoding(encoding);
+ bp.writeResultTo(resp.getOutputStream(), encoding);
+ session.invalidate();
+ }
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SessionTimeout.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SessionTimeout.java
new file mode 100644
index 00000000..2b56166c
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SessionTimeout.java
@@ -0,0 +1,49 @@
+/*
+* 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.webapp;
+
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.binding.BindingProcessorManager;
+import at.gv.egiz.bku.binding.IdFactory;
+
+/**
+ * Session listener to trigger the removal of the BindingProcessor
+ *
+ */
+public class SessionTimeout implements HttpSessionListener {
+
+ private static Log log = LogFactory.getLog(SessionTimeout.class);
+
+ @Override
+ public void sessionCreated(HttpSessionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void sessionDestroyed(HttpSessionEvent event) {
+ BindingProcessorManager manager = (BindingProcessorManager) event.getSession().getServletContext().getAttribute(SpringBKUServlet.BEAN_NAME);
+ log.info("Removing session: "+event.getSession().getId());
+ manager.removeBindingProcessor(IdFactory.getInstance().createId(event.getSession().getId()));
+ }
+
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SpringBKUServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SpringBKUServlet.java
new file mode 100644
index 00000000..6ee537b1
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/SpringBKUServlet.java
@@ -0,0 +1,31 @@
+/*
+* 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.webapp;
+
+import javax.servlet.http.HttpServlet;
+
+import at.gv.egiz.bku.binding.BindingProcessorManager;
+
+public abstract class SpringBKUServlet extends HttpServlet {
+
+ public final static String BEAN_NAME="bindingProcessorManager";
+
+ protected BindingProcessorManager getBindingProcessorManager() {
+ return (BindingProcessorManager) getServletContext().getAttribute(BEAN_NAME);
+ }
+
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/RequestBrokerSTALFactory.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/RequestBrokerSTALFactory.java
new file mode 100644
index 00000000..38c568ab
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/RequestBrokerSTALFactory.java
@@ -0,0 +1,38 @@
+/*
+* 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.service.impl;
+
+import at.gv.egiz.stal.STAL;
+import at.gv.egiz.stal.STALFactory;
+
+/**
+ *
+ * @author clemens
+ */
+public class RequestBrokerSTALFactory implements STALFactory {
+
+ @Override
+ public STAL createSTAL() {
+ return new STALRequestBrokerImpl();
+ }
+
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java
new file mode 100644
index 00000000..aad9b874
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java
@@ -0,0 +1,43 @@
+/*
+* 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.service.impl;
+
+import at.gv.egiz.stal.STAL;
+import at.gv.egiz.stal.STALRequest;
+import at.gv.egiz.stal.STALResponse;
+import at.gv.egiz.stal.HashDataInputCallback;
+import java.util.List;
+import java.util.concurrent.TimeoutException;
+
+/**
+ *
+ * @author clemens
+ */
+public interface STALRequestBroker extends STAL {
+
+ public static final int ERR_6000 = 6000;
+ public static final long TIMEOUT_MS = 1000*60*5; //300000;
+
+ public List nextRequest(List response);
+// public void setResponse(List response) throws TimeoutException;
+// public void interruptRequestHandling(ErrorResponseType error);
+ public HashDataInputCallback getHashDataInput();
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
new file mode 100644
index 00000000..19548247
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
@@ -0,0 +1,554 @@
+/*
+* 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.service.impl;
+
+import at.gv.egiz.stal.ErrorResponse;
+import at.gv.egiz.stal.QuitRequest;
+import at.gv.egiz.stal.STALRequest;
+import at.gv.egiz.stal.STALResponse;
+import at.gv.egiz.stal.HashDataInputCallback;
+import at.gv.egiz.stal.SignRequest;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * An instance of STALRequestBroker is shared between a producer threads (SLCommand)
+ * and multiple consumer threads (STALService).
+ * This implementation assures that handleRequest is executed only once the previous invocation returned.
+ * The BindingProcessor assures that a new SLCommand calls handleRequest() only once
+ * the bindingProcessor called handleRequest(QUIT) after the previous SLCommand's handleRequest() returned.
+ *
+ * Multiple STALService threads might call nextRequest()/getSignedReferences() in any order.
+ *
+ * @author clemens
+ */
+public class STALRequestBrokerImpl implements STALRequestBroker {
+
+ private static final Log log = LogFactory.getLog(STALRequestBrokerImpl.class);
+// protected RequestResponseBroker broker;
+ protected List requests = null;
+ protected List responses = null;
+ protected HashDataInputCallback currentHashDataInputCallback;
+ private boolean isHandlingRequest = false;
+ private boolean expectingResponse = false;
+// private Object handleRequestCondition = new Object();
+// private Object gotResponsesCondition = new Object();
+// public STALRequestBrokerImpl() {
+// broker = new RequestResponseBroker();
+// new Thread(handler).start();
+// }
+
+// @Override
+// public HashDataInputCallback getCurrentHashDataInputCallback() {
+// return broker.getCurrentHashDataInputCallback();
+// }
+ /**
+ * Produce requests (and HashDataInputCallback) and wait for responses.
+ * The next thread may enter once we consumed the responses.
+ *
+ * @param requests
+ * @return
+ *
+ * @pre requests either single SignRequest, QuitRequest or multiple ReadInfoboxRequests
+ */
+ @Override
+ public synchronized List handleRequest(List requests) {
+ while (isHandlingRequest) {
+ log.trace("waiting to produce request");
+ try {
+ long beforeWait = System.currentTimeMillis();
+ wait(TIMEOUT_MS);
+ if (System.currentTimeMillis() - beforeWait >= TIMEOUT_MS) {
+ log.warn("timeout while waiting to produce request");
+ return Collections.singletonList((STALResponse) new ErrorResponse(ERR_6000));
+ }
+ } catch (InterruptedException ex) {
+ log.warn("interrupt while waiting to produce request: " + ex.getMessage());
+ }
+ }
+ log.trace("produce request");
+ isHandlingRequest = true;
+
+ this.requests = requests;
+ currentHashDataInputCallback = null;
+ for (STALRequest request : requests) {
+ if (request instanceof SignRequest) {
+ log.trace("Received SignRequest, keep HashDataInput callback.");
+ currentHashDataInputCallback = ((SignRequest) request).getHashDataInput();
+ break;
+ } else if (request instanceof QuitRequest) {
+ //alternative1:
+ //for QUIT requests, do not wait for responses, but for request consumation
+ // (i.e. set isHandlingReq to false once QUIT is consumed)
+ log.trace("Received QuitRequest, do not wait for responses.");
+ log.trace("notifying request consumers");
+ notify();
+ //alternative2:
+ //wait for QUIT to be consumed
+ // (i.e. notify me noce QUIT is consumed)
+// while (this.requests != null) {
+// try {
+// long beforeWait = System.currentTimeMillis();
+// wait(TIMEOUT_MS);
+// if (System.currentTimeMillis() - beforeWait >= TIMEOUT_MS) {
+// log.warn("timeout while waiting for QUIT to be consumed");
+// this.requests = null;
+// isHandlingRequest = false;
+// return Collections.singletonList((STALResponse) new ErrorResponse(ERR_6000));
+// }
+// } catch (InterruptedException ex) {
+// log.warn("interrupt while waiting for QUIT to be consumed: " + ex.getMessage());
+// }
+// }
+// isHandlingRequest = false;
+ return new ArrayList();
+ } else if (log.isTraceEnabled()) {
+ log.trace("Received STAL request: " + request.getClass().getName());
+ }
+ }
+ log.trace("notifying request consumers");
+ notify();
+
+ while (this.responses == null) {
+ log.trace("waiting to consume response");
+ try {
+ long beforeWait = System.currentTimeMillis();
+ wait(TIMEOUT_MS);
+ if (System.currentTimeMillis() - beforeWait >= TIMEOUT_MS) {
+ log.warn("timeout while waiting to consume response");
+ this.requests = null;
+ currentHashDataInputCallback = null;
+ isHandlingRequest = false;
+ return Collections.singletonList((STALResponse) new ErrorResponse(ERR_6000));
+ }
+ } catch (InterruptedException ex) {
+ log.warn("interrupt while waiting to consume response: " + ex.getMessage());
+ }
+ }
+ log.trace("consuming responses");
+ List resps = responses;
+ responses = null;
+ log.trace("notifying response producers");
+ notify();
+
+ isHandlingRequest = false;
+ log.trace("notifying request producers");
+ notify();
+
+ return resps;
+ }
+
+ /**
+ *
+ * @param responses
+ * @return QUIT if expected responses are not provided
+ */
+ @Override
+ public synchronized List nextRequest(List responses) {
+ if (responses != null && responses.size() > 0) {
+ if (!expectingResponse) {
+ log.warn("Received unexpected response in nextRequest()");
+ return Collections.singletonList((STALRequest) new QuitRequest());
+ }
+ while (this.responses != null) {
+ log.trace("waiting to produce response");
+ try {
+ long beforeWait = System.currentTimeMillis();
+ wait(TIMEOUT_MS);
+ if (System.currentTimeMillis() - beforeWait >= TIMEOUT_MS) {
+ log.warn("timeout while waiting to produce response");
+ return Collections.singletonList((STALRequest) new QuitRequest());
+ }
+ } catch (InterruptedException ex) {
+ log.warn("interrupt while waiting to produce response: " + ex.getMessage());
+ }
+ }
+ log.trace("produce response");
+ this.responses = responses;
+ //reset HashDataInputCallback
+ if (log.isTraceEnabled()) {
+ for (STALResponse response : responses) {
+ log.trace("Received STAL response: " + response.getClass().getName());
+ }
+ }
+ log.trace("notifying response consumers");
+ notify();
+ } else {
+ if (expectingResponse) {
+ // while (expectingResponse) wait();
+ log.warn("No expected response received in nextRequest()");
+ return Collections.singletonList((STALRequest) new QuitRequest());
+ }
+ log.trace("expecting non-null response in next nextRequest(response)");
+ expectingResponse = true;
+ }
+ while (this.requests == null) {
+ log.trace("waiting to consume request");
+ try {
+ long beforeWait = System.currentTimeMillis();
+ wait(TIMEOUT_MS);
+ if (System.currentTimeMillis() - beforeWait >= TIMEOUT_MS) {
+ log.warn("timeout while waiting to consume request");
+ return Collections.singletonList((STALRequest) new QuitRequest());
+ }
+ } catch (InterruptedException ex) {
+ log.warn("interrupt while waiting to consume request: " + ex.getMessage());
+ }
+ }
+ log.trace("consume request");
+ List reqs = requests;
+ //TODO check if QUIT and set isHandlingReq to false here?
+ // (rename isHandlingReq -> produce)
+ // handleReq(QUIT) doesn't wait() and returns immediately
+ // cf. handleReq(QUIT)
+ requests = null;
+ //no need to notify; request producer is waiting for isHandlingRequest
+ //(alt2: the QUIT producer returned immediately and didn't notify)
+ //(alt1: the QUIT producer is waiting for notification on QUIT consumption)
+ if (reqs.size() > 0 && reqs.get(0) instanceof QuitRequest) {
+ isHandlingRequest = false;
+ log.trace("consumed QUIT, notifying request producers");
+ notify();
+ log.trace("expecting no response in next nextRequest()");
+ expectingResponse = false;
+ //notify no-response request consumers
+ }
+ return reqs;
+ }
+
+ @Override
+ public synchronized HashDataInputCallback getHashDataInput() {
+ log.trace("return current HashDataInput callback");
+ return currentHashDataInputCallback;
+ }
+// /**
+// * Causes the calling thread to sleep until response is passed via nextRequest()
+// * (except for QUIT request, which returns immediately).
+// * The requestList may contain at most one signRequest.
+// * The signRequest's signedRefCallback is stored until a response to the signRequest is provided (2nd nextRequest() call),
+// * i.e. until handleRequest() returns.
+// *
+// * @param aRequestList
+// * @return
+// * @pre requestList contains at most one signRequest
+// */
+// @Override
+// public List handleRequest(List requestList) {
+// try {
+// if (log.isTraceEnabled()) {
+// log.trace("HandleRequest (" + requestList.size() + " requests)");
+// }
+//
+// broker.produceRequests(requestList);
+//
+// // QUIT returns immediately
+// if (requestList.size() == 1 && requestList.get(0) instanceof QuitRequest) {
+// log.trace("Received QUIT request, do not wait for responses.");
+// return new ArrayList();
+// }
+// return broker.consumeResponses();
+// } catch (InterruptedException ex) {
+// log.error("Interrupted while handling STAL request list: " + ex.getMessage());
+// return Collections.singletonList((STALResponse) new ErrorResponse());
+// } catch (TimeoutException ex) {
+// log.error("Timeout during handle request: " + ex.getMessage());
+// ErrorResponse err = new ErrorResponse();
+// err.setErrorCode(ERR_6000);
+// return Collections.singletonList((STALResponse) err);
+// }
+// }
+//
+// @Override
+// public void setResponse(List responses) {
+// try {
+//// if (responses != null && responses.size() > 0) {
+//// List stalResponses = translateResponses(responses);
+// broker.produceResponses(responses);
+//// } else {
+//// log.trace("Received emtpy responses list, do not add.");
+//// }
+// } catch (InterruptedException ex) {
+// log.error("Interrupted while setting STAL response: " + ex.getMessage());
+//// broker.interrupt(new ErrorResponse());
+// } catch (TimeoutException ex) {
+// log.error("Timeout during setResponse: " + ex.getMessage());
+// }
+// }
+//
+// /**
+// * TODO split in nextRequest(void) and setResponses(responses)
+// *
+// * Translate (possibly empty) STAL-WS response list to STAL responses and
+// * wait until request(s) are available and translate to STAL-WS requests.
+// * @param prevResponse if null or zero-length, they are not passed to the handler
+// * @return
+// */
+// @Override
+// public List nextRequest() { //List responses) {
+// try {
+//// if (responses != null && responses.size() > 0) {
+//// List stalResponses = translateResponses(responses);
+//// broker.produceResponses(stalResponses);
+//// } else {
+//// log.trace("Received emtpy responses list, do not add.");
+//// }
+//
+//// List extends STALRequest> stalRequests = broker.consumeRequests();
+//// List requests = translateRequests(stalRequests);
+// return broker.consumeRequests();
+//// } catch (InterruptedException ex) {
+//// log.error("Interrupted while requesting next STAL request: " + ex.getMessage());
+//// return Collections.singletonList((STALResponse) new ErrorResponse());
+// } catch (InterruptedException ex) {
+// log.error("Interrupted while requesting next STAL request: " + ex.getMessage());
+//// broker.interrupt(new ErrorResponse());
+// return new ArrayList();
+// } catch (TimeoutException ex) {
+// log.error("Timeout during nextRequest: " + ex.getMessage());
+// return new ArrayList();
+// }
+// }
+//
+//// @Override
+//// public void interruptRequestHandling(ErrorResponseType error) {
+//// if (log.isTraceEnabled()) {
+//// log.trace("Received Error: " + error.getErrorMessage());
+//// }
+//// broker.interrupt(new ErrorResponse(error.getErrorCode()));
+//// }
+//
+// //TODO
+//// private List translateRequests(List extends STALRequest> stalRequests) {
+//// List requests = new ArrayList(stalRequests.size());
+//// for (STALRequest stalRequest : stalRequests) {
+//// if (stalRequest instanceof InfoboxReadRequest) {
+//// InfoboxReadRequestType req = new InfoboxReadRequestType();
+//// req.setInfoboxIdentifier(((InfoboxReadRequest) stalRequest).getInfoboxIdentifier());
+//// log.warn("TODO consider domain identifier for infobox " + req.getInfoboxIdentifier());
+//// req.setDomainIdentifier("TODO");
+//// requests.add(req);
+//// } else if (stalRequest instanceof SignRequest) {
+//// //TODO
+//// //remember current sign request for getSignedReferences()
+//// throw new UnsupportedOperationException("SignRequest unsupported");
+//// } else if (stalRequest instanceof QuitRequest) {
+//// requests.add(new QuitRequestType());
+//// } else {
+//// log.error("Unknown STAL request: " + stalRequest.getClass().getName());
+//// }
+//// }
+//// return requests;
+//// }
+//
+//// private List translateResponses(List responses) {
+//// List stalResponses = new ArrayList(responses.size());
+//// for (ResponseType response : responses) {
+//// if (response instanceof InfoboxReadResponseType) {
+//// byte[] infoboxValue = ((InfoboxReadResponseType) response).getInfoboxValue();
+//// stalResponses.add(new InfoboxReadResponse(infoboxValue));
+//// } else if (response instanceof SignResponseType) {
+//// byte[] signatureValue = ((SignResponseType) response).getSignatureValue();
+//// stalResponses.add(new SignResponse(signatureValue));
+//// } else if (response instanceof ErrorResponseType) {
+//// int errorCode = ((ErrorResponseType) response).getErrorCode();
+//// log.warn("TODO consider error msg: " + ((ErrorResponseType) response).getErrorMessage());
+//// stalResponses.add(new ErrorResponse(errorCode));
+//// } else {
+//// log.error("Unknown STAL service response " + response.getId() + ": " + response.getClass().getName());
+//// }
+//// }
+//// return stalResponses;
+//// }
+// /**
+// * synchronize on this, not on request/response lists since they are nulled
+// */
+// // protected since outer handler field is protected
+// protected class RequestResponseBroker { //implements Runnable {
+//
+// protected List requests = null;
+// protected List responses = null;
+// protected HashDataInputCallback currentHashDataInputCallback;
+//
+//// @Override
+//// public void run() {
+//// while (true) {
+//// ;
+//// }
+//// //TODO handler lifecycle in run()?
+//// }
+// /**
+// * wait until requests are consumed,
+// * produce requests, remember sigRefCallback and notify consumer
+// * (no need for synchronized?)
+// * @param requests
+// */
+// public synchronized void produceRequests(List requests) throws InterruptedException, TimeoutException {
+//// synchronized (requests) {
+//
+// // requests is null, since there's only one producer thread calling handleRequests()
+// // and handleRequest() returns only if nextRequest() was called
+// while (this.requests != null) {
+//// requests.wait();
+// long before = System.currentTimeMillis();
+// log.trace("waiting to produce requests ...");
+// wait(); //TIMEOUT_MS);
+// if (System.currentTimeMillis() - before >= TIMEOUT_MS) {
+// log.error("Timeout while waiting to produce requests.");
+// throw new TimeoutException();
+// }
+// }
+// log.trace("producing requests");
+// this.requests = requests;
+// // getSignedReferences does not produce responses,
+// // so the command thread will not continue (and no further signRequest can possibly be produced)
+// // once the ws-client sends nextRequest with responses to the signRequest, the callback is invalidated
+//
+// // reset callback if for some reason produceResponse() wasn't called
+// currentHashDataInputCallback = null;
+// for (STALRequest request : requests) {
+// if (request instanceof SignRequest) {
+// log.trace("keep hashdatainput callback");
+// currentHashDataInputCallback = ((SignRequest) request).getHashDataInput();
+// break;
+// }
+// }
+//
+//// requests.notify();
+// log.trace("notifying request consumers (TODO not only consumers)");
+// notify();
+//// }
+// }
+//
+// /**
+// * wait until requests are produced and consume them
+// * @return
+// */
+// public synchronized List consumeRequests() throws InterruptedException, TimeoutException {
+// List retVal = null;
+//// synchronized (requests) {
+// while (requests == null) {
+//// requests.wait();
+// long before = System.currentTimeMillis();
+// log.trace("waiting to consumer requests ...");
+// wait(); //TIMEOUT_MS);
+// if (System.currentTimeMillis() - before >= TIMEOUT_MS) {
+// log.error("Timeout while waiting to consume requests.");
+// throw new TimeoutException();
+// }
+// }
+// log.trace("consuming requests");
+// retVal = requests;
+// requests = null;
+//// }
+// log.trace("???notify request producers???");
+// return retVal;
+// }
+//
+// /**
+// * wait until previous responses are consumed,
+// * produce responses and notify consumer
+// * @param responses
+// */
+// public synchronized void produceResponses(List responses) throws InterruptedException, TimeoutException {
+//// synchronized (responses) {
+// while (this.responses != null) {
+//// responses.wait();
+// long before = System.currentTimeMillis();
+// log.trace("waiting to produce responses ...");
+// wait(); //TIMEOUT_MS);
+// if (System.currentTimeMillis() - before >= TIMEOUT_MS) {
+// log.error("Timeout while waiting to produce responses.");
+// throw new TimeoutException();
+// }
+// }
+// log.trace("producing responses");
+// this.responses = responses;
+// //invalidate sigrefcallback (from now on handleRequest() may be called, producing new requests)
+// //make sure the provided responses are for the corresponding signrequest
+// if (this.requests == null) {//requests already consumed=>responses correspond to these
+// log.trace("resetting current hashdatainput");
+// currentHashDataInputCallback = null;
+// }
+//// responses.notify();
+// log.trace("notify response consumers (TODO only consumers?)");
+// notify();
+//// }
+// }
+//
+// /**
+// * wait until responses are available, consume them
+// * @return
+// * @throws java.lang.Exception
+// */
+// public synchronized List consumeResponses() throws InterruptedException, TimeoutException {
+// List retVal = null;
+//// synchronized (responses) {
+// while (responses == null) {
+//// responses.wait();
+// long before = System.currentTimeMillis();
+// log.trace("waiting to consume responses ...");
+// wait(); //TIMEOUT_MS);
+// if (System.currentTimeMillis() - before >= TIMEOUT_MS) {
+// log.error("Timeout while waiting to consume responses.");
+// throw new TimeoutException();
+// }
+// }
+// log.trace("consuming responses");
+// retVal = responses;
+// responses = null;
+//// }
+// log.trace("???notify response producers???");
+// return retVal;
+// }
+//
+// /**
+// * get the signrefcallback until handleRequest() is called the next time.
+// * @return null if last request was not a signRequest
+// */
+// public synchronized HashDataInputCallback getCurrentHashDataInputCallback() {
+// log.trace("obtain current hashdatainput");
+// return currentHashDataInputCallback;
+// }
+// /**
+// * add the error to responses and notify (response-) consumers
+// * @param error
+// */
+//// public synchronized void interrupt(ErrorResponse error) {
+////// synchronized (responses) {
+//// if (responses == null) {
+//// responses = Collections.singletonList((STALResponse) error);
+//// } else {
+//// responses.add(error);
+//// }
+////// responses.notify();
+//// notify();
+////// }
+//// }
+// }
+ @Override
+ public void setLocale(Locale locale) {
+ // TODO Auto-generated method stub
+ }
+}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java
new file mode 100644
index 00000000..3e8ad6f3
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java
@@ -0,0 +1,220 @@
+/*
+* 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.service.impl;
+
+import at.gv.egiz.bku.binding.BindingProcessor;
+import at.gv.egiz.bku.binding.BindingProcessorManager;
+import at.gv.egiz.stal.service.*;
+import at.gv.egiz.bku.binding.Id;
+import at.gv.egiz.bku.binding.IdFactory;
+import at.gv.egiz.stal.ErrorResponse;
+import at.gv.egiz.stal.STALRequest;
+import at.gv.egiz.stal.STALResponse;
+import at.gv.egiz.stal.HashDataInputCallback;
+import at.gv.egiz.stal.InfoboxReadRequest;
+import at.gv.egiz.stal.QuitRequest;
+import at.gv.egiz.stal.SignRequest;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.servlet.ServletContext;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author clemens
+ */
+@WebService(endpointInterface = "at.gv.egiz.stal.service.STALPortType")
+public class STALServiceImpl implements STALPortType {
+
+ public static final String BINDING_PROCESSOR_MANAGER = "bindingProcessorManager";
+ public static final String TEST_SESSION_ID = "TestSession";
+ protected static final Log log = LogFactory.getLog(STALServiceImpl.class);
+ @Resource
+ WebServiceContext wsContext;
+ protected IdFactory idF = IdFactory.getInstance();
+
+ @Override
+ public GetNextRequestResponseType getNextRequest(GetNextRequestType request) {
+
+ // HttpSession session = ((HttpServletRequest)
+ // mCtx.get(MessageContext.SERVLET_REQUEST)).getSession();
+ String sessId = request.getSessionId();
+ List responses = request.getResponse();
+ if (log.isDebugEnabled()) {
+ log.debug("Received GetNextRequest for session " + sessId
+ + " containing " + responses.size() + " responses");
+ }
+
+ GetNextRequestResponseType response = new GetNextRequestResponseType();
+ response.setSessionId(sessId);
+
+ if (TEST_SESSION_ID.equals(sessId)) {
+ if (responses.size() > 0 && responses.get(0) instanceof ErrorResponse) {
+ log
+ .info("Received TestSession GetNextRequest(ErrorResponse), returning QuitRequest");
+ response.getRequest().add(new QuitRequest());
+ } else {
+ log
+ .info("Received TestSession GetNextRequest, returning InfoboxReadRequest ");
+ SignRequest sig = new SignRequest();
+ sig.setKeyIdentifier("SecureSignatureKeypair");
+ sig.setSignedInfo("id('signed-data-object-0-1214921968-27971781-13578')/node()H1IePEEfGQ2SG03H6LTzw1TpCuM=yV6Q+I60buqR4mMaxA7fi+CV35A=".getBytes());
+ response.getRequest().add(sig);
+ InfoboxReadRequest req = new InfoboxReadRequest();
+ req.setInfoboxIdentifier("IdentityLink");
+ req.setDomainIdentifier("hansiwurzel");
+ response.getRequest().add(req);
+ req = new InfoboxReadRequest();
+ req.setInfoboxIdentifier("CertifiedKeypair");
+ response.getRequest().add(req);
+ req = new InfoboxReadRequest();
+ req.setInfoboxIdentifier("SecureSignatureKeypair");
+ response.getRequest().add(req);
+ }
+ return response;
+ }
+
+ // get Session Id
+ Id sessionId = idF.createId(sessId);
+ STALRequestBroker stal = getStal(sessionId);
+
+ if (stal == null) {
+ log.error("Failed to get STAL for session " + sessId
+ + ", returning QuitRequest");
+ response.getRequest().add(new QuitRequest());
+ } else {
+ List responsesIn = request.getResponse();
+ for (STALResponse resp : responsesIn) {
+ log.debug(resp);
+ }
+ List requestsOut = ((STALRequestBroker) stal)
+ .nextRequest(responsesIn);
+ response.getRequest().addAll(requestsOut);
+ if (log.isDebugEnabled()) {
+ log.debug("Returning GetNextRequestResponse for session " + sessId
+ + " containing " + requestsOut.size() + " requests");
+ }
+ }
+ return response;
+ }
+
+ @Override
+ public GetHashDataInputResponseType getHashDataInput(
+ GetHashDataInputType request) throws GetHashDataInputFault {
+
+ String sessId = request.getSessionId();
+ if (log.isDebugEnabled()) {
+ log.debug("Received GetHashDataInputRequest for session " + sessId
+ + " containing " + request.getReference().size() + " referencese");
+ }
+
+ // get Session Id
+ Id sessionId = idF.createId(sessId);
+ STALRequestBroker stal = getStal(sessionId);
+
+ if (stal == null) {
+ String msg = "Failed to get STAL for session " + sessId;
+ log.error(msg);
+ GetHashDataInputFaultType faultInfo = new GetHashDataInputFaultType();
+ faultInfo.setErrorCode(1);
+ faultInfo.setErrorMessage(msg);
+ throw new GetHashDataInputFault(msg, faultInfo);
+ } else {
+ GetHashDataInputResponseType response = new GetHashDataInputResponseType();
+ response.setSessionId(sessId);
+
+ HashDataInputCallback hashDataInput = stal.getHashDataInput();
+ if (TEST_SESSION_ID.equals(sessId)) {
+ log
+ .debug("Received TestSession GetHashDataInput, setting dummy HashDataInputCallback");
+ hashDataInput = new HashDataInputCallback() {
+
+ @Override
+ public InputStream getHashDataInput(String referenceId) {
+ byte[] hd = ("dummyhashdatainput_" + referenceId).getBytes();
+ return new ByteArrayInputStream(hd);
+ }
+ };
+ }
+ if (hashDataInput != null) {
+ List references = request
+ .getReference();
+ for (GetHashDataInputType.Reference reference : references) {
+ String refId = reference.getID();
+ if (log.isDebugEnabled()) {
+ log.debug("Resolving HashDataInput for reference " + refId);
+ }
+ ByteArrayOutputStream baos = null;
+ try {
+ InputStream hdi = hashDataInput.getHashDataInput(refId);
+ baos = new ByteArrayOutputStream(hdi.available());
+ int c;
+ while ((c = hdi.read()) != -1) {
+ baos.write(c);
+ }
+ GetHashDataInputResponseType.Reference ref = new GetHashDataInputResponseType.Reference();
+ ref.setID(refId);
+ ref.setValue(baos.toByteArray());
+ response.getReference().add(ref);
+ } catch (IOException ex) {
+ String msg = "Failed to get HashDataInput for reference " + refId;
+ log.error(msg, ex);
+ GetHashDataInputFaultType faultInfo = new GetHashDataInputFaultType();
+ faultInfo.setErrorCode(1);
+ faultInfo.setErrorMessage(msg);
+ throw new GetHashDataInputFault(msg, faultInfo, ex);
+ } finally {
+ try {
+ baos.close();
+ } catch (IOException ex) {
+ }
+ }
+ }
+ } else {
+ log.warn("Could not resolve any HashDataInputs for session " + sessId
+ + ", no callback provided.");
+ }
+ return response;
+ }
+ }
+
+ private STALRequestBroker getStal(Id sessionId) {
+ // log.warn("RETURNING DUMMY STAL REQUEST BROKER");
+ // return new STALRequestBrokerImpl();
+
+ MessageContext mCtx = wsContext.getMessageContext();
+ ServletContext sCtx = (ServletContext) mCtx
+ .get(MessageContext.SERVLET_CONTEXT);
+ BindingProcessorManager bpMgr = (BindingProcessorManager) sCtx
+ .getAttribute(BINDING_PROCESSOR_MANAGER);
+ BindingProcessor bp = bpMgr.getBindingProcessor(sessionId);
+ return (bp == null) ? null : (STALRequestBroker) bp.getSTAL();
+ }
+}
diff --git a/BKUOnline/src/main/resources/commons-logging.properties b/BKUOnline/src/main/resources/commons-logging.properties
new file mode 100644
index 00000000..0d497b1b
--- /dev/null
+++ b/BKUOnline/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.Log4JLogger
diff --git a/BKUOnline/src/main/resources/log4j.properties b/BKUOnline/src/main/resources/log4j.properties
new file mode 100644
index 00000000..ed14b424
--- /dev/null
+++ b/BKUOnline/src/main/resources/log4j.properties
@@ -0,0 +1,34 @@
+# 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.
+
+# loglever DEBUG, appender STDOUT
+log4j.rootLogger=TRACE, STDOUT
+#log4j.logger.at.gv.egiz.slbinding.RedirectEventFilter=DEBUG, STDOUT
+
+# STDOUT appender
+log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
+log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
+#log4j.appender.STDOUT.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n
+#log4j.appender.STDOUT.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+log4j.appender.STDOUT.layout.ConversionPattern=%-5p | %t | %c %x - %m%n
+
+### FILE appender
+#log4j.appender.file=org.apache.log4j.RollingFileAppender
+#log4j.appender.file.maxFileSize=100KB
+#log4j.appender.file.maxBackupIndex=9
+#log4j.appender.file.File=egovbus_ca.log
+#log4j.appender.file.threshold=info
+#log4j.appender.file.layout=org.apache.log4j.PatternLayout
+#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
\ No newline at end of file
diff --git a/BKUOnline/src/main/webapp/HTTP-ohne.html b/BKUOnline/src/main/webapp/HTTP-ohne.html
new file mode 100644
index 00000000..9cdd67ab
--- /dev/null
+++ b/BKUOnline/src/main/webapp/HTTP-ohne.html
@@ -0,0 +1,85 @@
+
+
+
+
+Infobox Requests
+
+
+
+
+
+
+
+
diff --git a/BKUOnline/src/main/webapp/js/deployJava.js b/BKUOnline/src/main/webapp/js/deployJava.js
new file mode 100644
index 00000000..4d8a0ca3
--- /dev/null
+++ b/BKUOnline/src/main/webapp/js/deployJava.js
@@ -0,0 +1,886 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Sun Microsystems nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * deployJava.js
+ *
+ * This file is part of the Deployment Toolkit. It provides functions for web
+ * pages to detect the presence of a JRE, install the latest JRE, and easily run
+ * applets or Web Start programs. Usage guide may be found at http:///.
+ *
+ * The "live" copy of this file may be found at
+ * http://java.com/js/deployJava.js.
+ * You are encouraged to link directly to the live copy of the file.
+ *
+ * @version @(#)deployJava.js 1.11 08/07/11
+ */
+
+var deployJava = {
+ debug: null,
+
+ myInterval: null,
+ preInstallJREList: null,
+ returnPage: null,
+ brand: null,
+ locale: null,
+ installType: null,
+
+ EAInstallEnabled: false,
+ EarlyAccessURL: null,
+
+ // GetJava page
+ getJavaURL: 'http://java.sun.com/webapps/getjava/BrowserRedirect?host=java.com',
+
+ // Apple redirect page
+ appleRedirectPage: 'http://www.apple.com/support/downloads/',
+
+ // mime-type of the DeployToolkit plugin object
+ mimeType: 'application/npruntime-scriptable-plugin;DeploymentToolkit',
+
+ // location of the Java Web Start launch button graphic
+ launchButtonPNG: 'http://java.sun.com/products/jfc/tsc/articles/swing2d/webstart.png',
+
+
+ /**
+ * Returns an array of currently-installed JRE version strings.
+ * Version strings are of the form #.#[.#[_#]], with the function returning
+ * as much version information as it can determine, from just family
+ * versions ("1.4.2", "1.5") through the full version ("1.5.0_06").
+ *
+ * Detection is done on a best-effort basis. Under some circumstances
+ * only the highest installed JRE version will be detected, and
+ * JREs older than 1.4.2 will not always be detected.
+ */
+ getJREs: function() {
+ var list = new Array();
+ if (deployJava.isPluginInstalled()) {
+ var plugin = deployJava.getPlugin();
+ for (var i = 0; i < plugin.jvms.getLength(); i++) {
+ list[i] = plugin.jvms.get(i).version;
+ }
+ } else {
+ var browser = deployJava.getBrowser();
+
+ if (browser == 'MSIE') {
+ if (deployJava.testUsingActiveX('1.8.0')) {
+ list[0] = '1.8.0';
+ } else if (deployJava.testUsingActiveX('1.7.0')) {
+ list[0] = '1.7.0';
+ } else if (deployJava.testUsingActiveX('1.6.0')) {
+ list[0] = '1.6.0';
+ } else if (deployJava.testUsingActiveX('1.5.0')) {
+ list[0] = '1.5.0';
+ } else if (deployJava.testUsingActiveX('1.4.2')) {
+ list[0] = '1.4.2';
+ } else if (deployJava.testForMSVM()) {
+ list[0] = '1.1';
+ }
+ }
+ else if (browser == 'Netscape Family') {
+ if (deployJava.testUsingMimeTypes('1.8')) {
+ list[0] = '1.8.0';
+ } else if (deployJava.testUsingMimeTypes('1.7')) {
+ list[0] = '1.7.0';
+ } else if (deployJava.testUsingMimeTypes('1.6')) {
+ list[0] = '1.6.0';
+ } else if (deployJava.testUsingMimeTypes('1.5')) {
+ list[0] = '1.5.0';
+ } else if (deployJava.testUsingMimeTypes('1.4.2')) {
+ list[0] = '1.4.2';
+ }
+ } else if (browser == 'Safari') {
+ if (deployJava.testUsingPluginsArray('1.8.0')) {
+ list[0] = '1.8.0';
+ } else if (deployJava.testUsingPluginsArray('1.7.0')) {
+ list[0] = '1.7.0';
+ } else if (deployJava.testUsingPluginsArray('1.6.0')) {
+ list[0] = '1.6.0';
+ } else if (deployJava.testUsingPluginsArray('1.5.0')) {
+ list[0] = '1.5.0';
+ } else if (deployJava.testUsingPluginsArray('1.4.2')) {
+ list[0] = '1.4.2';
+ }
+ }
+ }
+
+ if (deployJava.debug) {
+ for (var i = 0; i < list.length; ++i) {
+ alert('We claim to have detected Java SE ' + list[i]);
+ }
+ }
+
+ return list;
+ },
+
+ /**
+ * Triggers a JRE installation. The exact effect of triggering an
+ * installation varies based on platform, browser, and if the
+ * Deployment Toolkit plugin is installed.
+ *
+ * The requestVersion string is of the form #[.#[.#[_#]]][+|*],
+ * which includes strings such as "1.4", "1.5.0*", and "1.6.0_02+".
+ * A star (*) means "any version starting within this family" and
+ * a plus (+) means "any version greater or equal to this".
+ * "1.5.0*" * matches 1.5.0_06 but not 1.6.0_01, whereas
+ * "1.5.0+" matches both.
+ *
+ * If the Deployment Toolkit plugin is not present, this will just call
+ * deployJava.installLatestJRE().
+ */
+ installJRE: function(requestVersion) {
+ var ret = false;
+ if (deployJava.isPluginInstalled()) {
+ if (deployJava.getPlugin().installJRE(requestVersion)) {
+ deployJava.refresh();
+ if (deployJava.returnPage != null) {
+ document.location = deployJava.returnPage;
+ }
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return deployJava.installLatestJRE();
+ }
+ },
+
+
+ /**
+ * Triggers a JRE installation. The exact effect of triggering an
+ * installation varies based on platform, browser, and if the
+ * Deployment Toolkit plugin is installed.
+ *
+ * In the simplest case, the browser window will be redirected to the
+ * java.com JRE installation page, and (if possible) a redirect back to
+ * the current URL upon successful installation. The return redirect is
+ * not always possible, as the JRE installation may require the browser to
+ * be restarted.
+ *
+ * In the best case (when the Deployment Toolkit plugin is present), this
+ * function will immediately cause a progress dialog to be displayed
+ * as the JRE is downloaded and installed.
+ */
+ installLatestJRE: function() {
+ if (deployJava.isPluginInstalled()) {
+ if (deployJava.getPlugin().installLatestJRE()) {
+ deployJava.refresh();
+ if (deployJava.returnPage != null) {
+ document.location = deployJava.returnPage;
+ }
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ var browser = deployJava.getBrowser();
+ var platform = navigator.platform.toLowerCase();
+ if ((deployJava.EAInstallEnabled == 'true') &&
+ (platform.indexOf('win') != -1) &&
+ (deployJava.EarlyAccessURL != null)) {
+
+ deployJava.preInstallJREList = deployJava.getJREs();
+ if (deployJava.returnPage != null) {
+ deployJava.myInterval =
+ setInterval("deployJava.poll()", 3000);
+ }
+
+ location.href = deployJava.EarlyAccessURL;
+
+ // we have to return false although there may be an install
+ // in progress now, when complete it may go to return page
+ return false;
+ } else {
+ if (browser == 'MSIE') {
+ return deployJava.IEInstall();
+ } else if ((browser == 'Netscape Family') &&
+ (platform.indexOf('win32') != -1)) {
+ return deployJava.FFInstall();
+ } else {
+ location.href = deployJava.getJavaURL +
+ ((deployJava.returnPage != null) ?
+ ('&returnPage=' + deployJava.returnPage) : '') +
+ ((deployJava.locale != null) ?
+ ('&locale=' + deployJava.locale) : '') +
+ ((deployJava.brand != null) ?
+ ('&brand=' + deployJava.brand) : '');
+ }
+ // we have to return false although there may be an install
+ // in progress now, when complete it may go to return page
+ return false;
+ }
+ }
+ },
+
+
+ /**
+ * Ensures that an appropriate JRE is installed and then runs an applet.
+ * minimumVersion is of the form #[.#[.#[_#]]], and is the minimum
+ * JRE version necessary to run this applet. minimumVersion is optional,
+ * defaulting to the value "1.1" (which matches any JRE).
+ * If an equal or greater JRE is detected, runApplet() will call
+ * writeAppletTag(attributes, parameters) to output the applet tag,
+ * otherwise it will call installJRE(minimumVersion + '+').
+ *
+ * After installJRE() is called, the script will attempt to detect that the
+ * JRE installation has completed and begin running the applet, but there
+ * are circumstances (such as when the JRE installation requires a browser
+ * restart) when this cannot be fulfilled.
+ *
+ * As with writeAppletTag(), this function should only be called prior to
+ * the web page being completely rendered. Note that version wildcards
+ * (star (*) and plus (+)) are not supported, and including them in the
+ * minimumVersion will result in an error message.
+ */
+ runApplet: function(attributes, parameters, minimumVersion) {
+ if (minimumVersion == 'undefined' || minimumVersion == null) {
+ minimumVersion = '1.1';
+ }
+
+ var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";
+
+ var matchData = minimumVersion.match(regex);
+
+ if (deployJava.returnPage == null) {
+ // if there is an install, come back here and run the applet
+ deployJava.returnPage = document.location;
+ }
+
+ if (matchData != null) {
+ var browser = deployJava.getBrowser();
+ if ((browser != '?') && (browser != 'Safari')) {
+ if (deployJava.versionCheck(minimumVersion + '+')) {
+ deployJava.writeAppletTag(attributes, parameters);
+ } else if (deployJava.installJRE(minimumVersion + '+')) {
+ // after successfull install we need to refresh page to pick
+ // pick up new plugin
+ deployJava.refresh();
+ location.href = document.location;
+ deployJava.writeAppletTag(attributes, parameters);
+ }
+ } else {
+ // for unknown or Safari - just try to show applet
+ deployJava.writeAppletTag(attributes, parameters);
+ }
+ } else {
+ if (deployJava.debug) {
+ alert('Invalid minimumVersion argument to runApplet():' +
+ minimumVersion);
+ }
+ }
+ },
+
+
+ /**
+ * Outputs an applet tag with the specified attributes and parameters, where
+ * both attributes and parameters are associative arrays. Each key/value
+ * pair in attributes becomes an attribute of the applet tag itself, while
+ * key/value pairs in parameters become tags. No version checking
+ * or other special behaviors are performed; the tag is simply written to
+ * the page using document.writeln().
+ *
+ * As document.writeln() is generally only safe to use while the page is
+ * being rendered, you should never call this function after the page
+ * has been completed.
+ */
+ writeAppletTag: function(attributes, parameters) {
+ var s = '<' + 'applet ';
+ for (var attribute in attributes) {
+ s += (' ' + attribute + '="' + attributes[attribute] + '"');
+ }
+ s += '>';
+ document.write(s);
+
+ if (parameters != 'undefined' && parameters != null) {
+ for (var parameter in parameters) {
+ s = '';
+ document.write(s);
+ }
+ }
+ document.write('<' + '/' + 'applet' + '>');
+ },
+
+
+ /**
+ * Returns true if there is a matching JRE version currently installed
+ * (among those detected by getJREs()). The versionPattern string is
+ * of the form #[.#[.#[_#]]][+|*], which includes strings such as "1.4",
+ * "1.5.0*", and "1.6.0_02+".
+ * A star (*) means "any version within this family" and a plus (+) means
+ * "any version greater or equal to the specified version". "1.5.0*"
+ * matches 1.5.0_06 but not 1.6.0_01, whereas "1.5.0+" matches both.
+ *
+ * If the versionPattern does not include all four version components
+ * but does not end with a star or plus, it will be treated as if it
+ * ended with a star. "1.5" is exactly equivalent to "1.5*", and will
+ * match any version number beginning with "1.5".
+ *
+ * If getJREs() is unable to detect the precise version number, a match
+ * could be ambiguous. For example if getJREs() detects "1.5", there is
+ * no way to know whether the JRE matches "1.5.0_06+". versionCheck()
+ * compares only as much of the version information as could be detected,
+ * so versionCheck("1.5.0_06+") would return true in in this case.
+ *
+ * Invalid versionPattern will result in a JavaScript error alert.
+ * versionPatterns which are valid but do not match any existing JRE
+ * release (e.g. "32.65+") will always return false.
+ */
+ versionCheck: function(versionPattern)
+ {
+ var index = 0;
+ var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?(\\*|\\+)?$";
+
+ var matchData = versionPattern.match(regex);
+
+ if (matchData != null) {
+ var familyMatch = true;
+
+ var patternArray = new Array();
+
+ for (var i = 1; i < matchData.length; ++i) {
+ // browser dependency here.
+ // Fx sets 'undefined', IE sets '' string for unmatched groups
+ if ((typeof matchData[i] == 'string') && (matchData[i] != '')) {
+ patternArray[index] = matchData[i];
+ index++;
+ }
+ }
+
+ if (patternArray[patternArray.length-1] == '+') {
+ familyMatch = false;
+ patternArray.length--;
+ } else {
+ if (patternArray[patternArray.length-1] == '*') {
+ patternArray.length--;
+ }
+ }
+
+ var list = deployJava.getJREs();
+ for (var i = 0; i < list.length; ++i) {
+ if (deployJava.compareVersionToPattern(list[i], patternArray,
+ familyMatch)) {
+ return true;
+ }
+ }
+
+ return false;
+ } else {
+ alert('Invalid versionPattern passed to versionCheck: ' +
+ versionPattern);
+ return false;
+ }
+ },
+
+
+ /**
+ * Returns true if an installation of Java Web Start of the specified
+ * minimumVersion can be detected. minimumVersion is optional, and
+ * if not specified, '1.4.2' will be used.
+ * (Versions earlier than 1.4.2 may not be detected.)
+ */
+ isWebStartInstalled: function(minimumVersion) {
+
+ var browser = deployJava.getBrowser();
+ if ((browser == '?') || (browser == 'Safari')) {
+ // we really don't know - better to try to use it than reinstall
+ return true;
+ }
+
+ if (minimumVersion == 'undefined' || minimumVersion == null) {
+ minimumVersion = '1.4.2';
+ }
+
+ var retval = false;
+ var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";
+ var matchData = minimumVersion.match(regex);
+
+ if (matchData != null) {
+ retval = deployJava.versionCheck(minimumVersion + '+');
+ } else {
+ if (deployJava.debug) {
+ alert('Invalid minimumVersion argument to isWebStartInstalled(): ' + minimumVersion);
+ }
+ retval = deployJava.versionCheck('1.4.2+');
+ }
+ return retval;
+ },
+
+
+ /**
+ * Outputs a launch button for the specified JNLP URL. When clicked, the
+ * button will ensure that an appropriate JRE is installed and then launch
+ * the JNLP application. minimumVersion is of the form #[.#[.#[_#]]], and
+ * is the minimum JRE version necessary to run this JNLP application.
+ * minimumVersion is optional, and if it is not specified, '1.4.2'
+ * will be used.
+ * If an appropriate JRE or Web Start installation is detected,
+ * the JNLP application will be launched, otherwise installLatestJRE()
+ * will be called.
+ *
+ * After installLatestJRE() is called, the script will attempt to detect
+ * that the JRE installation has completed and launch the JNLP application,
+ * but there are circumstances (such as when the JRE installation
+ * requires a browser restart) when this cannot be fulfilled.
+ */
+ createWebStartLaunchButton: function(jnlp, minimumVersion) {
+
+ if (deployJava.returnPage == null) {
+ // if there is an install, come back and run the jnlp file
+ deployJava.returnPage = jnlp;
+ }
+
+ var url = 'javascript:' +
+ 'if (!deployJava.isWebStartInstalled("' +
+ minimumVersion + '")) {' +
+ 'if (deployJava.installLatestJRE()) {' +
+ 'if (deployJava.launch("' + jnlp + '")) {}' +
+ '}' +
+ '} else {' +
+ 'if (deployJava.launch("' + jnlp + '")) {}' +
+ '}';
+
+ document.write('<' + 'a href="' + url +
+ '" onMouseOver="window.status=\'\'; ' +
+ 'return true;"><' + 'img ' +
+ 'src="' + deployJava.launchButtonPNG + '" ' +
+ 'border="0" /><' + '/' + 'a' + '>');
+ },
+
+
+ /**
+ * Launch a JNLP application, (using the plugin if available)
+ */
+ launch: function(jnlp) {
+ if (deployJava.isPluginInstalled()) {
+ return deployJava.getPlugin().launch(jnlp);
+ } else {
+ document.location=jnlp;
+ return true;
+ }
+ },
+
+
+ /*
+ * returns true if the ActiveX or XPI plugin is installed
+ */
+ isPluginInstalled: function() {
+ var plugin = deployJava.getPlugin();
+ if (plugin && plugin.jvms) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+
+ /*
+ * returns true if the plugin is installed and AutoUpdate is enabled
+ */
+ isAutoUpdateEnabled: function() {
+ if (deployJava.isPluginInstalled()) {
+ return deployJava.getPlugin().isAutoUpdateEnabled();
+ }
+ return false;
+ },
+
+ /*
+ * sets AutoUpdate on if plugin is installed
+ */
+ setAutoUpdateEnabled: function() {
+ if (deployJava.isPluginInstalled()) {
+ return deployJava.getPlugin().setAutoUpdateEnabled();
+ }
+ return false;
+ },
+
+ /*
+ * sets the preferred install type : null, online, kernel
+ */
+ setInstallerType: function(type) {
+ deployJava.installType = type;
+ if (deployJava.isPluginInstalled()) {
+ return deployJava.getPlugin().setInstallerType(type);
+ }
+ return false;
+ },
+
+ /*
+ * sets additional package list - to be used by kernel installer
+ */
+ setAdditionalPackages: function(packageList) {
+ if (deployJava.isPluginInstalled()) {
+ return deployJava.getPlugin().setAdditionalPackages(
+ packageList);
+ }
+ return false;
+ },
+
+ /*
+ * sets preference to install Early Access versions if available
+ */
+ setEarlyAccess: function(enabled) {
+ deployJava.EAInstallEnabled = enabled;
+ },
+
+ /*
+ * Determines if the next generation plugin (Plugin II) is default
+ */
+ isPlugin2: function() {
+ if (deployJava.isPluginInstalled()) {
+ try {
+ return deployJava.getPlugin().isPlugin2();
+ } catch (err) {
+ // older plugin w/o isPlugin2() function - just fall through
+ }
+ }
+ return false;
+ },
+
+
+ getPlugin: function() {
+ deployJava.refresh();
+ var ret = document.getElementById('deployJavaPlugin');
+ return ret;
+ },
+
+ compareVersionToPattern: function(version, patternArray, familyMatch) {
+ var regex = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+)(?:_(\\d+))?)?)?$";
+ var matchData = version.match(regex);
+
+ if (matchData != null) {
+ var index = 0;
+ var result = new Array();
+
+ for (var i = 1; i < matchData.length; ++i) {
+ if ((typeof matchData[i] == 'string') && (matchData[i] != ''))
+ {
+ result[index] = matchData[i];
+ index++;
+ }
+ }
+
+ var l = Math.min(result.length, patternArray.length);
+
+ if (familyMatch) {
+ for (var i = 0; i < l; ++i) {
+ if (result[i] != patternArray[i]) return false;
+ }
+
+ return true;
+ } else {
+ for (var i = 0; i < l; ++i) {
+ if (result[i] < patternArray[i]) {
+ return false;
+ } else if (result[i] > patternArray[i]) {
+ return true;
+ }
+ }
+
+ return true;
+ }
+ } else {
+ return false;
+ }
+ },
+
+
+ getBrowser: function() {
+ var browser = navigator.userAgent.toLowerCase();
+
+ if (deployJava.debug) {
+ alert('userAgent -> ' + browser);
+ }
+
+ if ((navigator.vendor) &&
+ (navigator.vendor.toLowerCase().indexOf('apple') != -1) &&
+ (browser.indexOf('safari') != -1)) {
+ if (deployJava.debug) {
+ alert('We claim to have detected "Safari".');
+ }
+ return 'Safari';
+ } else if (browser.indexOf('msie') != -1) {
+ if (deployJava.debug) {
+ alert('We claim to have detected "IE".');
+ }
+ return 'MSIE';
+ } else if ((browser.indexOf('mozilla') != -1) ||
+ (browser.indexOf('firefox') != -1)) {
+ if (deployJava.debug) {
+ alert('We claim to have detected a Netscape family browser.');
+ }
+ return 'Netscape Family';
+ } else {
+ if (deployJava.debug) {
+ alert('We claim to have failed to detect a browser.');
+ }
+ return '?';
+ }
+ },
+
+
+ testUsingActiveX: function(version) {
+ var objectName = 'JavaWebStart.isInstalled.' + version + '.0';
+
+ if (!ActiveXObject) {
+ if (deployJava.debug) {
+ alert ('Browser claims to be IE, but no ActiveXObject object?');
+ }
+ return false;
+ }
+
+ try {
+ return (new ActiveXObject(objectName) != null);
+ } catch (exception) {
+ return false;
+ }
+ },
+
+
+ testForMSVM: function() {
+ var clsid = '{08B0E5C0-4FCB-11CF-AAA5-00401C608500}';
+
+ if (typeof oClientCaps != 'undefined') {
+ var v = oClientCaps.getComponentVersion(clsid, "ComponentID");
+ if ((v == '') || (v == '5,0,5000,0')) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+ },
+
+
+ testUsingMimeTypes: function(version) {
+ if (!navigator.mimeTypes) {
+ if (deployJava.debug) {
+ alert ('Browser claims to be Netscape family, but no mimeTypes[] array?');
+ }
+ return false;
+ }
+
+ for (var i = 0; i < navigator.mimeTypes.length; ++i) {
+ s = navigator.mimeTypes[i].type;
+ var m = s.match(/^application\/x-java-applet\x3Bversion=(1\.8|1\.7|1\.6|1\.5|1\.4\.2)$/);
+ if (m != null) {
+ if (deployJava.compareVersions(m[1], version)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+
+
+ testUsingPluginsArray: function(version) {
+ if ((!navigator.plugins) || (!navigator.plugins.length)) {
+ if (deployJava.debug) {
+ alert ('Browser claims to be Safari, but no plugins[] array?');
+ }
+ return false;
+ }
+
+ for (var i = 0; i < navigator.plugins.length; ++i) {
+ s = navigator.plugins[i].description;
+
+ if (s.search(/^Java Switchable Plug-in/) != -1) {
+ return true;
+ }
+
+ m = s.match(/^Java (1\.4\.2|1\.5|1\.6|1\.7).* Plug-in/);
+ if (m != null) {
+ if (deployJava.compareVersions(m[1], version)) return true;
+ }
+ }
+ return false;
+ },
+
+ IEInstall: function() {
+
+ location.href = deployJava.getJavaURL +
+ ((deployJava.returnPage != null) ?
+ ('&returnPage=' + deployJava.returnPage) : '') +
+ ((deployJava.locale != null) ?
+ ('&locale=' + deployJava.locale) : '') +
+ ((deployJava.brand != null) ? ('&brand=' + deployJava.brand) : '') +
+ ((deployJava.installType != null) ?
+ ('&type=' + deployJava.installType) : '');
+
+ // should not actually get here
+ return false;
+ },
+
+ done: function (name, result) {
+ },
+
+ FFInstall: function() {
+
+ location.href = deployJava.getJavaURL +
+ ((deployJava.returnPage != null) ?
+ ('&returnPage=' + deployJava.returnPage) : '') +
+ ((deployJava.locale != null) ?
+ ('&locale=' + deployJava.locale) : '') +
+ ((deployJava.brand != null) ? ('&brand=' + deployJava.brand) : '') +
+ ((deployJava.installType != null) ?
+ ('&type=' + deployJava.installType) : '');
+
+ // should not actually get here
+ return false;
+ },
+
+ // return true if 'installed' (considered as a JRE version string) is
+ // greater than or equal to 'required' (again, a JRE version string).
+ compareVersions: function(installed, required) {
+
+ var a = installed.split('.');
+ var b = required.split('.');
+
+ for (var i = 0; i < a.length; ++i) {
+ a[i] = Number(a[i]);
+ }
+ for (var i = 0; i < b.length; ++i) {
+ b[i] = Number(b[i]);
+ }
+ if (a.length == 2) {
+ a[2] = 0;
+ }
+
+ if (a[0] > b[0]) return true;
+ if (a[0] < b[0]) return false;
+
+ if (a[1] > b[1]) return true;
+ if (a[1] < b[1]) return false;
+
+ if (a[2] > b[2]) return true;
+ if (a[2] < b[2]) return false;
+
+ return true;
+ },
+
+
+ enableAlerts: function() {
+ deployJava.debug = true;
+ },
+
+ poll: function() {
+
+ deployJava.refresh();
+ var postInstallJREList = deployJava.getJREs();
+
+ if ((deployJava.preInstallJREList.length == 0) &&
+ (postInstallJREList.length != 0)) {
+ clearInterval(deployJava.myInterval);
+ if (deployJava.returnPage != null) {
+ location.href = deployJava.returnPage;
+ };
+ }
+
+ if ((deployJava.preInstallJREList.length != 0) &&
+ (postInstallJREList.length != 0) &&
+ (deployJava.preInstallJREList[0] != postInstallJREList[0])) {
+ clearInterval(deployJava.myInterval);
+ if (deployJava.returnPage != null) {
+ location.href = deployJava.returnPage;
+ }
+ }
+
+ },
+
+ writePluginTag: function() {
+ var browser = deployJava.getBrowser();
+ if (browser == 'MSIE') {
+ document.write('<' +
+ 'object classid="clsid:CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA" ' +
+ 'id="deployJavaPlugin" width="0" height="0">' +
+ '<' + '/' + 'object' + '>');
+ } else if (browser == 'Netscape Family') {
+ if (navigator.mimeTypes != null) for (var i=0;
+ i < navigator.mimeTypes.length; i++) {
+ if (navigator.mimeTypes[i].type == deployJava.mimeType) {
+ if (navigator.mimeTypes[i].enabledPlugin) {
+ document.write('<' +
+ 'embed id="deployJavaPlugin" type="' +
+ deployJava.mimeType + '" hidden="true" />');
+ }
+ }
+ }
+ }
+ },
+
+ refresh: function() {
+ navigator.plugins.refresh(false);
+
+ var browser = deployJava.getBrowser();
+ if (browser == 'Netscape Family') {
+ var plugin = document.getElementById('deployJavaPlugin');
+ // only do this again if no plugin
+ if (plugin == null) {
+ if (navigator.mimeTypes != null) for (var i=0;
+ i < navigator.mimeTypes.length; i++) {
+ if (navigator.mimeTypes[i].type == deployJava.mimeType) {
+ if (navigator.mimeTypes[i].enabledPlugin) {
+ document.write('<' +
+ 'embed id="deployJavaPlugin" type="' +
+ deployJava.mimeType + '" hidden="true" />');
+ }
+ }
+ }
+ }
+ }
+ },
+
+ do_initialize: function() {
+ deployJava.writePluginTag();
+ if (deployJava.locale == null) {
+ var loc = null;
+
+ if (loc == null) try {
+ loc = navigator.userLanguage;
+ } catch (err) { }
+
+ if (loc == null) try {
+ loc = navigator.systemLanguage;
+ } catch (err) { }
+
+ if (loc == null) try {
+ loc = navigator.language;
+ } catch (err) { }
+
+ if (loc != null) {
+ loc.replace("-","_")
+ deployJava.locale = loc;
+ }
+ }
+ }
+
+};
+deployJava.do_initialize();
+
diff --git a/BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java b/BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java
new file mode 100644
index 00000000..cd321c71
--- /dev/null
+++ b/BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java
@@ -0,0 +1,362 @@
+/*
+* 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.service;
+
+import at.gv.egiz.stal.service.impl.STALRequestBrokerImpl;
+import at.gv.egiz.stal.service.impl.RequestBrokerSTALFactory;
+import at.gv.egiz.stal.service.impl.STALRequestBroker;
+import at.gv.egiz.stal.ErrorResponse;
+import at.gv.egiz.stal.HashDataInputCallback;
+import at.gv.egiz.stal.InfoboxReadRequest;
+import at.gv.egiz.stal.InfoboxReadResponse;
+import at.gv.egiz.stal.QuitRequest;
+import at.gv.egiz.stal.STALRequest;
+import at.gv.egiz.stal.STALResponse;
+import at.gv.egiz.stal.SignResponse;
+import at.gv.egiz.stal.SignRequest;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ *
+ * @author clemens
+ */
+public class STALRequestBrokerTest {
+
+ private static final Log log = LogFactory.getLog(STALRequestBrokerTest.class);
+ protected static STALRequestBroker stal;
+
+ @BeforeClass
+ public static void setUp() {
+ RequestBrokerSTALFactory fac = new RequestBrokerSTALFactory();
+ stal = (STALRequestBrokerImpl) fac.createSTAL();
+ log.debug("Created STAL " + stal.getClass().getName());
+ }
+
+ @Ignore
+ public void testInfoboxRead() {
+// try {
+
+ log.debug("*************** test ReadInfoboxRequest for two infoboxes");
+ List requests = new ArrayList();
+ InfoboxReadRequest r1 = new InfoboxReadRequest();
+ r1.setInfoboxIdentifier("infobox1");
+ requests.add(r1);
+ InfoboxReadRequest r2 = new InfoboxReadRequest();
+ r2.setInfoboxIdentifier("infobox2");
+ requests.add(r2);
+
+ BindingProcessorSimulator bp = new BindingProcessorSimulator();
+ bp.setRequests(Collections.singletonList(requests));
+
+ new Thread(bp, "BindingProcessor").start();
+ new Thread(new ServiceSimulator(), "STALService").start();
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {
+ log.error("interrupted: " + ex.getMessage());
+ }
+ }
+
+ @Ignore
+ public void testSign() {
+ log.debug("**************** test SignRequest");
+ List requests = new ArrayList();
+ SignRequest r1 = new SignRequest();
+ r1.setKeyIdentifier("keybox1");
+ r1.setSignedInfo("1234".getBytes());
+ r1.setHashDataInput(new HashDataInputCallback() {
+
+ @Override
+ public InputStream getHashDataInput(String referenceId) {
+ return new ByteArrayInputStream("hashdatainput1234".getBytes());
+ }
+ });
+ requests.add(r1);
+
+ BindingProcessorSimulator bp = new BindingProcessorSimulator();
+ bp.setRequests(Collections.singletonList(requests));
+
+ new Thread(bp, "BindingProcessor").start();
+// new Thread(bp2, "BindingProcessor2").start();
+ new Thread(new ServiceSimulator(), "STALService").start();
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {
+ log.error("interrupted: " + ex.getMessage());
+ }
+ }
+
+ @Ignore
+ public void testResponseTimeout() {
+ log.debug("**************** test SignRequest with responses timeout");
+ List requests = new ArrayList();
+ SignRequest r1 = new SignRequest();
+ r1.setKeyIdentifier("keybox1");
+ r1.setSignedInfo("1234".getBytes());
+ r1.setHashDataInput(new HashDataInputCallback() {
+
+ @Override
+ public InputStream getHashDataInput(String referenceId) {
+ return new ByteArrayInputStream("hashdatainput1234".getBytes());
+ }
+ });
+ requests.add(r1);
+
+ BindingProcessorSimulator bp = new BindingProcessorSimulator();
+ bp.setRequests(Collections.singletonList(requests));
+
+ new Thread(bp, "BindingProcessor").start();
+ new Thread(new TimeoutServiceSimulator(), "STALService").start();
+
+ try {
+ Thread.sleep(STALRequestBroker.TIMEOUT_MS + 1);
+ } catch (InterruptedException ex) {
+ log.error("interrupted: " + ex.getMessage());
+ }
+ }
+
+ @Ignore
+ public void testRequestTimeout() {
+ log.debug("**************** test requests timeout");
+ TimeoutBindingProcessorSimulator bp = new TimeoutBindingProcessorSimulator();
+
+ new Thread(bp, "BindingProcessor").start();
+ new Thread(new ServiceSimulator(), "STALService").start();
+
+ try {
+ Thread.sleep(STALRequestBroker.TIMEOUT_MS + 1);
+ } catch (InterruptedException ex) {
+ log.error("interrupted: " + ex.getMessage());
+ }
+ }
+
+ @Test
+ public void testMultipleServices() {
+ log.debug("**************** test multiple SignRequests");
+ List requests = new ArrayList();
+ SignRequest r1 = new SignRequest();
+ r1.setKeyIdentifier("keybox1");
+ r1.setSignedInfo("1234".getBytes());
+ r1.setHashDataInput(new HashDataInputCallback() {
+
+ @Override
+ public InputStream getHashDataInput(String referenceId) {
+ return new ByteArrayInputStream("hashdatainput1234".getBytes());
+ }
+ });
+ requests.add(r1);
+
+ List requests2 = new ArrayList();
+ SignRequest r2 = new SignRequest();
+ r2.setKeyIdentifier("keybox2");
+ r2.setSignedInfo("6789".getBytes());
+ r2.setHashDataInput(new HashDataInputCallback() {
+
+ @Override
+ public InputStream getHashDataInput(String referenceId) {
+ return new ByteArrayInputStream("hashdatainput6789".getBytes());
+ }
+ });
+ requests2.add(r2);
+
+ BindingProcessorSimulator bp = new BindingProcessorSimulator();
+ List> requestList = new ArrayList>();
+ requestList.add(requests);
+ requestList.add(requests2);
+ bp.setRequests(requestList);
+
+ new Thread(bp, "BindingProcessor").start();
+// new Thread(bp2, "BindingProcessor2").start();
+ new Thread(new ServiceSimulator(), "STALService1").start();
+ new Thread(new ServiceSimulator(), "STALService2").start();
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ex) {
+ log.error("interrupted: " + ex.getMessage());
+ }
+ }
+
+ class ServiceSimulator implements Runnable {
+
+ @Override
+ public void run() {
+ try {
+ // first call w/ empty response list
+ log.debug("calling stal.nextRequest");
+ List requests = stal.nextRequest(null); //new ArrayList());
+ log.debug("got " + requests.size() + " requests. processing...");
+ Thread.sleep(1);
+ List responses = new ArrayList();
+ for (STALRequest request : requests) {
+ if (request instanceof InfoboxReadRequest) {
+ InfoboxReadResponse r = new InfoboxReadResponse();
+ r.setInfoboxValue("dummyInfobox".getBytes());
+ responses.add(r);
+ } else if (request instanceof SignRequest) {
+
+ log.debug("calling stal.getCurrentHashDataInputCallback");
+ HashDataInputCallback cb = stal.getHashDataInput();
+ assertNotNull(cb);
+ InputStream hd = cb.getHashDataInput("1234");
+ byte[] data = new byte[hd.available()];
+ hd.read(data);
+ log.debug("got HashDataInput " + new String(data));
+
+
+ SignResponse r = new SignResponse();
+ r.setSignatureValue("dummySignature".getBytes());
+ responses.add(r);
+ } else if (request instanceof QuitRequest) {
+ log.debug("received UNEXPECTED QUIT request");
+ return;
+ }
+ }
+
+// if (requests.size() > 0) {
+// log.debug("calling stal.setResponse with " + requests.size() + " responses");
+// stal.setResponse(responses);
+// }
+ log.debug("calling stal.nextRequest with " + responses.size() + " responses");
+ requests = stal.nextRequest(responses);
+ for (STALRequest request : requests) {
+ if (request instanceof QuitRequest) {
+ log.debug("got QUIT request");
+ } else {
+ log.debug("expected QUIT request, got " + request.getClass().getName());
+ }
+ }
+ } catch (IOException ex) {
+ log.error(ex.getMessage());
+ } catch (InterruptedException ex) {
+ log.error(ex.getMessage());
+ }
+ }
+ }
+
+ class TimeoutServiceSimulator implements Runnable {
+
+ @Override
+ public void run() {
+ try {
+ // first call w/ empty response list
+ log.debug("calling stal.nextRequest");
+ List requests = stal.nextRequest(null); //new ArrayList());
+ log.debug("got " + requests.size() + " requests. processing...");
+ Thread.sleep(1);
+ for (STALRequest request : requests) {
+// if (request instanceof InfoboxReadRequest) {
+ if (request instanceof SignRequest) {
+ log.debug("calling stal.getCurrentHashDataInputCallback");
+ HashDataInputCallback cb = stal.getHashDataInput();
+ assertNotNull(cb);
+ InputStream hd = cb.getHashDataInput("1234");
+ byte[] data = new byte[hd.available()];
+ hd.read(data);
+ log.debug("got HashDataInput " + new String(data));
+ } else if (request instanceof QuitRequest) {
+ log.debug("received UNEXPECTED QUIT requests");
+ return;
+ }
+ }
+ log.debug("simulating timeout ...");
+ } catch (IOException ex) {
+ log.error(ex.getMessage());
+ } catch (InterruptedException ex) {
+ log.error(ex.getMessage());
+ }
+ }
+ }
+
+ class BindingProcessorSimulator implements Runnable {
+
+ List> requestsLists;
+
+ public void setRequests(List> requests) {
+ this.requestsLists = requests;
+ }
+
+ @Override
+ public void run() {
+
+ //simulate SLCommand execution
+ for (List requests : requestsLists) {
+ execSLCommand(requests);
+
+ log.debug("SLCommand finished, calling stal.handleReqeusts(QUIT)");
+ stal.handleRequest(Collections.singletonList((STALRequest) new QuitRequest()));
+ log.debug("QUIT returned (waiting for applet reload)");
+ }
+
+ }
+
+ public void execSLCommand(List requests) {
+ int numReq = requests.size();
+ log.debug("SLCommand calling stal.handleRequests " + numReq + " requests");
+ List responses = stal.handleRequest(requests);
+ assertEquals(numReq, responses.size());
+ for (int i = 0; i < numReq; i++) {
+ STALRequest request = requests.get(i);
+ STALResponse response = responses.get(i);
+
+ if (response instanceof ErrorResponse) {
+ log.warn("SLCommand received unexpected error response from STAL: " + ((ErrorResponse) response).getErrorCode());
+ } else if (request instanceof InfoboxReadRequest) {
+ assertTrue(response instanceof InfoboxReadResponse);
+ String infobox = new String(((InfoboxReadResponse) response).getInfoboxValue());
+ log.debug("SLCommand received expected InfoboxReadResponse from STAL: " + infobox);
+ } else if (request instanceof SignRequest) {
+ assertTrue(response instanceof SignResponse);
+ String signVal = new String(((SignResponse) response).getSignatureValue());
+ log.debug("SLCommand received expected SignResponse from STAL: " + signVal);
+ } else {
+ log.error("***** RequestType: " + request.getClass() + " TODO");
+ }
+ //TODO
+ }
+
+ }
+ }
+
+ class TimeoutBindingProcessorSimulator implements Runnable {
+
+ @Override
+ public void run() {
+
+ //simulate SLCommand execution
+ log.debug("simulating timeout ...");
+ }
+ }
+}
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 00000000..d6456956
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 00000000..2f25af7d
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,17 @@
+MOCCA Project
+Copyright 2008 Federal Chancellery Austria and Graz University of Technology
+
+This product includes software developed at
+E-Government Innovation Center (www.egiz.gv.at).
+
+E-Government Innovation Center is a joint initiative of
+Federal Chancellery Austria and Graz University of Technology.
+
+
+This product includes software developed by third parties
+and provided under an open source license (www.opensource.org).
+
+
+This product includes software provided by
+Stiftung Secure Information and Communication Technologies SIC
+(www.sic.st).
diff --git a/STAL/catalog.xml b/STAL/catalog.xml
new file mode 100644
index 00000000..38c98894
--- /dev/null
+++ b/STAL/catalog.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/STAL/pom.xml b/STAL/pom.xml
new file mode 100644
index 00000000..6b49ed47
--- /dev/null
+++ b/STAL/pom.xml
@@ -0,0 +1,48 @@
+
+
+
+ bku
+ at.gv.egiz
+ 1.0-SNAPSHOT
+
+ 4.0.0
+ at.gv.egiz
+ STAL
+ STAL
+ 1.0-SNAPSHOT
+
+
+ commons-logging
+ commons-logging
+
+
+
+
\ No newline at end of file
diff --git a/STAL/private/cache/retriever/catalog.xml b/STAL/private/cache/retriever/catalog.xml
new file mode 100644
index 00000000..c40b0d50
--- /dev/null
+++ b/STAL/private/cache/retriever/catalog.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/STAL/private/cache/retriever/java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd b/STAL/private/cache/retriever/java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
new file mode 100644
index 00000000..f9a884c0
--- /dev/null
+++ b/STAL/private/cache/retriever/java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
@@ -0,0 +1,362 @@
+
+
+
+ Schema for JAXB 2.0 binding declarations.
+
+
+
+Model group that represents a binding declaration. Each new binding
+declaration added to the jaxb namespace that is not restricted to
+globalBindings should be added as a child element to this model group.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Used to specify the version of the binding schema on the schema element for
+inline annotations or jaxb:bindings for external binding.
+
+
+
+
+Attributes used for property customization. The attribute group can be
+referenced either from the globalBindings declaration or from the
+property declaration. The following defaults are defined by the JAXB
+specification in global scope only. Thus they apply when the
+propertyAttributes group is referenced from the globalBindings declaration
+but not when referenced from the property declaration.
+ collectionType a class that implements java.util.List.
+ fixedAttributeAsConstantProperty false
+ enableFailFastCheck false
+ generateIsSetMethod false
+ optionalProperty wrapper
+ generateElementProperty false
+ attachmentRef default
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Customize XMLNames to Java id mapping
+
+
+
+
+
+
+
+
+
+ Customization values defined in global scope.
+
+
+
+
+
+ allows extension binding declarations to be specified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Customization values with schema scope
+
+
+
+
+
+
+
+
+ Customize interface and implementation class.
+
+
+
+
+
+ Java class name without package prefix.
+
+
+ Implementation class name including package prefix.
+
+
+ Default value derived from [jaxb:globalBindings]@generateValueClass.
+
+
+
+
+ Customize property.
+
+
+
+
+
+
+
+
+
+
+ Data type conversions; overriding builtins
+
+
+ name of the java type to which xml type is to be bound.
+
+
+ xml type to which java datatype has to be bound.Must be present when javaType is scoped to globalBindings
+
+
+
+
+
+If true, the parsMethod and printMethod must reference a method
+signtature that has a second parameter of type NamespaceContext.
+
+
+
+
+
+ Bind to a type safe enumeration class.
+
+
+
+
+
+
+
+
+
+
+ Enumeration member name in a type safe enumeration class.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+The name attribute for [baseType] enables more precise control over the actual base type for a JAXB property. This customization enables specifying a more general base type than the property's default base type. The name attribute value must be a fully qualified Java class name. Additionally, this Java class must be a super interface/class of the default Java base type for the property. When the default base type is a primitive type, consider the default Java base type to be the Java wrapper class of that primitive type.This customization is useful to enable simple type substitution for a JAXB property representing with too restrictive of a default base type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Treate underscore in XML Name to Java identifier mapping.
+
+
+
+
+
+
+
+XML types or types derived from them which have enumeration facet(s) which are be mapped to typesafeEnumClass by default. The following types cannot be specified in this list: "xsd:QName", "xsd:base64Binary", "xsd:hexBinary", "xsd:date", "xsd:time", "xsd:dateTime", "xsd:duration","xsd:gDay", "xsd:gMonth", "xsd:Year", "xsd:gMonthDay", "xsd:YearMonth", "xsd:ID", "xsd:IDREF", "xsd:NOTATION"
+
+
+
+
+ Used to customize how to handle name collisions.
+
+
+
+
+
+
+
+ Placeholder type to indicate Legal Java identifier.
+
+
+
+ Rule to transform an Xml name into another Xml name
+
+ prepend the string to QName.
+
+
+ Append the string to QName.
+
+
+
+ Allows transforming an xml name into another xml name. Use case UDDI 2.0 schema.
+
+
+ Mapping rule for type definitions.
+
+
+ Mapping rule for elements
+
+
+ Mapping rule for model group
+
+
+ Mapping rule for class names generated for an anonymous type.
+
+
+
+
+
+A binding compiler only processes this attribute when it occurs on an
+an instance of xs:schema element. The value of this attribute is a
+whitespace-separated list of namespace prefixes. The namespace bound
+to each of the prefixes is designated as a customization declaration
+namespace.
+
+
+
+
+
+
+Binding declaration(s) for a remote schema.
+If attribute node is set, the binding declaraions
+are associated with part of the remote schema
+designated by schemaLocation attribute. The node
+attribute identifies the node in the remote schema
+to associate the binding declaration(s) with.
+
+
+
+
+
+
+
+
+
+
+
+Location of the remote schema to associate binding declarations with.
+
+
+
+
+The value of the string is an XPATH 1.0 compliant string that
+resolves to a node in a remote schema to associate
+binding declarations with. The remote schema is specified
+by the schemaLocation attribute occuring in the current
+element or in a parent of this element.
+
+
+
+
+Used to indicate the version of binding declarations. Only valid on root level bindings element. Either this or "jaxb:version" attribute but not both may be specified.
+
+
+
+
+Used to indicate the version of binding declarations. Only valid on root level bindings element. Either this attribute or "version" attribute but not both may be specified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specify DOM API to bind to JAXB property to.
+
+
+
+
+ Disable MTOM/XOP encoding for this binary data. Annotation can be placed on a type defintion that derives from a W3C XSD binary data type or on an element that has a type that is or derives from a W3C XSD binary data type.
+
+
+
+
+
+
+
+
+
diff --git a/STAL/private/cache/retriever/www.w3.org/2001/XMLSchema.xsd b/STAL/private/cache/retriever/www.w3.org/2001/XMLSchema.xsd
new file mode 100644
index 00000000..2e9a2729
--- /dev/null
+++ b/STAL/private/cache/retriever/www.w3.org/2001/XMLSchema.xsd
@@ -0,0 +1,2534 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]>
+
+
+
+ Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp
+ Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp
+
+
+
+
+
+ The schema corresponding to this document is normative,
+ with respect to the syntactic constraints it expresses in the
+ XML Schema language. The documentation (within <documentation> elements)
+ below, is not normative, but rather highlights important aspects of
+ the W3C Recommendation of which this is a part
+
+
+
+
+ The simpleType element and all of its members are defined
+ towards the end of this schema document
+
+
+
+
+
+ Get access to the xml: attribute groups for xml:lang
+ as declared on 'schema' and 'documentation' below
+
+
+
+
+
+
+
+ This type is extended by almost all schema types
+ to allow attributes from other namespaces to be
+ added to user schemas.
+
+
+
+
+
+
+
+
+
+
+
+
+ This type is extended by all types which allow annotation
+ other than <schema> itself
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This group is for the
+ elements which occur freely at the top level of schemas.
+ All of their types are based on the "annotated" type by extension.
+
+
+
+
+
+
+
+
+
+
+
+
+ This group is for the
+ elements which can self-redefine (see <redefine> below).
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {extension, restriction}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {extension, restriction, list, union}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for maxOccurs
+
+
+
+
+
+
+
+
+
+
+
+ for all particles
+
+
+
+
+
+
+ for element, group and attributeGroup,
+ which both define and reference
+
+
+
+
+
+
+
+ 'complexType' uses this
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This branch is short for
+ <complexContent>
+ <restriction base="xs:anyType">
+ ...
+ </restriction>
+ </complexContent>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Will be restricted to required or forbidden
+
+
+
+
+
+ Not allowed if simpleContent child is chosen.
+ May be overriden by setting on complexContent child.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice is added simply to
+ make this a valid restriction per the REC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overrides any setting on complexType parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice is added simply to
+ make this a valid restriction per the REC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No typeDefParticle group reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ #all or (possibly empty) subset of {substitution, extension,
+ restriction}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The element element can be used either
+ at the top level to define an element-type binding globally,
+ or within a content model to either reference a globally-defined
+ element or type or declare an element-type binding locally.
+ The ref form is not allowed at the top level.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group type for explicit groups, named top-level groups and
+ group references
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ group type for the three kinds of group
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This choice with min/max is here to
+ avoid a pblm with the Elt:All/Choice/Seq
+ Particle derivation constraint
+
+
+
+
+
+
+
+
+
+ restricted max/min
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Only elements allowed inside
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ simple type for the value of the 'namespace' attr of
+ 'any' and 'anyAttribute'
+
+
+
+ Value is
+ ##any - - any non-conflicting WFXML/attribute at all
+
+ ##other - - any non-conflicting WFXML/attribute from
+ namespace other than targetNS
+
+ ##local - - any unqualified non-conflicting WFXML/attribute
+
+ one or - - any non-conflicting WFXML/attribute from
+ more URI the listed namespaces
+ references
+ (space separated)
+
+ ##targetNamespace or ##local may appear in the above list, to
+ refer to the targetNamespace of the enclosing
+ schema or an absent targetNamespace respectively
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A subset of XPath expressions for use
+in selectors
+ A utility type, not for public
+use
+
+
+
+ The following pattern is intended to allow XPath
+ expressions per the following EBNF:
+ Selector ::= Path ( '|' Path )*
+ Path ::= ('.//')? Step ( '/' Step )*
+ Step ::= '.' | NameTest
+ NameTest ::= QName | '*' | NCName ':' '*'
+ child:: is also allowed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A subset of XPath expressions for use
+in fields
+ A utility type, not for public
+use
+
+
+
+ The following pattern is intended to allow XPath
+ expressions per the same EBNF as for selector,
+ with the following change:
+ Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The three kinds of identity constraints, all with
+ type of or derived from 'keybase'.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+ A public identifier, per ISO 8879
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ notations for use within XML Schema schemas
+
+
+
+
+
+
+
+
+ Not the real urType, but as close an approximation as we can
+ get in the XML representation
+
+
+
+
+
+
+
+
+
+ First the built-in primitive datatypes. These definitions are for
+ information only, the real built-in definitions are magic.
+
+
+
+ For each built-in datatype in this schema (both primitive and
+ derived) can be uniquely addressed via a URI constructed
+ as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype
+
+ For example, to address the int datatype, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int
+
+ Additionally, each facet definition element can be uniquely
+ addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the facet
+
+ For example, to address the maxInclusive facet, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#maxInclusive
+
+ Additionally, each facet usage in a built-in datatype definition
+ can be uniquely addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype, followed
+ by a period (".") followed by the name of the facet
+
+ For example, to address the usage of the maxInclusive facet in
+ the definition of int, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int.maxInclusive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NOTATION cannot be used directly in a schema; rather a type
+ must be derived from it by specifying at least one enumeration
+ facet whose value is the name of a NOTATION declared in the
+ schema.
+
+
+
+
+
+
+
+
+
+ Now the derived primitive types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern specifies the content of section 2.12 of XML 1.0e2
+ and RFC 3066 (Revised version of RFC 1766).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 7 from the XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 5 from the XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pattern matches production 4 from the Namespaces in XML spec
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #all or (possibly empty) subset of {restriction, union, list}
+
+
+ A utility type, not for public use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Can be restricted to required or forbidden
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Required at the top level
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Forbidden when nested
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ We should use a substitution group for facets, but
+ that's ruled out because it would allow users to
+ add their own, which we're not ready for yet.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ base attribute and simpleType child are mutually
+ exclusive, but one or other is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ itemType attribute and simpleType child are mutually
+ exclusive, but one or other is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ memberTypes attribute must be non-empty or there must be
+ at least one simpleType child
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/STAL/src/main/java/META-INF/MANIFEST.MF b/STAL/src/main/java/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..5e949512
--- /dev/null
+++ b/STAL/src/main/java/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/STAL/src/main/java/at/gv/egiz/stal/ErrorResponse.java b/STAL/src/main/java/at/gv/egiz/stal/ErrorResponse.java
new file mode 100644
index 00000000..11d8637a
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/ErrorResponse.java
@@ -0,0 +1,112 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
Java class for ErrorResponseType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ErrorResponseType", propOrder = {
+ "errorCode",
+ "errorMessage"
+})
+public class ErrorResponse
+ extends STALResponse
+{
+
+ @XmlTransient
+ public static final int ERR_4000 = 4000;
+
+ @XmlElement(name = "ErrorCode")
+ protected int errorCode;
+ @XmlElement(name = "ErrorMessage", required = true)
+ protected String errorMessage;
+
+ public ErrorResponse() {
+ this.errorCode = ERR_4000;
+ }
+
+ public ErrorResponse(int errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ /**
+ * Gets the value of the errorCode property.
+ *
+ */
+ public int getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * Sets the value of the errorCode property.
+ *
+ */
+ public void setErrorCode(int value) {
+ this.errorCode = value;
+ }
+
+ /**
+ * Gets the value of the errorMessage property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ /**
+ * Sets the value of the errorMessage property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setErrorMessage(String value) {
+ this.errorMessage = value;
+ }
+
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/HashDataInputCallback.java b/STAL/src/main/java/at/gv/egiz/stal/HashDataInputCallback.java
new file mode 100644
index 00000000..f1ccf937
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/HashDataInputCallback.java
@@ -0,0 +1,24 @@
+/*
+* 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.stal;
+
+import java.io.InputStream;
+
+public interface HashDataInputCallback {
+
+ InputStream getHashDataInput(String referenceId);
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/InfoboxReadRequest.java b/STAL/src/main/java/at/gv/egiz/stal/InfoboxReadRequest.java
new file mode 100644
index 00000000..783113ab
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/InfoboxReadRequest.java
@@ -0,0 +1,112 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
Java class for InfoboxReadRequestType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "InfoboxReadRequestType", propOrder = {
+ "infoboxIdentifier",
+ "domainIdentifier"
+})
+public class InfoboxReadRequest
+ extends STALRequest
+{
+
+ @XmlElement(name = "InfoboxIdentifier", required = true)
+ protected String infoboxIdentifier;
+ @XmlElement(name = "DomainIdentifier")
+ protected String domainIdentifier;
+
+ /**
+ * Gets the value of the infoboxIdentifier property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getInfoboxIdentifier() {
+ return infoboxIdentifier;
+ }
+
+ /**
+ * Sets the value of the infoboxIdentifier property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setInfoboxIdentifier(String value) {
+ this.infoboxIdentifier = value;
+ }
+
+ /**
+ * Gets the value of the domainIdentifier property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDomainIdentifier() {
+ return domainIdentifier;
+ }
+
+ /**
+ * Sets the value of the domainIdentifier property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDomainIdentifier(String value) {
+ this.domainIdentifier = value;
+ }
+
+ public String toString() {
+ return "InfoboxReadRequest for: "+infoboxIdentifier;
+ }
+
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/InfoboxReadResponse.java b/STAL/src/main/java/at/gv/egiz/stal/InfoboxReadResponse.java
new file mode 100644
index 00000000..54476764
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/InfoboxReadResponse.java
@@ -0,0 +1,78 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
Java class for InfoboxReadResponseType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "InfoboxReadResponseType", propOrder = {
+ "infoboxValue"
+})
+public class InfoboxReadResponse
+ extends STALResponse
+{
+
+ @XmlElement(name = "InfoboxValue", required = true)
+ protected byte[] infoboxValue;
+
+ /**
+ * Gets the value of the infoboxValue property.
+ *
+ * @return
+ * possible object is
+ * byte[]
+ */
+ public byte[] getInfoboxValue() {
+ return infoboxValue;
+ }
+
+ /**
+ * Sets the value of the infoboxValue property.
+ *
+ * @param value
+ * allowed object is
+ * byte[]
+ */
+ public void setInfoboxValue(byte[] value) {
+ this.infoboxValue = ((byte[]) value);
+ }
+
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/QuitRequest.java b/STAL/src/main/java/at/gv/egiz/stal/QuitRequest.java
new file mode 100644
index 00000000..ed180d58
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/QuitRequest.java
@@ -0,0 +1,48 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
Java class for QuitRequestType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "QuitRequestType")
+public class QuitRequest
+ extends STALRequest
+{
+
+
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/STAL.java b/STAL/src/main/java/at/gv/egiz/stal/STAL.java
new file mode 100644
index 00000000..de29de9a
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/STAL.java
@@ -0,0 +1,43 @@
+/*
+* 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.stal;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Interface for all implementations of the Security Tokean Abstraction Layer.
+ * This interface is used by the BKU to handle all security token related parts.
+ *
+ *
+ */
+public interface STAL {
+
+ /**
+ * Handles a list of security token commands.
+ * @param aRequestList
+ * @return
+ */
+ public List handleRequest(List aRequestList);
+
+ /**
+ * Sets the preferred locale for userinteraction (e.g. PIN dialogs).
+ * If the locale is not set the default locale will be used.
+ * @param locale must not be null.
+ */
+ public void setLocale(Locale locale);
+}
\ No newline at end of file
diff --git a/STAL/src/main/java/at/gv/egiz/stal/STALFactory.java b/STAL/src/main/java/at/gv/egiz/stal/STALFactory.java
new file mode 100644
index 00000000..e7b3edd1
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/STALFactory.java
@@ -0,0 +1,22 @@
+/*
+* 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.stal;
+
+public interface STALFactory {
+
+ public STAL createSTAL();
+}
\ No newline at end of file
diff --git a/STAL/src/main/java/at/gv/egiz/stal/STALRequest.java b/STAL/src/main/java/at/gv/egiz/stal/STALRequest.java
new file mode 100644
index 00000000..0c3f88c2
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/STALRequest.java
@@ -0,0 +1,54 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
TODO update java doc: not only for RequestType complex type.
+ *
+ *
Java class for RequestType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RequestType")
+@XmlSeeAlso({
+ SignRequest.class,
+ InfoboxReadRequest.class,
+ QuitRequest.class
+})
+public abstract class STALRequest {
+
+
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/STALResponse.java b/STAL/src/main/java/at/gv/egiz/stal/STALResponse.java
new file mode 100644
index 00000000..91ef3c24
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/STALResponse.java
@@ -0,0 +1,89 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ *
TODO update java doc: not only for ResponseType complex type.
+ *
+ *
Java class for ResponseType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ResponseType")
+@XmlSeeAlso({
+ ErrorResponse.class,
+ SignResponse.class,
+ InfoboxReadResponse.class
+})
+public abstract class STALResponse {
+
+ @XmlAttribute(name = "Id")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ @XmlID
+ @XmlSchemaType(name = "ID")
+ protected String id;
+
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
+
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/SignRequest.java b/STAL/src/main/java/at/gv/egiz/stal/SignRequest.java
new file mode 100644
index 00000000..8c996d2c
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/SignRequest.java
@@ -0,0 +1,113 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
Java class for SignRequestType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "SignRequestType", propOrder = {
+ "keyIdentifier",
+ "signedInfo"
+})
+public class SignRequest
+ extends STALRequest {
+
+ @XmlElement(name = "KeyIdentifier", required = true)
+ protected String keyIdentifier;
+ @XmlElement(name = "SignedInfo", required = true)
+ protected byte[] signedInfo;
+ @XmlTransient
+ protected HashDataInputCallback hashData;
+
+ /**
+ * Gets the value of the keyIdentifier property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getKeyIdentifier() {
+ return keyIdentifier;
+ }
+
+ /**
+ * Sets the value of the keyIdentifier property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setKeyIdentifier(String value) {
+ this.keyIdentifier = value;
+ }
+
+ /**
+ * Gets the value of the signedInfo property.
+ *
+ * @return
+ * possible object is
+ * byte[]
+ */
+ public byte[] getSignedInfo() {
+ return signedInfo;
+ }
+
+ /**
+ * Sets the value of the signedInfo property.
+ *
+ * @param value
+ * allowed object is
+ * byte[]
+ */
+ public void setSignedInfo(byte[] value) {
+ this.signedInfo = ((byte[]) value);
+ }
+
+ public HashDataInputCallback getHashDataInput() {
+ return hashData;
+ }
+
+ public void setHashDataInput(HashDataInputCallback hashData) {
+ this.hashData = hashData;
+ }
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/SignResponse.java b/STAL/src/main/java/at/gv/egiz/stal/SignResponse.java
new file mode 100644
index 00000000..462af30b
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/SignResponse.java
@@ -0,0 +1,78 @@
+/*
+* 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.stal;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
Java class for SignResponseType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "SignResponseType", propOrder = {
+ "signatureValue"
+})
+public class SignResponse
+ extends STALResponse
+{
+
+ @XmlElement(name = "SignatureValue", required = true)
+ protected byte[] signatureValue;
+
+ /**
+ * Gets the value of the signatureValue property.
+ *
+ * @return
+ * possible object is
+ * byte[]
+ */
+ public byte[] getSignatureValue() {
+ return signatureValue;
+ }
+
+ /**
+ * Sets the value of the signatureValue property.
+ *
+ * @param value
+ * allowed object is
+ * byte[]
+ */
+ public void setSignatureValue(byte[] value) {
+ this.signatureValue = ((byte[]) value);
+ }
+
+}
diff --git a/STAL/src/main/java/at/gv/egiz/stal/signedinfo/CanonicalizationMethodType.java b/STAL/src/main/java/at/gv/egiz/stal/signedinfo/CanonicalizationMethodType.java
new file mode 100644
index 00000000..35de75fe
--- /dev/null
+++ b/STAL/src/main/java/at/gv/egiz/stal/signedinfo/CanonicalizationMethodType.java
@@ -0,0 +1,125 @@
+/*
+* 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.
+*/
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.07.28 at 08:23:24 AM GMT
+//
+
+
+package at.gv.egiz.stal.signedinfo;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlMixed;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
Java class for CanonicalizationMethodType complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *