C# 클래스 Tpm2Lib.PolicyTree

A PolicyTree contains machinery for creating, executing and persisting TPM policy expression.
파일 보기 프로젝트 열기: Microsoft/TSS.MSR 1 사용 예제들

공개 메소드들

메소드 설명
Create ( PolicyAce singlePolicyChain ) : void

Create a simple policy chain (no ORs).

CreateNormalizedPolicy ( PolicyAce policy ) : void

A "normalized" policy is one transformed into disjunctive normal form in which a collection of policy "AND chains" is combined with PolicyOR before submission to the TPM. Callers must provide an-array-of-arrays of TpmPolicyACEs. The arrays may NOT contain PolicyOr (these will be added automatically), but each array MUST be terminated with a unique string identifier encoded in a TpmPolicyChainId.

Deserialize ( PolicySerializationFormat format, Stream sourceStream ) : void

Load a policy from a stream (MemoryStream, FileStream) in the specified format

DeserializeFromFile ( PolicySerializationFormat fmt, string fileName ) : void
DeserializeFromString ( PolicySerializationFormat fmt, string stream ) : void
GetDataStructureToSign ( int expirationTime, byte nonceTpm, byte cpHash, byte policyRef ) : byte[]

This is a formatting helper to help callbacks create a properly formed hash to sign.

GetPolicyDigest ( ) : TpmHash
GetPolicyRoot ( ) : PolicyAce
InsertPolicyRoot ( PolicyAce newRoot ) : PolicyTree
PolicyTree ( TpmAlgId hashAlgorithm ) : System
ResetPolicyDigest ( ) : void
Serialize ( string policyIdentifier, PolicySerializationFormat format, Stream targetStream ) : void

Create a serialization of the current policy object in a stream (e.g. MemoryStream or FileStream)

SerializeToFile ( string policyIdentifier, PolicySerializationFormat fmt, string fileName ) : void
SerializeToString ( string policyIdentifier, PolicySerializationFormat fmt ) : string
Set ( PolicyAce leaf ) : void

Sets the current policy tree to a policy branch represented by its leaf ACE. A policy branch can be constructed by means of the following expressions: new TpmAce1().And(new TpmAce2()).And(new TpmAce3()); or new TpmAce1().AddNextAce(new TpmAce2()).AddNextAce(new TpmAce3());

SetNvCallback ( PolicyNVDelegate policyNvCallback ) : void
SetPolicyActionCallback ( PolicyActionDelegate policyActionCallback ) : void
SetPolicyRoot ( PolicyAce root ) : PolicyAce
SetPolicySecretCallback ( PolicySecretDelegate policySecretCallback ) : void
SetSignerCallback ( SignDelegate signer ) : void

비공개 메소드들

메소드 설명
CheckPolicy ( string branchIdToFind, PolicyAce &matchingAce ) : void

Check to see if all branches have an ID and that the IDs are unique.

CheckPolicyIdInternal ( PolicyAce ace, string branchIdToFind, PolicyAce &matchingAce, string nodeIdToFind = "" ) : void
ExecutePolicyActionCallback ( TpmPolicyAction ace ) : void
ExecutePolicyNvCallback ( TpmPolicyNV ace, TpmHandle &authHandle, TpmHandle &nvHandle, SessionBase &authSession ) : void

Called from TpmPolicyNV.

ExecutePolicySecretCallback ( TpmPolicySecret ace, SessionBase &authorizingSession, TpmHandle &authorizedEntityHandle, bool &flushAuthEntity ) : void

Called from TpmPolicySecret.

ExecuteSignerCallback ( TpmPolicySigned ace, byte nonceTpm, TpmPublic &verificationKey ) : ISignatureUnion

This is called from TpmPolicySigned when an external caller must sign the session data.

메소드 상세

Create() 공개 메소드

Create a simple policy chain (no ORs).
public Create ( PolicyAce singlePolicyChain ) : void
singlePolicyChain PolicyAce
리턴 void

CreateNormalizedPolicy() 공개 메소드

