public static TPMPCRInfoCore CreateFromTPMBlob(TPMBlob blob) { TPMPCRInfoCore pcrInfo = new TPMPCRInfoCore(); pcrInfo.ReadFromTpmBlob(blob); return(pcrInfo); }
public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper) { base.Init (param, tpmProvider, tpmWrapper); _digest = null; _responseDigest = null; _inData = param.GetValueOf<byte[]>("in_data"); _pcrInfo = new TPMPCRInfoCore(new TPMPCRSelectionCore(param.GetValueOf<TPMPCRSelection>("pcr_selection"))); _pcrInfo.CalculateDigests((TPMPCRInfoCore.GetPCRValueDelegate)delegate(uint pcrNum) { //TODO: Use TPM_Quote to determine pcr values once it's available Parameters pcrParams = new Parameters(); pcrParams.AddPrimitiveType("pcrnum", pcrNum); TPMCommandResponse pcrResponse = _tpmWrapper.Process(new TPMCommandRequest(TPMCommandNames.TPM_CMD_PCRRead, pcrParams)); if(!pcrResponse.Status) throw new TPMResponseException("An unknown error occured on performing pcrread"); return pcrResponse.Parameters.GetValueOf<byte[]>("value"); }); }
public static TPMPCRInfoCore CreateFromTPMBlob(TPMBlob blob) { TPMPCRInfoCore pcrInfo = new TPMPCRInfoCore(); pcrInfo.ReadFromTpmBlob(blob); return pcrInfo; }