Tpm2Lib.TpmHash.FromObject C# (CSharp) Method

FromObject() public static method

Make a new TpmHash from the hash of the TPM representation of data
public static FromObject ( TpmAlgId hashAlg, Object data ) : TpmHash
hashAlg TpmAlgId
data Object
return TpmHash
        public static TpmHash FromObject(TpmAlgId hashAlg, Object data)
        {
            var newHash = new TpmHash(hashAlg);
            byte[] temp = Marshaller.GetTpmRepresentation(data);
            newHash.HashData = CryptoLib.HashData(hashAlg, temp);
            return newHash;
        }