Intel

Developer Zone

SEMonotonicCounter

com.intel.util

Class SEMonotonicCounter

  • java.lang.Object
    • com.intel.util.SEMonotonicCounter


  • public abstract class SEMonotonicCounter
    extends java.lang.Object
    This class provides an interface for applets to access the Secure Enclave Monotonic Counters feature. this will allow the Secure Enclave applet to access its dedicated monotonic counters
    • Method Detail

      • getType

        public abstract byte getType()
                              throws UtilException
        Returns the monontonic counter type , one of SE_MONOTONIC_COUNTER_TYPE_XYZ
        Returns:
        Returns the monontonic counter type , one of SE_MONOTONIC_COUNTER_TYPE_XYZ
        Throws:
        UtilException - if an internal error occurred
      • getValue

        public abstract long getValue(byte id)
                               throws UtilException
        Returns the current monotonic counter value of the platform
        Parameters:
        id - the ID of the specific monotonic counter, one of SE_MONOTONIC_COUNTER_ID_X
        Returns:
        Current monotonic counter value of the platform
        Throws:
        IllegalParameterException - if id is unknown
        NotSupportedException - the monotonic counter is not supported by the current flash type
        UtilException - if one of the following occurs:
      • increment

        public abstract long increment(byte id)
                                throws UtilException
        Increments and returns the new monotonic counter value of the platform Note that after reaching maximum UINT32 value (0xFFFFFFFF), the monotonic counter is reset to 0.
        Parameters:
        id - the ID of the specific monotonic counter, one of SE_MONOTONIC_COUNTER_ID_X
        Returns:
        The new monotonic counter value of the platform
        Throws:
        IllegalParameterException - if id is unknown
        NotSupportedException - the monotonic counter is not supported by the current flash type
        FlashWearoutException - if the flash wearout mechanism blocked the increment operation
        UtilException - if one of the following occurs:
      • readPairingCounter

        public abstract byte readPairingCounter()
                                         throws UtilException
        Returns the current RPMC or RPMB pairing counter to the caller
        Returns:
        Returns the current RPMC or RPMB pairing counter to the caller
        Throws:
        NotSupportedException - if one of the following occurs
        UtilException - if one of the following occurs:
        • the flash was replaced more times than supported
        • internal error
      • enableHighUpdateFrequencyFlash

        public static final void enableHighUpdateFrequencyFlash()
        Enables writing data to flash file name: 1 using writeFlashData() while bypassing the DAL flash wear-out mechanism. NOTE: the write operations are still subject to the Storage stack flash wear-out restrictions. This disabling of the DAL flash wear-out mechanism is volatile, meaning this state is stored in-memory and is not persistent across any state changes that reset the DAL FW memory. It is persistent across different sessions closing a session doesn't change the state.
        Throws:
        UtilException - in case of an internal error.
      • disableHighUpdateFrequencyFlash

        public static final void disableHighUpdateFrequencyFlash()
        Disables writing data to flash file name: 1 while bypassing the DAL flash wear-out mechanism.
        Throws:
        UtilException - in case of an internal error.
      • getInstance

        public static final SEMonotonicCounter getInstance()
        Gets the singleton instance of the SEMonotonicCounter class
        Returns:
        the single instance of the SEMonotonicCounter class. If called more than once the same instance is returned