Ejemplo n.º 1
0
 public QuoteSigner(TPMSession tpmSession, ClientKeyHandle keyHandle, 
             TPMPCRSelection pcrSelection)
 {
     _tpmSession = tpmSession;
     _keyHandle = keyHandle;
     _pcrSelection = pcrSelection;
 }
Ejemplo n.º 2
0
 public QuoteSigner(TPMSession tpmSession, ClientKeyHandle keyHandle,
                    TPMPCRSelection pcrSelection)
 {
     _tpmSession   = tpmSession;
     _keyHandle    = keyHandle;
     _pcrSelection = pcrSelection;
 }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
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");
            }
        }
Ejemplo n.º 6
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");
            }
        }
Ejemplo n.º 7
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));
            }
        }
Ejemplo n.º 8
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;
 }
Ejemplo n.º 9
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);
 }
Ejemplo n.º 10
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);
 }