HBCI Medium

Security Medium For HBCI. More...

Constructor And Destructor

AQHBCI_API AH_MEDIUMAH_Medium_new (AH_HBCI *hbci, const char *typeName, const char *subTypeName, const char *mediumName)
AQHBCI_API void AH_Medium_free (AH_MEDIUM *m)
AQHBCI_API void AH_Medium_Attach (AH_MEDIUM *m)

Informational Functions

AQHBCI_API AH_HBCIAH_Medium_GetHBCI (const AH_MEDIUM *m)
AQHBCI_API AB_BANKINGAH_Medium_GetBankingApi (const AH_MEDIUM *m)
AQHBCI_API const char * AH_Medium_GetMediumTypeName (const AH_MEDIUM *m)
AQHBCI_API const char * AH_Medium_GetMediumSubTypeName (const AH_MEDIUM *m)
AQHBCI_API const char * AH_Medium_GetMediumName (const AH_MEDIUM *m)
AQHBCI_API void AH_Medium_SetMediumName (AH_MEDIUM *m, const char *s)
AQHBCI_API const char * AH_Medium_GetDescriptiveName (const AH_MEDIUM *m)
AQHBCI_API void AH_Medium_SetDescriptiveName (AH_MEDIUM *m, const char *s)
AQHBCI_API GWEN_TYPE_UINT32 AH_Medium_GetFlags (const AH_MEDIUM *m)
AQHBCI_API void AH_Medium_SetFlags (AH_MEDIUM *m, GWEN_TYPE_UINT32 fl)
AQHBCI_API void AH_Medium_AddFlags (AH_MEDIUM *m, GWEN_TYPE_UINT32 fl)
AQHBCI_API void AH_Medium_SubFlags (AH_MEDIUM *m, GWEN_TYPE_UINT32 fl)
AQHBCI_API int AH_Medium_IsMounted (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_GetTokenIdData (AH_MEDIUM *m, GWEN_BUFFER *buf)

Context Selection, Creation and Removal

AQHBCI_API int AH_Medium_SelectContext (AH_MEDIUM *m, int idx)
AH_MEDIUM_CTXAH_Medium_GetCurrentContext (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_ReadContext (AH_MEDIUM *m, int idx, int *country, GWEN_BUFFER *bankId, GWEN_BUFFER *userId, GWEN_BUFFER *server, int *port)
AQHBCI_API int AH_Medium_WriteContext (AH_MEDIUM *m, int idx, int country, const char *bankId, const char *userId, const char *server, int port)

Encryption And Decryption

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Encrypt (AH_MEDIUM *m, GWEN_BUFFER *msgbuf, GWEN_BUFFER *encryptbuf, GWEN_BUFFER *msgKeyBuffer)
AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Decrypt (AH_MEDIUM *m, GWEN_BUFFER *msgbuf, GWEN_BUFFER *decryptbuf, GWEN_BUFFER *msgKeyBuffer)

Virtual Functions

The functions in this group are wrappers which in most cases directly call the implementations of the functions (exceptions: AH_Medium_Mount and AH_Medium_Unmount).

AQHBCI_API int AH_Medium_Mount (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_Create (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_Unmount (AH_MEDIUM *m, int force)
AQHBCI_API int AH_Medium_ChangePin (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_ToDB (const AH_MEDIUM *m, GWEN_DB_NODE *db)
AQHBCI_API int AH_Medium_FromDB (AH_MEDIUM *m, GWEN_DB_NODE *db)
AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Sign (AH_MEDIUM *m, GWEN_BUFFER *msgbuf, GWEN_BUFFER *signbuf)
AQHBCI_API int AH_Medium_GetNextSignSeq (AH_MEDIUM *m)
AQHBCI_API AH_MEDIUM_RESULT AH_Medium_EncryptKey (AH_MEDIUM *m, GWEN_BUFFER *srckey, GWEN_BUFFER *encKey)
AQHBCI_API AH_MEDIUM_RESULT AH_Medium_DecryptKey (AH_MEDIUM *m, GWEN_BUFFER *srckey, GWEN_BUFFER *decKey)
AQHBCI_API GWEN_BUFFER * AH_Medium_GenerateMsgKey (AH_MEDIUM *m)
AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Verify (AH_MEDIUM *m, GWEN_BUFFER *msgbuf, GWEN_BUFFER *signbuf, int signseq)

Helper Functions

AQHBCI_API int AH_Medium_InputPin (AH_MEDIUM *m, char *buffer, int minLen, int maxLen, int flags)
AQHBCI_API int AH_Medium_SetPinStatus (AH_MEDIUM *m, const char *pin, AB_BANKING_PINSTATUS status)
AQHBCI_API int AH_Medium_InputTan (AH_MEDIUM *m, char *buffer, int minLen, int maxLen)
AQHBCI_API int AH_Medium_SetTanStatus (AH_MEDIUM *m, const char *tan, AB_BANKING_TANSTATUS status)

Detailed Description

Security Medium For HBCI.

Author:
Martin Preuss<martin@libchipcard.de>

Function Documentation

AQHBCI_API void AH_Medium_AddFlags AH_MEDIUM m,
GWEN_TYPE_UINT32  fl
 

AQHBCI_API void AH_Medium_Attach AH_MEDIUM m  ) 
 

Attaches to the medium. This means that the usage count of this medium gets incremented so a following free will not really destroy it until the usage counter reaches zero. So after finishing using the medium attached to you should simply call AH_Medium_free and that function will take care of the usage counter stuff. Please note that AH_Medium_new also increments the usage counter so you do not have to call this function after creating the medium.

AQHBCI_API int AH_Medium_ChangePin AH_MEDIUM m  ) 
 

Makes the medium change the PIN.

AQHBCI_API int AH_Medium_Create AH_MEDIUM m  ) 
 

Creates the medium. A KeyFile medium would prepare the file upon this. Upon successful return this medium is mounted so you need to unmount it in order to really write a keyfile.

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Decrypt AH_MEDIUM m,
GWEN_BUFFER *  msgbuf,
GWEN_BUFFER *  decryptbuf,
GWEN_BUFFER *  msgKeyBuffer
 

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_DecryptKey AH_MEDIUM m,
GWEN_BUFFER *  srckey,
GWEN_BUFFER *  decKey
 

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Encrypt AH_MEDIUM m,
GWEN_BUFFER *  msgbuf,
GWEN_BUFFER *  encryptbuf,
GWEN_BUFFER *  msgKeyBuffer
 

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_EncryptKey AH_MEDIUM m,
GWEN_BUFFER *  srckey,
GWEN_BUFFER *  encKey
 

AQHBCI_API void AH_Medium_free AH_MEDIUM m  ) 
 

Destroys the medium if the internal usage counter reaches zero. That counter is incremented by AH_Medium_new and AH_Medium_Attach and decremented by this function.

AQHBCI_API int AH_Medium_FromDB AH_MEDIUM m,
GWEN_DB_NODE *  db
 

Restores the medium from the given DB. This function restores the information it can access (like the keyspecs) and then calls the implementation with a subgroup of the given DB.

AQHBCI_API GWEN_BUFFER* AH_Medium_GenerateMsgKey AH_MEDIUM m  ) 
 

