예제 #1
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
                );
        }
예제 #2
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
                );
        }