A "normalized" policy is one transformed into disjunctive normal form in which a collection of policy "AND chains" is combined with PolicyOR before submission to the TPM. Callers must provide an-array-of-arrays of TpmPolicyACEs. The arrays may NOT contain PolicyOr (these will be added automatically), but each array MUST be terminated with a unique string identifier encoded in a TpmPolicyChainId.
public CreateNormalizedPolicy ( PolicyAce policy ) : void
policy PolicyAce
리턴 void

Deserialize() 공개 메소드

Load a policy from a stream (MemoryStream, FileStream) in the specified format
public Deserialize ( PolicySerializationFormat format, Stream sourceStream ) : void
format PolicySerializationFormat
sourceStream Stream
리턴 void

DeserializeFromFile() 공개 메소드

public DeserializeFromFile ( PolicySerializationFormat fmt, string fileName ) : void
fmt PolicySerializationFormat
fileName string
리턴 void

DeserializeFromString() 공개 메소드

public DeserializeFromString ( PolicySerializationFormat fmt, string stream ) : void
fmt PolicySerializationFormat
stream string
리턴 void

GetDataStructureToSign() 공개 정적인 메소드

This is a formatting helper to help callbacks create a properly formed hash to sign.
public static GetDataStructureToSign ( int expirationTime, byte nonceTpm, byte cpHash, byte policyRef ) : byte[]
expirationTime int
nonceTpm byte
cpHash byte
policyRef byte
리턴 byte[]

GetPolicyDigest() 공개 메소드

public GetPolicyDigest ( ) : TpmHash
리턴 TpmHash

GetPolicyRoot() 공개 메소드

public GetPolicyRoot ( ) : PolicyAce
리턴 PolicyAce

InsertPolicyRoot() 공개 메소드

public InsertPolicyRoot ( PolicyAce newRoot ) : PolicyTree
newRoot PolicyAce
리턴 PolicyTree

PolicyTree() 공개 메소드

public PolicyTree ( TpmAlgId hashAlgorithm ) : System
hashAlgorithm TpmAlgId
리턴 System

ResetPolicyDigest() 공개 메소드

public ResetPolicyDigest ( ) : void
리턴 void

Serialize() 공개 메소드

Create a serialization of the current policy object in a stream (e.g. MemoryStream or FileStream)
public Serialize ( string policyIdentifier, PolicySerializationFormat format, Stream targetStream ) : void
policyIdentifier string
format PolicySerializationFormat
targetStream Stream
리턴 void

SerializeToFile() 공개 메소드

public SerializeToFile ( string policyIdentifier, PolicySerializationFormat fmt, string fileName ) : void
policyIdentifier string
fmt PolicySerializationFormat
fileName string
리턴 void

SerializeToString() 공개 메소드

public SerializeToString ( string policyIdentifier, PolicySerializationFormat fmt ) : string
policyIdentifier string
fmt PolicySerializationFormat
리턴 string

Set() 공개 메소드

Sets the current policy tree to a policy branch represented by its leaf ACE. A policy branch can be constructed by means of the following expressions: new TpmAce1().And(new TpmAce2()).And(new TpmAce3()); or new TpmAce1().AddNextAce(new TpmAce2()).AddNextAce(new TpmAce3());
public Set ( PolicyAce leaf ) : void
leaf PolicyAce
리턴 void

SetNvCallback() 공개 메소드

public SetNvCallback ( PolicyNVDelegate policyNvCallback ) : void
policyNvCallback PolicyNVDelegate
리턴 void

SetPolicyActionCallback() 공개 메소드

public SetPolicyActionCallback ( PolicyActionDelegate policyActionCallback ) : void
policyActionCallback PolicyActionDelegate
리턴 void

SetPolicyRoot() 공개 메소드

public SetPolicyRoot ( PolicyAce root ) : PolicyAce
root PolicyAce
리턴 PolicyAce

SetPolicySecretCallback() 공개 메소드

public SetPolicySecretCallback ( PolicySecretDelegate policySecretCallback ) : void
policySecretCallback PolicySecretDelegate
리턴 void

SetSignerCallback() 공개 메소드

public SetSignerCallback ( SignDelegate signer ) : void
signer SignDelegate
리턴 void