public IActionResult RsaEncrypt(string hexKey, string val, string sign) { string publicXml = "<RSAKeyValue><Modulus>{0}</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"; publicXml = string.Format(publicXml, Base64Helper.Base64String(HexHelper.ToByte(hexKey))); var res = SecurityHelper.RsaEncrypt(128, val, publicXml, sign); //var res = SecurityUtils.RsaEncryptToByte(val, RsaSecurity.RSAPublicKeyJava2DotNet(HexUtils.ToByte(hexKey))); return(new JsonResult(new { en = res })); }
public IActionResult HexToString(string key) { return(new JsonResult(new { key = Encoding.UTF8.GetString(HexHelper.ToByte(key)) })); }
public IActionResult HexToBase64(string key) { return(new JsonResult(new { key = Base64Helper.Base64String(HexHelper.ToByte(key)) })); }