예제 #1
0
        public static TPMPCRInfoCore CreateFromTPMBlob(TPMBlob blob)
        {
            TPMPCRInfoCore pcrInfo = new TPMPCRInfoCore();

            pcrInfo.ReadFromTpmBlob(blob);
            return(pcrInfo);
        }
예제 #2
0
파일: TPM_Seal.cs 프로젝트: deveck/doTSS
        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");
            });
        }
예제 #3
0
 public static TPMPCRInfoCore CreateFromTPMBlob(TPMBlob blob)
 {
     TPMPCRInfoCore pcrInfo = new TPMPCRInfoCore();
     pcrInfo.ReadFromTpmBlob(blob);
     return pcrInfo;
 }