opencard.core.service
Class CardHolderVerificationGUI

java.lang.Object
  extended by opencard.core.service.CardHolderVerificationGUI

public final class CardHolderVerificationGUI
extends java.lang.Object

The system user interaction handler.

This class provides a trusted path to the OpenCard Framework.

Version:
$Id: CardHolderVerificationGUI.java,v 1.2 2005/09/19 10:21:22 asc Exp $
Author:
Peter Trommler (trp@zurich.ibm.com), Thomas Schaeck (schaeck@de.ibm.com)

Constructor Summary
protected CardHolderVerificationGUI()
           
 
Method Summary
protected  void clearDisplay()
          Clear the display.
protected  void display(int num)
          Display a message.
protected  java.lang.String keyboardInput(CardTerminalIOControl ioControl, CHVDialog customCHVDialog)
          Return keyboard (i.e., keyboard, PIN pad, etc.) input.
protected  java.lang.String promptUser(int chvNumber, CardTerminalIOControl ioControl, CHVDialog customCHVDialog)
          Prompt the user for a password, etc.
 ResponseAPDU sendVerifiedAPDU(SlotChannel slotchan, CommandAPDU command, CHVControl control, CHVDialog dialog)
          Queries for a PIN and sends it to the smartcard.
 ResponseAPDU sendVerifiedAPDU(SlotChannel slotchan, CommandAPDU command, CHVControl control, CHVDialog dialog, int timeout)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CardHolderVerificationGUI

protected CardHolderVerificationGUI()
Method Detail

clearDisplay

protected void clearDisplay()
Clear the display.


display

protected void display(int num)
Display a message.

Parameters:
message - The String to display.

keyboardInput

protected java.lang.String keyboardInput(CardTerminalIOControl ioControl,
                                         CHVDialog customCHVDialog)
Return keyboard (i.e., keyboard, PIN pad, etc.) input.

Parameters:
ioControl - A CardTerminalIOControl object that specifies how the user input should look like.
Returns:
A String containing the input.

promptUser

protected java.lang.String promptUser(int chvNumber,
                                      CardTerminalIOControl ioControl,
                                      CHVDialog customCHVDialog)
Prompt the user for a password, etc.

Parameters:
prompt - The message to be displayed.
ioControl - A CardTerminalIOControl object that specifies how the user input should look like.
Returns:
A String containing the input.

sendVerifiedAPDU

public ResponseAPDU sendVerifiedAPDU(SlotChannel slotchan,
                                     CommandAPDU command,
                                     CHVControl control,
                                     CHVDialog dialog,
                                     int timeout)
                              throws CardTerminalException,
                                     CardServiceInvalidCredentialException
Deprecated. 

Throws:
CardTerminalException
CardServiceInvalidCredentialException

sendVerifiedAPDU

public ResponseAPDU sendVerifiedAPDU(SlotChannel slotchan,
                                     CommandAPDU command,
                                     CHVControl control,
                                     CHVDialog dialog)
                              throws CardTerminalException,
                                     CardServiceInvalidCredentialException
Queries for a PIN and sends it to the smartcard. This method expects a command including a PIN to send to the smartcard. The PIN or password within the command is pre-initialized with padding bytes. This method queries the password from the user, stores it in the command, and sends the resulting command to the smartcard. The smartcard's response is returned.
This method is invoked by CardChannel.sendVerifiedAPDU only if the card terminal does not take responsibility for querying and filling in the password. If the terminal implements the interface VerifiedAPDUInterface, the channel will use the card terminal to do the job.

Parameters:
slotchan - the physical channel to the smartcard
command - the APDU to send, password still missing
control - the parameters needed to query and fill in the password, for example the message for querying, and an offset in the command APDU
dialog - a dialog provided by the application, or null to use a default dialog
Throws:
CardTerminalException - An error occurred while sending the command.
CardServiceInvalidCredentialException - The user entered an empty password, or cancelled the password input. No command has been sent to the smartcard.
See Also:
CardChannel.sendVerifiedAPDU(opencard.core.terminal.CommandAPDU, opencard.core.terminal.CHVControl, opencard.core.service.CHVDialog, int)