public IActionResult Encrypt(string key, string data) { return(Json(rsaService.Encrypt(key, data))); }
public static string Encrypt(string message) { var publicKey = _rsaPemFileLoader.GetPublicKeyAsServiceProvider("D:\\PublicKey"); return(publicKey == null ? "Exception when read file" : _rsaService.Encrypt(message, publicKey)); }