com.cryptware.jsle4442api.sle4442applet
Class SLE4442Applet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by com.cryptware.jsle4442api.sle4442applet.SLE4442Applet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class SLE4442Applet
extends java.applet.Applet

Author:
ugo
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static int ERROR_INIT_ERROR
           
static int ERROR_INVALID_MEMORY_RANGE
           
static int ERROR_NO_READER_AVAILABLE
           
static int ERROR_NOT_CONNECTED
           
static int ERROR_NOT_INITIALIZED
           
static int ERROR_PIN_ATTEMPTS_LEFT
           
static int ERROR_PIN_VERIFY_FAILED
           
static int ERROR_PIN_VERIFY_NEEDED
           
static int ERROR_PIN_WRONG_LENGTH
           
static int ERROR_REMOVED_CARD
           
static int ERROR_SLE4442LIB_NOT_FOUND
           
static int ERROR_SMARTCARD_MANAGER
           
static int ERROR_UNEXPECTED
           
static int INCOMPATIBLE_READER
           
static int UNKNOWN_CARD
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SLE4442Applet()
           
 
Method Summary
 int changeDefaultPIN(java.lang.String pin)
          Cambia il PIN di default (da 0xFFFFFF al PIN dato in input)
 int changePIN(java.lang.String oldpin, java.lang.String newpin)
          Cambia il PIN
 int close()
          Closes the native library SLE4442Lib
 int connect()
          Apre una connessione con il lettore di smart card
 int disconnect()
          Disconnette dal lettore
 java.lang.String getAppletInfo()
           
 int getLastError()
          Ritorna l'ultimo errore verificatosi
 void init()
          Chiamato dal browser pre inizializzare l'applet
 boolean isReaderPresent()
          Verifica se c'è almeno un lettore connesso
 boolean isSmartCardPresent()
          Verifica la presenza della smart card nel lettore
 int open()
          Initializes the applet and the underlying libraries
 java.lang.String readMainMemory(int offset, int len)
          Legge il numero seriale della smart card
 void stop()
          Chiamato dal browser per fermare l'applet
 int updateMainMemory(java.lang.String data, int offset, int len)
          Update the main momory
 int verifyPIN(java.lang.String pin)
          Verifica il PIN
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_SLE4442LIB_NOT_FOUND

public static final int ERROR_SLE4442LIB_NOT_FOUND
See Also:
Constant Field Values

ERROR_SMARTCARD_MANAGER

public static final int ERROR_SMARTCARD_MANAGER
See Also:
Constant Field Values

ERROR_NO_READER_AVAILABLE

public static final int ERROR_NO_READER_AVAILABLE
See Also:
Constant Field Values

ERROR_NOT_INITIALIZED

public static final int ERROR_NOT_INITIALIZED
See Also:
Constant Field Values

ERROR_NOT_CONNECTED

public static final int ERROR_NOT_CONNECTED
See Also:
Constant Field Values

ERROR_PIN_WRONG_LENGTH

public static final int ERROR_PIN_WRONG_LENGTH
See Also:
Constant Field Values

ERROR_INIT_ERROR

public static final int ERROR_INIT_ERROR
See Also:
Constant Field Values

INCOMPATIBLE_READER

public static final int INCOMPATIBLE_READER
See Also:
Constant Field Values

UNKNOWN_CARD

public static final int UNKNOWN_CARD
See Also:
Constant Field Values

ERROR_INVALID_MEMORY_RANGE

public static final int ERROR_INVALID_MEMORY_RANGE
See Also:
Constant Field Values

ERROR_PIN_VERIFY_NEEDED

public static final int ERROR_PIN_VERIFY_NEEDED
See Also:
Constant Field Values

ERROR_PIN_VERIFY_FAILED

public static final int ERROR_PIN_VERIFY_FAILED
See Also:
Constant Field Values

ERROR_PIN_ATTEMPTS_LEFT

public static final int ERROR_PIN_ATTEMPTS_LEFT
See Also:
Constant Field Values

ERROR_REMOVED_CARD

public static final int ERROR_REMOVED_CARD
See Also:
Constant Field Values

ERROR_UNEXPECTED

public static final int ERROR_UNEXPECTED
See Also:
Constant Field Values
Constructor Detail

SLE4442Applet

public SLE4442Applet()
Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet
See Also:
Applet.getAppletInfo()

stop

public void stop()
Chiamato dal browser per fermare l'applet

Overrides:
stop in class java.applet.Applet
See Also:
Applet.stop()

close

public int close()
Closes the native library SLE4442Lib

Returns:
0 OK error code otherwise

init

public void init()
Chiamato dal browser pre inizializzare l'applet

Overrides:
init in class java.applet.Applet
See Also:
Applet.init()

open

public int open()
Initializes the applet and the underlying libraries

Returns:
0 success, error code otherwise

isReaderPresent

public boolean isReaderPresent()
Verifica se c'è almeno un lettore connesso

Returns:
true if the reader is present

connect

public int connect()
Apre una connessione con il lettore di smart card

Returns:
0 se la connessione è stata stabilita con successo, codice di errore altrimenti.

disconnect

public int disconnect()
Disconnette dal lettore

Returns:
il risultato dell'operazione: 0 se OK codice di errore altrimenti

isSmartCardPresent

public boolean isSmartCardPresent()
Verifica la presenza della smart card nel lettore

Returns:
true se la smart card è inserita, false altrimenti.

readMainMemory

public java.lang.String readMainMemory(int offset,
                                       int len)
Legge il numero seriale della smart card

Returns:
il numero seriale della smart card o null in caso di errore. In caso di errore il codice di errore è leggibile mediente getLastError()

updateMainMemory

public int updateMainMemory(java.lang.String data,
                            int offset,
                            int len)
Update the main momory

Parameters:
data - to write
Returns:
0 OK, error code otherwise

verifyPIN

public int verifyPIN(java.lang.String pin)
Verifica il PIN

Parameters:
pin - il PIN composto da 3 byte
Returns:
il risultato dell'operazione: 0 se OK codice di errore altrimenti

changeDefaultPIN

public int changeDefaultPIN(java.lang.String pin)
Cambia il PIN di default (da 0xFFFFFF al PIN dato in input)

Parameters:
pin - il nuovo PIN
Returns:
il risultato dell'operazione: 0 se OK codice di errore altrimenti

changePIN

public int changePIN(java.lang.String oldpin,
                     java.lang.String newpin)
Cambia il PIN

Parameters:
oldpin - vecchio PIN
newpin - nuovo PIN
Returns:
il risultato dell'operazione: 0 se OK codice di errore altrimenti

getLastError

public int getLastError()
Ritorna l'ultimo errore verificatosi

Returns:
codice di errore