#include <mediumrdhbase.h>
Inheritance diagram for HBCI::MediumRDHBase:
Public Methods | |
MediumRDHBase (const Hbci *hbci) | |
virtual | ~MediumRDHBase () |
Medium management | |
virtual Error | selectContext (int country, const string &instcode, const string &userid)=0 |
virtual Error | createMedium (int country, const string &instcode, const string &userid, const string &pin="")=0 |
virtual Error | mountMedium (const string &pin="")=0 |
virtual Error | unmountMedium (const string &pin="")=0 |
virtual Error | changePIN () |
virtual Error | changeContext (int context, int country=0, const string instcode="", const string userid="", const string custid="", const string server="") |
virtual unsigned int | nextSEQ ()=0 |
virtual void | resetSEQ ()=0 |
virtual void | setSEQ (int seq)=0 |
Medium Information | |
virtual bool | isMounted ()=0 |
virtual string | mediumId () const=0 |
virtual int | securityMode () const |
virtual const string & | mediumName () const=0 |
virtual MediumType | mediumType () const=0 |
virtual int | signKeyNumber () const=0 |
virtual int | signKeyVersion () const=0 |
virtual int | cryptKeyNumber () const=0 |
virtual int | cryptKeyVersion () const=0 |
virtual const string & | cryptKeyOwner () const=0 |
virtual Error | getContext (int num, int &countrycode, string &instcode, string &userid, string &server) const=0 |
Cryptographic Methods | |
virtual string | createMessageKey () const=0 |
virtual string | encryptKey (const string &srckey)=0 |
virtual string | decryptKey (const string &srckey)=0 |
virtual Error | verify (const string &data, const string &signature)=0 |
virtual string | sign (const string &data)=0 |
Key Generation and management | |
virtual Error | createUserKeys (bool activate=true)=0 |
virtual Error | activateKeys ()=0 |
virtual Pointer< RSAKey > | getTempSignKey ()=0 |
virtual Pointer< RSAKey > | getTempCryptKey ()=0 |
virtual Error | setInstituteCryptKey (Pointer< RSAKey > cryptkey)=0 |
virtual Error | setInstituteSignKey (Pointer< RSAKey > signkey)=0 |
virtual void | setSystemId (const string &newid)=0 |
Key Information | |
virtual bool | hasInstSignKey () const=0 |
virtual Pointer< RSAKey > | userPubCryptKey () const=0 |
virtual Pointer< RSAKey > | userPubSignKey () const=0 |
Ini-Letter Information | |
virtual string | getInstIniLetterModulus (bool crypt=false) const=0 |
virtual string | getInstIniLetterExponent (bool crypt=false) const=0 |
virtual string | getInstIniLetterHash (bool crypt=false) const=0 |
virtual int | getInstKeyNumber (bool usecrypt=false) const=0 |
virtual int | getInstKeyVersion (bool usecrypt=false) const=0 |
virtual string | getUserIniLetterModulus () const=0 |
virtual string | getUserIniLetterExponent () const=0 |
virtual string | getUserIniLetterHash () const=0 |
virtual int | getUserKeyNumber () const=0 |
virtual int | getUserKeyVersion () const=0 |
Static Public Attributes | |
const unsigned int | minPinSize |
This is a base class for all RSA-DES-hybrid (RDH) media. RSA keys are used for authentification and encryption of the session keys, and Triple-DES-keys are used as session keys for the actual encryption of messages.
Currently only key files are supported, but in future RDH chip cards might also be implemented.
|
Constructor.
|
|
|
|
Activates the previously created keys. This is required if you specified "false" as arguement to createUserKeys(). This will finally store the created keys to their destination, so that they are usable for further signing/crypting.
|
|
Change data that is stored on the medium.
Implements HBCI::Medium. |
|
Change the PIN that is used to protect the medium data. Implements HBCI::Medium. |
|
Creates a context in your medium. A context is just the combination of a userid and the institute code (+ country code). IMPORTANT: If you want to add a context to an already existing medium you MUST call this method with the medium MOUNTED !! Otherwise the keys on that medium will be LOST !! Well, of course, if that medium does not exist you have to this method without prior mounting (since there is nothing to mount).
|
|
Creates a key for encryption of data.
Implements HBCI::Medium. |
|
Generates the users sign and crypt keys.
|
|
Returns the number of the crypt key. RDH-media should return the number of the institutes public crypt key.
Implements HBCI::Medium. |
|
Returns the user ID of the owner of the crypt key. RDH-media should return the owner of the institutes public crypt key. This is retrieved from HIISA segments.
|
|
Returns the version of the crypt key. RDH-media should return the version of the institutes public crypt key.
Implements HBCI::Medium. |
|
Lets the card decrypt the key.
Implements HBCI::Medium. |
|
Lets the card encrypt the key.
Implements HBCI::Medium. |
|
Returns the context with the given number. Some media are able of storing multiple contexts (like chip cards). Please note that the medium has to be mounted prior to calling this method.
Implements HBCI::Medium. |
|
return the ini-letter-exponent that is needed to print the ini-letter
|
|
return the ini-letter-hash that is needed to print the ini-letter
|
|
Returns the modulus of the institute key that is needed to print the ini-letter.
|
|
Returns the number of the institute key.
|
|
Returns the version of the institute key.
|
|
This returns the temporary crypt key which has been created by createUserKeys(). You'll need this in a key change protocol.
|
|
This returns the temporary sign key which has been created by createUserKeys(). You'll need this in a key change protocol.
|
|
return the ini-letter-exponent that is needed to print the ini-letter |
|
return the ini-letter-hash that is needed to print the ini-letter |
|
return the ini-letter-modulus that is needed to print the ini-letter |
|
This method is needed when generating the users ini letter.
|
|
This method is needed when generating the users ini letter.
|
|
Returns true, if the institute/bank of this MediumRDH uses a public signature key. |
|
Checks whether the medium is mounted.
Implements HBCI::Medium. |
|
Returns the id of the medium. For DDV this is the CID of the chip card, for RDH this is the system ID assigned to us by an institute.
Implements HBCI::Medium. |
|
Returns the id of the medium. For DDV this is the card number, for RDH this is the name of the file. Implements HBCI::Medium. |
|
Returns the type this medium is of.
Implements HBCI::Medium. |
|
Mounts a medium and makes its crypto methods available.
Implements HBCI::Medium. |
|
Returns a unique sequence number. This method MUST never return a sequence number it returned before! Therefore the medium will probably save the current sequence number before returning a new one. (Depends on the actual implementation class, of course.)
Implements HBCI::Medium. |
|
Sets the seq counter to 1 |
|
Returns the security mode of this medium (DDV, RDH)
Implements HBCI::Medium. |
|
Since some media (like hbci chip cards) are able to store multiple account entries you have to select one.
Implements HBCI::Medium. |
|
Sets the institutes public crypt key.
|
|
Sets the institutes public sign key.
|
|
Directly set the seq counter |
|
Sets the SystemId.
|
|
sign data
Implements HBCI::Medium. |
|
Returns the number of the sign key. RDH-media should return the number of the users private sign key.
Implements HBCI::Medium. |
|
Returns the version of the crypt key. RDH-media should return the version of the users private sign key.
Implements HBCI::Medium. |
|
Unmounts a medium so that it may be removed.
Implements HBCI::Medium. |
|
Returns the users public crypt key.
|
|
Returns the users public sign key.
|
|
Verify the signature of given data
Implements HBCI::Medium. |
|
The minimum size of a new PIN, otherwise it will not be accepted and an Error will be thrown. |