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

mediumrdhbase.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: mediumrdhbase.h,v $
00003                              -------------------
00004     cvs         : $Id: mediumrdhbase.h,v 1.17 2003/05/16 15:40:57 aquamaniac Exp $
00005     begin       : Tue Aug 27 2002
00006     copyright   : (C) 2002 by Martin Preuss
00007     email       : openhbci@aquamaniac.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00033 #ifndef MEDIUMRDHBASE_H
00034 #define MEDIUMRDHBASE_H
00035 
00036 #ifdef __cplusplus
00037 #include <string>
00038 #endif /* __cplusplus */
00039 #include <openhbci/medium.h>
00040 #ifdef __cplusplus
00041 #include <openhbci/cryptkey.h>
00042 #include <openhbci/rsakey.h>
00043 
00044 namespace HBCI {
00045 
00058 class DLLIMPORT MediumRDHBase: public Medium {
00059 public:
00065     MediumRDHBase(const Hbci *hbci);
00066 
00067     virtual ~MediumRDHBase();
00068 
00076     virtual Error selectContext(int country,
00077                                 const string &instcode,
00078                                 const string &userid)=0;
00079 
00090     virtual Error createMedium(int country,
00091                                const string &instcode,
00092                                const string &userid,
00093                                const string &pin="")=0;
00094 
00105     virtual Error mountMedium(const string &pin="")=0;
00106 
00112     virtual Error unmountMedium(const string &pin="")=0;
00113 
00118     virtual Error changePIN();
00119 
00131     virtual Error changeContext(int context, int country=0,
00132                                 const string instcode="",
00133                                 const string userid="",
00134                                 const string custid="",
00135                                 const string server="");
00136 
00137     virtual unsigned int nextSEQ()=0;
00138 
00142     virtual void resetSEQ()=0;
00143 
00147     virtual void setSEQ(int seq)=0;
00148 
00158     virtual bool isMounted()=0;
00159 
00165     virtual string mediumId() const =0;
00166 
00171     virtual int securityMode() const { return HBCI_SECURITY_RDH;};
00172 
00177     virtual const string& mediumName() const =0;
00178 
00184     virtual MediumType mediumType() const =0;
00185 
00191     virtual int signKeyNumber() const =0;
00192 
00198     virtual int signKeyVersion() const =0;
00199 
00205     virtual int cryptKeyNumber() const =0;
00206 
00212     virtual int cryptKeyVersion() const =0;
00213 
00221     virtual const string &cryptKeyOwner() const =0;
00222 
00239     virtual Error getContext(int num,
00240                              int &countrycode,
00241                              string &instcode,
00242                              string &userid,
00243                              string &server) const =0;
00253     virtual string createMessageKey() const =0;
00254 
00261     virtual string encryptKey(const string &srckey) =0;
00262 
00269     virtual string decryptKey(const string &srckey) =0;
00270 
00278     virtual Error verify(const string &data, const string &signature) =0;
00279 
00286     virtual string sign(const string &data) =0;
00287 
00300     virtual Error createUserKeys(bool activate=true)=0;
00301 
00309     virtual Error activateKeys()=0;
00310 
00316     virtual Pointer<RSAKey> getTempSignKey()=0;
00317 
00323     virtual Pointer<RSAKey> getTempCryptKey()=0;
00324 
00329     virtual Error setInstituteCryptKey(Pointer<RSAKey> cryptkey) =0;
00330 
00335     virtual Error setInstituteSignKey(Pointer<RSAKey> signkey) =0;
00336 
00341     virtual void setSystemId(const string &newid) =0;
00348     virtual bool hasInstSignKey() const =0;
00349 
00354     virtual Pointer<RSAKey> userPubCryptKey() const =0;
00355 
00360     virtual Pointer<RSAKey> userPubSignKey() const =0;
00374     virtual string getInstIniLetterModulus(bool crypt=false) const =0;
00375 
00385     virtual string getInstIniLetterExponent(bool crypt=false) const =0;
00386 
00397     virtual string getInstIniLetterHash(bool crypt=false) const =0;
00398 
00409     virtual int getInstKeyNumber(bool usecrypt = false) const =0;
00420     virtual int getInstKeyVersion(bool usecrypt = false) const =0;
00421 
00425     virtual string getUserIniLetterModulus() const =0;
00426 
00430     virtual string getUserIniLetterExponent() const =0;
00431 
00435     virtual string getUserIniLetterHash() const =0;
00436 
00441     virtual int getUserKeyNumber() const =0;
00442 
00447     virtual int getUserKeyVersion() const =0;
00452     const static unsigned int minPinSize;
00453 };
00454 
00455 } /* namespace HBCI */
00456 
00458 typedef HBCI::MediumRDHBase HBCI_MediumRDHBase;
00459 extern "C" {
00460 #else /* __cplusplus */
00461     typedef struct HBCI_MediumRDHBase HBCI_MediumRDHBase;
00462 #endif /* __cplusplus */
00463 
00467     extern HBCI_Medium *HBCI_MediumRDHBase_Medium(HBCI_MediumRDHBase *h);
00469     extern HBCI_MediumRDHBase *HBCI_Medium_MediumRDHBase(HBCI_Medium *h);
00472     extern int 
00473     HBCI_MediumRDHBase_hasInstSignKey(const HBCI_MediumRDHBase *h);
00484     extern char *
00485     HBCI_MediumRDHBase_getInstIniLetterExponent(const HBCI_MediumRDHBase *h, 
00486                                                 int usecrypt);
00495     extern char *
00496     HBCI_MediumRDHBase_getInstIniLetterHash(const HBCI_MediumRDHBase *h, 
00497                                             int usecrypt);
00506     extern char *
00507     HBCI_MediumRDHBase_getInstIniLetterModulus(const HBCI_MediumRDHBase *h, 
00508                                                int usecrypt);
00517     extern int 
00518     HBCI_MediumRDHBase_getInstKeyNumber(const HBCI_MediumRDHBase *h, 
00519                                         int usecrypt);
00528     extern int 
00529     HBCI_MediumRDHBase_getInstKeyVersion(const HBCI_MediumRDHBase *h, 
00530                                          int usecrypt);
00531 
00535     extern char *
00536     HBCI_MediumRDHBase_getUserIniLetterExponent(const HBCI_MediumRDHBase *h);
00540     extern char *
00541     HBCI_MediumRDHBase_getUserIniLetterHash(const HBCI_MediumRDHBase *h);
00545     extern char *
00546     HBCI_MediumRDHBase_getUserIniLetterModulus(const HBCI_MediumRDHBase *h);
00551     extern int 
00552     HBCI_MediumRDHBase_getUserKeyNumber(const HBCI_MediumRDHBase *h);
00557     extern int 
00558     HBCI_MediumRDHBase_getUserKeyVersion(const HBCI_MediumRDHBase *h);
00561 #ifdef __cplusplus
00562 }
00563 #endif /* __cplusplus */
00564 
00565 #endif
00566 

Generated on Mon Jun 23 13:41:07 2003 for openhbci by doxygen1.2.17