ds.ov2.gui
Class Terminal_thread

java.lang.Object
  extended by javax.swing.SwingWorker<Void,Runnable>
      extended by ds.ov2.gui.Terminal_thread
All Implemented Interfaces:
Runnable, Future<Void>, RunnableFuture<Void>

 class Terminal_thread
extends SwingWorker<Void,Runnable>

Worker thread that performs all card related tasks. The GUI can only be controlled from one thread, the GUI thread or, in SUN Java speak, the event dispatch thread. Because the GUI thread should not contain long running methods all the real work must be done in a separate thread, the terminal thread or, in SUN Java speak, the worker thread. The terminal thread is called terminal thread, because most of the code it executes talks to a Java Card terminal. The code of this class is executed on two threads: the GUI thread and the terminal thread. Many methods can only be executed on one thread. The method documentation indicates to which thread each method belongs. The GUI starts the terminal thread by calling the inherited method execute, which then executes doInBackground() in a different thread.

The GUI and the terminal thread communicate in the following way. The GUI sets the next_action that the terminal thread should execute and, if necessary, interrupts the terminal thread (via set_next_action). The terminal thread performs an endless loop that always executes the action that is found in next_action. To simplify the logic here, each role of the GUI has its own waiting action, which runs when the GUI is waiting for the user to press some buttons. This waiting action is started when the corresponding role is selected. The waiting action then enables and disables all the buttons in the GUI as cards are inserted and removed in an endless loop. The waiting action only terminates if the terminal thread gets interrupted because the GUI sets a new action.

The terminal thread publish'es the actions to be executed in the GUI. They are then somewhere queued by the swing framework and get executed in the GUI in the process method.

For simplicity all the actions that are communicated between the GUI and the terminal thread are simply Runnable's. The action to be executed in the other thread is captured in the run method. The thread that creates an action has to create a suitable anonymous class instance. This instance is then communicated to the other thread (either via set_next_action or via publish). The other thread then executes the action by calling the run method. For creating anonymous classes and objects of the Runnable interface the Action class is used.

The Runnable.run() method does not permit any checked exceptions, therefore all CardException's are wrapped in a Runtime_card_exception. If this class were properly written it would use a version of Runnable that permits CardException in its run method...

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
To Do:
the messages field should be moved to Card_protocols
Author:
Hendrik Tews
Version:
$Revision: 1.16 $
Last Commit:
$Date: 2010-03-01 21:20:16 $ by $Author: tews $

Nested Class Summary
private static class Terminal_thread.Runtime_card_exception
          Runtime version of CardException.
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
 
Field Summary
private  Object action_lock
          Lock for next_action.
 boolean card_is_present
          Remembers whether we believe that there is currently a card present in the configured card reader.
private  Card_protocols card_protocols
          Card protocol instance.
private  Action clear_applet_list
          GUI action to clear the applet list in the applet list dialog.
private  byte[] default_applet_name
          The AID of the package that seems to be on any card.
private  Ov_demo_gui gui
          The GUI object.
private  Gui_actions gui_actions
          GUI actions for the GUI thread.
(package private)  Action gui_card_inserted
          GUI Action to display "Card inserted" in the status line of the GUI.
private  Action gui_clear_message
          GUI Action to clear the status line in the GUI.
private  Action gui_disable_ptls_actions
          GUI Action to disable all the card maintenance buttons in the GUI.
private  Action gui_enable_ptls_actions
          GUI Action to enable all the card maintenance buttons in the GUI.
private  Action gui_proof_finished
          GUI Action to display "Proof finished.
(package private)  Action gui_wait_for_card
          GUI Action to display the line "Waiting for a card ..." in the status line of the GUI.
private  Action gui_wait_for_card_removal
          GUI Action to display "Please remove card" in the status line of the GUI.
private  Gui_protocol_messages messages
          Instance for printing progess messages in the GUI.
private  Action next_action
          Next action to execute in the terminal thread.
private  Action proof_failed_warning
          GUI action to display a warning when the entry gate check failed.
private  Action resign_failed_warning
          GUI action to display a warning when resigning fails.
private  Action resign_finished_action
          GUI action for enabling the PTLS automaton run button and display a finished message in the status line.
private  Thread thread
          The terminal thread.
private  Action wait_in_ptls_automaton
          Terminal thread action for waiting in the PTLS automaton tab.
