00001
00010 #ifndef SEC_GAME_H
00011 #define SEC_GAME_H
00012
00013 typedef enum
00014 {
00015 SEC_3DES_KEY_SIZE = 24,
00016 sw1LeWarning = 0x61
00017 } teSECURITY_GENERIC;
00018
00019 typedef enum
00020 {
00021 SEC_CLASS = 0x80
00022 } teSECURITY_CLASS;
00023
00024 typedef enum
00025 {
00026 SEC_SET_SESSION_ID = 0x00,
00027 SEC_AUTHENTICATE_FPGA = 0x02,
00028 SEC_GET_SESSION_KEY = 0x04,
00029 SEC_SET_SESSION_KEY = 0x06,
00030 SEC_SET_SECRET_KEY = 0x08,
00031 SEC_ZERO_COUNTERS = 0x0a,
00032 SEC_READ_COUNTERS = 0x0c
00034 } teSECURITY_INST;
00035
00036
00037 typedef struct
00038 {
00039 ZCBCICARD tCard;
00040 ZCCRIREADER tReader;
00041 unsigned long SessionId;
00042 char acApplicationName[ 250 ];
00043 } tsSMARTCARD_INFO;
00044
00045 extern unsigned char abKeyGame[ 8 ];
00046
00047
00048 int sec_OpenSmartCard( tsSMARTCARD_INFO *psSmartCard, BYTE bKeyId, BYTE *abKey,
00049 int zlKeySize );
00050 int sec_CloseSmartCard( tsSMARTCARD_INFO *psSmartCard );
00051 int sec_AuthFpga( tsSMARTCARD_INFO *psSmartCard, unsigned char *pabData, int zLen );
00052 char *sec_GetZcbriErorStr( ZCBCIRET tRv );
00053 char *sec_GetZccriErorStr( ZCCRIRET tRv );
00054 int sec_SetSessionId( tsSMARTCARD_INFO *psSmartCard, unsigned long CurSessionId );
00055 int sec_GetDesSessionKey( tsSMARTCARD_INFO *psSmartCard, LONG lIdx, BYTE *pabDesKeyBuf );
00056
00057 #endif
00058
00059
00060