Esempio n. 1
0
        public bool NewKeyRegistration(NewPublicKeyInfo newPublicKey)
        {
            Guid _genGuid = Guid.NewGuid();
            try
            {
                UserProfile _selectedUser =
                    db.UserProfile.FirstOrDefault(val => val.UserProfileID == newPublicKey.SelectedUserID);
                _selectedUser.KeyID = _genGuid;
                db.ObjectStateManager.ChangeObjectState(_selectedUser, EntityState.Modified);

                KeyTable _table = new KeyTable();
                _table.GenerationTime = newPublicKey.KeyGenerationTime;
                _table.ExpirationTime = newPublicKey.KeyExpirationTime;
                _table.FingerPrint = newPublicKey.KeyFingerPrint;
                _table.HostIdentity = newPublicKey.UserIdentity;
                _table.TableID = _genGuid;

                db.KeyTable.AddObject(_table);
                db.SaveChanges();

                return true;
            }
            catch (Exception e)
            {
                return false;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Create a new KeyTable object.
 /// </summary>
 /// <param name="tableID">Initial value of the TableID property.</param>
 public static KeyTable CreateKeyTable(global::System.Guid tableID)
 {
     KeyTable keyTable = new KeyTable();
     keyTable.TableID = tableID;
     return keyTable;
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the KeyTable EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToKeyTable(KeyTable keyTable)
 {
     base.AddObject("KeyTable", keyTable);
 }