HBCI Medium
[HBCI Backend (AqHBCI)]


Detailed Description

Security Medium For HBCI.

Author:
Martin Preuss<martin@libchipcard.de>


Constructor And Destructor

AQHBCI_API void AH_Medium_free (AH_MEDIUM *m)
AQHBCI_API void AH_Medium_Attach (AH_MEDIUM *m)

Informational Functions

AQHBCI_API GWEN_TYPE_UINT32 AH_Medium_GetUniqueId (const AH_MEDIUM *m)
AQHBCI_API void AH_Medium_SetUniqueId (AH_MEDIUM *m, GWEN_TYPE_UINT32 id)
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)
AQHBCI_API 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)

Mounting and Unmounting

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)

Pins and Keys

AQHBCI_API int AH_Medium_ChangePin (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_CreateKeys (AH_MEDIUM *m)
AQHBCI_API GWEN_CRYPTKEY * AH_Medium_GetLocalPubSignKey (AH_MEDIUM *m)
AQHBCI_API GWEN_CRYPTKEY * AH_Medium_GetLocalPubCryptKey (AH_MEDIUM *m)
AQHBCI_API GWEN_CRYPTKEY * AH_Medium_GetPubSignKey (AH_MEDIUM *m)
AQHBCI_API GWEN_CRYPTKEY * AH_Medium_GetPubCryptKey (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_SetPubSignKey (AH_MEDIUM *m, const GWEN_CRYPTKEY *key)
AQHBCI_API int AH_Medium_SetPubCryptKey (AH_MEDIUM *m, const GWEN_CRYPTKEY *key)
AQHBCI_API int AH_Medium_ResetServerKeys (AH_MEDIUM *m)
AQHBCI_API int AH_Medium_ResetUserKeys (AH_MEDIUM *m)

Functions Which Are Not Part of the API

These functions are only used for debugging purposes, you MUST NOT rely on their existence or parameter list!

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_EncryptWithKey (AH_MEDIUM *m, GWEN_BUFFER *msgbuf, GWEN_BUFFER *encryptbuf, GWEN_CRYPTKEY *sessionKey)

Defines

#define AH_MEDIUM_FLAGS_DISABLE_SMALLER_SIGNATURE   0x00000001

Typedefs

typedef AH_MEDIUM AH_MEDIUM

Enumerations

enum  AH_MEDIUMTYPE { AH_MediumTypeDDV = 0, AH_MediumTypeRDH, AH_MediumTypePINTAN }
enum  AH_MEDIUM_RESULT {
  AH_MediumResultOk = 0, AH_MediumResultNoKey, AH_MediumResultBadKey, AH_MediumResultSignSeq,
  AH_MediumResultInvalidSignature, AH_MediumResultGenericError, AH_MediumResultNotSupported
}

Functions

 GWEN_LIST_FUNCTION_LIB_DEFS (AH_MEDIUM, AH_Medium, AQHBCI_API)


Define Documentation

#define AH_MEDIUM_FLAGS_DISABLE_SMALLER_SIGNATURE   0x00000001

If this flag is set then signing with an RSA key will not choose the smaller signature according iso9796-appendix. The default is to allow it.

Definition at line 40 of file medium.h.


Typedef Documentation

typedef struct AH_MEDIUM AH_MEDIUM

Definition at line 46 of file medium.h.


Enumeration Type Documentation

enum AH_MEDIUM_RESULT

Enumerator:
AH_MediumResultOk 
AH_MediumResultNoKey 
AH_MediumResultBadKey 
AH_MediumResultSignSeq 
AH_MediumResultInvalidSignature 
AH_MediumResultGenericError 
AH_MediumResultNotSupported 

Definition at line 55 of file medium.h.

enum AH_MEDIUMTYPE

Enumerator:
AH_MediumTypeDDV 
AH_MediumTypeRDH 
AH_MediumTypePINTAN 

Definition at line 48 of file medium.h.


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 int AH_Medium_CreateKeys ( AH_MEDIUM m  ) 

AQHBCI_API AH_MEDIUM_RESULT AH_Medium_EncryptWithKey ( AH_MEDIUM m,
GWEN_BUFFER *  msgbuf,
GWEN_BUFFER *  encryptbuf,
GWEN_CRYPTKEY *  sessionKey 
)

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 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 GWEN_CRYPTKEY* AH_Medium_GetLocalPubCryptKey ( AH_MEDIUM m  ) 

AQHBCI_API GWEN_CRYPTKEY* AH_Medium_GetLocalPubSignKey ( 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 GWEN_CRYPTKEY* AH_Medium_GetPubCryptKey ( AH_MEDIUM m  ) 

AQHBCI_API GWEN_CRYPTKEY* AH_Medium_GetPubSignKey ( AH_MEDIUM m  ) 

AQHBCI_API int AH_Medium_GetTokenIdData ( AH_MEDIUM m,
GWEN_BUFFER *  buf 
)

AQHBCI_API GWEN_TYPE_UINT32 AH_Medium_GetUniqueId ( const AH_MEDIUM m  ) 

AQHBCI_API int AH_Medium_IsMounted ( AH_MEDIUM m  ) 

AQHBCI_API int AH_Medium_Mount ( AH_MEDIUM m  ) 

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 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_ResetServerKeys ( AH_MEDIUM m  ) 

AQHBCI_API int AH_Medium_ResetUserKeys ( AH_MEDIUM m  ) 

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_SetPubCryptKey ( AH_MEDIUM m,
const GWEN_CRYPTKEY *  key 
)

AQHBCI_API int AH_Medium_SetPubSignKey ( AH_MEDIUM m,
const GWEN_CRYPTKEY *  key 
)

AQHBCI_API void AH_Medium_SetUniqueId ( AH_MEDIUM m,
GWEN_TYPE_UINT32  id 
)

AQHBCI_API void AH_Medium_SubFlags ( AH_MEDIUM m,
GWEN_TYPE_UINT32  fl 
)

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 int AH_Medium_WriteContext ( AH_MEDIUM m,
int  idx,
int  country,
const char *  bankId,
const char *  userId,
const char *  server,
int  port 
)

GWEN_LIST_FUNCTION_LIB_DEFS ( AH_MEDIUM  ,
AH_Medium  ,
AQHBCI_API   
)


Generated on Fri Nov 10 03:56:55 2006 for aqbanking by  doxygen 1.5.1