AQHBCI_API AB_BANKING* AH_Medium_GetBankingApi const AH_MEDIUM m  ) 
 

AH_MEDIUM_CTX* AH_Medium_GetCurrentContext AH_MEDIUM m  ) 
 

AQHBCI_API const char* AH_Medium_GetDescriptiveName const AH_MEDIUM m  ) 
 

This string is presented to the user to allow him to identify the medium an interactive function refers to (such as GetPin). This string should be stored by the medium upon unmount and restored when mounting the medium.

AQHBCI_API GWEN_TYPE_UINT32 AH_Medium_GetFlags const AH_MEDIUM m  ) 
 

AQHBCI_API AH_HBCI* AH_Medium_GetHBCI const AH_MEDIUM m  ) 
 

AQHBCI_API const char* AH_Medium_GetMediumName const AH_MEDIUM m  ) 
 

AQHBCI_API const char* AH_Medium_GetMediumSubTypeName const AH_MEDIUM m  ) 
 

AQHBCI_API const char* AH_Medium_GetMediumTypeName const AH_MEDIUM m  ) 
 

AQHBCI_API int AH_Medium_GetNextSignSeq AH_MEDIUM m  ) 
 

AQHBCI_API int AH_Medium_GetTokenIdData AH_MEDIUM m,
GWEN_BUFFER *  buf
 

