C# Class Tpm2Lib.TpmHandle

Inheritance: TpmStructureBase, INameUnion
Mostrar archivo Open project: Microsoft/TSS.MSR Class Usage Examples

Private Properties

Property Type Description
IsNull bool
IsSession bool
TpmHandle System

Public Methods

Method Description
Copy ( ) : TpmHandle
Equals ( Object obj ) : bool
GetFirst ( Ht rangeType ) : uint

Get uint value representing the first handle in the range dedicated to the handles of the given type.

GetHashCode ( ) : int
GetIndex ( ) : uint
GetName ( ) : byte[]

Get the TPM name of the associated entity. If the entity is a transient object, persistent object or NV index, the name must have been previously set explicitly by the caller (by means of SetName() or GetName(Tpm2 tpm) methods) or implicitly by the framework (when an object is created by means of CreatePrimary, CreateLoaded or Create command). Otherwise the name is a 4-byte TPM representation of the handle value.

GetName ( Tpm2 tpm ) : byte[]

Returns the cached name of an entity referenced by this handle. If the name is not cached yet, retrieves it from the TPM (for a transient or persistent object, or NV index) or computes it (for session, PCR or permanent handles).

GetOffset ( ) : uint

return the handle minus the handle-type (top byte) field

GetQualifiedName ( TpmHandle hierarchyHandle, TpmPublic children ) : byte[]

Calculate the qualified name of an object presumed loaded under the provided ancestral chain in a given hierarchy.

GetRangeLength ( Ht rangeType ) : uint

Get the length (number of handles) in the range dedicated to the handles of the given type.

GetType ( ) : Ht
GetUnionSelector ( ) : NameUnionTagValues
HmacSession ( uint handleIndex ) : TpmHandle

Create a HMAC handle given an index into the HMAC handle range

NV ( int slotIndex ) : TpmHandle

Return a handle to the the specified NV index

NV ( uint slotIndex ) : TpmHandle

Return a handle to the the specified NV index

Pcr ( int pcrIndex ) : TpmHandle
Pcr ( uint pcrIndex ) : TpmHandle

Return a handle for the PCR of specified index

Persistent ( uint handleIndex ) : TpmHandle

Create a persistent handle given an index into the persistent handle range

SetAuth ( AuthValue auth ) : TpmHandle

Associates authorization value with the handle. This association is done automatically by TPM commands producing the corresponding handle or changing object's auth value. However on many occasions the library does not have access to the auth value at any moment before it is required for authorizing access to the handle. Notably, when an externally created key is imported, pre-existing NV index or persistent object is used, SetAuth() is required to associate auth value with the handle.

SetName ( byte name ) : TpmHandle

Associates the name with the handle. Only needed for transient, persistent and NV handles. Normally this association is done automatically either by TPM commands producing the corresponding handle, or when the handle is passed as a parameter to a command requiring HMAC authorization (the name is implicitly requested from the TPM by means of TPM2_ReadPublic or TPM2_NV_ReadPublic commands). Thus this method has to be used only either when Tpm2 object is in the strict mode (i.e. it is prohibited to issue commands not explicitly requested by the user), or for the sake of performance optimization (if the client code has the name pre-computed).

TpmHandle ( ) : System
TpmHandle ( Ht handleType, uint offset ) : System

Create a handle of the given type with the given numerical value.

TpmHandle ( TpmHandle the_TpmHandle ) : System
TpmHandle ( TpmRh reservedHandle ) : System

Create a reserved TPM handle.

TpmHandle ( uint the_handle ) : System
operator ( ) : ParametrizedHandle
operator ( ) : bool

Returns true if the two arguments either are both null references or encapsulate the same TPM handle.

Private Methods

Method Description
IsNull ( TpmHandle h ) : bool
IsSession ( ) : bool
TpmHandle ( TpmHandle src, Bind bind ) : System

Method Details

Copy() public method

public Copy ( ) : TpmHandle
return TpmHandle

Equals() public method

public Equals ( Object obj ) : bool
obj Object
return bool

GetFirst() public static method

Get uint value representing the first handle in the range dedicated to the handles of the given type.
public static GetFirst ( Ht rangeType ) : uint
rangeType Ht
return uint

GetHashCode() public method

public GetHashCode ( ) : int
return int

GetIndex() public method

public GetIndex ( ) : uint
return uint

GetName() public method

