Program.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // See https://aka.ms/new-console-template for more information
  2. using PCC.App;
  3. using PCC.App.Security;
  4. Console.WriteLine("Hello, World!");
  5. //try
  6. //{
  7. // if (PccConfigFile.Instance.MyKeyPrivate == null || PccConfigFile.Instance.MyKeyPublic == null)
  8. // {
  9. // Console.WriteLine("Generate 8192bit RSA key... be patient, may take up to 30 seconds...");
  10. // var (pub, pri) = RsaUtility.GeneratePKCS1(8192);
  11. // PccConfigFile.Instance.MyKeyPrivate = Convert.ToBase64String(pri, Base64FormattingOptions.None);
  12. // PccConfigFile.Instance.MyKeyPublic = Convert.ToBase64String(pub, Base64FormattingOptions.None);
  13. // PccConfigFile.Save();
  14. // Console.WriteLine("RSA key generated and saved.");
  15. // }
  16. // Console.WriteLine("Your public key show below for send to trusted peer.");
  17. // Console.WriteLine();
  18. // Console.WriteLine(PccConfigFile.Instance.MyKeyPublic);
  19. // Console.WriteLine();
  20. // if (PccConfigFile.Instance.TrustPeerKeyPub == null || PccConfigFile.Instance.TrustPeerHost == null || PccConfigFile.Instance.TrustPeerPort == null)
  21. // {
  22. // Console.WriteLine($"Missing config one of `{nameof(PccConfigFile.TrustPeerKeyPub)}' or `{nameof(PccConfigFile.TrustPeerHost)}' or `{nameof(PccConfigFile.TrustPeerPort)}', please obtain from trusted peer, HALT");
  23. // return;
  24. // }
  25. // if (PccConfigFile.Instance.ListenPort == null)
  26. // {
  27. // Console.WriteLine($"Missing config `{nameof(PccConfigFile.ListenPort)}', HALT");
  28. // return;
  29. // }
  30. // //TODO: Networking sub system
  31. // Console.WriteLine("Bye, World!");
  32. //}
  33. //finally
  34. //{
  35. // Console.WriteLine("");
  36. // Console.Write("Finished. Press ENTER to exit...");
  37. //}