Exemple #1
0
 public TpmPolicyLocality(LocalityAttr loc, string branchName = "", string nodeId = null)
     : base(branchName, nodeId)
 {
     AllowedLocality = loc;
 }
Exemple #2
0
 public void PolicyLocality(
     TpmHandle policySession,
     LocalityAttr locality
 )
 {
     Tpm2PolicyLocalityRequest inS = new Tpm2PolicyLocalityRequest();
     inS.policySession = policySession;
     inS.locality = locality;
     TpmStructureBase outSBase;
     DispatchMethod(TpmCc.PolicyLocality, (TpmStructureBase) inS, typeof(Tpm2PolicyLocalityResponse), out outSBase, 1, 0);
 }
Exemple #3
0
 /// <summary>
 /// This command indicates that the authorization will be limited to a specific locality
 /// </summary>
 public TpmPolicyLocality(LocalityAttr loc, string branchName = "") : base(branchName)
 {
     AllowedLocality = loc;
 }
Exemple #4
0
 public Tpm2PolicyLocalityRequest(Tpm2PolicyLocalityRequest the_Tpm2PolicyLocalityRequest)
 {
     if((Object) the_Tpm2PolicyLocalityRequest == null ) throw new ArgumentException(Globs.GetResourceString("parmError"));
     policySession = the_Tpm2PolicyLocalityRequest.policySession;
     locality = the_Tpm2PolicyLocalityRequest.locality;
 }
Exemple #5
0
 ///<param name = "the_policySession">handle for the policy session being extended Auth Index: None</param>
 ///<param name = "the_locality">the allowed localities for the policy</param>
 public Tpm2PolicyLocalityRequest(
 TpmHandle the_policySession,
 LocalityAttr the_locality
 )
 {
     this.policySession = the_policySession;
     this.locality = the_locality;
 }
Exemple #6
0
 public Tpm2PolicyLocalityRequest()
 {
     policySession = new TpmHandle();
     locality = new LocalityAttr();
 }
Exemple #7
0
 ///<param name = "the_pcrSelect">list indicating the PCR included in pcrDigest</param>
 ///<param name = "the_pcrDigest">digest of the selected PCR using nameAlg of the object for which this structure is being created pcrDigest.size shall be zero if the pcrSelect list is empty.</param>
 ///<param name = "the_locality">the locality at which the object was created</param>
 ///<param name = "the_parentNameAlg">nameAlg of the parent</param>
 ///<param name = "the_parentName">Name of the parent at time of creation The size will match digest size associated with parentNameAlg unless it is TPM_ALG_NULL, in which case the size will be 4 and parentName will be the hierarchy handle.</param>
 ///<param name = "the_parentQualifiedName">Qualified Name of the parent at the time of creation Size is the same as parentName.</param>
 ///<param name = "the_outsideInfo">association with additional information added by the key creator This will be the contents of the outsideInfo parameter in TPM2_Create() or TPM2_CreatePrimary().</param>
 public CreationData(
 PcrSelection[] the_pcrSelect,
 byte[] the_pcrDigest,
 LocalityAttr the_locality,
 TpmAlgId the_parentNameAlg,
 byte[] the_parentName,
 byte[] the_parentQualifiedName,
 byte[] the_outsideInfo
 )
 {
     this.pcrSelect = the_pcrSelect;
     this.pcrDigest = the_pcrDigest;
     this.locality = the_locality;
     this.parentNameAlg = the_parentNameAlg;
     this.parentName = the_parentName;
     this.parentQualifiedName = the_parentQualifiedName;
     this.outsideInfo = the_outsideInfo;
 }
Exemple #8
0
 public CreationData()
 {
     pcrSelect = new PcrSelection[0];
     pcrDigest = new byte[0];
     locality = new LocalityAttr();
     parentNameAlg = TpmAlgId.Null;
     parentName = new byte[0];
     parentQualifiedName = new byte[0];
     outsideInfo = new byte[0];
 }
Exemple #9
0
 /// <summary>
 /// Set the locality for future commands.  The default locality is Locality0.  Not all TPM
 /// devices will be able to honor all locality requests.
 /// </summary>
 /// <param name="locality"></param>
 public Tpm2 _SetLocality(LocalityAttr locality)
 {
     switch (locality)
     {
         case LocalityAttr.TpmLocZero:
             ActiveModifiers.ActiveLocality = 0;
             break;
         case LocalityAttr.TpmLocOne:
             ActiveModifiers.ActiveLocality = 1;
             break;
         case LocalityAttr.TpmLocTwo:
             ActiveModifiers.ActiveLocality = 2;
             break;
         case LocalityAttr.TpmLocThree:
             ActiveModifiers.ActiveLocality = 3;
             break;
         case LocalityAttr.TpmLocFour:
             ActiveModifiers.ActiveLocality = 4;
             break;
         default:
             if ((int)locality > 31 && (int)locality < 256)
             {
                 ActiveModifiers.ActiveLocality = (byte)locality;
                 break;
             }
             throw new ArgumentException("Invalid locality");
     }
     return this;
 }
Exemple #10
0
 /// <summary>
 /// This command indicates that the authorization will be limited to a specific locality
 /// </summary>
 public TpmPolicyLocality(LocalityAttr loc, string branchName = "") : base(branchName)
 {
     AllowedLocality = loc;
 }