private  Action wait_in_ptls_office
          Terminal thread wait action for the PTLS office.
 
Constructor Summary
Terminal_thread(Ov_demo_gui gui, Gui_actions gui_actions, Card_protocols card_protocols)
          Constructor.
 
Method Summary
private  Action applet_cap_file_warning(IOException e)
          Gui action to display a warning if the applet file cannot be opened.
private  Action applet_install_failed_warning(cardservices.GlobalPlatformException e)
          Gui action to display a warning dialog for applet installation errors.
private  Action applet_table_line(String kind, Printable_aid name)
          GUI action for adding an applet/package line to the applet list dialog.
private  Action card_communication_error_warning(String message)
          Gui action to display a warning if card communication fails for some reason.
private  Action card_status(boolean everything)
          Terminal thread action for displaying installed applets/packages in the applet list display.
private  Action delete_applets(Printable_aid[] aids, boolean everything)
          Terminal thread action to delete some applets/packages and update the applet list dialog afterwards.
 Void doInBackground()
          Main loop of the terminal thread.
private  Applet_list_window get_applet_list_window()
          Return the applet list window or throw an assertion if no such window is registered.
private  Action get_next_action()
          Return the next action for the terminal thread and clear the next_action field.
private  Action gui_background_died(Throwable e)
          GUI Action to display an error to the user on the fatal event that the terminal thread dies.
 void gui_card_message(BigInteger blinded_a, String message)
          GUI action to display a card appearence message.
 void gui_message(JTextPane pane, String message, boolean bold)
          GUI action to display a message in a message text pane.
 void gui_progress_message(String message, boolean bold)
          GUI action to display a progress message.
private  Action gui_set_entry_run_button(boolean b)
          GUI action to enable/disable the run button on the entry gate tab.
private  Action gui_set_ptls_automaton_button(boolean b)
          GUI action to enable or disable the obtain-new-signature button in the PTLS automaton tab.
private  Action gui_status_line_message(String message)
          GUI Action to display an arbitrary message in the status line.
private  Action install_applet_action(Applet_type applet_type)
          Terminal thread action for installing one of the applets.
private  Action invalid_card_warning(String message)
          Gui action to display a warning dialog if the card is invalid for some reason.
private  Action personalize_action(Applet_type applet_type)
          Terminal thread action to personalize an applet.
 void process(List<Runnable> actions)
          Process actions to change the GUI in the GUI thread (event dispatch thread).
private  Action proof_action(Applet_type applet_type)
          Terminal thread action to run the entry-gate proof-protocol.
private  void proof_ex(Applet_type applet_type)
          Exception wrapper for proof.
private  void proof(Applet_type applet_type)
          Run the entry-gate proof-protocol on the card.
private  boolean publish_registry(cardservices.AIDRegistry r, boolean everything)
          Display all applets/packages of one registry in the applet list dialog.
private  Action reinstall_personalize(Applet_type applet_type)
          Terminal thread action for reinstalling the applet with subsequent personalization.
private  Action reset_action(Applet_type applet_type)
          Terminal thread action to reset an applet.
private  Action resign_action(Applet_type applet_type, BigInteger[] updates)
          Terminal thread action for resigning.
 void set_next_action(Action next_action)
          Set the next action to be executed in the terminal thread and interrupt the action that currently executes on the terminal thread.
protected  void set_successor_action(Action successor_action)
          Set a successor action for the currently executing action.
 void start_card_status_action(boolean everything)
          Set card status action.
 void start_delete_applets(Printable_aid[] aids, boolean everything)
          Set applet/package deletion as next action in the terminal thread.
 void start_install_applet(Applet_type type)
          Set the applet install action for the terminal thread.
 void start_personalize(Applet_type applet_type)
          Set personalization as next action of the terminal thread.
 void start_proof(Applet_type applet_type)
          Set the proof-protocol action as next action of the terminal thread.
 void start_reinstall_personalize(Applet_type applet_type)
          Set reinstall + personalize as next action of the terminal thread.
 void start_reset_applet(Applet_type applet_type)
          Set personalization as next action of the terminal thread.
 void start_resign(Applet_type applet_type, BigInteger[] updates)
          Set the resign action as next action to execute in the terminal thread.
private  boolean status_entry_filter(cardservices.AIDRegistryEntry e)
          Filter the interesting applets/packages to display in the applet list dialog.
 void wait_for_card()
          Wait until a card is inserted or the terminal thread is interrupted.
