Ejemplo n.º 1
0
        private static void ChatingSimulation()
        {
            var certificateRepo = new CertificateSource();

            var alice = new RsaUser("Alice");

            alice.SetCertificateRepo(certificateRepo);

            var bob = new RsaUser("Bob");

            bob.SetCertificateRepo(certificateRepo);

            alice.SetFriend(bob);
            bob.SetFriend(alice);

            Console.WriteLine();
            alice.SendMessageToFriend("Hello");

            Console.WriteLine();
            bob.SendMessageToFriend("Hi");

            Console.WriteLine();
            alice.SendMessageToFriend(c_testText);

            var notAFriend = new RsaUser("Hacker");

            notAFriend.SetFriend(bob);

            Console.WriteLine();
            notAFriend.SendMessageToFriend("Hello bob it's Alice");
        }
Ejemplo n.º 2
0
 public void SetCertificateRepo(CertificateSource source)
 {
     m_sertSource = source;
     _Log("Register in new certificate repo");
     m_sertSource.AddUser(this, m_signatureKey.cert);
 }