00001 00011 #ifndef __GOBI_API_UIM_H__ 00012 #define __GOBI_API_UIM_H__ 00013 00014 #ifdef __cplusplus 00015 extern "C" { 00016 #endif 00017 00018 #define MAX_DESCRIPTION_LENGTH 255 00019 #define MAX_CONTENT_LENGTH 1024 00020 #define MAX_NO_OF_APPLICATIONS 10 00021 #define MAX_NO_OF_SLOTS 5 00022 #define MAX_PUK_LENGTH 8 00023 #define MAX_PATH_LENGTH 255 00024 00042 ULONG SLQSUIMReset(); 00043 00054 typedef struct 00055 { 00056 BYTE slot; 00057 } UIMPowerDownReq; 00058 00076 ULONG SLQSUIMPowerDown ( UIMPowerDownReq *pUIMPowerDownReq ); 00077 00093 typedef struct { 00094 WORD fileID; 00095 BYTE pathLen; 00096 WORD path[MAX_PATH_LENGTH]; 00097 } fileInfo; 00098 00152 typedef struct 00153 { 00154 BYTE stage; 00155 BYTE mode; 00156 BYTE sessionType; 00157 BYTE aidLength; 00158 BYTE aid[MAX_DESCRIPTION_LENGTH]; 00159 WORD numOfFiles; 00160 fileInfo arrfileInfo[MAX_DESCRIPTION_LENGTH]; 00161 } UIMRefreshEvent; 00162 00265 typedef struct 00266 { 00267 BYTE appType; 00268 BYTE appState; 00269 BYTE persoState; 00270 BYTE persoFeature; 00271 BYTE persoRetries; 00272 BYTE persoUnblockRetries; 00273 BYTE aidLength; 00274 BYTE aidVal[MAX_DESCRIPTION_LENGTH]; 00275 BYTE univPin; 00276 BYTE pin1State; 00277 BYTE pin1Retries; 00278 BYTE puk1Retries; 00279 BYTE pin2State; 00280 BYTE pin2Retries; 00281 BYTE puk2Retries; 00282 } appStatus; 00283 00335 typedef struct 00336 { 00337 BYTE cardState; 00338 BYTE upinState; 00339 BYTE upinRetries; 00340 BYTE upukRetries; 00341 BYTE errorState; 00342 BYTE numApp; 00343 appStatus AppStatus[MAX_NO_OF_APPLICATIONS]; 00344 } slotInfo; 00345 00386 typedef struct 00387 { 00388 WORD indexGwPri; 00389 WORD index1xPri; 00390 WORD indexGwSec; 00391 WORD index1xSec; 00392 BYTE numSlot; 00393 slotInfo SlotInfo[MAX_NO_OF_SLOTS]; 00394 } cardStatus; 00395 00411 typedef struct 00412 { 00413 BYTE hotSwapLength; 00414 BYTE hotSwap[MAX_DESCRIPTION_LENGTH]; 00415 } hotSwapStatus; 00416 00430 typedef struct 00431 { 00432 cardStatus *pCardStatus; 00433 hotSwapStatus *pHotSwapStatus; 00434 } UIMGetCardStatusResp; 00435 00455 ULONG SLQSUIMGetCardStatus ( UIMGetCardStatusResp *pUIMGetCardStatusResp ); 00456 00482 typedef struct 00483 { 00484 BYTE sessionType; 00485 BYTE aidLength; 00486 BYTE aid[MAX_DESCRIPTION_LENGTH]; 00487 } UIMSessionInformation ; 00488 00513 typedef struct 00514 { 00515 BYTE pinID; 00516 BYTE pinOperation; 00517 BYTE pinLength; 00518 BYTE pinValue[MAX_DESCRIPTION_LENGTH]; 00519 } setPINProtection; 00520 00546 typedef struct 00547 { 00548 UIMSessionInformation sessionInfo; 00549 setPINProtection pinProtection; 00550 BYTE *pKeyReferenceID; 00551 ULONG *pIndicationToken; 00552 } UIMSetPinProtectionReq ; 00553 00570 typedef struct 00571 { 00572 BYTE verifyLeft; 00573 BYTE unblockLeft; 00574 } remainingRetries; 00575 00590 typedef struct 00591 { 00592 BYTE pin1Len; 00593 BYTE pin1Val[MAX_DESCRIPTION_LENGTH]; 00594 } encryptedPIN1; 00595 00615 typedef struct 00616 { 00617 remainingRetries *pRemainingRetries; 00618 encryptedPIN1 *pEncryptedPIN1; 00619 ULONG *pIndicationToken; 00620 } UIMPinResp; 00621 00648 ULONG SLQSUIMSetPinProtection ( 00649 UIMSetPinProtectionReq *pUIMSetPinProtectionReq, 00650 UIMPinResp *pUIMSetPinProtectionResp ); 00651 00671 typedef struct{ 00672 BYTE pinID; 00673 BYTE pinLen; 00674 BYTE pinVal[MAX_DESCRIPTION_LENGTH]; 00675 } verifyUIMPIN; 00676 00705 typedef struct 00706 { 00707 UIMSessionInformation sessionInfo; 00708 verifyUIMPIN verifyPIN; 00709 encryptedPIN1 *pEncryptedPIN1; 00710 BYTE *pKeyReferenceID; 00711 ULONG *pIndicationToken; 00712 } UIMVerifyPinReq; 00713 00738 ULONG SLQSUIMVerifyPin ( UIMVerifyPinReq *pUIMVerifyPinReq, 00739 UIMPinResp *pUIMVerifyPinResp ); 00740 00767 typedef struct{ 00768 BYTE pinID; 00769 BYTE oldPINLen; 00770 BYTE oldPINVal[MAX_DESCRIPTION_LENGTH]; 00771 BYTE pinLen; 00772 BYTE pinVal[MAX_DESCRIPTION_LENGTH]; 00773 } changeUIMPIN; 00774 00800 typedef struct 00801 { 00802 UIMSessionInformation sessionInfo; 00803 changeUIMPIN changePIN; 00804 BYTE *pKeyReferenceID; 00805 ULONG *pIndicationToken; 00806 } UIMChangePinReq; 00807 00834 ULONG SLQSUIMChangePin ( UIMChangePinReq *pUIMChangePinReq, 00835 UIMPinResp *pUIMChangePinResp ); 00836 00861 typedef struct{ 00862 BYTE pinID; 00863 BYTE pukLen; 00864 BYTE pukVal[MAX_DESCRIPTION_LENGTH]; 00865 BYTE newPINLen; 00866 BYTE newPINVal[MAX_DESCRIPTION_LENGTH]; 00867 } unblockUIMPIN; 00868 00894 typedef struct 00895 { 00896 UIMSessionInformation sessionInfo; 00897 unblockUIMPIN unblockPIN; 00898 BYTE *pKeyReferenceID; 00899 ULONG *pIndicationToken; 00900 } UIMUnblockPinReq; 00901 00927 ULONG SLQSUIMUnblockPin ( UIMUnblockPinReq *pUIMUnblockPinReq, 00928 UIMPinResp *pUIMUnblockPinResp ); 00929 00942 typedef struct 00943 { 00944 ULONG eventMask; 00945 } UIMEventRegisterReqResp; 00946 00967 ULONG SLQSUIMEventRegister ( 00968 UIMEventRegisterReqResp *pUIMEventRegisterReqResp ); 00969 00982 typedef struct 00983 { 00984 UIMSessionInformation sessionInfo; 00985 BYTE OKtoRefresh; 00986 } UIMRefreshOKReq; 00987 01006 ULONG SLQSUIMRefreshOK ( 01007 UIMRefreshOKReq *pUIMRefreshOKReq ); 01008 01034 typedef struct 01035 { 01036 BYTE registerFlag; 01037 BYTE voteForInit; 01038 WORD numFiles; 01039 fileInfo arrfileInfo[MAX_DESCRIPTION_LENGTH]; 01040 } registerRefresh; 01041 01055 typedef struct 01056 { 01057 UIMSessionInformation sessionInfo; 01058 registerRefresh regRefresh; 01059 } UIMRefreshRegisterReq; 01060 01084 ULONG SLQSUIMRefreshRegister( 01085 UIMRefreshRegisterReq *pUIMRefreshRegisterReq ); 01086 01101 typedef struct 01102 { 01103 UIMSessionInformation sessionInfo; 01104 BYTE refreshComplete; 01105 } UIMRefreshCompleteReq; 01106 01107 01125 ULONG SLQSUIMRefreshComplete ( 01126 UIMRefreshCompleteReq *pUIMRefreshCompleteReq ); 01127 01135 typedef struct 01136 { 01137 UIMRefreshEvent *pRefreshEvent; 01138 } UIMRefreshGetLastEventResp; 01139 01148 typedef struct 01149 { 01150 UIMSessionInformation sessionInfo; 01151 } UIMRefreshGetLastEventReq; 01152 01177 ULONG SLQSUIMRefreshGetLastEvent ( 01178 UIMRefreshGetLastEventReq *pUIMRefreshGetLastEventReq, 01179 UIMRefreshGetLastEventResp *pUIMRefreshGetLastEventResp ); 01180 01199 typedef struct 01200 { 01201 UIMSessionInformation sessionInfo; 01202 fileInfo fileIndex; 01203 ULONG *pIndicationToken; 01204 } UIMGetFileAttributesReq; 01205 01216 typedef struct 01217 { 01218 BYTE sw1; 01219 BYTE sw2; 01220 } cardResult; 01221 01334 typedef struct 01335 { 01336 WORD fileSize; 01337 WORD fileID; 01338 BYTE fileType; 01339 WORD recordSize; 01340 WORD recordCount; 01341 BYTE secRead; 01342 WORD secReadMask; 01343 BYTE secWrite; 01344 WORD secWriteMask; 01345 BYTE secIncrease; 01346 WORD secIncreaseMask; 01347 BYTE secDeactivate; 01348 WORD secDeactivateMask; 01349 BYTE secActivate; 01350 WORD secActivateMask; 01351 WORD rawLen; 01352 BYTE rawValue[MAX_DESCRIPTION_LENGTH]; 01353 } fileAttributes; 01354 01373 typedef struct 01374 { 01375 cardResult *pCardResult; 01376 fileAttributes *pFileAttributes; 01377 ULONG *pIndicationToken; 01378 } UIMGetFileAttributesResp; 01379 01404 ULONG SLQSUIMGetFileAttributes ( 01405 UIMGetFileAttributesReq *pUIMGetFileAttributesReq, 01406 UIMGetFileAttributesResp *pUIMGetFileAttributesResp ); 01407 01438 typedef struct{ 01439 BYTE feature; 01440 BYTE operation; 01441 BYTE ckLen; 01442 BYTE ckVal[MAX_DESCRIPTION_LENGTH]; 01443 } depersonalizationInformation; 01444 01453 typedef struct 01454 { 01455 depersonalizationInformation depersonilisationInfo; 01456 } UIMDepersonalizationReq; 01457 01468 typedef struct 01469 { 01470 remainingRetries *pRemainingRetries; 01471 } UIMDepersonalizationResp; 01472 01493 ULONG SLQSUIMDepersonalization ( 01494 UIMDepersonalizationReq *pUIMDepersonilizationReq, 01495 UIMDepersonalizationResp *pUIMDepersonilizationResp ); 01496 01543 typedef struct 01544 { 01545 BYTE context; 01546 WORD dataLen; 01547 BYTE data[MAX_CONTENT_LENGTH]; 01548 } authenticationData; 01549 01568 typedef struct 01569 { 01570 UIMSessionInformation sessionInfo; 01571 authenticationData authData; 01572 ULONG *pIndicationToken; 01573 } UIMAuthenticateReq; 01574 01586 typedef struct 01587 { 01588 WORD contentLen; 01589 BYTE content[MAX_CONTENT_LENGTH]; 01590 } authenticateResult; 01591 01610 typedef struct 01611 { 01612 cardResult *pCardResult; 01613 authenticateResult *pAuthenticateResult; 01614 ULONG *pIndicationToken; 01615 } UIMAuthenticateResp; 01616 01640 ULONG SLQSUIMAuthenticate ( UIMAuthenticateReq *pUIMAuthenticateReq, 01641 UIMAuthenticateResp *pUIMAuthenticateResp); 01642 01643 #ifdef __cplusplus 01644 } /* extern "C" { */ 01645 #endif 01646 01647 #endif /* __GOBI_API_UIM_H__ */