Get the TPM name of the associated entity. If the entity is a transient object, persistent object or NV index, the name must have been previously set explicitly by the caller (by means of SetName() or GetName(Tpm2 tpm) methods) or implicitly by the framework (when an object is created by means of CreatePrimary, CreateLoaded or Create command). Otherwise the name is a 4-byte TPM representation of the handle value.
public GetName ( ) : byte[]
return byte[]

GetName() public method

Returns the cached name of an entity referenced by this handle. If the name is not cached yet, retrieves it from the TPM (for a transient or persistent object, or NV index) or computes it (for session, PCR or permanent handles).
public GetName ( Tpm2 tpm ) : byte[]
tpm Tpm2
return byte[]

GetOffset() public method

return the handle minus the handle-type (top byte) field
public GetOffset ( ) : uint
return uint

GetQualifiedName() public static method

Calculate the qualified name of an object presumed loaded under the provided ancestral chain in a given hierarchy.
public static GetQualifiedName ( TpmHandle hierarchyHandle, TpmPublic children ) : byte[]
hierarchyHandle TpmHandle
children TpmPublic
return byte[]

GetRangeLength() public static method

Get the length (number of handles) in the range dedicated to the handles of the given type.
public static GetRangeLength ( Ht rangeType ) : uint
rangeType Ht
return uint

GetType() public method

public GetType ( ) : Ht
return Ht

GetUnionSelector() public method

public GetUnionSelector ( ) : NameUnionTagValues
return NameUnionTagValues

HmacSession() public static method

Create a HMAC handle given an index into the HMAC handle range
public static HmacSession ( uint handleIndex ) : TpmHandle
handleIndex uint
return TpmHandle

NV() public static method

Return a handle to the the specified NV index
public static NV ( int slotIndex ) : TpmHandle
slotIndex int
return TpmHandle

NV() public static method

Return a handle to the the specified NV index
public static NV ( uint slotIndex ) : TpmHandle
slotIndex uint
return TpmHandle

Pcr() public static method

public static Pcr ( int pcrIndex ) : TpmHandle
pcrIndex int
return TpmHandle

Pcr() public static method

Return a handle for the PCR of specified index
public static Pcr ( uint pcrIndex ) : TpmHandle
pcrIndex uint
return TpmHandle

Persistent() public static method

Create a persistent handle given an index into the persistent handle range
public static Persistent ( uint handleIndex ) : TpmHandle
handleIndex uint
return TpmHandle

SetAuth() public method

Associates authorization value with the handle. This association is done automatically by TPM commands producing the corresponding handle or changing object's auth value. However on many occasions the library does not have access to the auth value at any moment before it is required for authorizing access to the handle. Notably, when an externally created key is imported, pre-existing NV index or persistent object is used, SetAuth() is required to associate auth value with the handle.
public SetAuth ( AuthValue auth ) : TpmHandle
auth AuthValue
return TpmHandle

SetName() public method

Associates the name with the handle. Only needed for transient, persistent and NV handles. Normally this association is done automatically either by TPM commands producing the corresponding handle, or when the handle is passed as a parameter to a command requiring HMAC authorization (the name is implicitly requested from the TPM by means of TPM2_ReadPublic or TPM2_NV_ReadPublic commands). Thus this method has to be used only either when Tpm2 object is in the strict mode (i.e. it is prohibited to issue commands not explicitly requested by the user), or for the sake of performance optimization (if the client code has the name pre-computed).
public SetName ( byte name ) : TpmHandle
name byte
return TpmHandle

TpmHandle() public method

public TpmHandle ( ) : System
return System

TpmHandle() public method

Create a handle of the given type with the given numerical value.
public TpmHandle ( Ht handleType, uint offset ) : System
handleType Ht
offset uint
return System

TpmHandle() public method

public TpmHandle ( TpmHandle the_TpmHandle ) : System
the_TpmHandle TpmHandle
return System

TpmHandle() public method

Create a reserved TPM handle.
public TpmHandle ( TpmRh reservedHandle ) : System
reservedHandle TpmRh
return System

TpmHandle() public method

public TpmHandle ( uint the_handle ) : System
the_handle uint Handle value
return System

operator() public static method

public static operator ( ) : ParametrizedHandle
return ParametrizedHandle

operator() public static method

Returns true if the two arguments either are both null references or encapsulate the same TPM handle.
public static operator ( ) : bool
return bool