Tpm2Lib.TpmPolicyDuplicationSelect.GetPolicyDigest C# (CSharp) Method

GetPolicyDigest() private method

private GetPolicyDigest ( TpmAlgId hashAlg ) : TpmHash
hashAlg TpmAlgId
return TpmHash
        internal override TpmHash GetPolicyDigest(TpmAlgId hashAlg)
        {
            var m = new Marshaller();
            m.Put(TpmCc.PolicyDuplicationSelect, "ordinal");
            if (IncludeObjectNameInPolicyHash)
            {
                m.Put(NameOfObject, "objectName");
            }
            m.Put(NameOfNewParent, "newParent");
            byte includeName = IncludeObjectNameInPolicyHash ? (byte)1 : (byte)0;
            m.Put(includeName, "includeObject");
            TpmHash previous = GetNextAcePolicyDigest(hashAlg);
            return previous.Extend(m.GetBytes());
        }