mirror of
https://github.com/ldqk/Masuit.Tools.git
synced 2026-10-25 18:30:29 +08:00
34 lines
826 B
C#
34 lines
826 B
C#
using Masuit.Tools;
|
|
using Masuit.Tools.Security;
|
|
using Masuit.Tools.Systems;
|
|
using System;
|
|
|
|
namespace Test
|
|
{
|
|
static class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
var rsaKey = RsaCrypt.GenerateRsaKeys();
|
|
Console.WriteLine(rsaKey.PrivateKey);
|
|
var enc = new MyClass()
|
|
{
|
|
SdTime = DateTime.Now,
|
|
MyProperty = "asdf"
|
|
}.ToJsonString().RSAEncrypt();
|
|
Console.WriteLine(enc);
|
|
Console.WriteLine(HiPerfTimer.Execute(() =>
|
|
{
|
|
var dec = enc.RSADecrypt();
|
|
Console.WriteLine(dec);
|
|
}) * 1000);
|
|
}
|
|
}
|
|
|
|
public class MyClass
|
|
{
|
|
public string MyProperty { get; set; }
|
|
public DateTime SdTime { get; set; }
|
|
|
|
}
|
|
} |