private  Action wait_in_entry_gate_action(boolean automatic_proof, Applet_type applet_type)
          Terminal thread action for waiting in the entry gate tab.
 void wait_in_entry_gate(Applet_type applet_type, boolean automatic_proof)
          Set the entry-gate waiting-action as next action of the terminal thread.
 void wait_in_ptls_automaton()
          Set the waiting action of the PTLS automaton as next action.
 void wait_in_ptls_office()
          Set the PTLS waiting action.
 void wait_until_card_is_removed()
          Wait until the card is removed or the terminal thread is interrupted.
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gui

private final Ov_demo_gui gui
The GUI object. Needed for accessing and changing the GUI.


gui_actions

private final Gui_actions gui_actions
GUI actions for the GUI thread.


messages

private final Gui_protocol_messages messages
Instance for printing progess messages in the GUI.

To Do:
this field should be copied to Card_protocols

card_protocols

private final Card_protocols card_protocols
Card protocol instance.


thread

private Thread thread
The terminal thread. Whenever the user suddenly changes his mind the GUI must interrupt the terminal thread, see set_next_action.


gui_clear_message

private Action gui_clear_message
GUI Action to clear the status line in the GUI.


gui_wait_for_card

Action gui_wait_for_card
GUI Action to display the line "Waiting for a card ..." in the status line of the GUI.


gui_wait_for_card_removal

private Action gui_wait_for_card_removal
GUI Action to display "Please remove card" in the status line of the GUI.


gui_card_inserted

Action gui_card_inserted
GUI Action to display "Card inserted" in the status line of the GUI.


gui_proof_finished

private Action gui_proof_finished
GUI Action to display "Proof finished. Please remove card." in the status line of the GUI.


action_lock

private Object action_lock
Lock for next_action. All accesses to next_action must be guarded by locking this object.


next_action

private Action next_action
Next action to execute in the terminal thread. Or null, if the terminal thread currently executes an action and the next action has not been set yet. All accesses to this field must be guarded by locking the object in action_lock. There are three methods that should be used instead of accessing this field: get_next_action(), set_next_action and set_successor_action.


card_is_present

public boolean card_is_present
Remembers whether we believe that there is currently a card present in the configured card reader.


gui_enable_ptls_actions

private Action gui_enable_ptls_actions
GUI Action to enable all the card maintenance buttons in the GUI.


gui_disable_ptls_actions

private Action gui_disable_ptls_actions
GUI Action to disable all the card maintenance buttons in the GUI.


wait_in_ptls_office

private Action wait_in_ptls_office
Terminal thread wait action for the PTLS office. This action does not finish if the card is removed. Instead it switches the PTLS buttons on and off as cards are inserted and removed until it is interrupted because of a new action.


clear_applet_list

private Action clear_applet_list
GUI action to clear the applet list in the applet list dialog.


default_applet_name

private final byte[] default_applet_name
The AID of the package that seems to be on any card. Will be filtered out from the applet list dialog (if everything is not checked).


wait_in_ptls_automaton

private Action wait_in_ptls_automaton
Terminal thread action for waiting in the PTLS automaton tab. The action runs endlessly until interrupted and switches the PTLS automaton button on and off as cards are inserted and removed.


resign_failed_warning

private Action resign_failed_warning
GUI action to display a warning when resigning fails.


resign_finished_action

private Action resign_finished_action
GUI action for enabling the PTLS automaton run button and display a finished message in the status line.


proof_failed_warning

private Action proof_failed_warning
GUI action to display a warning when the entry gate check failed.

Constructor Detail

Terminal_thread

public Terminal_thread(Ov_demo_gui gui,
                       Gui_actions gui_actions,
                       Card_protocols card_protocols)
Constructor. Record the arguments into private state.

Can be executed on any thread.

Parameters:
gui - the GUI object
gui_actions - the GUI actions
Method Detail

process

public void process(List<Runnable> actions)
Process actions to change the GUI in the GUI thread (event dispatch thread). For simplicity the actions are encapsulated in the run method of a Runnable.

Must be executed on the GUI thread.

Overrides:
process in class SwingWorker<Void,Runnable>
Parameters:
actions - actions that have accumulated since the last call to this method.

gui_status_line_message

