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)
It depends on your project. You have 3 solutions. one is for cases that you have access to Internet on the phone and two for cases you don't.
If you have Internet access :
Using the above procedure, in cases that you don't want the SIM applet to work anymore, you can send an invalid encrypted value in the respond of phone application requests.
If you don't have Internet access :
All SMS packets enveloped concatenated with current time of server but normally, the operator sends its packets to a special applet on the card. I mean the packets has a header that indicate the AID of its applet in the card. The SIM card analyze and decrypt this packet data and the body of it return to phone (For calls and SMS-s, and not for OTA envelopes).In this procedure the data (both encrypted and decrypted) are not shared on the SIM. So if you install an applet on the SIM, there is no way to gain those data (Including the network current time) and you must use one of the following options :
or:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With