Program.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Masuit.Tools.Security;
  2. using Microsoft.AspNetCore;
  3. using Microsoft.AspNetCore.Hosting;
  4. using System;
  5. using System.ComponentModel;
  6. namespace NetCoreTest
  7. {
  8. public class Program
  9. {
  10. public static void Main(string[] args)
  11. {
  12. var rsaKey = RsaCrypt.GenerateRsaKeys(RsaKeyType.PKCS8, 2048);
  13. Console.WriteLine(rsaKey.PrivateKey);
  14. Console.WriteLine(rsaKey.PublicKey);
  15. var enc = "123456".RSAEncrypt();
  16. Console.WriteLine(enc);
  17. Console.Beep();
  18. var dec = enc.RSADecrypt();
  19. Console.WriteLine(dec);
  20. Console.ReadKey();
  21. //CreateWebHostBuilder(args).Build().Run();
  22. }
  23. public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
  24. WebHost.CreateDefaultBuilder(args)
  25. .UseStartup<Startup>();
  26. }
  27. public class MyClass
  28. {
  29. [Description("test")]
  30. public string MyProperty { get; set; }
  31. public int MyProperty1 { get; set; }
  32. }
  33. }