Exemple #1
0
        public void NewsDeriveKey(string chatRoomName)
        {
            ChatUser Bob   = ChatingUsers.Find(x => x.ChatUserName == Context.User.Identity.Name);
            ChatUser Alice = ChatingUsers.Find(x => x.ChatUserName != Context.User.Identity.Name && x.ChatRoomName == chatRoomName);

            Clients.Group(chatRoomName).blockChat();

            Alice.GenerateNewKey();
            Bob.GenerateNewKey(Alice.PublicKey);
            Alice.SetDeriveKey(Bob.PublicKey);
            Alice.PreviousDeriveKey = null;
            Bob.PreviousDeriveKey   = null;
            ChatingUsers[ChatingUsers.IndexOf(Alice)] = Alice;
            ChatingUsers[ChatingUsers.IndexOf(Bob)]   = Bob;

            Clients.Group(chatRoomName).allowChat();
        }