Package tss
Class TpmDevice
- java.lang.Object
-
- tss.TpmDevice
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
TpmDeviceLinux
,TpmDeviceTbs
,TpmDeviceTcp
public abstract class TpmDevice extends Object implements Closeable
Partially abstract base class for classes implementing communication interface with TPM devices of different kinds (e.g. a simulator, TBS interface on Windows or /dev/tpm0 on linux).- Author:
- pengland
-
-
Field Summary
Fields Modifier and Type Field Description protected int
TpmInfo
protected int
TpmInRawMode
protected int
TpmLinuxOldUserModeTrm
protected int
TpmNoLocalityCtl
protected int
TpmNoPowerCtl
protected int
TpmPlatformAvailable
protected int
TpmSocketConn
protected int
TpmSupportsPP
protected int
TpmTbsConn
protected int
TpmTctiConn
protected int
TpmUsesTrm
-
Constructor Summary
Constructors Constructor Description TpmDevice()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
assertPhysicalPresence(boolean on)
Asserts or stops asserting Physical Presence.abstract void
close()
Closes the established connection with the TPM device.abstract boolean
connect()
Establishes a connection with the TPM device.abstract void
dispatchCommand(byte[] cmdBuf)
Sends the TPM command buffer byte array to the TPMabstract byte[]
getResponse()
boolean
implementsPhysicalPresence()
boolean
localityCtlAvailable()
boolean
platformAvailable()
void
powerCtl(boolean on)
Powers on/off the TPM.boolean
powerCtlAvailable()
void
powerCycle()
Convenience wrapper forpowerCtl(false); powerCtl(true)
.void
powerOff()
Convenience wrapper forpowerCtl(false)
void
powerOn()
Convenience wrapper forpowerCtl(true)
void
ppOff()
Convenience wrapper forassertPhysicalPresence(false)
void
ppOn()
Convenience wrapper forassertPhysicalPresence(true)
abstract boolean
responseReady()
void
setLocality(int locality)
Sets the locality for subsequent commands.
-
-
-
Field Detail
-
TpmInfo
protected int TpmInfo
-
TpmPlatformAvailable
protected final int TpmPlatformAvailable
- See Also:
- Constant Field Values
-
TpmUsesTrm
protected final int TpmUsesTrm
- See Also:
- Constant Field Values
-
TpmInRawMode
protected final int TpmInRawMode
- See Also:
- Constant Field Values
-
TpmSupportsPP
protected final int TpmSupportsPP
- See Also:
- Constant Field Values
-
TpmNoPowerCtl
protected final int TpmNoPowerCtl
- See Also:
- Constant Field Values
-
TpmNoLocalityCtl
protected final int TpmNoLocalityCtl
- See Also:
- Constant Field Values
-
TpmSocketConn
protected final int TpmSocketConn
- See Also:
- Constant Field Values
-
TpmTbsConn
protected final int TpmTbsConn
- See Also:
- Constant Field Values
-
TpmLinuxOldUserModeTrm
protected final int TpmLinuxOldUserModeTrm
- See Also:
- Constant Field Values
-
TpmTctiConn
protected final int TpmTctiConn
- See Also:
- Constant Field Values
-
-
Method Detail
-
connect
public abstract boolean connect()
Establishes a connection with the TPM device.- Returns:
- Whether the connection was established
-
close
public abstract void close()
Closes the established connection with the TPM device.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
dispatchCommand
public abstract void dispatchCommand(byte[] cmdBuf)
Sends the TPM command buffer byte array to the TPM- Parameters:
cmdBuf
- TPM command buffer
-
getResponse
public abstract byte[] getResponse()
- Returns:
- TPM response buffer received from the TPM device
-
responseReady
public abstract boolean responseReady()
- Returns:
- Whether the TPM response to the previously issued command is ready
-
powerCtl
public void powerCtl(boolean on)
Powers on/off the TPM. Only implemented for TPM simulators and TPM vendors test harness.- Parameters:
on
- New on/off state (true/false correspondingly)
-
assertPhysicalPresence
public void assertPhysicalPresence(boolean on)
Asserts or stops asserting Physical Presence. Only implemented for TPM simulators and TPM vendors test harness.- Parameters:
on
- New on/off state (true/false correspondingly)
-
setLocality
public void setLocality(int locality)
Sets the locality for subsequent commands. Only implemented for TPM simulators and TPM vendors test harness.- Parameters:
locality
- New locality value
-
platformAvailable
public boolean platformAvailable()
- Returns:
- true if the TPM device supports sending/emulation of platform signals, and if the platform hierarchy is enabled.
-
powerCtlAvailable
public boolean powerCtlAvailable()
- Returns:
- true if the TPM device can be power cycled programmatically
-
localityCtlAvailable
public boolean localityCtlAvailable()
- Returns:
- true if the TPM device allows changing locality programmatically
-
implementsPhysicalPresence
public boolean implementsPhysicalPresence()
- Returns:
- true if physical presence can be asserted
-
powerOn
public void powerOn()
Convenience wrapper forpowerCtl(true)
-
powerOff
public void powerOff()
Convenience wrapper forpowerCtl(false)
-
powerCycle
public void powerCycle()
Convenience wrapper forpowerCtl(false); powerCtl(true)
. Power-cycles the TPM device, i.e. turns it off and then back on.
-
ppOn
public void ppOn()
Convenience wrapper forassertPhysicalPresence(true)
-
ppOff
public void ppOff()
Convenience wrapper forassertPhysicalPresence(false)
-
-