Example #1
0
 public QuoteSigner(TPMSession tpmSession, ClientKeyHandle keyHandle, 
             TPMPCRSelection pcrSelection)
 {
     _tpmSession = tpmSession;
     _keyHandle = keyHandle;
     _pcrSelection = pcrSelection;
 }
Example #2
0
        /// <summary>
        /// Cosntructs a new BindBlockCipher with the specified arguments, the seal auth is requested from the user 
        /// on first use
        /// </summary>
        /// <param name="keyHandle"></param>
        /// <param name="session"></param>
        public BindBlockCipher(ClientKeyHandle keyHandle, TPMSession session)
        {
            _keyHandle = keyHandle;
            _session = session;
            _keyInfo = _keyHandle.KeyInfo;

            if(_keyInfo.KeyUsage != TPMKeyUsage.TPM_KEY_BIND)
                throw new ArgumentException(string.Format("The key '{0}' is not a binding key!", keyHandle.FriendlyName));
        }
Example #3
0
        public TPMRSASHA1Signer(TPMSession session, ClientKeyHandle keyHandle)
        {
            _session = session;
            _keyHandle = keyHandle;

            if(_keyHandle.KeyInfo.AlgorithmParams.AlgorithmId != TPMAlgorithmId.TPM_ALG_RSA ||
               _keyHandle.KeyInfo.AlgorithmParams.SigScheme != TPMSigScheme.TPM_SS_RSASSAPKCS1v15_SHA1)
            {
                throw new ArgumentException("Invalid key handle for TPMRSASHA1Signer");
            }
        }
Example #4
0
 /// <summary>
 /// Cosntructs a new SealBlockCipher with the specified arguments, the seal auth is requested from the user 
 /// on first use
 /// </summary>
 /// <param name="keyHandle"></param>
 /// <param name="session"></param>
 public SealBlockCipher(ClientKeyHandle keyHandle, TPMSession session, TPMPCRSelection pcrSelection)
 {
     _keyHandle = keyHandle;
     _session = session;
     _myId = session.GetFreeId();
     _pcrSelection = pcrSelection;
     _keyInfo = _keyHandle.KeyInfo;
 }
Example #5
0
 /// <summary>
 /// Constructs a new SealBlockCipher with the specified arguments and caches the specified seal auth value
 /// </summary>
 /// <param name="keyHandle"></param>
 /// <param name="session"></param>
 /// <param name="sealAuth"></param>
 public SealBlockCipher(ClientKeyHandle keyHandle, TPMSession session, TPMPCRSelection pcrSelection, ProtectedPasswordStorage sealAuth)
     : this(keyHandle, session, pcrSelection)
 {
     _session.SetValue("secret_seal_" + _keyHandle.FriendlyName + "_" + _myId.ToString(), sealAuth);
 }
Example #6
0
        /// <summary>
        /// Selects the specified tpm device. 
        /// On success a TPMSession object is returned
        /// </summary>
        /// <param name="tpmIdentifier"></param>
        /// <returns></returns>
        public TPMSession SelectTPMDevice(string tpmIdentifier)
        {
            SelectTPMRequest request = new SelectTPMRequest (_ctx);
            request.TPMIdentifier = tpmIdentifier;

            SelectTPMResponse response = request.TypedExecute ();
            response.AssertTPMSuccess ();

            TPMSession session = new TPMSession (_ctx, response.TPMSessionIdentifier, this);
            session.SetRequestSecretCallback(_requestSecret);

            _activeSessions.Add (session.SessionIdentifier, session);

            return session;
        }
Example #7
0
 /// <summary>
 /// Removes the specified TPMSession from the active sessions
 /// </summary>
 /// <param name="tpmSession"></param>
 public void RemoveTPMSession(TPMSession tpmSession)
 {
     if (_activeSessions.ContainsKey (tpmSession.SessionIdentifier))
     {
         _activeSessions.Remove (tpmSession.SessionIdentifier);
         tpmSession.Dispose ();
     }
 }
Example #8
0
 public TPMCapabilityClient(TPMSession tpmSession)
 {
     _tpmSession = tpmSession;
 }
Example #9
0
 public TPMIntegrityClient(TPMSession tpmSession)
 {
     _tpmSession = tpmSession;
 }
 public TPMEndorsementKeyHandlingClient(TPMSession tpmSession)
 {
     _tpmSession = tpmSession;
 }
Example #11
0
 public ClientKeyHandle(string friendlyName, string identifier, TPMSession tpmSession)
 {
     _friendlyName = friendlyName;
     _keyIdentifier = identifier;
     _tpmSession = tpmSession;
 }
Example #12
0
 public TPMKeyClient(TPMSession tpmSession)
 {
     _tpmSession = tpmSession;
 }
Example #13
0
File: RNG.cs Project: deveck/doTSS
 public RNG(TPMSession tpmSession)
 {
     _tpmSession = tpmSession;
 }
Example #14
0
 public CounterClient(TPMSession tpmSession)
 {
     _tpmSession = tpmSession;
 }
Example #15
0
 public CounterContext(TPMSession tpmSession, uint counterId)
 {
     _tpmSession = tpmSession;
     _counterId = counterId;
 }
Example #16
0
 public TPMAdministrationClient(TPMSession tpmSession)
 {
     _tpmSession = tpmSession;
 }