private Action gui_status_line_message(String message)
GUI Action to display an arbitrary message in the status line.

Parameters:
message - the message to display

gui_background_died

private Action gui_background_died(Throwable e)
GUI Action to display an error to the user on the fatal event that the terminal thread dies. When the user acknowledges the application is terminated.

Should be executed on the Terminal thread.


gui_message

public void gui_message(JTextPane pane,
                        String message,
                        boolean bold)
GUI action to display a message in a message text pane. When the bold flag is true the message is displayed in the "bold" style, which therefore should exist on the text pane pane.

Should be executed on the Terminal thread.

Parameters:
pane - the text pane to write to
message - the message
bold - display in bold if true

gui_progress_message

public void gui_progress_message(String message,
                                 boolean bold)
GUI action to display a progress message. The message can be displayed in bold.

Should be executed on the Terminal thread.

Parameters:
message - the message
bold - display in bold if true

gui_card_message

public void gui_card_message(BigInteger blinded_a,
                             String message)
GUI action to display a card appearence message.

Should be executed on the Terminal thread.

Parameters:
blinded_a - the blinded attribute expression of the card
message - the message

invalid_card_warning

private Action invalid_card_warning(String message)
Gui action to display a warning dialog if the card is invalid for some reason.

Should be executed on the Terminal thread.

Parameters:
message - more detailed message
Returns:
GUI action to display the warning dialog

card_communication_error_warning

private Action card_communication_error_warning(String message)
Gui action to display a warning if card communication fails for some reason.

Should be executed on the Terminal thread.

Parameters:
message - some more detailed reason
Returns:
GUI action to display the warning dialog

get_next_action

private Action get_next_action()
Return the next action for the terminal thread and clear the next_action field.

Should be executed on the Terminal thread.

Returns:
next action to execute on the terminal thread

set_next_action

public void set_next_action(Action next_action)
Set the next action to be executed in the terminal thread and interrupt the action that currently executes on the terminal thread. This method is for use in the GUI, for instance, when the user presses some button. Note that the interrupts in Java are not really interrupts, so it might take some time until the terminal thread reacts.

Should be executed on the GUI thread.

Parameters:
next_action - next action for the terminal thread

set_successor_action

protected void set_successor_action(Action successor_action)
Set a successor action for the currently executing action. This method is meant for chaining actions in the terminal thread. Setting the successor action takes only effect if the GUI has not itself set an action.

Should be executed on the Terminal thread.

Parameters:
successor_action - the successor action

wait_until_card_is_removed

public void wait_until_card_is_removed()
                                throws InterruptedException,
                                       Terminal_thread.Runtime_card_exception
Wait until the card is removed or the terminal thread is interrupted. Because CardTerminal does not abort timeouts on interrupts this method performs busy-waiting and checks every 100 milliseconds whether the terminal thread has been interrupted.

Must be executed on the Terminal thread.

Throws:
InterruptedException - in case this thread was interrupted before a card removal has been detected
Terminal_thread.Runtime_card_exception - in case of problems with the card reader

wait_for_card

public void wait_for_card()
                   throws InterruptedException,
                          Terminal_thread.Runtime_card_exception
Wait until a card is inserted or the terminal thread is interrupted. An InterruptedException is generated if an interrupt is detected before a card insertion. Because CardTerminal does not react to interrupts, this method performs busy waiting and checks every 100 milliseconds whether an interrupt occurred.

Must be executed on the Terminal thread.

Throws:
InterruptedException - if an interrupt is detected
Terminal_thread.Runtime_card_exception - for card reader problems

wait_in_ptls_office

public void wait_in_ptls_office()
Set the PTLS waiting action.

Should be executed on the GUI thread.


get_applet_list_window

private Applet_list_window get_applet_list_window()
Return the applet list window or throw an assertion if no such window is registered.

Not bound to any thread.

Returns:
the applet list window instance

applet_table_line

private Action applet_table_line(String kind,
                                 Printable_aid name)
GUI action for adding an applet/package line to the applet list dialog.

Should be executed on the Terminal thread.

Parameters:
kind - kind of the entry
name - name of the entry
Returns:
GUI action for adding the specified line

status_entry_filter

private boolean status_entry_filter(cardservices.AIDRegistryEntry e)
Filter the interesting applets/packages to display in the applet list dialog. The default applet packages are filtered out.

Not bound to any thread.

