C# Класс Tpm2Lib.Tbs

Instances of the class TPM are created on top of TPM devices (either a physical TPM, or another Tbs) via new Tbs(theTpmDevice). TPM device contexts are then typically created through GetTpm(int locality).
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DebugAssertTpmIsEmpty ( ) : void
DestroyContext ( Tpm2Lib.Tpm2Device tpmDevice ) : void
Dispose ( ) : void
DisposeContext ( TbsContext c ) : void

Removes all TPM objects referenced by this context and then removes the context from the TBS database.

GetFreeSessionCount ( ) : int
GetSessionCount ( int &savedSessionCount ) : int
GetUnderlyingTpm ( ) : Tpm2
NumActiveContexts ( ) : int
NumEntitiesInTpm ( ) : int
SetS3Probability ( double probability ) : void

If probability is not 0.0, the SlotManager will randomly cycle the TPM through a simulated S3 transition at the start of DispatchCommand (before the requested command is invoked).

Tbs ( Tpm2Lib.Tpm2Device theUnderlyingTpm, bool tpmHasRm ) : System

Приватные методы

Метод Описание
CheckConsistency ( string message = "" ) : void
CleanTpm ( ) : void
ContextSaveEverything ( ) : void
CreateTbsContext ( ) : TbsContext
DebugStateSave ( ) : void
DispatchCommand ( TbsContext caller, Tpm2Lib.CommandModifier active, byte inBuf, byte &outBuf ) : void

Dispatch a command to the underlying TPM. This method implements all significant functionality. DispatchCommand examines the command stream and performs (approximately) the following functions 1) If the command references a handle (session or transient object) then TBS makes sure that the entity is loaded. If it is, then the handle is "translated" to the underlying TPM handle. If it is not, then TBS checks to see if it has a saved context for the entity, and if so loads it. 2) If the command will fill a slot, then TBS ensures that a slot is available. It does this by ContextSaving the LRU entity of the proper type (that is not used in this command).

FormatError ( TpmRc errorCode ) : byte[]

Create a 10 byte error response that matches TPM error responses.

GetAllLoadedEntities ( Tpm2 tpm ) : Tpm2Lib.TpmHandle[]
GetLoadedEntities ( Tpm2 tpm, Ht rangeToQuery ) : Tpm2Lib.TpmHandle[]
GetReferencedObjects ( TbsContext caller, TpmHandle inHandles ) : Tpm2Lib.ObjectContext[]

Look up TBS ObjectContext records given the handles in the inHandles input parms.

GetResultCode ( byte responseBuf ) : TpmRc
GetSessions ( TbsContext caller, SessionIn inSessions ) : Tpm2Lib.ObjectContext[]

Get the TBS ObjectContext given SessionIn objects collected from the inputs stream.

LoadEntities ( ObjectContext neededContexts ) : bool

Ensure that all referenced objects are loaded.

LoadObject ( ObjectContext contextToLoad, ObjectContext doNotEvict ) : bool

Load an object making a space if needed. If we need to make a space then we are mindful not to evict anything in the doNotEvict array.

MakeSpace ( SlotType neededSlot, ObjectContext doNotEvict ) : bool

Make a space in the TPM for an entity of type neededSlot (while not evicting another needed entity)

ProcessUpdatedTpmState ( TbsContext caller, Tpm2Lib.CommandInfo command, TpmHandle responseHandles, ObjectContext inputObjects ) : void

Updates TBS context database for commands that either fill or empty slots.

ReplaceHandlesIn ( TpmHandle handles, SessionIn sessions, ObjectContext theObjects, ObjectContext theSessions ) : void

Modifies the handles and sessions arrays so that they contain the translated handles.

ReplaceHandlesOut ( IEnumerable outHandles ) : void
SlotTypeFromHandle ( TpmHandle h ) : SlotType
StateSaveAndReload ( bool startupState, bool doPowerCycle ) : void

TPM Debug support. Cycle the TPM through (a) SaveContext all loaded contexts, (b) StateSave(), (c) powerOff, (d) powerOn (e) Startup(SU_State) or Startup(S_CLEAR). Then needed objects and sessions will be paged back in as needed. This command is NOT thread safe. This command has side-effects on the startup counter and will likely result in clock discontinuities.

UpdateLastUseCount ( IEnumerable entities ) : void

Описание методов

DebugAssertTpmIsEmpty() публичный Метод

public DebugAssertTpmIsEmpty ( ) : void
Результат void

DestroyContext() публичный Метод

public DestroyContext ( Tpm2Lib.Tpm2Device tpmDevice ) : void
tpmDevice Tpm2Lib.Tpm2Device
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

DisposeContext() публичный Метод

Removes all TPM objects referenced by this context and then removes the context from the TBS database.
public DisposeContext ( TbsContext c ) : void
c TbsContext
Результат void

GetFreeSessionCount() публичный Метод

public GetFreeSessionCount ( ) : int
Результат int

GetSessionCount() публичный Метод

public GetSessionCount ( int &savedSessionCount ) : int
savedSessionCount int
Результат int

GetUnderlyingTpm() публичный Метод

public GetUnderlyingTpm ( ) : Tpm2
Результат Tpm2

NumActiveContexts() публичный Метод

public NumActiveContexts ( ) : int
Результат int

NumEntitiesInTpm() публичный Метод

public NumEntitiesInTpm ( ) : int
Результат int

SetS3Probability() публичный Метод

If probability is not 0.0, the SlotManager will randomly cycle the TPM through a simulated S3 transition at the start of DispatchCommand (before the requested command is invoked).
public SetS3Probability ( double probability ) : void
probability double
Результат void

Tbs() публичный Метод

public Tbs ( Tpm2Lib.Tpm2Device theUnderlyingTpm, bool tpmHasRm ) : System
theUnderlyingTpm Tpm2Lib.Tpm2Device
tpmHasRm bool
Результат System