Middleware framework for smart card terminals