I have a JavaCard applet working on Gemalto SIM card in a smartphone. I would like to create an electronic wallet with validity to a specifed date and time.
I know this is impossible using a classic smartcard, which has no clock inside because of absence of the battery. However, with a SIM card it might be possible: a SIM card must have some access to network time (not the local system time, which can be changed by the user) when connected to the network and the last known network time value could be probably stored somewhere on the SIM card.
Is there any way to access the last known network time from my applet in a secure way? (I do not trust any application installed in the phone, because it could be easily hacked)
Do you think there is any other solution of my problem?
EDIT
I did not mention the reason why I think about this: I need to solve this problem without the Internet connection, because my customers are supposed to use my electronic wallet without the Internet connection in their phones. They need to use it in subway where there is no signal and some of them do not pay for the Internet connection at all. So my application must be able to find out the time offline.
EDIT 2
On Android phones, there is an option:
That means there is some user-independent source of time. The question is, if it can be accessed somehow in a secure way from a JavaCard applet on the SIM card. (or if the last known value can be accessed in the case of no connection)