예제 #1
0
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _param = param;
            _capArea = param.GetValueOf<CapabilityData.TPMCapabilityArea> ("capArea");
        }
예제 #2
0
파일: TPM_Extend.cs 프로젝트: deveck/doTSS
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            if(_params.IsDefined<uint>("pcr") == false)
                throw new ArgumentException("Parameter 'pcr' is not defined");
            if(_params.IsDefined<byte[]>("digest") == false)
                throw new ArgumentException("Parameter 'digest' is not defined");
        }
예제 #3
0
파일: TPM_Quote.cs 프로젝트: deveck/doTSS
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _digest = null;
            _responseDigest = null;

            if(param.IsDefined<byte[]>("externalData"))
                _nonce = param.GetValueOf<byte[]>("externalData");
            else
                _nonce = NonceGenerator.GenerateByteNonce(20);

            object myType = param.GetValueOf<object>("targetPCR");
            _pcrSelection = param.GetValueOf<TPMPCRSelectionCore>("targetPCR");
        }
예제 #4
0
파일: TPM_Unbind.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");
        }
예제 #5
0
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _digest = null;

            _tpmKey = TPMKeyCore.Create (
                CapabilityDataCore.TPMVersionCore.CreateVersion11(),
                _params.GetValueOf<TPMKeyUsage>("key_usage"),
                _params.GetValueOf<TPMKeyFlags>("key_flags"),
                TPMAuthDataUsage.TPM_AUTH_ALWAYS,
                TPMKeyParamsCore.Create (
                    TPMAlgorithmId.TPM_ALG_RSA,
                    _params.GetValueOf<TPMEncScheme>("enc_scheme"),
                    _params.GetValueOf<TPMSigScheme>("sig_scheme"),
                    TPMRSAKeyParamsCore.Create (
                        _params.GetValueOf<uint>("key_length"),
                        _params.GetValueOf<uint>("num_primes"),
                        _params.GetValueOf<byte[]>("exponent"))
                    ),
                null, //Pubkey, use default (empty) pubkey
                null  //no encoded data
                );
        }
예제 #6
0
파일: TPM_Unseal.cs 프로젝트: deveck/doTSS
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _digest = null;
            _responseDigest = null;
            _inData = TPMStoredDataCore.CreateFromBytes(param.GetValueOf<byte[]>("in_data"));
        }
예제 #7
0
파일: TPM_PCRRead.cs 프로젝트: deveck/doTSS
 public override void Init(Parameters param, TPMProvider provider, TPMWrapper tpmWrapper)
 {
     base.Init(param, provider, tpmWrapper);
     _register = param.GetValueOf<UInt32>("pcrnum");
 }
예제 #8
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");
            });
        }
예제 #9
0
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _digest = null;
            _tpmKey =  TPMKeyCore.CreateFromBytes(param.GetValueOf<byte[]>("key_blob"));
        }
예제 #10
0
파일: TPMWrapper.cs 프로젝트: deveck/doTSS
 /// <summary>
 /// Init TPM Connection with a suitable backend, that requiers some options
 /// </summary>
 /// <param name="providerName">
 /// A <see cref="System.String"/>
 /// </param>
 /// <param name="options">
 /// A <see cref="IDictionary<String, String>"/>
 /// </param>
 public void Init(string providerName, IDictionary<String, String> options)
 {
     _backend = TPMProviders.Create(providerName,options);
 }
예제 #11
0
파일: TPMWrapper.cs 프로젝트: deveck/doTSS
 /// <summary>
 /// Init TPM Connection with a suitable backend
 /// </summary>
 /// <param name="providerName">
 /// A <see cref="System.String"/>
 /// </param>
 public void Init(string providerName)
 {
     _backend = TPMProviders.Create(providerName,null);
 }
예제 #12
0
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _secret = _params.GetValueOf<byte[]>("secret");
            _label = _params.GetValueOf<byte[]>("label");
        }
예제 #13
0
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _digest = null;
        }
예제 #14
0
        public override void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
        {
            base.Init (param, tpmProvider, tpmWrapper);

            _digest = null;

            _tpmKey = TPMKeyCore.Create (
                CapabilityDataCore.TPMVersionCore.CreateVersion11(),
                TPMKeyUsage.TPM_KEY_STORAGE,
                TPMKeyFlags.None,
                TPMAuthDataUsage.TPM_AUTH_ALWAYS,
                TPMKeyParamsCore.Create (
                    TPMAlgorithmId.TPM_ALG_RSA,
                    TPMEncScheme.TPM_ES_RSAESOAEP_SHA1_MGF1,
                    TPMSigScheme.TPM_SS_NONE,
                    TPMRSAKeyParamsCore.Create (TPMRSAKeyParamsCore.DEFAULT_KEYLENGTH, TPMRSAKeyParamsCore.DEFAULT_NUMPRIMES, null)
                    ),
                null, //Pubkey, use default (empty) pubkey
                null  //no encoded data
                );
        }
예제 #15
0
파일: TPMCommand.cs 프로젝트: deveck/doTSS
 //        private TPMCommand (UInt32 tag, UInt32 ordinal, Parameters param) : this(tag, ordinal)
 //        {
 //            _params = param;
 //        }
 //        
 public virtual void Init(Parameters param, TPMProvider tpmProvider, TPMWrapper tpmWrapper)
 {
     _tpmProvider = tpmProvider;
     _params = param;
     _tpmWrapper = tpmWrapper;
 }