12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- // See https://aka.ms/new-console-template for more information
- using PCC.App;
- using PCC.App.Security;
- Console.WriteLine("Hello, World!");
- //try
- //{
- // if (PccConfigFile.Instance.MyKeyPrivate == null || PccConfigFile.Instance.MyKeyPublic == null)
- // {
- // Console.WriteLine("Generate 8192bit RSA key... be patient, may take up to 30 seconds...");
- // var (pub, pri) = RsaUtility.GeneratePKCS1(8192);
- // PccConfigFile.Instance.MyKeyPrivate = Convert.ToBase64String(pri, Base64FormattingOptions.None);
- // PccConfigFile.Instance.MyKeyPublic = Convert.ToBase64String(pub, Base64FormattingOptions.None);
- // PccConfigFile.Save();
- // Console.WriteLine("RSA key generated and saved.");
- // }
- // Console.WriteLine("Your public key show below for send to trusted peer.");
- // Console.WriteLine();
- // Console.WriteLine(PccConfigFile.Instance.MyKeyPublic);
- // Console.WriteLine();
- // if (PccConfigFile.Instance.TrustPeerKeyPub == null || PccConfigFile.Instance.TrustPeerHost == null || PccConfigFile.Instance.TrustPeerPort == null)
- // {
- // Console.WriteLine($"Missing config one of `{nameof(PccConfigFile.TrustPeerKeyPub)}' or `{nameof(PccConfigFile.TrustPeerHost)}' or `{nameof(PccConfigFile.TrustPeerPort)}', please obtain from trusted peer, HALT");
- // return;
- // }
- // if (PccConfigFile.Instance.ListenPort == null)
- // {
- // Console.WriteLine($"Missing config `{nameof(PccConfigFile.ListenPort)}', HALT");
- // return;
- // }
- // //TODO: Networking sub system
- // Console.WriteLine("Bye, World!");
- //}
- //finally
- //{
- // Console.WriteLine("");
- // Console.Write("Finished. Press ENTER to exit...");
- //}
|