Parameters:
e - registry entry describing one applet/package
Returns:
true if e should be displayed without the everything check box checked

publish_registry

private boolean publish_registry(cardservices.AIDRegistry r,
                                 boolean everything)
Display all applets/packages of one registry in the applet list dialog.

Should be executed on the Terminal thread.

Parameters:
r - the registry to display
everything - if true display all entries, otherwise filter default entries out
Returns:
true if nothing has been displayed

card_status

private Action card_status(boolean everything)
Terminal thread action for displaying installed applets/packages in the applet list display. Querys the status of the card, updates the display and set the ptls office waiting action wait_in_ptls_office as successor action.

The action can throw a Terminal_thread.Runtime_card_exception for a low-level communication problem.

Should be executed on the GUI thread.

Parameters:
everything - if true display all card entries, otherwise filter default entries out
Returns:
the encapsolated action

start_card_status_action

public void start_card_status_action(boolean everything)
Set card status action. Only to be called from within the GUI thread.

Must be executed on the GUI thread.

Parameters:
everything - if true display all card entries in the applet list dialog, otherwise filter default entries out

applet_install_failed_warning

private Action applet_install_failed_warning(cardservices.GlobalPlatformException e)
Gui action to display a warning dialog for applet installation errors.

Should be executed on the Terminal thread.

Parameters:
e - Exception from the global platform service
Returns:
GUI action to display the warning dialog

applet_cap_file_warning

private Action applet_cap_file_warning(IOException e)
Gui action to display a warning if the applet file cannot be opened.

Should be executed on the Terminal thread.

Parameters:
e - IOException from the global platform service
Returns:
GUI action to display the warning dialog

install_applet_action

private Action install_applet_action(Applet_type applet_type)
Terminal thread action for installing one of the applets.

The action might throw a Terminal_thread.Runtime_card_exception for low-level communication problems.

Should be executed on the GUI thread.

Parameters:
applet_type - the applet to install
Returns:
the action performing the task
Throws:
Terminal_thread.Runtime_card_exception - if the operation is terminated because of a CardException

start_install_applet

public void start_install_applet(Applet_type type)
Set the applet install action for the terminal thread. Only to be called from the GUI thread.

Must be executed on the GUI thread.

Parameters:
type - the applet to install

delete_applets

private Action delete_applets(Printable_aid[] aids,
                              boolean everything)
Terminal thread action to delete some applets/packages and update the applet list dialog afterwards.

The action may throw a Terminal_thread.Runtime_card_exception because of a low-level communication problem.

Should be executed on the GUI thread.

Parameters:
aids - applets/packages to delete
everything - if true display all card entries in the applet list dialog, otherwise filter default entries out
Returns:
Action to perform the deletion

start_delete_applets

public void start_delete_applets(Printable_aid[] aids,
                                 boolean everything)
Set applet/package deletion as next action in the terminal thread. Only to be called from the GUI thread.

Must be executed on the GUI thread.

Parameters:
aids - applets/packages to delete
everything - if true display all card entries in the applet list dialog, otherwise filter default entries out

personalize_action

private Action personalize_action(Applet_type applet_type)
Terminal thread action to personalize an applet.

The action might throw a Terminal_thread.Runtime_card_exception for a low-level communication problem.

Should be executed on the GUI thread.

Parameters:
applet_type - the applet to personalize
Returns:
the action that will run the personalization in the terminal thread

start_personalize

public void start_personalize(Applet_type applet_type)
Set personalization as next action of the terminal thread.

Must be executed on the GUI thread.

Parameters:
applet_type - the applet to personalize

reinstall_personalize

private Action reinstall_personalize(Applet_type applet_type)
Terminal thread action for reinstalling the applet with subsequent personalization.

The action might throw a Terminal_thread.Runtime_card_exception for a low-level communication problem.

Should be executed on the GUI thread.

Parameters:
applet_type - the applet to reinstall and personlize
Returns:
the action that performs these tasks in the terminal thread

start_reinstall_personalize

public void start_reinstall_personalize(Applet_type applet_type)
Set reinstall + personalize as next action of the terminal thread.

Must be executed on the GUI thread.

Parameters:
applet_type - the applet to reinstall and personalize

reset_action

private Action reset_action(Applet_type applet_type)
Terminal thread action to reset an applet.

The action might throw a Terminal_thread.Runtime_card_exception for a low-level communication problem.

