简体   繁体   中英

Store Date & Time in Java Card 2.2.1 platform

I am developing a smart card application and i have to store Date info. In brief i would like to store last (10) transactions which should contains Date and Time in smart card.

Platforms used in:

  • Java Card 2.2.1
  • Global Platform 2.1.1

I found Class Date but it requires Java Card 3.0.

Is it possible to store transaction's Date/Time info in smart card using Java Card 2.2.1?

You can store whatever you want in a JavaCard (like a UNIX timestamp of re-create the Date class) but keep in mind that javacard does not have an internal clock with a batter. So you rely on external time source and the times are probably only informative.

Yes you can store such data, but the data is wrapped into byte array or custom class containing bytes of day, month, year, hour, minute, second.

  1. The Date/Info shall be send by terminal (in APDU bytes)
  2. Your applet shall parse the Date/Time information based on format
  3. Store the parsed data in byte array or in custom class object

If you need to calculate time span, then you need to create method to do addition/subtraction to the byte arrays.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM