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
-
-
Field Summary
Fields Modifier and Type Field and Description static byte
SE_MONOTONIC_COUNTER_ID_2
SE monotonic counter #2 supported only whengetType()
returnsSE_MONOTONIC_COUNTER_TYPE_RPMB
orSE_MONOTONIC_COUNTER_TYPE_RPMC
static byte
SE_MONOTONIC_COUNTER_ID_3
SE monotonic counter #3 supported only whengetType()
returnsSE_MONOTONIC_COUNTER_TYPE_RPMC
static byte
SE_MONOTONIC_COUNTER_TYPE_RPMB
SE monotonic counter type is RPMBstatic byte
SE_MONOTONIC_COUNTER_TYPE_RPMC
SE monotonic counter type is RPMCstatic byte
SE_MONOTONIC_COUNTER_TYPE_UNKNOWN
SE monotonic counter type is neither RPMC or RPMBstatic byte
SE_PAIRING_COUNTER_MAX_VALUE
Maximum value for SE pairing counter
-
Method Summary
Methods Modifier and Type Method and Description static void
disableHighUpdateFrequencyFlash()
Disables writing data to flash file name: 1 while bypassing the DAL flash wear-out mechanism.static void
enableHighUpdateFrequencyFlash()
Enables writing data to flash file name: 1 usingwriteFlashData()
while bypassing the DAL flash wear-out mechanism.static SEMonotonicCounter
getInstance()
Gets the singleton instance of the SEMonotonicCounter classabstract byte
getType()
Returns the monontonic counter type , one of SE_MONOTONIC_COUNTER_TYPE_XYZabstract int
getUpdateRate()
Returns the number of seconds to wait between consecutive calls toincrement(byte)
abstract long
getValue(byte id)
Returns the current monotonic counter value of the platformabstract long
increment(byte id)
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.abstract byte
readPairingCounter()
Returns the current RPMC or RPMB pairing counter to the caller
-
-
-
Field Detail
-
SE_MONOTONIC_COUNTER_ID_2
public static final byte SE_MONOTONIC_COUNTER_ID_2
SE monotonic counter #2 supported only whengetType()
returnsSE_MONOTONIC_COUNTER_TYPE_RPMB
orSE_MONOTONIC_COUNTER_TYPE_RPMC
- See Also:
- Constant Field Values
-
SE_MONOTONIC_COUNTER_ID_3
public static final byte SE_MONOTONIC_COUNTER_ID_3
SE monotonic counter #3 supported only whengetType()
returnsSE_MONOTONIC_COUNTER_TYPE_RPMC
- See Also:
- Constant Field Values
-
SE_MONOTONIC_COUNTER_TYPE_RPMC
public static final byte SE_MONOTONIC_COUNTER_TYPE_RPMC
SE monotonic counter type is RPMC- See Also:
- Constant Field Values
-
SE_MONOTONIC_COUNTER_TYPE_RPMB
public static final byte SE_MONOTONIC_COUNTER_TYPE_RPMB
SE monotonic counter type is RPMB- See Also:
- Constant Field Values
-
SE_MONOTONIC_COUNTER_TYPE_UNKNOWN
public static final byte SE_MONOTONIC_COUNTER_TYPE_UNKNOWN
SE monotonic counter type is neither RPMC or RPMB- See Also:
- Constant Field Values
-
SE_PAIRING_COUNTER_MAX_VALUE
public static final byte SE_PAIRING_COUNTER_MAX_VALUE
Maximum value for SE pairing counter- See Also:
- Constant Field Values
-
-
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 unknownNotSupportedException
- the monotonic counter is not supported by the current flash typeUtilException
- if one of the following occurs:getType()
returnSE_MONOTONIC_COUNTER_TYPE_RPMC
and the flash part was replaced more times than supported- internal error
-
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 unknownNotSupportedException
- the monotonic counter is not supported by the current flash typeFlashWearoutException
- if the flash wearout mechanism blocked the increment operationUtilException
- if one of the following occurs:getType()
returnSE_MONOTONIC_COUNTER_TYPE_RPMC
and the flash part was replaced more times than supported- internal error
-
getUpdateRate
public abstract int getUpdateRate() throws UtilException
Returns the number of seconds to wait between consecutive calls toincrement(byte)
- Returns:
- The number of seconds to wait between consecutive calls to
increment(byte)
- Throws:
NotSupportedException
- if one of the following occurs- the SE monotonic counter is not supported
getType()
doesn't returnSE_MONOTONIC_COUNTER_TYPE_RPMC
UtilException
- if one of the following occurs:- the flash was replaced more times than supported
- internal error
-
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- the SE monotonic counter is not supported
getType()
doesn't returnSE_MONOTONIC_COUNTER_TYPE_RPMC
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 usingwriteFlashData()
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
-
-