Should be executed on the GUI thread.

Parameters:
applet_type - the applet to reset

start_reset_applet

public void start_reset_applet(Applet_type applet_type)
Set personalization as next action of the terminal thread.

Must be executed on the GUI thread.

Parameters:
applet_type - the applet to reset

gui_set_ptls_automaton_button

private Action gui_set_ptls_automaton_button(boolean b)
GUI action to enable or disable the obtain-new-signature button in the PTLS automaton tab.

Should be executed on the Terminal thread.

Parameters:
b - if true enable the button, otherwise disable it
Returns:
Action that enables/disables the button in the GUI thread

wait_in_ptls_automaton

public void wait_in_ptls_automaton()
Set the waiting action of the PTLS automaton as next action.

Must be executed on the GUI thread.


resign_action

private Action resign_action(Applet_type applet_type,
                             BigInteger[] updates)
Terminal thread action for resigning.

The action might throw a Terminal_thread.Runtime_card_exception for a low-level communication problem.

Should be executed on the GUI thread.

Parameters:
applet_type - the applet that should be selected for resigning
updates - user selected attribute updates or null for using random attribute updates
Returns:
the action for doing the resign in the terminal thread

start_resign

public void start_resign(Applet_type applet_type,
                         BigInteger[] updates)
Set the resign action as next action to execute in the terminal thread.

Must be executed on the GUI thread.

Parameters:
applet_type - the applet to select for resigning
updates - user selected attribute updates or null for using random attribute updates

proof

private void proof(Applet_type applet_type)
            throws CardException
Run the entry-gate proof-protocol on the card.

Must be executed on the Terminal thread.

Parameters:
applet_type - the applet to select and to run the protocol with
Throws:
CardException - on low-level communication errors

proof_ex

private void proof_ex(Applet_type applet_type)
               throws Terminal_thread.Runtime_card_exception
Exception wrapper for proof. Runs the entry-gate protocol and turn various exceptions into gui visible warnings.

Must be executed on the Terminal thread.

Parameters:
applet_type - the applet to select and to run the protocol with
Throws:
Terminal_thread.Runtime_card_exception - in case of unhandled communication errors

gui_set_entry_run_button

private Action gui_set_entry_run_button(boolean b)
GUI action to enable/disable the run button on the entry gate tab.

Should be executed on the Terminal thread.

Parameters:
b - enable the button if true, otherwise disable the button
Returns:
GUI action for chaning the button

wait_in_entry_gate_action

private Action wait_in_entry_gate_action(boolean automatic_proof,
                                         Applet_type applet_type)
Terminal thread action for waiting in the entry gate tab. The action runs endlessly until it is interrupted and enables and disables the entry gate controls as cards are inserted and removed.

The action might throw a Terminal_thread.Runtime_card_exception for a low-level communication problem.

Should be executed on the GUI thread. The returned actions sould be executed in the terminal thread.

Parameters:
automatic_proof - if true start the proof protocol automatically when a card is inserted
applet_type - applet to select and to run the proof protocol on
Returns:
Terminal thread action for performing these tasks

wait_in_entry_gate

public void wait_in_entry_gate(Applet_type applet_type,
                               boolean automatic_proof)
Set the entry-gate waiting-action as next action of the terminal thread.

Must be executed on the GUI thread.

Parameters:
automatic_proof - if true start the proof protocol automatically when a card is inserted
applet_type - applet to select and to run the proof protocol on

proof_action

private Action proof_action(Applet_type applet_type)
Terminal thread action to run the entry-gate proof-protocol.

The action might throw a Terminal_thread.Runtime_card_exception for a low-level communication problem.

Should be executed on the GUI thread.

Parameters:
applet_type - the applet to select and to run the proof protocol on
Returns:
terminal thread action of running the proof protocol

start_proof

public void start_proof(Applet_type applet_type)
Set the proof-protocol action as next action of the terminal thread.

Must be executed on the GUI thread.

Parameters:
applet_type - the applet to select and to run the proof protocol on

doInBackground

public Void doInBackground()
Main loop of the terminal thread. Started by the SwingWorker machinery in a thread different from the GUI thread. The main loop continuously executes the actions it finds in next_action. Such actions can be set from the GUI or by actions themselves.

Specified by:
doInBackground in class SwingWorker<Void,Runnable>
Returns:
nothing