#include <rsacard.h>
Inheritance diagram for RSACard:
Public Member Functions | |
Constructors and Destructors | |
Methods to connect and disconnect the card. Most other methods only work if the card is open. | |
RSACard (const CTCard &c) | |
~RSACard () | |
Opening and closing operations | |
Methods to connect and disconnect the card. Most other methods only work if the card is open. | |
virtual CTError | reopenCard () |
virtual CTError | openCard () |
virtual CTError | closeCard (bool force=false) |
Informational methods | |
These methods tell you about the type and the status of the card. | |
virtual string | cardType () |
virtual string | cardTypes () |
const string & | initialPin () const |
string | cardNumber () const |
Pin Verification and Changes | |
These method allow verifying and changing the pin. There are methods for terminals with keypads, too. On these you can enter the pin directly into the card readers keypad (secure mode). | |
CTError | verifyPin (int kid, const string &pin) |
CTError | changePin (int kid, const string &oldpin, const string &newpin) |
CTError | changePin (int kid) |
CTError | verifyPin (int kid) |
CTError | pinStatus (int &maxerr, int &errleft) |
Key Management | |
This group contains methods to create, read, write, inspect and update keys on the card. | |
CTError | deleteKeyDescriptor (int kid) |
unsigned int | readKeyStatus (int kid) |
CTError | writeKeyStatus (int kid, unsigned int st) |
CTError | writeKeyDescriptor (int kid, const string &kd) |
string | readKeyDescriptor (int kid) |
string | readPublicKey (int kid) |
CTError | writePublicKey (int kid, const string &modulus) |
string | createKey (int kid, bool overwrite) |
CTError | activateKey (int kid, int num, int ver) |
bool | isBankKey (int kid) |
bool | isSignKey (int kid) |
int | getKeyId (int bank, bool pub, bool sign) |
KeyLogStatus | readKeyLogStatus () |
CTError | writeKeyLogStatus (KeyLogStatus st) |
Bank Descriptions | |
Methods of this group read, delete and update bank descriptions on the card. | |
BankDescription | readBankDescription (int idx) |
CTError | writeBankDescription (int idx, const BankDescription &bd) |
CTError | deleteBankDescription (int idx) |
int | findFreeBankDescription () |
Cryptographic Methods | |
Methods of this group allow signing, verifying a signature, encrypting and decrypting data. | |
string | getRandom (int s) |
string | sign (int kid, const string &data) |
CTError | verify (int kid, const string &data, const string &signature) |
string | encrypt (int kid, const string &data) |
string | decrypt (int kid, const string &data) |
Signature Sequence Counter | |
This group contains methods concerning the signature sequence counter. This can only be read (not written) and is updated automatically upon sign(). When creating keys for a bank context then this counter is reset to 0. | |
unsigned int | readSeq (int bank) |
CTError | writeSeq (int bank, unsigned int seq) |
Classes | |
class | BankDescription |
class | KeyDescriptor |
struct | KeyLogStatus |
|
|
|
|
|
This activates a previously created key pair. After this method has been called the new keys are stored at their final destination and used by all subsequent calls to cryptographic methods with this key id. |
|
Returns the cards serial number. |
|
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 CTProcessorCard. |
|
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 CTProcessorCard. |
|
Changes the pin using the keypad of your reader. This is the recommended method of changing the pin, since no trojan horse can spy out your pin !
|
|
Changes the pin without using the keypad. If your reader has a keypad I recommend using the secure method !!
|
|
Call this if you have finished working with the card. After this method is called you may safely remove the card from the reader.
Reimplemented from CTCard. |
|
Creates a keypair for the given key id. This can take some seconds (up to a minute). The key pair created is not automatically activated.
|
|
|
|
|
|
Deletes a key descriptor. This allows overwriting a key stored on the card.
|
|
|
|
|
|
Translates the given information about a key into a key id which can then be used for the other methods of this class. |
|
|
|
Returns the initial pin of a pristine card. On such a card verifying the pin does not work as long as you did not change the pin using changePin(). The initial pin (which MUST be changed) is the serial number of the card stored in one of the files on it. With this method here you get that number. This method is only valid after openCard() has been called successfully. |
|
Checks whether the given key id belongs to a partner of to us. |
|
Checks whether the given key id belongs to a signature key. |
|
Opens the card for usage. This way the card is powered on. This method does some basic checks and retrieves basic information about the card (whether it is a memory card or a processor card, the size of the memory etc). When this method successfully returns the card may be used.
Reimplemented from CTCard. |
|
Get the pin status of the card.
|
|
|
|
Reads a fully 8 byte key descriptor. |
|
The keylog status contains information about how many bank descriptions are in use and about whether there are newly generated but not yet activated keys. |
|
Reads the key status for the given key. |
|
Reads the modulus of a public key. The exponent is defined to be always 0x010001. |
|
|
|
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 CTProcessorCard. |
|
|
|
|
|
Verifies the pin using the keypad of your reader. This is the recommended method of verifying the pin, since no trojan horse can spy out your pin !
|
|
Verifies the pin without using the keypad. If your reader has a key pad I recommend using the secure method !!
|
|
|
|
This method updates a full 8 byte key descriptor. |
|
Updates the keylog status. |
|
Updates the key status for the given key. |
|
Updates the modulus of a public key. This is used to store the partners public keys on the card (like the pulic keys of the bank). |
|
|