Go to the documentation of this file.
23 #ifndef OPGP_CONNECTION_H
24 #define OPGP_CONNECTION_H
42 #if !defined __winscard_h__
43 #define MAX_ATR_SIZE 33
46 #define OPGP_TRACE_MODE_ENABLE 1
47 #define OPGP_TRACE_MODE_DISABLE 0
49 #define OPGP_CARD_PROTOCOL_T0 SCARD_PROTOCOL_T0
50 #define OPGP_CARD_PROTOCOL_T1 SCARD_PROTOCOL_T1
71 TCHAR libraryName[64];
72 TCHAR libraryVersion[32];
unsigned long * PDWORD
A Microsoft LPDWORD/Muscle pointer to a DWORD.
Definition: types.h:50
DWORD ATRLength
The length of the ATR buffer.
Definition: connection.h:82
OPGP_API OPGP_ERROR_STATUS OPGP_establish_context(OPGP_CARD_CONTEXT *cardContext)
This function establishes a context to connection layer.
Definition: connection.c:51
unsigned char * PBYTE
A Microsoft/Muscle LPBYTE, pointer to unsigned char.
Definition: types.h:48
OPGP_API OPGP_ERROR_STATUS OPGP_card_connect(OPGP_CARD_CONTEXT cardContext, OPGP_CSTRING readerName, OPGP_CARD_INFO *cardInfo, DWORD protocol)
This function connects to a reader.
Definition: connection.c:164
Definition: connection.h:69
unsigned char BYTE
A Microsoft/Muscle BYTE definition.
Definition: types.h:51
OPGP_API OPGP_ERROR_STATUS OPGP_release_context(OPGP_CARD_CONTEXT *cardContext)
This function releases the context to the connection layer established by OPGP_establish_context().
Definition: connection.c:103
Definition: security.h:203
PVOID cardConnect
Function to connect to the card.
Definition: connection.h:59
OPGP_CONNECTION_FUNCTIONS connectionFunctions
Connection functions of the connection library. Is automatically filled in if the connection library ...
Definition: connection.h:74
Definition: connection.h:55
BYTE specVersion
The specification version, see OP_201 or GP_211.
Definition: connection.h:84
OPGP_API void OPGP_enable_trace_mode(DWORD enable, FILE *out)
Enables the trace mode.
Definition: connection.c:38
PVOID librarySpecific
Specific data for the library.
Definition: connection.h:85
void * PVOID
Pointer definition.
Definition: types.h:36
unsigned long DWORD
A Microsoft/Muscle DWORD definition.
Definition: types.h:52
PVOID listReaders
Function to list the readers.
Definition: connection.h:61
PVOID establishContext
Function to establish the context.
Definition: connection.h:57
OPGP_API OPGP_ERROR_STATUS OPGP_send_APDU(OPGP_CARD_CONTEXT cardContext, OPGP_CARD_INFO cardInfo, GP211_SECURITY_INFO *secInfo, PBYTE capdu, DWORD capduLength, PBYTE rapdu, PDWORD rapduLength)
This function sends an APDU.
Definition: connection.c:202
const typedef char * OPGP_CSTRING
A Microsoft/Muscle LPCTSTR.
Definition: types.h:47
PVOID cardDisconnect
Function to disconnect from the card.
Definition: connection.h:60
char * OPGP_STRING
A Microsoft/Muscle LPTSTR.
Definition: types.h:46
This handles smartcard reader communications.
PVOID sendAPDU
Function to send an APDU.
Definition: connection.h:62
Definition: connection.h:80
OPGP_API OPGP_ERROR_STATUS OPGP_list_readers(OPGP_CARD_CONTEXT cardContext, OPGP_STRING readerNames, PDWORD readerNamesLength)
This function returns a list of currently available readers.
Definition: connection.c:145
PVOID releaseContext
Function to release the context.
Definition: connection.h:58
PVOID librarySpecific
Library specific data.
Definition: connection.h:70
#define MAX_ATR_SIZE
Maximum ATR size.
Definition: connection.h:43
BYTE logicalChannel
The current logical channel.
Definition: connection.h:83
PVOID libraryHandle
The handle to the library.
Definition: connection.h:73
OPGP_API OPGP_ERROR_STATUS OPGP_card_disconnect(OPGP_CARD_CONTEXT cardContext, OPGP_CARD_INFO *cardInfo)
This function disconnects a reader.
Definition: connection.c:181