C# Класс Tpm2Lib.AuthSession

AuthSession encapsulates HMAC, policy, encryption/decryption, and audit sessions, i.e. all session types that are represented by a TPM handle created by means of TPM2_StartAuthSession command.
Наследование: SessionBase
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Attrs SessionAttr
AuthHash TpmAlgId
BindObject TpmHandle
NonceCaller byte[]
NonceTpm byte[]
Salt byte[]
SessionKey byte[]
SessionType TpmSe
Symmetric SymDef

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

Метод Описание
AuthSession ( ParametrizedHandle ph ) : System
AuthSession ( TpmHandle h ) : System

Constructs an object encapsulating a session opened in TPM. The Tpm2 object that was used to create the session tracks other information associated with it and uses it to compute session key and command/response HMAC.

NewNonceCaller ( ) : void
RunPolicy ( Tpm2 tpm, PolicyTree policyTree, string branchToEvaluate = null, bool allowErrors = false ) : TpmRc

Run a path on the policy tree. The path is identified by the leaf identifier string. A session is created and returned. If allowErrors is true then errors returned do not cause an exception (but are returned in the response code).

SetNonceTpm ( byte nonceTpm ) : void

Защищенные методы

Метод Описание
AuthSession ( ) : System

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

Метод Описание
AuthSession ( TpmSe sessionType, TpmHandle tpmKey, TpmHandle bindObject, byte nonceCaller, byte nonceTpm, SymDef symmetric, TpmAlgId authHash ) : System

Constructs a temporary object to hold parameters of a session. Intended only for internal use by the Tpm2 class.

CalcSessionKey ( ) : void

Calculate the session-key from the nonces and salt/bound values (if present)

CanEncrypt ( ) : bool

Checks whether the given session can be used for parameter encryption.

GetAuthHmac ( byte parmHash, Direction direction, byte nonceDec = null, byte nonceEnc = null ) : byte[]

Calculate and return the auth-hmac (or plaintext auth if it is a policy session with PlaintextAuth set) based on the current session parms.

Init ( AuthSession Params ) : void

Sets parameters associated with the session.

Initialized ( ) : bool

Returns true if the parameters associated with the session context in TPM have been set in this object.

ParmEncrypt ( byte parm, Direction inOrOut ) : byte[]

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

AuthSession() защищенный метод

protected AuthSession ( ) : System
Результат System

AuthSession() публичный метод

public AuthSession ( ParametrizedHandle ph ) : System
ph ParametrizedHandle
Результат System

AuthSession() публичный метод

Constructs an object encapsulating a session opened in TPM. The Tpm2 object that was used to create the session tracks other information associated with it and uses it to compute session key and command/response HMAC.
public AuthSession ( TpmHandle h ) : System
h TpmHandle
Результат System

NewNonceCaller() публичный метод

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

RunPolicy() публичный метод

Run a path on the policy tree. The path is identified by the leaf identifier string. A session is created and returned. If allowErrors is true then errors returned do not cause an exception (but are returned in the response code).
public RunPolicy ( Tpm2 tpm, PolicyTree policyTree, string branchToEvaluate = null, bool allowErrors = false ) : TpmRc
tpm Tpm2
policyTree PolicyTree
branchToEvaluate string
allowErrors bool
Результат TpmRc

SetNonceTpm() публичный метод

public SetNonceTpm ( byte nonceTpm ) : void
nonceTpm byte
Результат void

Описание свойств

Attrs публичное свойство

public SessionAttr Attrs
Результат SessionAttr

AuthHash публичное свойство

Hash algorithm used by this session.
public TpmAlgId AuthHash
Результат TpmAlgId

BindObject публичное свойство

public TpmHandle,Tpm2Lib BindObject
Результат TpmHandle

NonceCaller публичное свойство

public byte[] NonceCaller
Результат byte[]

NonceTpm публичное свойство

public byte[] NonceTpm
Результат byte[]

Salt публичное свойство

public byte[] Salt
Результат byte[]

SessionKey публичное свойство

public byte[] SessionKey
Результат byte[]

SessionType публичное свойство

public TpmSe SessionType
Результат TpmSe

Symmetric публичное свойство

Symmetric cipher to be used for encrypting and decrypting sessions.
public SymDef,Tpm2Lib Symmetric
Результат SymDef