예제 #1
0
        public void TestNetworkTest()
        {
            string uid     = "*****@*****.**";
            string name    = "Pierre St Juste";
            string pcid    = "pdesktop";
            string version = "SVPN_0.3.0";
            string country = "US";

            SocialUtils.CreateCertificate(uid, name, pcid, version, country,
                                          "address1234", "certificates",
                                          "private_key");


            string cert_path = System.IO.Path.Combine("certificates", "lc.cert");

            byte[]     cert_data = SocialUtils.ReadFileBytes(cert_path);
            SocialUser user      = new SocialUser(cert_data);

            TestNetwork backend = new TestNetwork(user);

            backend.SayHello();
            backend.GetFingerprints("uid");
        }
예제 #2
0
        public void TestNetworkTest()
        {
            ///*
              string uid = "*****@*****.**";
              string name = "Pierre St Juste";
              string pcid = "pdesktop";
              string version = "SVPN_0.3.0";
              string country = "US";
              string address =
            Brunet.Applications.Utils.GenerateAHAddress().ToString();
              SocialUtils.CreateCertificate(uid, name, pcid, version, country,
                                    address, "certificates", "private_key");
              //*/
              string cert_path = System.IO.Path.Combine("certificates", "local.cert");
              byte[] cert_data = SocialUtils.ReadFileBytes(cert_path);
              SocialUser user = new SocialUser(cert_data);

              Console.WriteLine(user);
              TestNetwork backend = new TestNetwork(user, cert_data);
              //backend.StoreFingerprint();
              string[] friends = backend.GetFriends().ToArray();
              foreach(string friend in friends) {
            Console.WriteLine(friend);
              }
              string[] fprs = backend.GetFingerprints(friends).ToArray();
              foreach(string fpr in fprs) {
            Console.WriteLine(fpr);
              }
        }
예제 #3
0
        public void TestNetworkTest()
        {
            string uid = "*****@*****.**";
              string name = "Pierre St Juste";
              string pcid = "pdesktop";
              string version = "SVPN_0.3.0";
              string country = "US";

              SocialUtils.CreateCertificate(uid, name, pcid, version, country,
                                    "address1234", "certificates",
                                    "private_key");

              string cert_path = System.IO.Path.Combine("certificates", "lc.cert");
              byte[] cert_data = SocialUtils.ReadFileBytes(cert_path);
              SocialUser user = new SocialUser(cert_data);

              TestNetwork backend = new TestNetwork(user);
              backend.SayHello();
              backend.GetFingerprints("uid");
        }