Tpm2Lib.TpmPolicyOr.GetPolicyHashArray C# (CSharp) Method

GetPolicyHashArray() public method

Calculates and returns the policy-hashes of the attached branches.
public GetPolicyHashArray ( TpmAlgId hashAlg ) : Tpm2Lib.Tpm2bDigest[]
hashAlg TpmAlgId
return Tpm2Lib.Tpm2bDigest[]
        public Tpm2bDigest[] GetPolicyHashArray(TpmAlgId hashAlg)
        {
            int numBranches = PolicyBranches.Count;
            if (numBranches < 2 || numBranches > 8)
            {
                Globs.Throw("GetPolicyHashArray: Must have between 2 and 8 branches in a PolicyOr");
            }

            int i = 0;
            var childHashes = new Tpm2bDigest[numBranches];
            foreach (PolicyAce branch in PolicyBranches)
            {
                TpmHash branchPolicyHash = branch.GetPolicyDigest(hashAlg);
                childHashes[i++] = branchPolicyHash;
            }

            return childHashes;
        }