JMRTD 0.4.5

net.sourceforge.scuba.smartcards
Class APDUFingerprint

java.lang.Object
  extended by net.sourceforge.scuba.smartcards.APDUFingerprint
All Implemented Interfaces:
CardFingerprint

public class APDUFingerprint
extends Object
implements CardFingerprint

Fingerprint data structure. Basically maps commands to response codes (status words). Under construction! Reads and parses files in basedir/fingerprintfiles formatted with filestructures of Henning. TODO: We should think of some other fileformat: Henning's format is based on toString() of javax.smartcardio.*APDU classes, not under our control. TODO: For long term: maybe turn this into some CardType-like system similar to OCF?

Author:
Henning Richter (hrichter@fh-lausitz.de), Martijn Oostdijk (martijn.oostdijk@gmail.com)

Constructor Summary
APDUFingerprint()
          Constructs an empty fingerprint.
APDUFingerprint(CardService service)
          Constructs a fingerprint by sending some APDUs to the card connected to service.
 
Method Summary
 boolean equals(Object obj)
           
 Properties guessProperties()
          Produces some string that identifies this card.
 int hashCode()
           
 void put(CommandAPDU capdu, ResponseAPDU rapdu)
          Adds a command-response pair to this fingerprint.
 void put(CommandAPDU capdu, short sw)
          Adds a command-response pair to this fingerprint.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

APDUFingerprint

public APDUFingerprint()
Constructs an empty fingerprint.


APDUFingerprint

public APDUFingerprint(CardService service)
Constructs a fingerprint by sending some APDUs to the card connected to service. FIXME: only tested with PassportService, which selects the passportapplet when opened!

Parameters:
service - some card service
Method Detail

put

public void put(CommandAPDU capdu,
                ResponseAPDU rapdu)
Adds a command-response pair to this fingerprint.

Parameters:
capdu - command
rapdu - response

put

public void put(CommandAPDU capdu,
                short sw)
Adds a command-response pair to this fingerprint.

Parameters:
capdu - command apdu
sw - response

guessProperties

public Properties guessProperties()
Produces some string that identifies this card.

Specified by:
guessProperties in interface CardFingerprint
Returns:
some string that identifies this card

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

JMRTD 0.4.5