MODULE s4module

	TYPE  SENSE4_CONTEXT
	    sequence
   		INTEGER*4 dwIndex
		INTEGER*4 dwVersion
		INTEGER*4 hLock
		CHARACTER reserve(12)
		CHARACTER bAtr(56)
		CHARACTER bID(8)
		INTEGER*4  dwAtrLen
	END TYPE SENSE4_CONTEXT

	TYPE S4CREATEDIRINFO
	    sequence
	    	INTEGER*4	dwS4CreateDirInfoSize
	    	CHARACTER	szAtr(8)
	END  TYPE S4CREATEDIRINFO

	TYPE 	S4OPENINFO
	    sequence
	    	INTEGER*4	dwS4OpenInfoSize
	    	INTEGER*4	dwShareMode
	END	TYPE S4OPENINFO
	
	TYPE EFINFO
		sequence			
			INTEGER*2 EfID
			CHARACTER EfType
			INTEGER*2 EfSize
	END TYPE EFINFO



	TYPE S4_RSA_PUBLIC_KEY
			sequence			
		CHARACTER modulus(128)			 
		CHARACTER exponent(128)			
	END TYPE S4_RSA_PUBLIC_KEY

	TYPE S4_RSA_PRIVATE_KEY
			sequence			
		CHARACTER modulus(128)			
		CHARACTER publicExponent(128)		
 		CHARACTER exponent(128)			 
		CHARACTER prime(128)			 
		CHARACTER primeExponent(128)	
		CHARACTER coefficient(64)			 
	END TYPE  S4_RSA_PRIVATE_KEY

	integer, parameter :: S4_USER_PIN = #000000a1
	integer, parameter :: S4_DEV_PIN = #000000a2

	integer, parameter :: S4_RSA_PUBLIC_FILE = #00000006		
	integer, parameter :: S4_RSA_PRIVATE_FILE	= #00000007		
	integer, parameter :: S4_EXE_FILE = #00000008
	integer, parameter :: S4_DATA_FILE = #00000009
	integer, parameter :: S4_XA_EXE_FILE = #0000000b

	integer, parameter :: S4_CREATE_NEW = #000000a5
	integer, parameter :: S4_UPDATE_FILE = #000000a6
	integer, parameter :: S4_CREATE_ROOT_DIR = #000000ab
	integer, parameter :: S4_CREATE_SUB_DIR = #000000ac
	integer, parameter :: S4_KEY_GEN_RSA_FILE = #000000a7		
	integer, parameter :: S4_SET_LICENCES		= #000000a8		
	integer, parameter :: S4_CREATE_MODULE		= #000000ad		
	
	integer, parameter :: S4_EXCLUSIZE_MODE	 = #00000000
	integer, parameter :: S4_SHARE_MODE  = #00000001

	integer, parameter :: S4_VM_EXE	= #00000000		
	integer, parameter :: S4_XA_EXE	= #00000001	

	integer, parameter :: S4_LED_UP	=  #00000004				
	integer, parameter :: S4_LED_DOWN	= #00000008				
	integer, parameter :: S4_LED_WINK	= #00000028				
	integer, parameter :: S4_GET_DEVICE_TYPE = #00000025		
	integer, parameter :: S4_GET_SERIAL_NUMBER	=#00000026		
	integer, parameter :: S4_GET_VM_TYPE		=#00000027		
	integer, parameter :: S4_GET_DEVICE_USABLE_SPACE = #00000029	
	integer, parameter :: S4_SET_DEVICE_ID		= #0000002a			
	integer, parameter :: S4_DF_AVAILABLE_SPACE    = #00000031		
	integer, parameter :: S4_EF_INFO                = #00000032		
	integer, parameter :: S4_SET_USB_MODE		= #00000041
	integer, parameter :: S4_SET_HID_MODE		= #00000042

	integer, parameter :: S4_LOCAL_DEVICE	= #00		
	integer, parameter :: S4_MASTER_DEVICE	= #01		
	integer, parameter :: S4_SLAVE_DEVICE	= #02		

	integer, parameter :: S4_VM_51			= #00		
	integer, parameter :: S4_VM_251_BINARY	= #01		
	integer, parameter :: S4_VM_251_SOURCE	= #02		

END MODULE
