internal override TpmHash GetPolicyDigest(TpmAlgId hashAlg)
{
TpmCc commandCode = 0;
if (TicketType == TpmSt.AuthSecret)
{
commandCode = TpmCc.PolicySecret;
}
else if (TicketType == TpmSt.AuthSigned)
{
commandCode = TpmCc.PolicySigned;
}
else
{
Globs.Throw <ArgumentException>("Ticket type is not recognized");
return(new TpmHash(hashAlg));
}
if (ObjectName == null)
{
ObjectName = AuthorizingKey.GetName();
}
var m = new Marshaller();
m.Put(commandCode, "ordinal");
m.Put(ObjectName, "name");
// ReSharper disable once UnusedVariable
TpmHash atStart = GetNextAcePolicyDigest(hashAlg);
TpmHash firstExtend = GetNextAcePolicyDigest(hashAlg).Extend(m.GetBytes());
TpmHash secondExtend = firstExtend.Extend(PolicyRef);
return(secondExtend);
}