AQHBCI_API int AH_Medium_InputPin AH_MEDIUM m,
char *  buffer,
int  minLen,
int  maxLen,
int  flags
 

AQHBCI_API int AH_Medium_InputTan AH_MEDIUM m,
char *  buffer,
int  minLen,
int  maxLen
 

AQHBCI_API int AH_Medium_IsMounted AH_MEDIUM m  ) 
 

AQHBCI_API int AH_Medium_Mount AH_MEDIUM m  ) 
 

The implementation of this function should make the KeySpecs available (using AH_Medium_SetRemoteCryptKeySpec and others as appropriate), at least id the medium is mounted for the first time in it's lifetime. These keyspecs are then preserved upon AH_Medium_ToDB and AH_Medium_fromDB.

It generally is a good idea to update the keyspecs upon mount.

Please note that this call only get's through to the virtual function of inheriting classes if the mountCount is 0. Otherwise the mountCount will simply be incremented without calling the implementation.

AQHBCI_API AH_MEDIUM* AH_Medium_new AH_HBCI hbci,
const char *  typeName,
const char *  subTypeName,
const char *  mediumName
 

Parameters:
mtn medium type name (like "RDHFile", "DDVCard" etc)
bankId bank code (German "Bankleitzahl")
userId id of this medium's owner

AQHBCI_API int AH_Medium_ReadContext AH_MEDIUM m,
int  idx,
int *  country,
GWEN_BUFFER *  bankId,
GWEN_BUFFER *  userId,
GWEN_BUFFER *  server,
int *  port
 

AQHBCI_API int AH_Medium_SelectContext AH_MEDIUM m,
int  idx
 

AQHBCI_API void AH_Medium_SetDescriptiveName AH_MEDIUM m,
const char *  s
 

AQHBCI_API void AH_Medium_SetFlags AH_MEDIUM m,
GWEN_TYPE_UINT32  fl
 

AQHBCI_API void AH_Medium_SetMediumName AH_MEDIUM m,
const char *  s
 

AQHBCI_API int AH_Medium_SetPinStatus AH_MEDIUM m,
const char *  pin,
AB_BANKING_PINSTATUS  status
 

AQHBCI_API int AH_Medium_SetTanStatus AH_MEDIUM m,
const char *  tan,
AB_BANKING_TANSTATUS  status
 

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Sign AH_MEDIUM m,
GWEN_BUFFER *  msgbuf,
GWEN_BUFFER *  signbuf
 

AQHBCI_API void AH_Medium_SubFlags AH_MEDIUM m,
GWEN_TYPE_UINT32  fl
 

AQHBCI_API int AH_Medium_ToDB const AH_MEDIUM m,
GWEN_DB_NODE *  db
 

Stores all interesting data about this medium to the given DB (but not the keys!) in order to make the medium restoreable via AH_Medium_FromDB. This function stores the information it can access (like the keyspecs) and then calls the implementation with a subgroup of the given DB.

AQHBCI_API int AH_Medium_Unmount AH_MEDIUM m,
int  force
 

Please note that this call only get's through to the virtual function of inheriting classes if the mountCount is 1 or force is !=0. Otherwise the mountCount will simply be decremented without calling the implementation.

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_Verify AH_MEDIUM m,
GWEN_BUFFER *  msgbuf,
GWEN_BUFFER *  signbuf,
int  signseq
 

Parameters:
signseq Signature sequence counter received. If 0 then this will not be verified, therefore the caller MUST make sure that a "0" is never accepted from a signature inside a message !

AQHBCI_API int AH_Medium_WriteContext AH_MEDIUM m,
int  idx,
int  country,
const char *  bankId,
const char *  userId,
const char *  server,
int  port
 


Generated on Sat Jan 7 04:22:43 2006 for aqbanking by  doxygen 1.4.6