Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

CTProcessorCard Class Reference
[General Card Classes]

Basic class for processor cards. More...

#include <ctprocessorcard.h>

Inheritance diagram for CTProcessorCard:

CTCard CTCardBase CTGeldKarte HBCICard RSACard List of all members.

Public Member Functions

Constructors/Destructor
Methods to retrieve the private members of this class.

 CTProcessorCard (const CTCard &c)
virtual ~CTProcessorCard ()
Opening and closing operations
Methods to connect and disconnect the card. Most other methods only work if the card is open.

virtual CTError reopenCard ()
Informational methods
These methods tell you about the type and the status of the card.

virtual string cardType ()
virtual string cardTypes ()
Commands
These methods allow you to send a command to the card. Of course the card needs to be already open.

CTError selectMF (string &fcp)
CTError selectDF (string &fcp, unsigned short fid)
CTError selectEF (string &fcp, unsigned short fid)
CTError selectParent (string &fcp)
CTError selectById (string &fcp, string id)
CTError readRecord (string &data, unsigned char num, unsigned char size=0)
CTError updateRecord (string &data, unsigned char num)

Detailed Description

Basic class for processor cards.

This class provides basic access to processor chip cards. It allows reading, writing and selecting of files on the card.

Author:
Martin Preuss<martin@libchipcard.de>


Constructor & Destructor Documentation

CTProcessorCard::CTProcessorCard const CTCard c  ) 
 

virtual CTProcessorCard::~CTProcessorCard  )  [virtual]
 


Member Function Documentation

virtual string CTProcessorCard::cardType  )  [virtual]
 

This method returns a short name of the class which handles this card. A HBCI card for example returns "HBCICard". So you can use this method to check for the type of the card.

Reimplemented from CTCard.

Reimplemented in CTGeldKarte, HBCICard, and RSACard.

virtual string CTProcessorCard::cardTypes  )  [virtual]
 

This method returns a comma separated list of all card types this card inherits including the type of this card, e.g. a HBCI card would return "CTProcessorCard, HBCICard". If you overload this method in your own class (you SHOULD) you simply have to call this method of the class it directly inherits. That class will then do the same, so that there is a list upon return.

Reimplemented from CTCard.

Reimplemented in CTGeldKarte, HBCICard, and RSACard.

CTError CTProcessorCard::readRecord string &  data,
unsigned char  num,
unsigned char  size = 0
 

Reads a record from the currently selected EF.

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
CTError object that holds the result (call isOk() to see if there was an error)
Parameters:
data reference to a string to receive the data
num number of the record to retrieve. Please note that the first record has the number 1, because 00 and 0xff are reserved !!
size number of bytes to read (if 0 or omitted all bytes are read)

virtual CTError CTProcessorCard::reopenCard  )  [virtual]
 

When this method is called normally the card is already opened by means of openCard(). However, it is likely that openCard() has been called assuming this card is only a CTCard() object, nothing special. You may then call THIS method here on all known card classes to check for the type of this card. This method must assume that any file on the card is already selected, so it is in most cases a good idea to select the MF as the first action of this method. If the executing class finds that the card inserted is not of a type it can handle then it MUST return an error.

Reimplemented from CTCard.

Reimplemented in CTGeldKarte, HBCICard, and RSACard.

CTError CTProcessorCard::selectById string &  fcp,
string  id
 

Selects a DF by its name (AID, Application Identifier). On success the FCI is returned. Please note that some cards do not support this command. In that case you have to use the basic method CTCard::selectFile().

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
CTError object that holds the result (call isOk() to see if there was an error)
Parameters:
fcp a reference to a string to receive the FCI
id file identifier

CTError CTProcessorCard::selectDF string &  fcp,
unsigned short  fid
 

Selects a dedicated file (DF) within the currently selected one. On success the FCI is returned. Please note that some cards do not support this command. In that case you have to use the basic method CTCard::selectFile().

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
CTError object that holds the result (call isOk() to see if there was an error)
Parameters:
fcp a reference to a string to receive the FCI
fid the two byte file identifier

CTError CTProcessorCard::selectEF string &  fcp,
unsigned short  fid
 

Selects an elementary file (EF) within the currently selected DF. On success the FCI is returned. Please note that some cards do not support this command. In that case you have to use the basic method CTCard::selectFile().

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
CTError object that holds the result (call isOk() to see if there was an error)
Parameters:
fcp a reference to a string to receive the FCI
fid the two byte file identifier

CTError CTProcessorCard::selectMF string &  fcp  ) 
 

Selects the master file. On success the FCI (File Control Information) is returned. The FCI may contain some usefull information about access rights you have for the file. For a closer information about FCI see the file "geldkarte.pdf" which may be obtained from the Chaos Computer Club (CCC). Please note that some cards do not support this command. In that case you have to use the basic method CTCard::selectFile().

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
CTError object that holds the result (call isOk() to see if there was an error)
Parameters:
fcp a reference to a string to receive the FCI

CTError CTProcessorCard::selectParent string &  fcp  ) 
 

Selects the parent DF of the currently selected DF/EF. On success the FCI is returned. Please note that some cards do not support this command. In that case you have to use the basic method CTCard::selectFile().

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
CTError object that holds the result (call isOk() to see if there was an error)
Parameters:
fcp a reference to a string to receive the FCI

CTError CTProcessorCard::updateRecord string &  data,
unsigned char  num
 

Writes a record into the currently selected EF.

Author:
Martin Preuss<martin@libchipcard.de>
Returns:
CTError object that holds the result (call isOk() to see if there was an error)
Parameters:
data reference to a string which holds the data to be written
num number of the record to write to. Please note that the first record has the number 1, because 00 and 0xff are reserved !!


The documentation for this class was generated from the following file:
Generated on Sat Feb 11 15:20:28 2006 for libchipcard by  doxygen 1.4.2