Developer Guide

  • 10/27/2020
  • Public Content
Contents

Secure Time Guidelines

This page provides guidelines for how to use the Secure Time feature of the Intel® DAL environment. For an overview of what the Secure Time feature does, see
Secure Time
.

Initialization

  1. Calendar object should be instantiated with 
    Calendar.CLOCK_SOURCE_PRTC
     as parameter.
  2. Current time should be acquired from a trusted source.
Note:
The current time should be injected only once. 
The current time is to be achieved in a secured way – either during the installation or a SIGMA connection with a trusted server. Time should be in UNIX timestamp format:  Number of seconds elapsed since 1 January 1970.
     
3.
Calendar.setTime() 
should be called. The return byte array now contains the calendar meta-data.
     4. The metadata should be stored securely on HD for future uses. See Secure Storage sample as a reference.

Use

  1. Calendar object should be instantiated with 
    Calendar.CLOCK_SOURCE_PRTC 
    as parameter.
  2. Calendar metadata should be retrieved from the hard disk.
  3. Calendar.setTime()
     can now be called with the byte array metadata as input.
  4. Current time is returned in UNIX timestamp format:  Number of seconds elapsed since 1 January 1970.

Code Snippet

In the head of the class, declare the following variables:
 
Calendar cal = null; byte[] timeInfo = null; TimerManager timerManager = null; TimerClient timerClient = null; Timer timer = null;
In the Invoke command function:
//just for test: init the time with 10/10/2013, 10:00:00 final int startTime = 1381399200; //get the calendar instance cal = Calendar.getInstance(Calendar.CLOCK_SOURCE_PRTC, new TimeZone()); timeInfo = new byte[Calendar.SET_TIME_INFO_LENGTH]; //init the instance with current time cal.setTime(startTime, timeInfo, 0); //test - call a timer timerManager = TimerManager.getInstance(); timerClient = new TimerClient() { //function should be called in 50 seconds public void onTimerTick(byte[] userData) { get calendar current time int res = cal.getTime(timeInfo, 0); //subtract it from the start time of the calendar int secondsElapsed = res - startTime; //validate times matches DebugPrint.printString("Expected 50, actual:"); DebugPrint.printInt(secondsElapsed); } }; //start the time to tick in 50 seconds timer = timerManager.createTimer(timerClient); timer.start(50000, null, 0, 0, false);

Troubleshooting

If the expected time is wrong when working in emulation then the ticks of the emulation may be slower that on a real platform.  To compensate for the difference, in DALsdkDir\Platforms\YourPlatform\Emulator\RP_AMT06.INI change the 
Schedule_Timing 
from 2 to 1 and rerun the emulation.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804